text
stringlengths
1
22.8M
Banana Culture Entertainment (바나나컬쳐 엔터테인먼트) or simply Banana Culture, was a South Korean entertainment company. It was a division of the Chinese company Banana Culture Music. On March 25, 2020, it was reported that Banana Culture would be closing. History The company was founded in 1984 under the name Yedang Planning by Byun Dae-yun (real name Byun Doo-seop). On October 28, 1992, the company became a corporation under the name Yedang Sound. In May 2000, the company was renamed to Yedang Entertainment. In March 2010, the company was renamed again to Yedang Company. In March 2014, Yedang Company was acquired by Wellmade StarM and start using new name Wellmade Yedang . In June 2014, girl group EXID signed with Yedang when their original label AB Entertainment was acquired by Wellmade Yedang. The head of the label and their producer, Shinsadong Tiger, also joined Wellmade Yedang. It was confirmed that Shinsadong Tiger would remain as the producer of EXID. In December 2015, Wellmade Yedang officially separate and Yedang became an independent company. In 2016, Yedang officially changed their name after signing a merger agreement with Banana Culture Music and announced that the brand of Yedang would returning to the family of former Yedang Company Chairman Byun Doo-seop. On March 25, 2020, it was reported that Banana Culture would be closing, with employees and executives stepping down and the departure of EXID. However, the label CEO denied this statement, saying that the label still has many Chinese shares and they would continue to manage TREI and other female trainees. Despite this, their website was deleted after TREI's disbandment. Artists Korea Soloists Shin Zisu Lee Youjin Actors/Actress Lee Jung Hyun (2017–present) Ha Seung Ri (2017–2020) Former artists Korea Former recording artists Seo Taiji and Boys (1992–1996) Deux (1993–1995) Tim (2005–2006) C-Clown (2012–2015) EXID (2014–2020) Sung Eun (2015–2020) TREI (2019–2020) Former actors/actresses Lim Ju-hwan (2004–2011) Notes References Entertainment companies of South Korea Companies based in Seoul Defunct record labels of South Korea South Korean companies established in 1992 Entertainment companies established in 1992 Companies disestablished in 2020
Lucero is a Spanish surname. Notable people with the surname include: Adrián Lucero (born 1984), Argentine footballer Alfredo Lucero (born 1979), Argentine cyclist Anna Larroucau Laborde de Lucero (1864 – 1956), French philanthropist and educator Anthony Lucero (born 1967), American poet Anthony Lucero (director), American film director and visual effects editor Armando Lucero (1942 – 2010), Argentine suspect Ariel Lucero (born 1999), Argentine footballer Beatriz Lucero Lhuillier, (born Beatriz Lucero, 1972), American taekwondoist Carla Lucero, American composer/librettist Carla Lucero (tennis) (born 1990), Argentine tennis player Carlos F. Lucero (born 1940), American judge Cristian Lucero (footballer, born 1987), Argentine footballer Cristian Lucero (footballer, born 1988), Argentine footballer Diego Rodríguez de Lucero, inquisitor based in Córdoba between 1499 and 1507 Ed Lucero, American kayaker Eduardo Lucero, Mexican fashion designer Emanuel Lucero (born 1995), Argentine footballer Emmanuel Lucero (born 1978), Mexican boxer Enrique Lucero (1920 – 1989), Mexican film actor Eric Lucero (born 1977/1978), American politician Evelina Zuni Lucero, Native American writer Georgina Zapata Lucero (born 1981), Mexican politician Isaías Lucero, Mexican singer Jesús Lucero, Mexican paralympic athlete Juan Manuel Lucero (born 1985), Argentine footballer Juan Martín Lucero (born 1991), Argentine footballer Judy Lucero, prisoner poet Karol Lucero (born 1987), Chilean entertainer Marcelo Lucero (born 1980), Chilean footballer Martín Lucero (born 1990), Argentine footballer Michael Lucero (1963 – 1998), American music video director Michael Lucero (sculptor) (1953–), American artist Pablo Lucero (c. 1800 - 1856), Argentine politician Richard Lucero (born 1934), mayor from New Mexico Robert Edward Lucero, Philippine Army officer Roberto Lucero (born 1966), Argentine biathlete Santiago Lucero (1904 – ??), Filipino politician Sid Lucero (born 1981), Filipino television and film actor Wendy Lucero-Schayes (born 1963), American diver See also Lucero (given name) Spanish-language surnames
Centaurea virgata is a species of Centaurea. It is native to Western Asia. The subspecies C. virgata subsp. squarrosa is known as squarrose knapweed. It is found in northern California, Idaho, Utah and eastern Oregon. Plants are taprooted perennials and may reach a height of 36 inches. Flowers are formed in a slender urn-shaped head (4 to 8 flowers per head). Heads are slightly curved downward and resemble diffuse knapweed (Centaurea diffusa Lam.) on a diet but with rose-purple flowers. The head is made of a cluster of bracts and the tip of the bract is bent out. Seeds are pale brown and may disperse 60 feet when not spread by animals. The bent bract often allows the head to catch a ride on passing animals and is considered the mechanism for long distant dispersal. Older plants may have multiple rosettes on top of the long taproot. The taproot allows this weed to thrive in dry sites so it maybe more invasive than diffuse knapweed in ultra-dry rangeland. virgata Flora of Western Asia
Henchir-El-Djemel, is a village of North Africa, near Sakiet Ezzit in the Gouvernorat of Safaqis, in Tunisia. Geography Henchir-El-Djemel is located at 34°53'50" N and 10°46'51" E just north of Sfax. It is situated on a wadi, 7 km from the Mediterranean coast with an elevation of 57 meters above sea level. Hennchir el Djemel is also known as Hanshīr al Jamal, and Henchir el Jemel. History Henchir-El-Djemel was the site of a Roman civitas in Africa Proconsulare. It was a Catholic diocese called Vicus Turris. The area is today arid but supports commercial agriculture. References Populated places in Sfax Governorate Communes of Tunisia Cities in Tunisia
The Women's 50 metre breaststroke competition of the 2022 FINA World Swimming Championships (25 m) was held on 17 and 18 December 2022. Records Prior to the competition, the existing world and championship records were as follows. The following new records were set during this competition: Results Heats The heats were started on 17 December at 12:36. Semifinals The semifinals were started on 17 December at 21:07. Final The final was held on 18 December at 19:49. References Women's 50 metre breaststroke 2022 in women's swimming
The WAGGGS-Asia Pacific Region is the divisional office of the World Association of Girl Guides and Girl Scouts, headquartered in Makati, Philippines; Australia; and Japan. The WAGGGS-Asia Pacific Region services Guiding in the land area of Asia south of Russia-in-Asia and the bulk of the Pacific Basin. All the formerly communist states of Central Asia and the Soviet Union have developed or are developing Guiding in the wake of the renaissance in the region. For several years, communism repressed Guiding in Afghanistan, where it has newly returned, as well as in Mongolia, which had been the first Soviet satellite state since 1924. This region is the counterpart of the Asia-Pacific Region of the World Organization of the Scout Movement (WOSM). Post-soviet nations are divided between the WAGGGS-Europe Region and the WAGGGS-Asia Pacific Region. Member organisations Founding members Twelve member organizations (from Australia, New Zealand, India, Malaysia, South Korea, Japan, Thailand, Taiwan, Sri Lanka, Singapore, Philippines, and Pakistan) formed the original Asia Pacific Region in 1969. Full list of member organisations The year in the 'date joined' column refers to the year the organization was granted membership to the Asia Pacific Region of WAGGGS, not the year Guiding started in that country. See also References World Association of Girl Guides and Girl Scouts Organizations based in Manila
Helen Knott is an Indigenous spoken word poet, grassroots activist, leader and social worker from the Prophet River First Nation. She is of Dane-Zaa, Nehiyaw, Métis, and European descent. Residing in Fort St. John, British Columbia, Canada, Knott has published a number of poems and short pieces of creative non-fiction in Red Rising Magazine, the Malahat Review, through CBC Arts, and in a compendium entitled Surviving Canada: Indigenous People Celebrate 150 Years of Betrayal. Most recently, she published her first book, In My Own Moccasins: A Memoir of Resilience, and is currently writing Taking Back the Bones, which has been described as an "Indigenous female manifesto". She is currently enrolled as a graduate student in the First Nations Studies program at the University of Northern British Columbia. Career Knott is currently serving as the Director of Indigenous Education at Northern Lights College in northern British Columbia. She also advocates against violence in Indigenous lands and its correlation to violence against Indigenous women. Along with studying at UNBC, Knott has written many poems. A few of her most notable pieces of poetry include "Your Eyes They Curve Around Me" and "The Things We Taught Our Daughters". She has also appeared in many short videos advocating for ending gender-based violence. Her first book, In My Own Moccasins: A Memoir of Resilience, was published in hardcover in August, 2019, and paperback in March 2020. Helen has also taken part in the Treaty 8 Caravan, calling herself an "accidental activist". Much of Knott's work is based on the land and water on which she grew up. Based on this personal connection to her tribal lands, she decided to advocate for those involved in the controversial construction of the Site C dam. Many of her written works and advocacy projects are about the correlation between resource extraction and violence against indigenous women. Treaty 8 Caravan Much of Knott's advocacy began with her work against the Site C dam and taking part in the Treaty 8 Caravan. In 2014, the federal and provincial governments approved the construction of the B.C. Hydro Site C hydroelectric dam project, upsetting the people of the Prophet River and West Moberly First Nations, as it seems the dam will threaten three of the largest rivers in the Peace River territory: the Peace, Moberly, and Halfway Rivers. In an attempt to halt the Site C dam project, Knott, elders, youth, and Treaty 8 members caravanned to Montreal, where the West Moberly and Prophet River First Nations appealed the government's decision to begin construction on the dam. The construction of Site C is alleged to violate the previously established Treaty 8, which states the First Nations could continue their traditional practices of hunting, trapping, fishing, and collecting medicinal plants "for as long as the sun shines, the rivers flow and the grass grows." Against the wishes of the Treaty 8 Caravan, logging and land clearing for the dam began in 2015. The dam is proposed to be 60-meters high and 1,050-meters-long on the Peace River between the communities of Hudson's Hope and Taylor on Treaty 8 territory. It is planned to be operational in 2024. References External links Helen's Blog - Reclaim the Warrior Cree people Living people 21st-century Canadian essayists 21st-century Canadian women writers First Nations activists Year of birth missing (living people) Canadian women essayists First Nations women writers
Love Island is a 2014 film directed by Jasmila Žbanić. Cast Ariane Labed - Liliane Ermin Bravo - Grebo Ada Condeescu - Flora Franco Nero - Marquis Polesini Leon Lučev - Stipica Branka Petrić - Madame Henzl Reception Stephen Dalton gave a negative review in The Hollywood Reporter: "Love Island is not a subtle movie. The dialogue, written and spoken by people for whom English is plainly a second or third language, is full of corny lines and clunky twists. The camera work also feels oddly jittery, with lots of sudden crash zooms that would make more sense in a mockumentary than in this kind of sweet comic trifle. The characters are cartoons, their romantic crisis deeply implausible and their final reconciliation risibly silly." References External links Croatian romantic comedy films Films directed by Jasmila Žbanić Films set on islands Films shot in Croatia
Fontaine-le-Puits (; ) is a former commune in the Savoie department in the Auvergne-Rhône-Alpes region in south-eastern France. On 1 January 2016, it was merged into the new commune of Salins-Fontaine. See also Communes of the Savoie department References Former communes of Savoie
is a retired Japanese kickboxer. A professional competitor between 2005 and 2014, Itabashi is the former RISE and Krush super featherweight champion. Kickboxing career RISE Early career Itabashi made his professional debut against Daisuke Urata at TRIAL LEAGUE.1 on March 20, 2005. He won the fight by unanimous decision, with scores of 28–27, 29–27 and 29–27. Itabashi faced Junichi Kato in the second TRIAL LEAGUE event, held on June 26, 2005. He was once again victorious by unanimous decision. Itabashi made his AJKF debut against Yasuhiro Hamashima at AJKF "Muay Thai Wave from YOKOHAMA 4" on July 31, 2005. He won the fight by unanimous decision. Itabashi faced Masaya Takahashi at R.I.S.E. G-BAZOOKA TOURNAMENT '06 on March 26, 2006, in his RISE promotional debut. He won the fight by unanimous decision. After beating Ryoma by unanimous decision at R.I.S.E. XXV on April 29, 2006, Itabashi was booked to face Tomoaki Suehiro R.I.S.E. FLASH to CRUSH TOURNAMENT '06 on June 25, 2006, in the quarterfinal bout of the 2006 RISE super featherweight tournament. He lost the fight by a first-round technical knockout. Following his first professional loss, Itabashi was booked to face KAWASAKI at R.I.S.E. XXXV on April 29, 2007. He won the fight by unanimous decision. After successfully rebounding from his loss, Itabashi participated faced Yusuke Sugawara in the quarterfinals of the one-day RISE super featherweight tournament. He won the fight by unanimous decision. Itabashi advanced to the semifinals, where he faced Tomoaki Suehiro. He lost the fight by a second-round technical knockout. Itabashi faced Nagaoka R.I.S.E. -β- "L7" on October 28, 2007. He won the fight by unanimous decision. Itabashi was then booked to face Akihiro Kuroda at J-NETWORK "Let's Kick with J 1st" on February 29, 2008. The fight was ruled a draw by unanimous decision. After amassing an 8–2–2 record, Itabashi would go on a four fight winning streak, before challenging for a title. Itabashi first beat Fire Hiroshi by majority decision at RISE 44 on March 30, 2008. He was then booked to face Yu Akiyama at RISE 46 on May 11, 2008, whom he beat by unanimous decision. Itabashi extended his winning streak to three straight fights at RISE 49 on August 30, 2008, with a third-round knockout of Tomoya Miyashita. Itabashi faced Tomoaki Suehiro at RISE 51 on November 30, 2008, in his final fight of the year. He won the bout by majority decision. Super featherweight champion Itabashi challenged the reigning RISE Super Featherweight titleholder Yuki at RISE 52 on January 31, 2009. He won the fight by unanimous decision, with scores of 49–44, 49–46 and 49–43. Itabashi made his first RISE title defense against TURBΦ at RISE 57 on July 26, 2009. He won the fight by split decision. Two of the judges scored the fight 49–47 and 49–48 in his favor, while the third judge scored it 49–48 for TURBΦ. Itabashi made his second RISE title defense against the 2006 RISE Dead Or Alive Tournament tournament winner Keiji Ozaki at RISE 60 on November 22, 2009. He won the fight by a second-round knockout, flooring Ozaki with a flurry of punches. Itabashi fought in three non-title bouts, following his first two title defenses. He first lost to Masahiro Yamamoto by unanimous decision at RISE 63 on April 7, 2010, but successfully rebounded with decision victories against Kanongsuk Weerasakreck at RISE 68 on July 31, 2010 and Anuwat Kaewsamrit at KGS "RISE 71" on October 3, 2010. Itabashi made his third RISE title defense against Kosuke Komiyama at RISE 74 on February 27, 2011. He lost the fight by split decision. Itabashi faced Genki Yamamoto at REBELS.8 & IT’S SHOWTIME JAPAN countdown-1 on July 18, 2011, in Yamamoto's retirement fight. He won the bout by unanimous decision, after an extra round was fought. Itabashi next fought Masahiro Yamamoto for the vacant It's Showtime World -61kg title at REBELS.9 & It's Showtime Japan 4 on October 23, 2011. He lost the fight by unanimous decision. Krush Itabashi made his Krush debut against Naoki Ishikawa at Krush 19 on June 8, 2012. He lost the fight by unanimous decision. He rebounded from this loss with a first-round technical knockout of Katsuya Goto at Krush.23 on October 8, 2012. Itabashi challenged the reigning Krush Super Featherweight champion Hirotaka Urabe at Krush.30 on August 11, 2013. He won the fight by unanimous decision, after an extra round was fought. Itabashi next fought in two non-title bouts. He first beat Edoardo Tocci by a first-round knockout at Krush.34 on November 10, 2013, which he followed up with a unanimous decision victory against Sho Ogawa at Krush.38 on February 14, 2014. Itabashi made his first Krush super featherweight title defense against the former AJKF Lightweight champion Haruaki Otsuki at Krush 41 on May 11, 2014. He lost the fight by unanimous decision. Itabashi faced Tihomir Mitev at REBELS 30 on September 28, 2014, in what was the final professional kickboxing bout of his career. He won his retirement fight by unanimous decision. Titles and accomplishments RISE RISE Super Featherweight championship Two successful title defenses Krush Krush Super Featherweight Championship Professional kickboxing record |- style="background:#cfc;" | 2014-09-28|| Win ||align=left| Tihomir Mitev || REBELS 30 || Tokyo, Japan || Decision (Unanimous)|| 3 || 3:00 |- style="background:#fbb;" | 2014-05-11|| Loss||align=left| Haruaki Otsuki || Krush 41 || Tokyo, Japan || Decision (Unanimous) || 3 || 3:00 |- ! style=background:white colspan=9 | |- style="background:#cfc;" | 2014-02-14|| Win ||align=left| Sho Ogawa || Krush.38 || Tokyo, Japan || Decision (Unanimous)|| 3 || 3:00 |- style="background:#cfc;" | 2013-11-10|| Win ||align=left| Edoardo Tocci || Krush.34 || Tokyo, Japan || KO (3 Knockdowns)|| 1 || 2:28 |- style="background:#cfc;" | 2013-08-11|| Win ||align=left| Hirotaka Urabe || Krush.30 || Tokyo, Japan || Ext.R Decision (Unanimous)|| 4 || 3:00 |- ! style=background:white colspan=9 | |- style="background:#cfc;" | 2012-10-08|| Win ||align=left| Katsuya Goto || Krush.23 || Tokyo, Japan || TKO (Punches)|| 1 || 1:54 |- bgcolor="#fbb" | 2012-06-08 || Loss ||align=left| Naoki Ishikawa || Krush 19 || Tokyo, Japan || Decision (unanimous) || 3 || 3:00 |- bgcolor="#fbb" | 2011-10-23 || Loss||align=left| Masahiro Yamamoto || REBELS.9 & It's Showtime Japan 4 || Tokyo, Japan || Decision (unanimous) || 3 || 3:00 |- ! style=background:white colspan=9 | |- bgcolor="#cfc" | 2011-07-18 || Win ||align=left| Genki Yamamoto || REBELS.8 & IT’S SHOWTIME JAPAN countdown-1 || Tokyo, Japan || Ext.R Decision (Unanimous) || 4 || 3:00 |- style="background:#fbb;" | 2011-02-27 || Loss|| align=left| Kosuke Komiyama || RISE 74 || Tokyo, Japan || Decision (Split) || 5 || 3:00 |- ! style=background:white colspan=9 | |- bgcolor="#cfc" | 2010-10-03 || Win ||align=left| Anuwat Kaewsamrit || KGS "RISE 71" || Bunkyō, Tokyo, Japan || Ext.R Decision (Unanimous) || 4 || 3:00 |- bgcolor="#cfc" | 2010-07-31 || Win ||align=left| Kanongsuk Weerasakreck || RISE 68 || Tokyo, Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#fbb" | 2010-04-07 || Loss ||align=left| Masahiro Yamamoto || RISE 63 || Tokyo, Japan || Ext.R Decision (unanimous) || 4 || 3:00 |- bgcolor="#cfc" | 2009-11-22 || Win ||align=left| Keiji Ozaki ||RISE 60 || Bunkyo, Tokyo, Japan || KO (Punches) || 2 || 2:29 |- ! style=background:white colspan=9 | |- bgcolor="#cfc" | 2009-07-26 || Win ||align=left| TURBΦ || RISE 57 || Tokyo, Japan || Decision (Split) || 5 || 3:00 |- ! style=background:white colspan=9 | |- bgcolor="#cfc" | 2009-05-31 || Win ||align=left| Jun Kaito || RISE 55 || Tokyo, Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#cfc" | 2009-01-31 || Win ||align=left| Yuki || RISE 52 || Japan || Decision (Unanimous) || 5 || 3:00 |- ! style=background:white colspan=9 | |- bgcolor="#cfc" | 2008-11-30 || Win ||align=left| Tomoaki Suehiro || RISE 51 || Tokyo, Japan || Decision (Majority) || 3 || 3:00 |- bgcolor="#cfc" | 2008-08-30 || Win ||align=left| Tomoya Miyashita || RISE 49 〜RISING ROOKIES CUP〜 || Tokyo, Japan || KO (Punches) || 3 || 1:38 |- bgcolor="#cfc" | 2008-05-11|| Win ||align=left| Yu Akiyama || RISE 46 〜THE KING OF GLADIATORs '08〜 || Tokyo, Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#cfc" | 2008-03-30|| Win ||align=left| Fire Hiroshi || RISE 44 || Tokyo, Japan || Decision (Majority) || 3 || 3:00 |- bgcolor="#c5d2ea" | 2008-02-29|| Draw||align=left| Akihiro Kuroda || J-NETWORK "Let's Kick with J 1st" || Tokyo, Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#cfc" | 2007-10-28|| Win ||align=left| Nagaoka || R.I.S.E. -β- "L7" || Tokyo, Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#fbb" | 2007-06-17|| Loss ||align=left| Tomoaki Suehiro || R.I.S.E. FLASH to CRUSH TOURNAMENT '07, Semi Final || Tokyo, Japan || TKO (2 Knockdowns/Knees) || 2 || 1:38 |- bgcolor="#cfc" | 2007-06-17|| Win ||align=left| Yusuke Sugawara || R.I.S.E. FLASH to CRUSH TOURNAMENT '07, Quarter Final || Tokyo, Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#cfc" | 2007-04-29|| Win ||align=left| KAWASAKI || R.I.S.E. XXXV || Tokyo, Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#fbb" | 2006-06-25|| Loss ||align=left| Tomoaki Suehiro || R.I.S.E. FLASH to CRUSH TOURNAMENT '06, Quarter Final || Tokyo, Japan || TKO (2 Knockdowns/Right Hook) || 1 || 0:46 |- bgcolor="#cfc" | 2006-04-29|| Win ||align=left| Ryoma || R.I.S.E. XXV || Tokyo, Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#cfc" | 2006-03-26|| Win ||align=left| Masaya Takahashi || R.I.S.E. G-BAZOOKA TOURNAMENT '06 || Tokyo, Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#c5d2ea" | 2005-07-31|| Draw||align=left| Yasuhiro Hamashima || AJKF "Muay Thai Wave from YOKOHAMA 4" || Yokohama, Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#cfc" | 2005-06-26|| Win ||align=left| Junichi Kato || TRIAL LEAGUE.2 || Japan || Decision (Unanimous) || 3 || 3:00 |- bgcolor="#cfc" | 2005-04|| Win ||align=left| Daisuke Urata || || Japan || KO || || |- bgcolor="#cfc" | 2005-03-20|| Win ||align=left| Daisuke Urata || TRIAL LEAGUE.1 || Japan || Decision (Unanimous) || 3 || 3:00 |- | colspan=9 | Legend: See also List of male kickboxers References Living people 1982 births Japanese male kickboxers Sportspeople from Fukushima Prefecture
William Greenfield (died 6 December 1315) served as both the Lord Chancellor of England and the Archbishop of York. He was also known as William of Greenfield. Early life Greenfield was born in the eponymous Lincolnshire hamlet of Greenfield. The date of his birth is now lost yet we know that he was related to a predecessor in the See, Archbishop Walter Giffard, who paid for the young Greenfield's Oxford education in the year 1269. Giffard instructed that his bailiff at Churchdown (near Gloucester), "...to pay to Roger the miller of Oxford twenty shillings, for our kinsman William of Greenfield while he is studying there, because it would be difficult for us to send the money to him on account of the perils of the ways". Greenfield next studied in Paris, where he became a doctor of both civil and canon law. Walter Giffard's brother was Godfrey Gifford, the Bishop of Worcester. Greenfield was the first of a number of Archbishops who ruled the northern English Archiepiscopal diocese as well as being significant statesmen during the fourteenth century. Before being made Archbishop he was variously: Dean of Chichester, Rector of Stratford-upon-Avon Prebend of Ripon – where his stall was for a time sequestrated, on account of his non-residence – as at this time he was mainly occupied on affairs of state as a clerk and counsellor to Edward I Temporal Chancellor of Durham Chancellor of England (1302–1305). On 30 September 1302 Greenfield received the custody of the great seal as chancellor at St. Radegund's Abbey (near Dover). During his absence in France, one Adam of Osgodby, then the Master of the Rolls, acted as his substitute. Employed in the service of the State by King Edward I from 1290 onwards. Archbishop of York Greenfield was elected by the Chapter of York on 4 December 1304; however there was delay in his consecration due to the death of Pope Benedict XI; when finally consecrated it was by Clement V at Lyons, on 30 January 1306. Greenfield was strongly commended to the pope and cardinals by the King, who told them of his "...wisdom in council, industry, literary knowledge, and usefulness to the state". Before his appointment Greenfield had lived for some time resident in Rome where the cost of his living and the procuring of the Papal assent were very heavy leaving Greenfield obliged to borrow money and to remark, "All the money lenders were ecclesiastics. The Jews had disappeared some years before and the greater part of the treasure of the country was now stored away in the chests of some wealthy clerk or in the coffers of the monastery." He was forced to raise money to pay his debts from the company of the Bellardi of Lucca. In an attempt to free himself from the Italian money lenders he exacted aids from the clergy, and borrowed from many church dignitaries in the north of England. As a result of the ongoing war with Scotland York became almost the de facto capital of England, with Parliament being held there in 1298, 1299 and 1300. The Courts of Justice were also moved to York and did not return to London for seven years. When the attack on the Templars in England began in 1308 Greenfield was favourable to them and so refused to take any part in actions against them within the province of Canterbury; he was however present at the Great Council of Vienne in 1312, when Pope Clement V issued an edict dissolving the Order of the Templars. Greenfield died at his palace of Cawood on 6 December 1315, and was buried in the eastern part of the north transept of York Minster, where his monument still remains. A gold ring with a ruby was taken from his finger when in 1735 his tomb was opened; these mementoes have been preserved by the Cathedral authorities. Citations References Lord chancellors of England Archbishops of York 14th-century English Roman Catholic archbishops 13th-century births 1315 deaths Year of birth unknown Burials at York Minster
Haji Jalal Din Shar is a village in the Union Council of Hindyari, tehsil Thari Mirwah. It is located at a distance of 5.6 km from the city of Thari Mirwah with a population of approximately 180 people. There are two primary schools for the education of boys and girls separately. References Populated places in Khairpur District
was a province of Japan which consisted of a peninsula in the southeastern part of modern Mie Prefecture. Its abbreviated name was . Shima bordered on Ise Province to the west, and on Ise Bay on the north, east and south. It roughly coincides with the modern municipalities of Shima and Toba. Shima is classified as one of the provinces of the Tōkaidō, and was the smallest of all provinces. Under the Engishiki classification system, Shima was ranked as an "inferior country" (下国) and a "near country" (近国), in terms of its distance from the capital. History Shima was an autonomous district of Ise Province, noted as a prosperous fishing region, and during the Nara period governors of the district were responsible for providing annual gifts of fish and abalone to the Emperor. It was separated from Ise Province during the late 7th or early 8th centuries. During the Asuka period and Nara period it was dominated by the Takahashi clan. As the arable land area of Shima Province was very small, portions of the rice lands of Ise Province, as well as Mikawa Province and Owari Province were considered as part of the taxable revenues of Shima Province for the purpose of upkeep of its provincial capital, shrines and temples. The exact location of the provincial capital is not known, but is traditionally believed to have been in Ago, currently part of the city of Shima where the ruins of the Kokubun-ji of Shima Province have been discovered. The Ichinomiya of the province is the , one of the subsidiary shrines within the Ise Grand Shrine complex. During the Kamakura period Shima came under the control of Hōjō clan, followed by the Kitabatake clan for much of the Muromachi period, although the Kuki clan, originally pirates in Ise Bay based at Toba Castle dominated much of the coastal areas by the end of the Sengoku period. Ohama Kagetaka was also a pirate operating in the Ise Bay area of Shima Province during the 16th century. With the establishment of the Tokugawa shogunate, Kuki Moritaka was confirmed as daimyō of Toba, initially with revenues of 35,000 koku, growing to 55,000 koku under his son Kuki Hisataka, who was transferred to Sanda Domain in Settsu Province. The Kuki were replaced by the tozama Naitō clan, which ruled Toba to 1680. The domain then reverted to tenryō status under the direct control of the Shogunate for one year. It then came under the control of the Doi clan (1681–1691), Ogyu-Matsudaira clan (1691–1710), Itakura clan (1710–1717), and Toda-Matsudaira clan (1717–1725) before finally coming under the Inagaki clan (1725–1871), where it remained until the Meiji Restoration. During the Boshin War, Inagaki Nagayuki remained loyal to the Shogunate, and as a result was fined heavily by the Meiji government and forced into retirement. His son, Inagaki Nagahiro became domain governor, and after the abolition of the han system in July 1871, Toba Domain became "Toba Prefecture", which merged with the short lived "Watarai Prefecture" of former Ise Province in November 1871, which later became part of Mie Prefecture. Historical districts Mie Prefecture Ago District (英虞郡) - merged with Tōshi District to become Shima District (志摩郡) on March 29, 1896 Tōshi District (答志郡) - merged with Ago District to become Shima District on March 29, 1896 Bakumatsu period domains Notes References Nussbaum, Louis-Frédéric and Käthe Roth. (2005). Japan encyclopedia. Cambridge: Harvard University Press. ; OCLC 58053128 Papinot, Edmond. (1910). Historical and Geographic Dictionary of Japan. Tokyo: Librarie Sansaisha. OCLC 77691250 External links Murdoch's map of provinces, 1903 History of Mie Prefecture Former provinces of Japan 1871 disestablishments in Japan States and territories disestablished in 1871
The 2001–02 Copa Federación de España was the ninth staging of the Copa Federación de España, a knockout competition for Spanish football clubs in Segunda División B and Tercera División. The Regional stages began in 2001, while the national tournament took place during the 2001–02 season. Regional tournaments Asturias tournament Group A Group B Group C Group D Final bracket Castile and León tournament National tournament Round of 32 |} Round of 16 |} Quarter-finals |} Semifinals |} Final |} References 2000–2009 Copa Federación results Copa Federación de España seasons
Jambavan (), also known as Jambavanta (), is the king of the bears in Hindu texts. He emerges out of the mouth of Brahma when the creator deity yawns. He assists the Rama avatar of Vishnu in his struggle against the rakshasa king Ravana. In the Ramayana, he helps Hanuman realise his potential, just before his famous leap over to the island of Lanka. Jambavan was present at the churning of the ocean, and is supposed to have circled Vamana 21 times in a single leap, when he was acquiring the three worlds from Mahabali. Jambavan, together with Parashurama and Hanuman, is considered to be one of the few to have been present for both the Rama and the Krishna avataras. His daughter Jambavati was married to Krishna. Nomenclature Jambavan is also known as: Jambavantan Jambavanta (জাম্বৱন্ত, Assamese (Axomiya)) Jambavan(ಜಾಂಬವಂತ, Kannada script) Jamvanta Kannada script Jāmbubān ‍(জাম্বুবান, Bangla) Champu (Khmer) Jembawan (Javanese) Jambuwana (Malay) Jāmbabān (Odia) Jambuvaan ( Marathi) Jambavan (Malayalam) Jāmbavantudu (జాంబ వంతుడు, Telugu) Keeratuvan (Punjabi) Zabaman (Burmese) Sambuvan (சாம்புவன், Tamil) Chomphuphan (ชมพูพาน, Thai) Legends Birth In the beginning, when Brahma was sitting on the lotus from the navel of Vishnu, he started meditating and yawned, from which a bear was born, which later became Jambavan. It is said he was called Jambavan either because he was born on Jambudvipa, or because he was born while yawning. He was present at the time when Vishnu was fighting the Madhu and Kaitabha daityas. At the time of Ramayana, he was 6 manvantaras old. Ramayana In the epic Ramayana, Jambavan helped Rama find his wife Sita and fight her abductor, Ravana. It is he who makes Hanuman realise his immense capabilities, and encourages him to fly across the ocean to search for Sita in Lanka. Mahabharata In the Mahabharata, Jambavan had killed a lion, who had acquired a gem called syamantaka from Prasena, after killing him. Krishna was suspected of killing Prasena for the jewel, so he tracked Prasena's steps until he learned that he had been killed by a lion, who had been killed by a bear. Krishna tracked Jambavan to his cave, and a fight ensued. The combat between Krishna and Jambavan ensued for 27/28 days (per Bhagavata Purana) and 21 days (per Vishnu Purana), after which Jambavan began to grow tired. Realising who Krishna was, Jambavan submitted. He gave Krishna the gem, and also presented him his daughter Jambavati, who became one of Krishna's wives. The cave where Krishna and Jambuvant's fight ensured is located near Ranavav, Porabandar District of Gujarat.[8] Temple The only temple of Jambuvanta is located at Jamkhed, in the Jalana district. His temple is in a cave on the hill north of Jamkhed. The temple is about 2 kilometres away from Jamkhed village. See also Vamana Sugriva Ramayana References External links Jambavanmotivating Hanuman for the task of leaping the ocean. in Valmiki Ramayana - Kishkindha Kanda in Prose Sarga 65 - Accessed August 14, 2006. Jambavan- A Rksha Warrior Characters in the Ramayana Bear deities Characters_in_the_Bhagavata_Purana
Khorey-Ver, Chorey-Ver or Khoreyver (Russian: Хорей-Вер), formerly named Mador-Hard and Madora, is a village with a rural settlement council in Nenets Autonomous Okrug, Russia situated along the Kolva river with a small airport, twelve streets, a secondary school, a boarding school, a district hospital, a kindergarten, a cultural center, a bakery, several shops and a power station. Its population in 2010 was 739, consisting of around 370 Nenets, a decrease from 842 in 2002 and the main occupation of the population is reindeer hunting. Since the village is quite remote, the village receives two flights a week from Naryan-Mar. The name of the village 'Khorey-Ver' directly translates in Nenets to 'direct forest' or 'straight forest'. The village was founded in 1926 when several families that hunted reindeer gathered to form the settlement and in 1939, they received permission in partnerships to hunt and fish, and later to farm; the partnership was named 'Ilyich' after Vladimir Lenin's middle name. References Rural localities in Nenets Autonomous Okrug
Pardes Mein Hai Mera Dil ( My Heart Lives In A Foreign Land) (International title:Chasing My Heart) is an Indian television series produced by Ekta Kapoor under her banner Balaji Telefilms for Star Plus. The story, set in Austria, is inspired by the 1997 film Pardes and Manju Kapur's 2008 novel The Immigrant. It was shot in locations in India, Vienna and Innsbruck. The series stars Drashti Dhami as Naina Vivek Batra, Arjun Bijlani as Raghav Rajesh Mehra and Vineet Raina as Rehaan Karan Khurana. It went off air on 30 June 2017 with 170 episodes. It was replaced by Iss Pyaar Ko Kya Naam Doon 3. Plot Set in Austria, Raghav Mehra works in his rich Indian family. He loves the rich and spoilt Sanjana who ignores him. Naina Batra, a woman close to her family breaks up with her fiancé Amit due to her heart patient mother Asha's illness and leaves to Austria for the operation. Naina and Raghav become friends. Raghav's grandmother Indumati fixes Naina's marriage with his cousin Veer. On the wedding day, he leaves after which Raghav sacrifices his love and marries Naina who feels betrayed but soon trusts him. Sanjana is pregnant with Veer's child. Naina helps Raghav start a business in Austria. Indumati falls into a coma. A buyer Rehaan Khanna enters. Naina meets his wife Ahana and agrees to become a surrogate mother. Raghav misunderstands that Naina has an affair and carries someone else's baby. Without justification, Raghav divorces Naina. Veer marries Sanjana who gives birth to a daughter Veera. Ahana meets with a car accident planned by Rehaan's stepmother Harjeet, and dies after telling Naina that the baby is in danger. 6 months later Naina lives in India. Raghav is an arrogant businessman. Indumati wakes up from coma and mistakes Ahana's baby to be of Raghav and Naina. Rehaan learns that Ahana hired a surrogate so he began searching her and also told about this to Harjeet who now wants to kill Ahana's baby. Naina gives premature birth to a baby boy Ahaan. Naina and Raghav grow closer as they confess their love but part ways amid misunderstandings. Rehaan attacks Raghav thinking he had kidnapped the baby. Raghav presumably dies thinking Naina cheated on him and Rehaan is Ahaan's father. Naina marries Rehaan to look after Ahaan, and acts to be possessed by Ahana's ghost. Naina reveals Harjeet's true intentions. She tells Indumati that her marriage with Rehaan is real. Harjeet is arrested and tries to shoot Naina but Rehaan sacrifices himself indeed but got saved by Indu, Naina and Ishaan. Naina gives birth to Rehaan's son named Neil. 7 years later Naina, Rehaan, Ishaan, Ahaan, Neil and Indumati live happily. Naina works as a tuition teacher and points towards Raghav's photo when her students question about her love story. She tells them that Raghav is her life as he told her the meaning of love and she will be united with him in heaven. Cast Main Drashti Dhami as Naina Batra Khurana / Naina Batra Mehra: Asha's daughter; Rajeev's sister; Raghav's widow; Rehaan's wife; Ishaan and Neil's mother; Ahaan's surrogate mother (2016–2017) Arjun Bijlani as Raghav Mehra: Swaraj's son; Sanjana's ex-lover; Naina's first husband; Ishaan's father (2016–2017) (Dead) Vineet Raina as Rehaan Khurana: Armaan's half-brother; Ahana's widower; Naina's husband; Ahaan and Neil's father (2017) Recurring Surekha Sikri as Indumati Mehra: Madan, Swaraj and Balraj's mother; Veer, Akash, Shaurya, Ira and Raghav's grandmother (2016–2017) Alka Amin as Asha Batra: Rajeev and Naina's mother; Ayaan's grandmother (2016–2017) Adaa Khan as Ahana Khurana: Rehaan's first wife; Ahaan's mother (2017) (Dead) Sudha Chandran as Harjeet Khurana: Armaan's mother; Rehaan's step-mother (2017) Alok Narula as Rajeev Batra: Asha's son; Naina's elder brother; Chanchal's husband; Ayaan's father (2016–2017) Unknown as Ayaan Batra: Rajeev and Chanchal's son Sangeeta Kapure as Chanchal Batra: Rajeev's wife; Ayaan's mother (2016–2017) Rakesh Kukreti as Madan Mehra: Indumati's son; Swaraj and Balraj's brother; Sudha's husband; Veer and Akash's father (2016–2017) Manini Mishra as Sudha Mehra: Madan's wife; Veer and Akash's mother (2016–2017) Laksh Lalwani as Veer Mehra: Madan and Sudha's son; Akash's brother; Naina's ex-fiancé; Sanjana's husband; Veera's father (2016–2017) (Dead) Additi Gupta as Sanjana Mehra: Raghav's ex-lover; Veer's wife; Veera's mother (2016–2017) Gauri Singh as Seema (2017) Unknown as Veera Mehra: Veer and Sanjana's daughter Lovekesh Solanki as Akash Mehra: Madan and Sudha's son; Veer's brother; Soumya's husband; Aman's father (2016–2017) Unknown as Soumya Mehra: Akash's wife; Aman's mother Unknown as Aman Mehra: Akash and Soumya's son Manish Khanna as Balraj Mehra: Indumati's son; Swaraj and Madan's brother; Parmeshwari's husband; Shaurya and Ira's father (2016–2017) Sonia Rakkar as Parmeshwari Mehra: Balraj's wife; Shaurya and Ira's mother (2016–2017) Ankit Shah as Sikandar "Shaurya" Mehra: Balraj and Parmeshwari's son; Ira's brother; Pragya's husband; Prayag's father (2016–2017) Unknown as Pragya Mehra: Shaurya's wife; Prayag's mother Unknown as Prayag Mehra: Shaurya and Pragya's son Rini Das as Iranjali "Ira" Khurana: Balraj and Parmeshwari's daughter; Shaurya's sister; Armaan's wife; Imraan's mother (2016–2017) Pulkit Bangia as Armaan Khurana: Harjeet's son; Rehaan's half-brother; Ira's husband; Imraan's father (2017) Parveen Kaur as Amit's mother (2016) Vicky Arora as Amit Vishwakarma: Manjari's son; Naina's ex-fiancé; Bella's boyfriend (2016) Lucinda Nicholas as Bella D'Costa: Amit's girlfriend (2016) References External links Pardes Mein Hai Mera Dil on Hotstar Balaji Telefilms television series 2016 Indian television series debuts 2017 Indian television series endings StarPlus original programming Television shows set in Austria Television shows set in Mumbai Television shows based on Indian novels Indian television soap operas Serial drama television series
A Latin-script alphabet (Latin alphabet or Roman alphabet) is an alphabet that uses letters of the Latin script. The 21-letter archaic Latin alphabet and the 23-letter classical Latin alphabet belong to the oldest of this group. The 26-letter modern Latin alphabet is the newest of this group. Encoding The 26-letter ISO basic Latin alphabet (adopted from the earlier ASCII) contains the 26 letters of the English alphabet. To handle the many other alphabets also derived from the classical Latin one, ISO and other telecommunications groups "extended" the ISO basic Latin multiple times in the late 20th century. More recent international standards (e.g. Unicode) include those that achieved ISO adoption. Key types of differences Apart from alphabets for modern spoken languages, there exist phonetic alphabets and spelling alphabets in use derived from Latin script letters. Historical languages may also have used (or are now studied using) alphabets that are derived but still distinct from those of classical Latin and their modern forms (if any). The Latin script was typically slightly altered to function as an alphabet for each different language (or other use), although the main letters are largely the same. A few general classes of alteration cover many particular cases: diacritics could be added to existing letters; two letters could be fused together into ligatures; additional letters could be inserted; or pairs or triplets of letters could be treated as units (digraphs and trigraphs). These often were given a place in the alphabet by defining an alphabetical order or collation sequence, which can vary between languages. Some of the results, especially from just adding diacritics, were not considered distinct letters for this purpose; for example, the French é and the German ö are not listed separately in their respective alphabet sequences. With some alphabets, some altered letters are considered distinct while others are not; for instance, in Spanish, ñ (which indicates a unique phoneme) is listed separately, while á, é, í, ó, ú, and ü (which do not; the first five of these indicate a nonstandard stress-accent placement, while the last forces the pronunciation of a normally-silent letter) are not. Digraphs in some languages may be separately included in the collation sequence (e.g. Hungarian CS, Welsh RH). New letters must be separately included unless collation is not practised. Properties Letter inventory Coverage of the letters of the ISO basic Latin alphabet can be complete partial and additional letters can be absent present, either as letters with diacritics (e.g. in the Danish, Norwegian and Swedish alphabets) ligatures (e. g. in Danish, Norwegian, and Icelandic) new letter forms (e.g. in the Azerbaijani alphabet) Grapheme order Most alphabets have the letters of the ISO basic Latin alphabet in the same order as that alphabet. Multigraphs Some alphabets regard digraphs as distinct letters, e.g. the Spanish alphabet from 1803 to 1994 had CH and LL sorted apart from C and L. Diacritics and ligatures Some alphabets sort letters that have diacritics or are ligatures at the end of the alphabet. Examples are the Scandinavian Danish, Norwegian, Swedish, and Finnish alphabets. New letter forms Icelandic sorts a new letter form and a ligature at the end, as well as one letter with diacritic, while others with diacritics are sorted behind the corresponding non-diacritic letter. Grapheme–sound correspondence The phonetic values of graphemes can differ between alphabets. Names of letters References External links Appendix:Latin script/alphabets at Wiktionary
Symphytum peregrinum may refer to the following comfrey species: Symphytum peregrinum auct.: Symphytum × uplandicum, the Russian or Quaker comfrey Symphytum peregrinum Ledeb.: Symphytum officinale subsp. officinale References
Taurus was an broad gauge locomotive operated by the South Devon Railway. It was a very different locomotive to all the other s used on the South Devon Railway. It was much smaller and was normally used on one of the branches, where it would regularly work passenger trains, or on the dockside lines in the Plymouth area. It was built by the Avonside Engine Company and was a saddle tank similar to 2-4-0 Prince. On 1 February 1876 the South Devon Railway was amalgamated with the Great Western Railway, all its locomotives were given numbers by their new owners but continued to carry their names too. After the gauge conversion on 21 May 1892 Taurus was unused for a while but in 1894 it was converted to standard gauge and worked in this form as no. 1326 until 1905. Locomotive Taurus (1869 – 1892) GWR no. 2170 The name comes from the Greek word for bull and represents a constellation. See Taurus (constellation). References Railway company records at The National Archives South Devon Railway Taurus 0-6-0ST locomotives Taurus Avonside locomotives Individual locomotives of Great Britain Railway locomotives introduced in 1869
ATP-dependent Clp protease ATP-binding subunit clpX-like, mitochondrial is an enzyme that in humans is encoded by the CLPX gene. This protein is a member of the family of AAA Proteins (AAA+ ATPase) and is to form the protein complex of Clp protease (Endopeptidase Clp). Structure Tertiary The human enzyme ClpX is drawn from the protein complex structure of Clp protease. These hexameric HSP100/Clp proteins produce ring like structures resembling chaperonins. The Clp proteases have a two-component structure which includes two different proteolytic cores and multiple chaperone rings. As a result, there are several possible combinations of Clp protease complexes. The ClpP protease core can partner with different chaperones, namely ClpA, ClpC, ClpE, and ClpX, to form active chaperone-protease complexes. On the other hand, ClpQ interacts exclusively with the ClpY chaperone to form the ClpYQ protease (also called HslUV) . The Clp-type ATPases can be classified into two distinct groups: class I with two consecutive AAA modules per protomer(ClpA, ClpC, and ClpE) and class II with only one AAA module per protomer. ClpA and ClpX of E. coli are protein unfoldases that require ATP to function. They individually associate with the ClpP protease to facilitate targeted protein degradation. These variants have inflicted variants interspecific with ClpP. Quaternary The complex assembly of the regulatory subunits of ATP-dependent Clp proteases is induced in the critical role in cellular thermotolerance. There are numerous proteases that are thought to have a bacterial origin. Studies on the protein of E. coli are the main source of information about the human ClpX protein. In E. coli, the ClpX protein monomer has an N-terminal domain and a AAA+ module made up of two AAA+ domains, one larger than the other. Since the prevalence of E.coli is at such a high factor in most people around the world, the constitutive aspect of ClpX showed multiple signs in research of the protease. Clp protease is made up of ATPase-active chaperone rings and a proteolytic core, two functional units with distinct functions that play a role in cellular thermotolerance. The ClpXP chaperone-protease is present in almost every type of bacteria, commonly found together with the widely distributed Lon and FtsH proteases. Hence, ClpXP is the most prevalent among the Clp. The HslV rings engage with an unrelated chaperone ATPase called HslU, which also has 6-fold ring symmetry. This is similar to the ClpX chaperone, which it potentially evolved from, and almost all AAA+ ATPase proteins that emerged from a surge of gene duplications prior to the last common ancestor of all life. This allows the assumption that most mammals from the common ancestors between humans and mice were shown to have this relating enzyme. As shown on the infobox gene similarity between a mouse and a human, we can distinctly see its similarities and differences in the Clp protease. Function Bacteria use the ATP-dependent ClpX protease for a variety of purposes, including protein quality control, stress tolerance, the production of virulence factors, and binding to protein degradation tags in E.coli. The ATPase component is in charge of substrate recognition, unfolding, and transport into the proteolytic component. The proteolytic component has several serine- or threonine-type active sites that allow for protein hydrolysis. Accordingly, it seems that depending on the physiological circumstances, clpX can either be produced alone or in conjunction with clpP in cells. ClpX and ClpP are two proteins that work together in the ClpXP complex, which is a major protein degradation system in bacteria. ClpX is an ATPase that provides the energy for unfolding and translocating target proteins into the ClpP protease for degradation. ClpP is the protease that cleaves the unfolded target proteins. The function of the ClpX has several complexity factors that can be seen in the proteasome evolution figure. This shows the evolution of proteasomes that has occurred in a stepwise manner, with increasing complexity over time. The first step was the development of the HslV ring protease, followed by the 20S proteasome, and finally, the 26S proteasome. Grey bars on the evolutionary tree represent the two significant transitions in proteasome structure that are crucial for polarizing the tree. Additionally, four other evolutionary transitions are marked by blue bars that also align with the tree's polarization. The HslV ring protease has 6-fold symmetry, with a 2-tiered ring consisting of 12 identical subunits. It is believed to have arisen from a monomeric NTN hydrolase, possibly just before the divergence of Hadobacteria. The regulation of ClpX and ClpP expression is complex and involves various factors, including transcriptional regulators, environmental signals, and post-transcriptional modifications. Understanding how the expression of these proteins is regulated can provide insights into the mechanisms by which bacteria respond to stress and maintain cellular homeostasis. Clinical significance The mitochondrial system responsible for maintaining protein quality, especially clpx, plays a crucial role in influencing fertility, survival, and neural aging. Studies have indicated that improper regulation of the protein quality control system within the mitochondria, which includes the CLPXP complex, can significantly impact cellular health and function. For instance, when researchers deleted the CLPP subunit in mice, they observed a decline in fertility and a rise in early embryonic mortality. These findings suggest that the clpx complex plays a crucial role in maintaining appropriate mitochondrial function during gamete production and embryonic development. The ClpXP protease is a significant player in mitochondrial protein quality control in mammals. When ClpXP function is compromised, it can result in the accumulation of damaged proteins and mitochondrial malfunctions. These issues are believed to be potential causes of neurodegenerative diseases and aging. Having such a variety of Clp complexes, the insight of the ClpX assembly is crucial to identify any detrimental damages in humans for long term issues or term. Having a common ancestor with mice allows for future studies to be developed in understanding this enzyme. Through extensive research of E.coli with correlation to ClpXp, research on Mycobacterium tuberculosis took place. The data revealed that ClpX participates in DNA replication and identify the first activator of ClpXp in mycobacteria as well. This knowledge correlates with research of when ClpX is inhibited, the bacterium became more susceptible to antibiotics. This suggests that targeting ClpX could be a strategy for overcoming antibiotic resistance in bacterial infections in this research. However, the research is ongoing and more definitive results are needed to take place. References Proteases EC 3.4
Bled White is a 2011 horror film written and directed by Jose Carlos Gomez and starring North Roberts, Matthew Prochazka, and Colleen Boag. The film was shot around the Chicago area, during the winter. It went on to win several awards. Premise The story centers around six characters who must survive a post-apocalyptic disaster. The movie is told in chapters, all of which come together at the end. Festivals and awards Tabloid Witch Awards, 2009; Best Supporting Actress (Colleen Boag), Best Soundtrack Actress (DC McAuliffe), and Honorable Mention (Jose Carlos Gomez). ScareFest Horror and Paranornal Convention, 2010; Official Selection. Geneva Film Festival, 2009; Official Selection. Fear Fete Film Festival, 2011; Best Zombie Feature. 8th Annual South African Horror Fest, 2012; Official Selection. Living Dead Film Festival, 2012; Best Actor (North Roberts), and Director's Choice Award. Reception Bled White received positive reviews from critics. Horror Society called the film "one hell of a zombie flick." See also List of apocalyptic and post-apocalyptic fiction References External links 2011 horror films 2011 films American post-apocalyptic films
Heuchelheim bei Frankenthal is a municipality in the Rhein-Pfalz-Kreis, in Rhineland-Palatinate, Germany. References Rhein-Pfalz-Kreis
Sim Kwon-Ho (Hangul: 심권호, Hanja: 沈權虎; born October 10, 1972, in Seongnam, South Korea) is a retired South Korean Greco Roman wrestler. He won gold medals at the 1996 and 2000 Olympic Games, and is the only South Korean wrestler to win two gold medals in the Olympics. Career Sim was born on October 10, 1972, in Seongnam, Gyeonggi-do, and started wrestling at the age of 13. While attending Seoul Physical Education High School in 1990, Sim was first selected for the South Korean national wrestling team. Sim first gained attention at the 1993 World Wrestling Championships where he won the bronze medal in the 48 kg category. Next year, Sim won the gold medal in the Men's Greco-Roman 48 kg at the Asian Games. Since the 1994 Asian Games, Sim swept gold medals in the Greco-Roman light flyweight(48 kg) and flyweight(54 kg) categories never losing a match at major international competitions such as Olympic Games, World Championships, Asian Games and Asian Championships until his retirement in 2000. 1992 Olympic trials While trying to earn his spot to compete for the 1992 Summer Olympics, in Barcelona, Sim was ranked first in the Men's Greco-Roman 48 kg at the South Korean national trials, beating 1991 World Champion Goun Duk-Yong. Amid controversy, however, Goun was selected by Korea Wrestling Federation over Sim in the 48 kg category at the Barcelona Games, despite being ranked lower in the trials. At the Barcelona Games Goun was eventually eliminated in Round 1. 1996 Olympics At the Atlanta Games in 1996, Sim won his first Olympic title by defeating Aleksandr Pavlov of Belarus in the final. He scored two points with a chest-high roll-through with 42 seconds left in regulation time and then added two more points with another roll in overtime to score a 4–0 victory. In November 1996 Sim became the last world light flyweight (48 kg) champion at the 1996 World Cup where the FILA's final international 48 kg class competitions were held, dominating all the opponents by technical fall including two-time World Champion Wilber Sánchez of Cuba. 2000 Olympics Sim moved up in weight from 48 kg to 54 kg in 1997 when the new weight classes were established by FILA. In the semifinals of the Sydney Games in 2000, he defeated Kang Yong-Gyun of North Korea 10–0. At the Opening Ceremony, the North and South Koreans had marched together. In this spirit, before the medal matches, Sim gave advice to Kang about the man he would be facing in the bronze-medal match-Andriy Kalashnikov of Ukraine, while Kang gave Sim a scouting report on his opponent in the gold-medal match-Lázaro Rivas of Cuba. Both Koreans won, with Sim scoring early and often against Rivas and prevailing 8–0. Post career Sim is currently a wrestling commentator for SBS Sports and serving as an assistant coach for the KOMSCO wrestling team. Notable final matches |- style="text-align:center; background:#e3e3e3;" | style="border-style:none none solid solid; "|Opponent | style="border-style:none none solid solid; "|Res. | style="border-style:none none solid solid; "|Class | style="border-style:none none solid solid; "|Score | style="border-style:none none solid solid; "|Date | style="border-style:none none solid solid; "|Competition | style="border-style:none none solid solid; "|Notes |- align=center |Win||align=left| Lázaro Rivas |rowspan=4||| || |align=left| |align=left| |- align=center |Win||align=left| Shamseddin Khudoyberdiev || || |align=left| |align=left| |- align=center |Win||align=left| Kang Yong-Gyun || || |align=left| |align=left| |- align=center |Win||align=left| Marian Sandu || || |align=left| |align=left| |- align=center |Win||align=left| Aleksandr Pavlov |rowspan=5||| || |align=left| |align=left| |- align=center |Win||align=left| Kang Yong-Gyun || || |align=left| |align=left| |- align=center |Win||align=left| Hiroshi Kado || || |align=left| |align=left| |- align=center |Win||align=left| Dmitri Korshunov || || |align=left| |align=left| |- align=center |Win||align=left| Reza Simkhah || || |align=left| |align=left| External links Sim Kwon-Ho's highlights in the 1996 and 2000 Olympics from Youtube.com Olympic wrestlers for South Korea Wrestlers at the 1996 Summer Olympics Wrestlers at the 2000 Summer Olympics South Korean male sport wrestlers Olympic gold medalists for South Korea 1972 births Living people Olympic medalists in wrestling Asian Games medalists in wrestling Wrestlers at the 1994 Asian Games Wrestlers at the 1998 Asian Games World Wrestling Championships medalists Medalists at the 2000 Summer Olympics Medalists at the 1996 Summer Olympics Asian Games gold medalists for South Korea Medalists at the 1994 Asian Games Medalists at the 1998 Asian Games Asian Wrestling Championships medalists Sportspeople from Seongnam 20th-century South Korean people 21st-century South Korean people Kwon-ho
The Codroipo electoral district (official name: Friuli-Venezia Giulia - 04 uninominal district) was an uninominal district in Italy for the Chamber of Deputies. Territory As required by law, it was part of the Friuli-Venezia Giulia electoral constituency. The Codroipo-district was composed by 86 comuni: Amaro, Ampezzo, Arba, Arta Terme, Artegna, Basiliano, Bertiolo, Bordano, Buja, Camino al Tagliamento, Cassacco, Castelnovo del Friuli, Cavasso Nuovo, Cavazzo Carnico, Cercivento, Chiusaforte, Clauzetto, Codroipo, Colloredo di Monte Albano, Comeglians, Coseano, Dignano, Dogna, Enemonzo, Fagagna, Fanna, Flaibano, Forgaria nel Friuli, Forni Avoltri, Forni di Sopra, Forni di Sotto, Frisanco, Gemona del Friuli, Lauco, Lestizza, Ligosullo, Magnano in Riviera, Majano, Malborghetto Valbruna, Martignacco, Mereto di Tomba, Moggio Udinese, Montenars, Moruzzo, Osoppo, Ovaro, Pagnacco, Paluzza, Pasian di Prato, Paularo, Pinzano al Tagliamento, Pontebba, Povoletto, Prato Carnico, Preone, Ragogna, Ravascletto, Raveo, Reana del Rojale, Resiutta, Rigolato, Rive d'Arcano, San Daniele del Friuli, San Vito di Fagagna, Sappada, Sauris, Sedegliano, Sequals, Socchieve, Sutrio, Tarcento, Tarvisio, Tolmezzo, Tramonti di Sopra, Tramonti di Sotto, Trasaghis, Travesio, Treppo Carnico, Treppo Grande, Tricesimo, Venzone, Verzegnis, Villa Santina, Vito d'Asio and Zuglio. The district was part of the province of Udine and Pordenone. The district was part of the Friuli-Venezia Giulia - 01 plurinominal district. Elected Electoral results References Constituencies established in 2017 Chamber of Deputies constituencies in Italy
```smalltalk using System; using DataStructures.LinkedList.SkipList; using NUnit.Framework; using FluentAssertions; using System.Collections.Generic; namespace DataStructures.Tests.LinkedList; public static class SkipListTests { [Test] public static void TestAdd() { var list = new SkipList<int>(); list.AddOrUpdate(1, 1); list[2] = 2; list[3] = 3; list.Count.Should().Be(3); list.GetValues().Should().ContainInOrder(1, 2, 3); } [Test] public static void TestUpdate() { var list = new SkipList<string>(); // Add some elements. list[1] = "v1"; list[2] = "v2"; list[5] = "v5"; // Update list.AddOrUpdate(1, "v1-updated"); list[2] = "v2-updated"; list.Count.Should().Be(3); list.GetValues().Should().ContainInOrder("v1-updated", "v2-updated", "v5"); } [Test] public static void TestContains() { var list = new SkipList<int>(); list.AddOrUpdate(1, 1); list.AddOrUpdate(3, 3); list.AddOrUpdate(5, 5); list.Contains(1).Should().BeTrue(); list.Contains(3).Should().BeTrue(); list.Contains(5).Should().BeTrue(); list.Contains(0).Should().BeFalse(); list.Contains(2).Should().BeFalse(); list.Contains(9).Should().BeFalse(); } [Test] public static void TestGetByKey_Success() { var list = new SkipList<string>(); list[1] = "value1"; list[1].Should().Be("value1"); } [Test] public static void TestGetByKey_KeyNotFoundException() { var list = new SkipList<string>(); list[1] = "value1"; string value; Action act = () => value = list[2]; act.Should().Throw<KeyNotFoundException>(); } [Test] public static void TestRemove_ItemRemoved() { var list = new SkipList<int>(); list.AddOrUpdate(1, 1); list.AddOrUpdate(2, 2); list.AddOrUpdate(3, 3); list.Count.Should().Be(3); list.Contains(2).Should().BeTrue(); var isRemoved = list.Remove(2); list.Count.Should().Be(2); list.Contains(2).Should().BeFalse(); isRemoved.Should().BeTrue(); } [Test] public static void TestRemove_ItemNotFound() { var list = new SkipList<int>(); list.AddOrUpdate(1, 1); list.AddOrUpdate(2, 2); list.AddOrUpdate(3, 3); var isRemoved = list.Remove(222); list.Count.Should().Be(3); isRemoved.Should().BeFalse(); } [Test] public static void TestGetValues() { var list = new SkipList<string>(); list[4] = "four"; list[2] = "two"; list[3] = "three"; list[1] = "one"; var valuesSortedByKey = list.GetValues(); valuesSortedByKey.Should().ContainInOrder("one", "two", "three", "four"); } } ```
```shell What is stored in a commit? Search for commits by author `master` and `origin` aren't special Remote repositories: viewing, editing and deleting Dates in git ```
```xml //===-- MachProcess.cpp -----------------------------------------*- C++ -*-===// // // See path_to_url for license information. // //===your_sha256_hash------===// // // Created by Greg Clayton on 6/15/07. // //===your_sha256_hash------===// #include "DNB.h" #include "MacOSX/CFUtils.h" #include "SysSignal.h" #include <dlfcn.h> #include <inttypes.h> #include <mach-o/loader.h> #include <mach/mach.h> #include <mach/task.h> #include <pthread.h> #include <signal.h> #include <spawn.h> #include <sys/fcntl.h> #include <sys/ptrace.h> #include <sys/stat.h> #include <sys/sysctl.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <uuid/uuid.h> #include <algorithm> #include <chrono> #include <map> #include <TargetConditionals.h> #import <Foundation/Foundation.h> #include "DNBDataRef.h" #include "DNBLog.h" #include "DNBThreadResumeActions.h" #include "DNBTimer.h" #include "MachProcess.h" #include "PseudoTerminal.h" #include "CFBundle.h" #include "CFString.h" #ifndef PLATFORM_BRIDGEOS #define PLATFORM_BRIDGEOS 5 #endif #ifndef PLATFORM_MACCATALYST #define PLATFORM_MACCATALYST 6 #endif #ifndef PLATFORM_IOSSIMULATOR #define PLATFORM_IOSSIMULATOR 7 #endif #ifndef PLATFORM_TVOSSIMULATOR #define PLATFORM_TVOSSIMULATOR 8 #endif #ifndef PLATFORM_WATCHOSSIMULATOR #define PLATFORM_WATCHOSSIMULATOR 9 #endif #ifndef PLATFORM_DRIVERKIT #define PLATFORM_DRIVERKIT 10 #endif #ifdef WITH_SPRINGBOARD #include <CoreFoundation/CoreFoundation.h> #include <SpringBoardServices/SBSWatchdogAssertion.h> #include <SpringBoardServices/SpringBoardServer.h> #endif // WITH_SPRINGBOARD #if WITH_CAROUSEL // For definition of CSLSOpenApplicationOptionForClockKit. #include <CarouselServices/CSLSOpenApplicationOptions.h> #endif // WITH_CAROUSEL #if defined(WITH_SPRINGBOARD) || defined(WITH_BKS) || defined(WITH_FBS) // This returns a CFRetained pointer to the Bundle ID for app_bundle_path, // or NULL if there was some problem getting the bundle id. static CFStringRef CopyBundleIDForPath(const char *app_bundle_path, DNBError &err_str); #endif #if defined(WITH_BKS) || defined(WITH_FBS) #import <Foundation/Foundation.h> static const int OPEN_APPLICATION_TIMEOUT_ERROR = 111; typedef void (*SetErrorFunction)(NSInteger, std::string, DNBError &); typedef bool (*CallOpenApplicationFunction)(NSString *bundleIDNSStr, NSDictionary *options, DNBError &error, pid_t *return_pid); // This function runs the BKSSystemService (or FBSSystemService) method // openApplication:options:clientPort:withResult, // messaging the app passed in bundleIDNSStr. // The function should be run inside of an NSAutoReleasePool. // // It will use the "options" dictionary passed in, and fill the error passed in // if there is an error. // If return_pid is not NULL, we'll fetch the pid that was made for the // bundleID. // If bundleIDNSStr is NULL, then the system application will be messaged. template <typename OpenFlavor, typename ErrorFlavor, ErrorFlavor no_error_enum_value, SetErrorFunction error_function> static bool CallBoardSystemServiceOpenApplication(NSString *bundleIDNSStr, NSDictionary *options, DNBError &error, pid_t *return_pid) { // Now make our systemService: OpenFlavor *system_service = [[OpenFlavor alloc] init]; if (bundleIDNSStr == nil) { bundleIDNSStr = [system_service systemApplicationBundleIdentifier]; if (bundleIDNSStr == nil) { // Okay, no system app... error.SetErrorString("No system application to message."); return false; } } mach_port_t client_port = [system_service createClientPort]; __block dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); __block ErrorFlavor open_app_error = no_error_enum_value; __block std::string open_app_error_string; bool wants_pid = (return_pid != NULL); __block pid_t pid_in_block; const char *cstr = [bundleIDNSStr UTF8String]; if (!cstr) cstr = "<Unknown Bundle ID>"; NSString *description = [options description]; DNBLog("[LaunchAttach] START (%d) templated *Board launcher: app lunch " "request for " "'%s' - options:\n%s", getpid(), cstr, [description UTF8String]); [system_service openApplication:bundleIDNSStr options:options clientPort:client_port withResult:^(NSError *bks_error) { // The system service will cleanup the client port we created for // us. if (bks_error) open_app_error = (ErrorFlavor)[bks_error code]; if (open_app_error == no_error_enum_value) { if (wants_pid) { pid_in_block = [system_service pidForApplication:bundleIDNSStr]; DNBLog("[LaunchAttach] In completion handler, got pid for " "bundle id " "'%s', pid: %d.", cstr, pid_in_block); } else { DNBLog("[LaunchAttach] In completion handler, launch was " "successful, " "debugserver did not ask for the pid"); } } else { const char *error_str = [(NSString *)[bks_error localizedDescription] UTF8String]; if (error_str) { open_app_error_string = error_str; DNBLogError( "[LaunchAttach] END (%d) In app launch attempt, got error " "localizedDescription '%s'.", getpid(), error_str); const char *obj_desc = [NSString stringWithFormat:@"%@", bks_error].UTF8String; DNBLogError( "[LaunchAttach] END (%d) In app launch attempt, got error " "NSError object description: '%s'.", getpid(), obj_desc); } DNBLogThreadedIf(LOG_PROCESS, "In completion handler for send " "event, got error \"%s\"(%ld).", error_str ? error_str : "<unknown error>", (long)open_app_error); } [system_service release]; dispatch_semaphore_signal(semaphore); } ]; const uint32_t timeout_secs = 30; dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, timeout_secs * NSEC_PER_SEC); long success = dispatch_semaphore_wait(semaphore, timeout) == 0; dispatch_release(semaphore); DNBLog("[LaunchAttach] END (%d) templated *Board launcher finished app lunch " "request for " "'%s'", getpid(), cstr); if (!success) { DNBLogError("[LaunchAttach] END (%d) timed out trying to send " "openApplication to %s.", getpid(), cstr); error.SetError(OPEN_APPLICATION_TIMEOUT_ERROR, DNBError::Generic); error.SetErrorString("timed out trying to launch app"); } else if (open_app_error != no_error_enum_value) { error_function(open_app_error, open_app_error_string, error); DNBLogError("[LaunchAttach] END (%d) unable to launch the application with " "CFBundleIdentifier '%s' " "bks_error = %ld", getpid(), cstr, (long)open_app_error); success = false; } else if (wants_pid) { *return_pid = pid_in_block; DNBLogThreadedIf( LOG_PROCESS, "Out of completion handler, pid from block %d and passing out: %d", pid_in_block, *return_pid); } return success; } #endif #if defined(WITH_BKS) || defined(WITH_FBS) static void SplitEventData(const char *data, std::vector<std::string> &elements) { elements.clear(); if (!data) return; const char *start = data; while (*start != '\0') { const char *token = strchr(start, ':'); if (!token) { elements.push_back(std::string(start)); return; } if (token != start) elements.push_back(std::string(start, token - start)); start = ++token; } } #endif #ifdef WITH_BKS #import <Foundation/Foundation.h> extern "C" { #import <BackBoardServices/BKSOpenApplicationConstants_Private.h> #import <BackBoardServices/BKSSystemService_LaunchServices.h> #import <BackBoardServices/BackBoardServices.h> } static bool IsBKSProcess(nub_process_t pid) { BKSApplicationStateMonitor *state_monitor = [[BKSApplicationStateMonitor alloc] init]; BKSApplicationState app_state = [state_monitor mostElevatedApplicationStateForPID:pid]; return app_state != BKSApplicationStateUnknown; } static void SetBKSError(NSInteger error_code, std::string error_description, DNBError &error) { error.SetError(error_code, DNBError::BackBoard); NSString *err_nsstr = ::BKSOpenApplicationErrorCodeToString( (BKSOpenApplicationErrorCode)error_code); std::string err_str = "unknown BKS error"; if (error_description.empty() == false) { err_str = error_description; } else if (err_nsstr != nullptr) { err_str = [err_nsstr UTF8String]; } error.SetErrorString(err_str.c_str()); } static bool BKSAddEventDataToOptions(NSMutableDictionary *options, const char *event_data, DNBError &option_error) { std::vector<std::string> values; SplitEventData(event_data, values); bool found_one = false; for (std::string value : values) { if (value.compare("BackgroundContentFetching") == 0) { DNBLog("Setting ActivateForEvent key in options dictionary."); NSDictionary *event_details = [NSDictionary dictionary]; NSDictionary *event_dictionary = [NSDictionary dictionaryWithObject:event_details forKey: BKSActivateForEventOptionTypeBackgroundContentFetching]; [options setObject:event_dictionary forKey:BKSOpenApplicationOptionKeyActivateForEvent]; found_one = true; } else if (value.compare("ActivateSuspended") == 0) { DNBLog("Setting ActivateSuspended key in options dictionary."); [options setObject:@YES forKey: BKSOpenApplicationOptionKeyActivateSuspended]; found_one = true; } else { DNBLogError("Unrecognized event type: %s. Ignoring.", value.c_str()); option_error.SetErrorString("Unrecognized event data"); } } return found_one; } static NSMutableDictionary *BKSCreateOptionsDictionary( const char *app_bundle_path, NSMutableArray *launch_argv, NSMutableDictionary *launch_envp, NSString *stdio_path, bool disable_aslr, const char *event_data) { NSMutableDictionary *debug_options = [NSMutableDictionary dictionary]; if (launch_argv != nil) [debug_options setObject:launch_argv forKey:BKSDebugOptionKeyArguments]; if (launch_envp != nil) [debug_options setObject:launch_envp forKey:BKSDebugOptionKeyEnvironment]; [debug_options setObject:stdio_path forKey:BKSDebugOptionKeyStandardOutPath]; [debug_options setObject:stdio_path forKey:BKSDebugOptionKeyStandardErrorPath]; [debug_options setObject:[NSNumber numberWithBool:YES] forKey:BKSDebugOptionKeyWaitForDebugger]; if (disable_aslr) [debug_options setObject:[NSNumber numberWithBool:YES] forKey:BKSDebugOptionKeyDisableASLR]; // That will go in the overall dictionary: NSMutableDictionary *options = [NSMutableDictionary dictionary]; [options setObject:debug_options forKey:BKSOpenApplicationOptionKeyDebuggingOptions]; // And there are some other options at the top level in this dictionary: [options setObject:[NSNumber numberWithBool:YES] forKey:BKSOpenApplicationOptionKeyUnlockDevice]; DNBError error; BKSAddEventDataToOptions(options, event_data, error); return options; } static CallOpenApplicationFunction BKSCallOpenApplicationFunction = CallBoardSystemServiceOpenApplication< BKSSystemService, BKSOpenApplicationErrorCode, BKSOpenApplicationErrorCodeNone, SetBKSError>; #endif // WITH_BKS #ifdef WITH_FBS #import <Foundation/Foundation.h> extern "C" { #import <FrontBoardServices/FBSOpenApplicationConstants_Private.h> #import <FrontBoardServices/FBSSystemService_LaunchServices.h> #import <FrontBoardServices/FrontBoardServices.h> #import <MobileCoreServices/LSResourceProxy.h> #import <MobileCoreServices/MobileCoreServices.h> } #ifdef WITH_BKS static bool IsFBSProcess(nub_process_t pid) { BKSApplicationStateMonitor *state_monitor = [[BKSApplicationStateMonitor alloc] init]; BKSApplicationState app_state = [state_monitor mostElevatedApplicationStateForPID:pid]; return app_state != BKSApplicationStateUnknown; } #else static bool IsFBSProcess(nub_process_t pid) { // FIXME: What is the FBS equivalent of BKSApplicationStateMonitor return false; } #endif static void SetFBSError(NSInteger error_code, std::string error_description, DNBError &error) { error.SetError((DNBError::ValueType)error_code, DNBError::FrontBoard); NSString *err_nsstr = ::FBSOpenApplicationErrorCodeToString( (FBSOpenApplicationErrorCode)error_code); std::string err_str = "unknown FBS error"; if (error_description.empty() == false) { err_str = error_description; } else if (err_nsstr != nullptr) { err_str = [err_nsstr UTF8String]; } error.SetErrorString(err_str.c_str()); } static bool FBSAddEventDataToOptions(NSMutableDictionary *options, const char *event_data, DNBError &option_error) { std::vector<std::string> values; SplitEventData(event_data, values); bool found_one = false; for (std::string value : values) { if (value.compare("BackgroundContentFetching") == 0) { DNBLog("Setting ActivateForEvent key in options dictionary."); NSDictionary *event_details = [NSDictionary dictionary]; NSDictionary *event_dictionary = [NSDictionary dictionaryWithObject:event_details forKey: FBSActivateForEventOptionTypeBackgroundContentFetching]; [options setObject:event_dictionary forKey:FBSOpenApplicationOptionKeyActivateForEvent]; found_one = true; } else if (value.compare("ActivateSuspended") == 0) { DNBLog("Setting ActivateSuspended key in options dictionary."); [options setObject:@YES forKey: FBSOpenApplicationOptionKeyActivateSuspended]; found_one = true; #if WITH_CAROUSEL } else if (value.compare("WatchComplicationLaunch") == 0) { DNBLog("Setting FBSOpenApplicationOptionKeyActivateSuspended key in options dictionary."); [options setObject:@YES forKey: CSLSOpenApplicationOptionForClockKit]; found_one = true; #endif // WITH_CAROUSEL } else { DNBLogError("Unrecognized event type: %s. Ignoring.", value.c_str()); option_error.SetErrorString("Unrecognized event data."); } } return found_one; } static NSMutableDictionary * FBSCreateOptionsDictionary(const char *app_bundle_path, NSMutableArray *launch_argv, NSDictionary *launch_envp, NSString *stdio_path, bool disable_aslr, const char *event_data) { NSMutableDictionary *debug_options = [NSMutableDictionary dictionary]; if (launch_argv != nil) [debug_options setObject:launch_argv forKey:FBSDebugOptionKeyArguments]; if (launch_envp != nil) [debug_options setObject:launch_envp forKey:FBSDebugOptionKeyEnvironment]; [debug_options setObject:stdio_path forKey:FBSDebugOptionKeyStandardOutPath]; [debug_options setObject:stdio_path forKey:FBSDebugOptionKeyStandardErrorPath]; [debug_options setObject:[NSNumber numberWithBool:YES] forKey:FBSDebugOptionKeyWaitForDebugger]; if (disable_aslr) [debug_options setObject:[NSNumber numberWithBool:YES] forKey:FBSDebugOptionKeyDisableASLR]; // That will go in the overall dictionary: NSMutableDictionary *options = [NSMutableDictionary dictionary]; [options setObject:debug_options forKey:FBSOpenApplicationOptionKeyDebuggingOptions]; // And there are some other options at the top level in this dictionary: [options setObject:[NSNumber numberWithBool:YES] forKey:FBSOpenApplicationOptionKeyUnlockDevice]; // We have to get the "sequence ID & UUID" for this app bundle path and send // them to FBS: NSURL *app_bundle_url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:app_bundle_path] isDirectory:YES]; LSApplicationProxy *app_proxy = [LSApplicationProxy applicationProxyForBundleURL:app_bundle_url]; if (app_proxy) { DNBLog("Sending AppProxy info: sequence no: %lu, GUID: %s.", app_proxy.sequenceNumber, [app_proxy.cacheGUID.UUIDString UTF8String]); [options setObject:[NSNumber numberWithUnsignedInteger:app_proxy.sequenceNumber] forKey:FBSOpenApplicationOptionKeyLSSequenceNumber]; [options setObject:app_proxy.cacheGUID.UUIDString forKey:FBSOpenApplicationOptionKeyLSCacheGUID]; } DNBError error; FBSAddEventDataToOptions(options, event_data, error); return options; } static CallOpenApplicationFunction FBSCallOpenApplicationFunction = CallBoardSystemServiceOpenApplication< FBSSystemService, FBSOpenApplicationErrorCode, FBSOpenApplicationErrorCodeNone, SetFBSError>; #endif // WITH_FBS #if 0 #define DEBUG_LOG(fmt, ...) printf(fmt, ##__VA_ARGS__) #else #define DEBUG_LOG(fmt, ...) #endif #ifndef MACH_PROCESS_USE_POSIX_SPAWN #define MACH_PROCESS_USE_POSIX_SPAWN 1 #endif #ifndef _POSIX_SPAWN_DISABLE_ASLR #define _POSIX_SPAWN_DISABLE_ASLR 0x0100 #endif MachProcess::MachProcess() : m_pid(0), m_cpu_type(0), m_child_stdin(-1), m_child_stdout(-1), m_child_stderr(-1), m_path(), m_args(), m_task(this), m_flags(eMachProcessFlagsNone), m_stdio_thread(0), m_stdio_mutex(PTHREAD_MUTEX_RECURSIVE), m_stdout_data(), m_profile_enabled(false), m_profile_interval_usec(0), m_profile_thread(0), m_profile_data_mutex(PTHREAD_MUTEX_RECURSIVE), m_profile_data(), m_profile_events(0, eMachProcessProfileCancel), m_thread_actions(), m_exception_messages(), m_exception_messages_mutex(PTHREAD_MUTEX_RECURSIVE), m_thread_list(), m_activities(), m_state(eStateUnloaded), m_state_mutex(PTHREAD_MUTEX_RECURSIVE), m_events(0, kAllEventsMask), m_private_events(0, kAllEventsMask), m_breakpoints(), m_watchpoints(), m_name_to_addr_callback(NULL), m_name_to_addr_baton(NULL), m_image_infos_callback(NULL), m_image_infos_baton(NULL), m_sent_interrupt_signo(0), m_auto_resume_signo(0), m_did_exec(false), m_dyld_process_info_create(nullptr), m_dyld_process_info_for_each_image(nullptr), m_dyld_process_info_release(nullptr), m_dyld_process_info_get_cache(nullptr), m_dyld_process_info_get_state(nullptr) { m_dyld_process_info_create = (void *(*)(task_t task, uint64_t timestamp, kern_return_t * kernelError)) dlsym(RTLD_DEFAULT, "_dyld_process_info_create"); m_dyld_process_info_for_each_image = (void (*)(void *info, void (^)(uint64_t machHeaderAddress, const uuid_t uuid, const char *path))) dlsym(RTLD_DEFAULT, "_dyld_process_info_for_each_image"); m_dyld_process_info_release = (void (*)(void *info))dlsym(RTLD_DEFAULT, "_dyld_process_info_release"); m_dyld_process_info_get_cache = (void (*)(void *info, void *cacheInfo))dlsym( RTLD_DEFAULT, "_dyld_process_info_get_cache"); m_dyld_process_info_get_platform = (uint32_t (*)(void *info))dlsym( RTLD_DEFAULT, "_dyld_process_info_get_platform"); m_dyld_process_info_get_state = (void (*)(void *info, void *stateInfo))dlsym( RTLD_DEFAULT, "_dyld_process_info_get_state"); DNBLogThreadedIf(LOG_PROCESS | LOG_VERBOSE, "%s", __PRETTY_FUNCTION__); } MachProcess::~MachProcess() { DNBLogThreadedIf(LOG_PROCESS | LOG_VERBOSE, "%s", __PRETTY_FUNCTION__); Clear(); } pid_t MachProcess::SetProcessID(pid_t pid) { // Free any previous process specific data or resources Clear(); // Set the current PID appropriately if (pid == 0) m_pid = ::getpid(); else m_pid = pid; return m_pid; // Return actually PID in case a zero pid was passed in } nub_state_t MachProcess::GetState() { // If any other threads access this we will need a mutex for it PTHREAD_MUTEX_LOCKER(locker, m_state_mutex); return m_state; } const char *MachProcess::ThreadGetName(nub_thread_t tid) { return m_thread_list.GetName(tid); } nub_state_t MachProcess::ThreadGetState(nub_thread_t tid) { return m_thread_list.GetState(tid); } nub_size_t MachProcess::GetNumThreads() const { return m_thread_list.NumThreads(); } nub_thread_t MachProcess::GetThreadAtIndex(nub_size_t thread_idx) const { return m_thread_list.ThreadIDAtIndex(thread_idx); } nub_thread_t MachProcess::GetThreadIDForMachPortNumber(thread_t mach_port_number) const { return m_thread_list.GetThreadIDByMachPortNumber(mach_port_number); } nub_bool_t MachProcess::SyncThreadState(nub_thread_t tid) { MachThreadSP thread_sp(m_thread_list.GetThreadByID(tid)); if (!thread_sp) return false; kern_return_t kret = ::thread_abort_safely(thread_sp->MachPortNumber()); DNBLogThreadedIf(LOG_THREAD, "thread = 0x%8.8" PRIx32 " calling thread_abort_safely (tid) => %u " "(GetGPRState() for stop_count = %u)", thread_sp->MachPortNumber(), kret, thread_sp->Process()->StopCount()); if (kret == KERN_SUCCESS) return true; else return false; } ThreadInfo::QoS MachProcess::GetRequestedQoS(nub_thread_t tid, nub_addr_t tsd, uint64_t dti_qos_class_index) { return m_thread_list.GetRequestedQoS(tid, tsd, dti_qos_class_index); } nub_addr_t MachProcess::GetPThreadT(nub_thread_t tid) { return m_thread_list.GetPThreadT(tid); } nub_addr_t MachProcess::GetDispatchQueueT(nub_thread_t tid) { return m_thread_list.GetDispatchQueueT(tid); } nub_addr_t MachProcess::GetTSDAddressForThread( nub_thread_t tid, uint64_t plo_pthread_tsd_base_address_offset, uint64_t plo_pthread_tsd_base_offset, uint64_t plo_pthread_tsd_entry_size) { return m_thread_list.GetTSDAddressForThread( tid, plo_pthread_tsd_base_address_offset, plo_pthread_tsd_base_offset, plo_pthread_tsd_entry_size); } MachProcess::DeploymentInfo MachProcess::GetDeploymentInfo(const struct load_command &lc, uint64_t load_command_address, bool is_executable) { DeploymentInfo info; uint32_t cmd = lc.cmd & ~LC_REQ_DYLD; // Handle the older LC_VERSION load commands, which don't // distinguish between simulator and real hardware. auto handle_version_min = [&](char platform) { struct version_min_command vers_cmd; if (ReadMemory(load_command_address, sizeof(struct version_min_command), &vers_cmd) != sizeof(struct version_min_command)) return; info.platform = platform; info.major_version = vers_cmd.version >> 16; info.minor_version = (vers_cmd.version >> 8) & 0xffu; info.patch_version = vers_cmd.version & 0xffu; // Disambiguate legacy simulator platforms. #if (defined(__x86_64__) || defined(__i386__)) // If we are running on Intel macOS, it is safe to assume this is // really a back-deploying simulator binary. switch (info.platform) { case PLATFORM_IOS: info.platform = PLATFORM_IOSSIMULATOR; break; case PLATFORM_TVOS: info.platform = PLATFORM_TVOSSIMULATOR; break; case PLATFORM_WATCHOS: info.platform = PLATFORM_WATCHOSSIMULATOR; break; } #else // On an Apple Silicon macOS host, there is no ambiguity. The only // binaries that use legacy load commands are back-deploying // native iOS binaries. All simulator binaries use the newer, // unambiguous LC_BUILD_VERSION load commands. #endif }; switch (cmd) { case LC_VERSION_MIN_IPHONEOS: handle_version_min(PLATFORM_IOS); break; case LC_VERSION_MIN_MACOSX: handle_version_min(PLATFORM_MACOS); break; case LC_VERSION_MIN_TVOS: handle_version_min(PLATFORM_TVOS); break; case LC_VERSION_MIN_WATCHOS: handle_version_min(PLATFORM_WATCHOS); break; #if defined(LC_BUILD_VERSION) case LC_BUILD_VERSION: { struct build_version_command build_vers; if (ReadMemory(load_command_address, sizeof(struct build_version_command), &build_vers) != sizeof(struct build_version_command)) break; info.platform = build_vers.platform; info.major_version = build_vers.minos >> 16; info.minor_version = (build_vers.minos >> 8) & 0xffu; info.patch_version = build_vers.minos & 0xffu; break; } #endif } // The xctest binary is a pure macOS binary but is launched with // DYLD_FORCE_PLATFORM=6. In that case, force the platform to // macCatalyst and use the macCatalyst version of the host OS // instead of the macOS deployment target. if (is_executable && GetPlatform() == PLATFORM_MACCATALYST) { info.platform = PLATFORM_MACCATALYST; std::string catalyst_version = GetMacCatalystVersionString(); const char *major = catalyst_version.c_str(); char *minor = nullptr; char *patch = nullptr; info.major_version = std::strtoul(major, &minor, 10); info.minor_version = 0; info.patch_version = 0; if (minor && *minor == '.') { info.minor_version = std::strtoul(++minor, &patch, 10); if (patch && *patch == '.') info.patch_version = std::strtoul(++patch, nullptr, 10); } } return info; } std::optional<std::string> MachProcess::GetPlatformString(unsigned char platform) { switch (platform) { case PLATFORM_MACOS: return "macosx"; case PLATFORM_MACCATALYST: return "maccatalyst"; case PLATFORM_IOS: return "ios"; case PLATFORM_IOSSIMULATOR: return "iossimulator"; case PLATFORM_TVOS: return "tvos"; case PLATFORM_TVOSSIMULATOR: return "tvossimulator"; case PLATFORM_WATCHOS: return "watchos"; case PLATFORM_WATCHOSSIMULATOR: return "watchossimulator"; case PLATFORM_BRIDGEOS: return "bridgeos"; case PLATFORM_DRIVERKIT: return "driverkit"; default: DNBLogError("Unknown platform %u found for one binary", platform); return std::nullopt; } } static bool mach_header_validity_test(uint32_t magic, uint32_t cputype) { if (magic != MH_MAGIC && magic != MH_CIGAM && magic != MH_MAGIC_64 && magic != MH_CIGAM_64) return false; if (cputype != CPU_TYPE_I386 && cputype != CPU_TYPE_X86_64 && cputype != CPU_TYPE_ARM && cputype != CPU_TYPE_ARM64 && cputype != CPU_TYPE_ARM64_32) return false; return true; } // Given an address, read the mach-o header and load commands out of memory to // fill in // the mach_o_information "inf" object. // // Returns false if there was an error in reading this mach-o file header/load // commands. bool MachProcess::GetMachOInformationFromMemory( uint32_t dyld_platform, nub_addr_t mach_o_header_addr, int wordsize, struct mach_o_information &inf) { uint64_t load_cmds_p; if (wordsize == 4) { struct mach_header header; if (ReadMemory(mach_o_header_addr, sizeof(struct mach_header), &header) != sizeof(struct mach_header)) { return false; } if (!mach_header_validity_test(header.magic, header.cputype)) return false; load_cmds_p = mach_o_header_addr + sizeof(struct mach_header); inf.mach_header.magic = header.magic; inf.mach_header.cputype = header.cputype; // high byte of cpusubtype is used for "capability bits", v. // CPU_SUBTYPE_MASK, CPU_SUBTYPE_LIB64 in machine.h inf.mach_header.cpusubtype = header.cpusubtype & 0x00ffffff; inf.mach_header.filetype = header.filetype; inf.mach_header.ncmds = header.ncmds; inf.mach_header.sizeofcmds = header.sizeofcmds; inf.mach_header.flags = header.flags; } else { struct mach_header_64 header; if (ReadMemory(mach_o_header_addr, sizeof(struct mach_header_64), &header) != sizeof(struct mach_header_64)) { return false; } if (!mach_header_validity_test(header.magic, header.cputype)) return false; load_cmds_p = mach_o_header_addr + sizeof(struct mach_header_64); inf.mach_header.magic = header.magic; inf.mach_header.cputype = header.cputype; // high byte of cpusubtype is used for "capability bits", v. // CPU_SUBTYPE_MASK, CPU_SUBTYPE_LIB64 in machine.h inf.mach_header.cpusubtype = header.cpusubtype & 0x00ffffff; inf.mach_header.filetype = header.filetype; inf.mach_header.ncmds = header.ncmds; inf.mach_header.sizeofcmds = header.sizeofcmds; inf.mach_header.flags = header.flags; } for (uint32_t j = 0; j < inf.mach_header.ncmds; j++) { struct load_command lc; if (ReadMemory(load_cmds_p, sizeof(struct load_command), &lc) != sizeof(struct load_command)) { return false; } if (lc.cmd == LC_SEGMENT) { struct segment_command seg; if (ReadMemory(load_cmds_p, sizeof(struct segment_command), &seg) != sizeof(struct segment_command)) { return false; } struct mach_o_segment this_seg; char name[17]; ::memset(name, 0, sizeof(name)); memcpy(name, seg.segname, sizeof(seg.segname)); this_seg.name = name; this_seg.vmaddr = seg.vmaddr; this_seg.vmsize = seg.vmsize; this_seg.fileoff = seg.fileoff; this_seg.filesize = seg.filesize; this_seg.maxprot = seg.maxprot; this_seg.initprot = seg.initprot; this_seg.nsects = seg.nsects; this_seg.flags = seg.flags; inf.segments.push_back(this_seg); if (this_seg.name == "ExecExtraSuspend") m_task.TaskWillExecProcessesSuspended(); } if (lc.cmd == LC_SEGMENT_64) { struct segment_command_64 seg; if (ReadMemory(load_cmds_p, sizeof(struct segment_command_64), &seg) != sizeof(struct segment_command_64)) { return false; } struct mach_o_segment this_seg; char name[17]; ::memset(name, 0, sizeof(name)); memcpy(name, seg.segname, sizeof(seg.segname)); this_seg.name = name; this_seg.vmaddr = seg.vmaddr; this_seg.vmsize = seg.vmsize; this_seg.fileoff = seg.fileoff; this_seg.filesize = seg.filesize; this_seg.maxprot = seg.maxprot; this_seg.initprot = seg.initprot; this_seg.nsects = seg.nsects; this_seg.flags = seg.flags; inf.segments.push_back(this_seg); if (this_seg.name == "ExecExtraSuspend") m_task.TaskWillExecProcessesSuspended(); } if (lc.cmd == LC_UUID) { struct uuid_command uuidcmd; if (ReadMemory(load_cmds_p, sizeof(struct uuid_command), &uuidcmd) == sizeof(struct uuid_command)) uuid_copy(inf.uuid, uuidcmd.uuid); } if (DeploymentInfo deployment_info = GetDeploymentInfo( lc, load_cmds_p, inf.mach_header.filetype == MH_EXECUTE)) { std::optional<std::string> lc_platform = GetPlatformString(deployment_info.platform); if (dyld_platform != PLATFORM_MACCATALYST && inf.min_version_os_name == "macosx") { // macCatalyst support. // // This the special case of "zippered" frameworks that have both // a PLATFORM_MACOS and a PLATFORM_MACCATALYST load command. // // When we are in this block, this is a binary with both // PLATFORM_MACOS and PLATFORM_MACCATALYST load commands and // the process is not running as PLATFORM_MACCATALYST. Stick // with the "macosx" load command that we've already // processed, ignore this one, which is presumed to be a // PLATFORM_MACCATALYST one. } else { inf.min_version_os_name = lc_platform.value_or(""); inf.min_version_os_version = ""; inf.min_version_os_version += std::to_string(deployment_info.major_version); inf.min_version_os_version += "."; inf.min_version_os_version += std::to_string(deployment_info.minor_version); if (deployment_info.patch_version != 0) { inf.min_version_os_version += "."; inf.min_version_os_version += std::to_string(deployment_info.patch_version); } } } load_cmds_p += lc.cmdsize; } return true; } // Given completely filled in array of binary_image_information structures, // create a JSONGenerator object // with all the details we want to send to lldb. JSONGenerator::ObjectSP MachProcess::FormatDynamicLibrariesIntoJSON( const std::vector<struct binary_image_information> &image_infos) { JSONGenerator::ArraySP image_infos_array_sp(new JSONGenerator::Array()); const size_t image_count = image_infos.size(); for (size_t i = 0; i < image_count; i++) { if (!image_infos[i].is_valid_mach_header) continue; JSONGenerator::DictionarySP image_info_dict_sp( new JSONGenerator::Dictionary()); image_info_dict_sp->AddIntegerItem("load_address", image_infos[i].load_address); image_info_dict_sp->AddIntegerItem("mod_date", image_infos[i].mod_date); image_info_dict_sp->AddStringItem("pathname", image_infos[i].filename); uuid_string_t uuidstr; uuid_unparse_upper(image_infos[i].macho_info.uuid, uuidstr); image_info_dict_sp->AddStringItem("uuid", uuidstr); if (!image_infos[i].macho_info.min_version_os_name.empty() && !image_infos[i].macho_info.min_version_os_version.empty()) { image_info_dict_sp->AddStringItem( "min_version_os_name", image_infos[i].macho_info.min_version_os_name); image_info_dict_sp->AddStringItem( "min_version_os_sdk", image_infos[i].macho_info.min_version_os_version); } JSONGenerator::DictionarySP mach_header_dict_sp( new JSONGenerator::Dictionary()); mach_header_dict_sp->AddIntegerItem( "magic", image_infos[i].macho_info.mach_header.magic); mach_header_dict_sp->AddIntegerItem( "cputype", (uint32_t)image_infos[i].macho_info.mach_header.cputype); mach_header_dict_sp->AddIntegerItem( "cpusubtype", (uint32_t)image_infos[i].macho_info.mach_header.cpusubtype); mach_header_dict_sp->AddIntegerItem( "filetype", image_infos[i].macho_info.mach_header.filetype); mach_header_dict_sp->AddIntegerItem ("flags", image_infos[i].macho_info.mach_header.flags); // DynamicLoaderMacOSX doesn't currently need these fields, so // don't send them. // mach_header_dict_sp->AddIntegerItem ("ncmds", // image_infos[i].macho_info.mach_header.ncmds); // mach_header_dict_sp->AddIntegerItem ("sizeofcmds", // image_infos[i].macho_info.mach_header.sizeofcmds); image_info_dict_sp->AddItem("mach_header", mach_header_dict_sp); JSONGenerator::ArraySP segments_sp(new JSONGenerator::Array()); for (size_t j = 0; j < image_infos[i].macho_info.segments.size(); j++) { JSONGenerator::DictionarySP segment_sp(new JSONGenerator::Dictionary()); segment_sp->AddStringItem("name", image_infos[i].macho_info.segments[j].name); segment_sp->AddIntegerItem("vmaddr", image_infos[i].macho_info.segments[j].vmaddr); segment_sp->AddIntegerItem("vmsize", image_infos[i].macho_info.segments[j].vmsize); segment_sp->AddIntegerItem("fileoff", image_infos[i].macho_info.segments[j].fileoff); segment_sp->AddIntegerItem( "filesize", image_infos[i].macho_info.segments[j].filesize); segment_sp->AddIntegerItem("maxprot", image_infos[i].macho_info.segments[j].maxprot); // DynamicLoaderMacOSX doesn't currently need these fields, // so don't send them. // segment_sp->AddIntegerItem ("initprot", // image_infos[i].macho_info.segments[j].initprot); // segment_sp->AddIntegerItem ("nsects", // image_infos[i].macho_info.segments[j].nsects); // segment_sp->AddIntegerItem ("flags", // image_infos[i].macho_info.segments[j].flags); segments_sp->AddItem(segment_sp); } image_info_dict_sp->AddItem("segments", segments_sp); image_infos_array_sp->AddItem(image_info_dict_sp); } JSONGenerator::DictionarySP reply_sp(new JSONGenerator::Dictionary()); reply_sp->AddItem("images", image_infos_array_sp); return reply_sp; } // Get the shared library information using the old (pre-macOS 10.12, pre-iOS // 10, pre-tvOS 10, pre-watchOS 3) // code path. We'll be given the address of an array of structures in the form // {void* load_addr, void* mod_date, void* pathname} // // In macOS 10.12 etc and newer, we'll use SPI calls into dyld to gather this // information. JSONGenerator::ObjectSP MachProcess::GetLoadedDynamicLibrariesInfos( nub_process_t pid, nub_addr_t image_list_address, nub_addr_t image_count) { JSONGenerator::ObjectSP empty_reply_sp(new JSONGenerator::Dictionary()); int pointer_size = GetInferiorAddrSize(pid); std::vector<struct binary_image_information> image_infos; size_t image_infos_size = image_count * 3 * pointer_size; uint8_t *image_info_buf = (uint8_t *)malloc(image_infos_size); if (image_info_buf == NULL) { return empty_reply_sp; } if (ReadMemory(image_list_address, image_infos_size, image_info_buf) != image_infos_size) { return empty_reply_sp; } /// First the image_infos array with (load addr, pathname, mod date) /// tuples for (size_t i = 0; i < image_count; i++) { struct binary_image_information info; nub_addr_t pathname_address; if (pointer_size == 4) { uint32_t load_address_32; uint32_t pathname_address_32; uint32_t mod_date_32; ::memcpy(&load_address_32, image_info_buf + (i * 3 * pointer_size), 4); ::memcpy(&pathname_address_32, image_info_buf + (i * 3 * pointer_size) + pointer_size, 4); ::memcpy(&mod_date_32, image_info_buf + (i * 3 * pointer_size) + pointer_size + pointer_size, 4); info.load_address = load_address_32; info.mod_date = mod_date_32; pathname_address = pathname_address_32; } else { uint64_t load_address_64; uint64_t pathname_address_64; uint64_t mod_date_64; ::memcpy(&load_address_64, image_info_buf + (i * 3 * pointer_size), 8); ::memcpy(&pathname_address_64, image_info_buf + (i * 3 * pointer_size) + pointer_size, 8); ::memcpy(&mod_date_64, image_info_buf + (i * 3 * pointer_size) + pointer_size + pointer_size, 8); info.load_address = load_address_64; info.mod_date = mod_date_64; pathname_address = pathname_address_64; } char strbuf[17]; info.filename = ""; uint64_t pathname_ptr = pathname_address; bool still_reading = true; while (still_reading && ReadMemory(pathname_ptr, sizeof(strbuf) - 1, strbuf) == sizeof(strbuf) - 1) { strbuf[sizeof(strbuf) - 1] = '\0'; info.filename += strbuf; pathname_ptr += sizeof(strbuf) - 1; // Stop if we found nul byte indicating the end of the string for (size_t i = 0; i < sizeof(strbuf) - 1; i++) { if (strbuf[i] == '\0') { still_reading = false; break; } } } uuid_clear(info.macho_info.uuid); image_infos.push_back(info); } if (image_infos.size() == 0) { return empty_reply_sp; } free(image_info_buf); /// Second, read the mach header / load commands for all the dylibs for (size_t i = 0; i < image_count; i++) { // The SPI to provide platform is not available on older systems. uint32_t platform = 0; if (GetMachOInformationFromMemory(platform, image_infos[i].load_address, pointer_size, image_infos[i].macho_info)) { image_infos[i].is_valid_mach_header = true; } } /// Third, format all of the above in the JSONGenerator object. return FormatDynamicLibrariesIntoJSON(image_infos); } /// From dyld SPI header dyld_process_info.h typedef void *dyld_process_info; struct dyld_process_cache_info { /// UUID of cache used by process. uuid_t cacheUUID; /// Load address of dyld shared cache. uint64_t cacheBaseAddress; /// Process is running without a dyld cache. bool noCache; /// Process is using a private copy of its dyld cache. bool privateCache; }; uint32_t MachProcess::GetPlatform() { if (m_platform == 0) m_platform = MachProcess::GetProcessPlatformViaDYLDSPI(); return m_platform; } uint32_t MachProcess::GetProcessPlatformViaDYLDSPI() { kern_return_t kern_ret; uint32_t platform = 0; if (m_dyld_process_info_create) { dyld_process_info info = m_dyld_process_info_create(m_task.TaskPort(), 0, &kern_ret); if (info) { if (m_dyld_process_info_get_platform) platform = m_dyld_process_info_get_platform(info); m_dyld_process_info_release(info); } } return platform; } void MachProcess::GetAllLoadedBinariesViaDYLDSPI( std::vector<struct binary_image_information> &image_infos) { kern_return_t kern_ret; if (m_dyld_process_info_create) { dyld_process_info info = m_dyld_process_info_create(m_task.TaskPort(), 0, &kern_ret); if (info) { m_dyld_process_info_for_each_image( info, ^(uint64_t mach_header_addr, const uuid_t uuid, const char *path) { struct binary_image_information image; image.filename = path; uuid_copy(image.macho_info.uuid, uuid); image.load_address = mach_header_addr; image_infos.push_back(image); }); m_dyld_process_info_release(info); } } } // Fetch information about all shared libraries using the dyld SPIs that exist // in // macOS 10.12, iOS 10, tvOS 10, watchOS 3 and newer. JSONGenerator::ObjectSP MachProcess::GetAllLoadedLibrariesInfos(nub_process_t pid) { int pointer_size = GetInferiorAddrSize(pid); std::vector<struct binary_image_information> image_infos; GetAllLoadedBinariesViaDYLDSPI(image_infos); uint32_t platform = GetPlatform(); const size_t image_count = image_infos.size(); for (size_t i = 0; i < image_count; i++) { if (GetMachOInformationFromMemory(platform, image_infos[i].load_address, pointer_size, image_infos[i].macho_info)) { image_infos[i].is_valid_mach_header = true; } } return FormatDynamicLibrariesIntoJSON(image_infos); } // Fetch information about the shared libraries at the given load addresses // using the // dyld SPIs that exist in macOS 10.12, iOS 10, tvOS 10, watchOS 3 and newer. JSONGenerator::ObjectSP MachProcess::GetLibrariesInfoForAddresses( nub_process_t pid, std::vector<uint64_t> &macho_addresses) { int pointer_size = GetInferiorAddrSize(pid); // Collect the list of all binaries that dyld knows about in // the inferior process. std::vector<struct binary_image_information> all_image_infos; GetAllLoadedBinariesViaDYLDSPI(all_image_infos); uint32_t platform = GetPlatform(); std::vector<struct binary_image_information> image_infos; const size_t macho_addresses_count = macho_addresses.size(); const size_t all_image_infos_count = all_image_infos.size(); for (size_t i = 0; i < macho_addresses_count; i++) { bool found_matching_entry = false; for (size_t j = 0; j < all_image_infos_count; j++) { if (all_image_infos[j].load_address == macho_addresses[i]) { image_infos.push_back(all_image_infos[j]); found_matching_entry = true; } } if (!found_matching_entry) { // dyld doesn't think there is a binary at this address, // but maybe there isn't a binary YET - let's look in memory // for a proper mach-o header etc and return what we can. // We will have an empty filename for the binary (because dyld // doesn't know about it yet) but we can read all of the mach-o // load commands from memory directly. struct binary_image_information entry; entry.load_address = macho_addresses[i]; image_infos.push_back(entry); } } const size_t image_infos_count = image_infos.size(); for (size_t i = 0; i < image_infos_count; i++) { if (GetMachOInformationFromMemory(platform, image_infos[i].load_address, pointer_size, image_infos[i].macho_info)) { image_infos[i].is_valid_mach_header = true; } } return FormatDynamicLibrariesIntoJSON(image_infos); } // From dyld's internal podyld_process_info.h: JSONGenerator::ObjectSP MachProcess::GetSharedCacheInfo(nub_process_t pid) { JSONGenerator::DictionarySP reply_sp(new JSONGenerator::Dictionary()); kern_return_t kern_ret; if (m_dyld_process_info_create && m_dyld_process_info_get_cache) { dyld_process_info info = m_dyld_process_info_create(m_task.TaskPort(), 0, &kern_ret); if (info) { struct dyld_process_cache_info shared_cache_info; m_dyld_process_info_get_cache(info, &shared_cache_info); reply_sp->AddIntegerItem("shared_cache_base_address", shared_cache_info.cacheBaseAddress); uuid_string_t uuidstr; uuid_unparse_upper(shared_cache_info.cacheUUID, uuidstr); reply_sp->AddStringItem("shared_cache_uuid", uuidstr); reply_sp->AddBooleanItem("no_shared_cache", shared_cache_info.noCache); reply_sp->AddBooleanItem("shared_cache_private_cache", shared_cache_info.privateCache); m_dyld_process_info_release(info); } } return reply_sp; } nub_thread_t MachProcess::GetCurrentThread() { return m_thread_list.CurrentThreadID(); } nub_thread_t MachProcess::GetCurrentThreadMachPort() { return m_thread_list.GetMachPortNumberByThreadID( m_thread_list.CurrentThreadID()); } nub_thread_t MachProcess::SetCurrentThread(nub_thread_t tid) { return m_thread_list.SetCurrentThread(tid); } bool MachProcess::GetThreadStoppedReason(nub_thread_t tid, struct DNBThreadStopInfo *stop_info) { if (m_thread_list.GetThreadStoppedReason(tid, stop_info)) { if (m_did_exec) stop_info->reason = eStopTypeExec; return true; } return false; } void MachProcess::DumpThreadStoppedReason(nub_thread_t tid) const { return m_thread_list.DumpThreadStoppedReason(tid); } const char *MachProcess::GetThreadInfo(nub_thread_t tid) const { return m_thread_list.GetThreadInfo(tid); } uint32_t MachProcess::GetCPUType() { if (m_cpu_type == 0 && m_pid != 0) m_cpu_type = MachProcess::GetCPUTypeForLocalProcess(m_pid); return m_cpu_type; } const DNBRegisterSetInfo * MachProcess::GetRegisterSetInfo(nub_thread_t tid, nub_size_t *num_reg_sets) const { MachThreadSP thread_sp(m_thread_list.GetThreadByID(tid)); if (thread_sp) { DNBArchProtocol *arch = thread_sp->GetArchProtocol(); if (arch) return arch->GetRegisterSetInfo(num_reg_sets); } *num_reg_sets = 0; return NULL; } bool MachProcess::GetRegisterValue(nub_thread_t tid, uint32_t set, uint32_t reg, DNBRegisterValue *value) const { return m_thread_list.GetRegisterValue(tid, set, reg, value); } bool MachProcess::SetRegisterValue(nub_thread_t tid, uint32_t set, uint32_t reg, const DNBRegisterValue *value) const { return m_thread_list.SetRegisterValue(tid, set, reg, value); } void MachProcess::SetState(nub_state_t new_state) { // If any other threads access this we will need a mutex for it uint32_t event_mask = 0; // Scope for mutex locker { PTHREAD_MUTEX_LOCKER(locker, m_state_mutex); const nub_state_t old_state = m_state; if (old_state == eStateExited) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::SetState(%s) ignoring new " "state since current state is exited", DNBStateAsString(new_state)); } else if (old_state == new_state) { DNBLogThreadedIf( LOG_PROCESS, "MachProcess::SetState(%s) ignoring redundant state change...", DNBStateAsString(new_state)); } else { if (NUB_STATE_IS_STOPPED(new_state)) event_mask = eEventProcessStoppedStateChanged; else event_mask = eEventProcessRunningStateChanged; DNBLogThreadedIf( LOG_PROCESS, "MachProcess::SetState(%s) upating state (previous " "state was %s), event_mask = 0x%8.8x", DNBStateAsString(new_state), DNBStateAsString(old_state), event_mask); m_state = new_state; if (new_state == eStateStopped) m_stop_count++; } } if (event_mask != 0) { m_events.SetEvents(event_mask); m_private_events.SetEvents(event_mask); if (event_mask == eEventProcessStoppedStateChanged) m_private_events.ResetEvents(eEventProcessRunningStateChanged); else m_private_events.ResetEvents(eEventProcessStoppedStateChanged); // Wait for the event bit to reset if a reset ACK is requested m_events.WaitForResetAck(event_mask); } } void MachProcess::Clear(bool detaching) { // Clear any cached thread list while the pid and task are still valid m_task.Clear(); m_platform = 0; // Now clear out all member variables m_pid = INVALID_NUB_PROCESS; if (!detaching) CloseChildFileDescriptors(); m_path.clear(); m_args.clear(); SetState(eStateUnloaded); m_flags = eMachProcessFlagsNone; m_stop_count = 0; m_thread_list.Clear(); { PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex); m_exception_messages.clear(); } m_activities.Clear(); StopProfileThread(); } bool MachProcess::StartSTDIOThread() { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s ( )", __FUNCTION__); // Create the thread that watches for the child STDIO return ::pthread_create(&m_stdio_thread, NULL, MachProcess::STDIOThread, this) == 0; } void MachProcess::SetEnableAsyncProfiling(bool enable, uint64_t interval_usec, DNBProfileDataScanType scan_type) { m_profile_enabled = enable; m_profile_interval_usec = static_cast<useconds_t>(interval_usec); m_profile_scan_type = scan_type; if (m_profile_enabled && (m_profile_thread == NULL)) { StartProfileThread(); } else if (!m_profile_enabled && m_profile_thread) { StopProfileThread(); } } void MachProcess::StopProfileThread() { if (m_profile_thread == NULL) return; m_profile_events.SetEvents(eMachProcessProfileCancel); pthread_join(m_profile_thread, NULL); m_profile_thread = NULL; m_profile_events.ResetEvents(eMachProcessProfileCancel); } bool MachProcess::StartProfileThread() { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s ( )", __FUNCTION__); // Create the thread that profiles the inferior and reports back if enabled return ::pthread_create(&m_profile_thread, NULL, MachProcess::ProfileThread, this) == 0; } nub_addr_t MachProcess::LookupSymbol(const char *name, const char *shlib) { if (m_name_to_addr_callback != NULL && name && name[0]) return m_name_to_addr_callback(ProcessID(), name, shlib, m_name_to_addr_baton); return INVALID_NUB_ADDRESS; } bool MachProcess::Resume(const DNBThreadResumeActions &thread_actions) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Resume ()"); nub_state_t state = GetState(); if (CanResume(state)) { m_thread_actions = thread_actions; PrivateResume(); return true; } else if (state == eStateRunning) { DNBLog("Resume() - task 0x%x is already running, ignoring...", m_task.TaskPort()); return true; } DNBLog("Resume() - task 0x%x has state %s, can't continue...", m_task.TaskPort(), DNBStateAsString(state)); return false; } bool MachProcess::Kill(const struct timespec *timeout_abstime) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Kill ()"); nub_state_t state = DoSIGSTOP(true, false, NULL); DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Kill() DoSIGSTOP() state = %s", DNBStateAsString(state)); errno = 0; DNBLog("Sending ptrace PT_KILL to terminate inferior process pid %d.", m_pid); ::ptrace(PT_KILL, m_pid, 0, 0); DNBError err; err.SetErrorToErrno(); if (DNBLogCheckLogBit(LOG_PROCESS) || err.Fail()) { err.LogThreaded("MachProcess::Kill() DoSIGSTOP() ::ptrace " "(PT_KILL, pid=%u, 0, 0) => 0x%8.8x (%s)", m_pid, err.Status(), err.AsString()); } m_thread_actions = DNBThreadResumeActions(eStateRunning, 0); PrivateResume(); // Try and reap the process without touching our m_events since // we want the code above this to still get the eStateExited event const uint32_t reap_timeout_usec = 1000000; // Wait 1 second and try to reap the process const uint32_t reap_interval_usec = 10000; // uint32_t reap_time_elapsed; for (reap_time_elapsed = 0; reap_time_elapsed < reap_timeout_usec; reap_time_elapsed += reap_interval_usec) { if (GetState() == eStateExited) break; usleep(reap_interval_usec); } DNBLog("Waited %u ms for process to be reaped (state = %s)", reap_time_elapsed / 1000, DNBStateAsString(GetState())); return true; } bool MachProcess::Interrupt() { nub_state_t state = GetState(); if (IsRunning(state)) { if (m_sent_interrupt_signo == 0) { m_sent_interrupt_signo = SIGSTOP; if (Signal(m_sent_interrupt_signo)) { DNBLogThreadedIf( LOG_PROCESS, "MachProcess::Interrupt() - sent %i signal to interrupt process", m_sent_interrupt_signo); return true; } else { m_sent_interrupt_signo = 0; DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Interrupt() - failed to " "send %i signal to interrupt process", m_sent_interrupt_signo); } } else { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Interrupt() - previously " "sent an interrupt signal %i that hasn't " "been received yet, interrupt aborted", m_sent_interrupt_signo); } } else { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Interrupt() - process already " "stopped, no interrupt sent"); } return false; } bool MachProcess::Signal(int signal, const struct timespec *timeout_abstime) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Signal (signal = %d, timeout = %p)", signal, static_cast<const void *>(timeout_abstime)); nub_state_t state = GetState(); if (::kill(ProcessID(), signal) == 0) { // If we were running and we have a timeout, wait for the signal to stop if (IsRunning(state) && timeout_abstime) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Signal (signal = %d, timeout " "= %p) waiting for signal to stop " "process...", signal, static_cast<const void *>(timeout_abstime)); m_private_events.WaitForSetEvents(eEventProcessStoppedStateChanged, timeout_abstime); state = GetState(); DNBLogThreadedIf( LOG_PROCESS, "MachProcess::Signal (signal = %d, timeout = %p) state = %s", signal, static_cast<const void *>(timeout_abstime), DNBStateAsString(state)); return !IsRunning(state); } DNBLogThreadedIf( LOG_PROCESS, "MachProcess::Signal (signal = %d, timeout = %p) not waiting...", signal, static_cast<const void *>(timeout_abstime)); return true; } DNBError err(errno, DNBError::POSIX); err.LogThreadedIfError("kill (pid = %d, signo = %i)", ProcessID(), signal); return false; } bool MachProcess::SendEvent(const char *event, DNBError &send_err) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::SendEvent (event = %s) to pid: %d", event, m_pid); if (m_pid == INVALID_NUB_PROCESS) return false; // FIXME: Shouldn't we use the launch flavor we were started with? #if defined(WITH_FBS) || defined(WITH_BKS) return BoardServiceSendEvent(event, send_err); #endif return true; } nub_state_t MachProcess::DoSIGSTOP(bool clear_bps_and_wps, bool allow_running, uint32_t *thread_idx_ptr) { nub_state_t state = GetState(); DNBLogThreadedIf(LOG_PROCESS, "MachProcess::DoSIGSTOP() state = %s", DNBStateAsString(state)); if (!IsRunning(state)) { if (clear_bps_and_wps) { DisableAllBreakpoints(true); DisableAllWatchpoints(true); clear_bps_and_wps = false; } // If we already have a thread stopped due to a SIGSTOP, we don't have // to do anything... uint32_t thread_idx = m_thread_list.GetThreadIndexForThreadStoppedWithSignal(SIGSTOP); if (thread_idx_ptr) *thread_idx_ptr = thread_idx; if (thread_idx != UINT32_MAX) return GetState(); // No threads were stopped with a SIGSTOP, we need to run and halt the // process with a signal DNBLogThreadedIf(LOG_PROCESS, "MachProcess::DoSIGSTOP() state = %s -- resuming process", DNBStateAsString(state)); if (allow_running) m_thread_actions = DNBThreadResumeActions(eStateRunning, 0); else m_thread_actions = DNBThreadResumeActions(eStateSuspended, 0); PrivateResume(); // Reset the event that says we were indeed running m_events.ResetEvents(eEventProcessRunningStateChanged); state = GetState(); } // We need to be stopped in order to be able to detach, so we need // to send ourselves a SIGSTOP DNBLogThreadedIf(LOG_PROCESS, "MachProcess::DoSIGSTOP() state = %s -- sending SIGSTOP", DNBStateAsString(state)); struct timespec sigstop_timeout; DNBTimer::OffsetTimeOfDay(&sigstop_timeout, 2, 0); Signal(SIGSTOP, &sigstop_timeout); if (clear_bps_and_wps) { DisableAllBreakpoints(true); DisableAllWatchpoints(true); // clear_bps_and_wps = false; } uint32_t thread_idx = m_thread_list.GetThreadIndexForThreadStoppedWithSignal(SIGSTOP); if (thread_idx_ptr) *thread_idx_ptr = thread_idx; return GetState(); } bool MachProcess::Detach() { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Detach()"); uint32_t thread_idx = UINT32_MAX; nub_state_t state = DoSIGSTOP(true, true, &thread_idx); DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Detach() DoSIGSTOP() returned %s", DNBStateAsString(state)); { m_thread_actions.Clear(); m_activities.Clear(); DNBThreadResumeAction thread_action; thread_action.tid = m_thread_list.ThreadIDAtIndex(thread_idx); thread_action.state = eStateRunning; thread_action.signal = -1; thread_action.addr = INVALID_NUB_ADDRESS; m_thread_actions.Append(thread_action); m_thread_actions.SetDefaultThreadActionIfNeeded(eStateRunning, 0); PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex); ReplyToAllExceptions(); } m_task.ShutDownExcecptionThread(); // Detach from our process errno = 0; nub_process_t pid = m_pid; int ret = ::ptrace(PT_DETACH, pid, (caddr_t)1, 0); DNBError err(errno, DNBError::POSIX); if (DNBLogCheckLogBit(LOG_PROCESS) || err.Fail() || (ret != 0)) err.LogThreaded("::ptrace (PT_DETACH, %u, (caddr_t)1, 0)", pid); // Resume our task m_task.Resume(); // NULL our task out as we have already restored all exception ports m_task.Clear(); m_platform = 0; // Clear out any notion of the process we once were const bool detaching = true; Clear(detaching); SetState(eStateDetached); return true; } //your_sha256_hash------ // ReadMemory from the MachProcess level will always remove any software // breakpoints from the memory buffer before returning. If you wish to // read memory and see those traps, read from the MachTask // (m_task.ReadMemory()) as that version will give you what is actually // in inferior memory. //your_sha256_hash------ nub_size_t MachProcess::ReadMemory(nub_addr_t addr, nub_size_t size, void *buf) { // We need to remove any current software traps (enabled software // breakpoints) that we may have placed in our tasks memory. // First just read the memory as is nub_size_t bytes_read = m_task.ReadMemory(addr, size, buf); // Then place any opcodes that fall into this range back into the buffer // before we return this to callers. if (bytes_read > 0) m_breakpoints.RemoveTrapsFromBuffer(addr, bytes_read, buf); return bytes_read; } //your_sha256_hash------ // WriteMemory from the MachProcess level will always write memory around // any software breakpoints. Any software breakpoints will have their // opcodes modified if they are enabled. Any memory that doesn't overlap // with software breakpoints will be written to. If you wish to write to // inferior memory without this interference, then write to the MachTask // (m_task.WriteMemory()) as that version will always modify inferior // memory. //your_sha256_hash------ nub_size_t MachProcess::WriteMemory(nub_addr_t addr, nub_size_t size, const void *buf) { // We need to write any data that would go where any current software traps // (enabled software breakpoints) any software traps (breakpoints) that we // may have placed in our tasks memory. std::vector<DNBBreakpoint *> bps; const size_t num_bps = m_breakpoints.FindBreakpointsThatOverlapRange(addr, size, bps); if (num_bps == 0) return m_task.WriteMemory(addr, size, buf); nub_size_t bytes_written = 0; nub_addr_t intersect_addr; nub_size_t intersect_size; nub_size_t opcode_offset; const uint8_t *ubuf = (const uint8_t *)buf; for (size_t i = 0; i < num_bps; ++i) { DNBBreakpoint *bp = bps[i]; const bool intersects = bp->IntersectsRange( addr, size, &intersect_addr, &intersect_size, &opcode_offset); UNUSED_IF_ASSERT_DISABLED(intersects); assert(intersects); assert(addr <= intersect_addr && intersect_addr < addr + size); assert(addr < intersect_addr + intersect_size && intersect_addr + intersect_size <= addr + size); assert(opcode_offset + intersect_size <= bp->ByteSize()); // Check for bytes before this breakpoint const nub_addr_t curr_addr = addr + bytes_written; if (intersect_addr > curr_addr) { // There are some bytes before this breakpoint that we need to // just write to memory nub_size_t curr_size = intersect_addr - curr_addr; nub_size_t curr_bytes_written = m_task.WriteMemory(curr_addr, curr_size, ubuf + bytes_written); bytes_written += curr_bytes_written; if (curr_bytes_written != curr_size) { // We weren't able to write all of the requested bytes, we // are done looping and will return the number of bytes that // we have written so far. break; } } // Now write any bytes that would cover up any software breakpoints // directly into the breakpoint opcode buffer ::memcpy(bp->SavedOpcodeBytes() + opcode_offset, ubuf + bytes_written, intersect_size); bytes_written += intersect_size; } // Write any remaining bytes after the last breakpoint if we have any left if (bytes_written < size) bytes_written += m_task.WriteMemory( addr + bytes_written, size - bytes_written, ubuf + bytes_written); return bytes_written; } void MachProcess::ReplyToAllExceptions() { PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex); if (!m_exception_messages.empty()) { MachException::Message::iterator pos; MachException::Message::iterator begin = m_exception_messages.begin(); MachException::Message::iterator end = m_exception_messages.end(); for (pos = begin; pos != end; ++pos) { DNBLogThreadedIf(LOG_EXCEPTIONS, "Replying to exception %u...", (uint32_t)std::distance(begin, pos)); int thread_reply_signal = 0; nub_thread_t tid = m_thread_list.GetThreadIDByMachPortNumber(pos->state.thread_port); const DNBThreadResumeAction *action = NULL; if (tid != INVALID_NUB_THREAD) { action = m_thread_actions.GetActionForThread(tid, false); } if (action) { thread_reply_signal = action->signal; if (thread_reply_signal) m_thread_actions.SetSignalHandledForThread(tid); } DNBError err(pos->Reply(this, thread_reply_signal)); if (DNBLogCheckLogBit(LOG_EXCEPTIONS)) err.LogThreadedIfError("Error replying to exception"); } // Erase all exception message as we should have used and replied // to them all already. m_exception_messages.clear(); } } void MachProcess::PrivateResume() { PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex); m_auto_resume_signo = m_sent_interrupt_signo; if (m_auto_resume_signo) DNBLogThreadedIf(LOG_PROCESS, "MachProcess::PrivateResume() - task 0x%x " "resuming (with unhandled interrupt signal " "%i)...", m_task.TaskPort(), m_auto_resume_signo); else DNBLogThreadedIf(LOG_PROCESS, "MachProcess::PrivateResume() - task 0x%x resuming...", m_task.TaskPort()); ReplyToAllExceptions(); // bool stepOverBreakInstruction = step; // Let the thread prepare to resume and see if any threads want us to // step over a breakpoint instruction (ProcessWillResume will modify // the value of stepOverBreakInstruction). m_thread_list.ProcessWillResume(this, m_thread_actions); // Set our state accordingly if (m_thread_actions.NumActionsWithState(eStateStepping)) SetState(eStateStepping); else SetState(eStateRunning); // Now resume our task. m_task.Resume(); } DNBBreakpoint *MachProcess::CreateBreakpoint(nub_addr_t addr, nub_size_t length, bool hardware) { DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::CreateBreakpoint ( addr = " "0x%8.8llx, length = %llu, hardware = %i)", (uint64_t)addr, (uint64_t)length, hardware); DNBBreakpoint *bp = m_breakpoints.FindByAddress(addr); if (bp) bp->Retain(); else bp = m_breakpoints.Add(addr, length, hardware); if (EnableBreakpoint(addr)) { DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::CreateBreakpoint ( addr = " "0x%8.8llx, length = %llu) => %p", (uint64_t)addr, (uint64_t)length, static_cast<void *>(bp)); return bp; } else if (bp->Release() == 0) { m_breakpoints.Remove(addr); } // We failed to enable the breakpoint return NULL; } DNBBreakpoint *MachProcess::CreateWatchpoint(nub_addr_t addr, nub_size_t length, uint32_t watch_flags, bool hardware) { DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = " "0x%8.8llx, length = %llu, flags = " "0x%8.8x, hardware = %i)", (uint64_t)addr, (uint64_t)length, watch_flags, hardware); DNBBreakpoint *wp = m_watchpoints.FindByAddress(addr); // since the Z packets only send an address, we can only have one watchpoint // at // an address. If there is already one, we must refuse to create another // watchpoint if (wp) return NULL; wp = m_watchpoints.Add(addr, length, hardware); wp->SetIsWatchpoint(watch_flags); if (EnableWatchpoint(addr)) { DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = " "0x%8.8llx, length = %llu) => %p", (uint64_t)addr, (uint64_t)length, static_cast<void *>(wp)); return wp; } else { DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = " "0x%8.8llx, length = %llu) => FAILED", (uint64_t)addr, (uint64_t)length); m_watchpoints.Remove(addr); } // We failed to enable the watchpoint return NULL; } void MachProcess::DisableAllBreakpoints(bool remove) { DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::%s (remove = %d )", __FUNCTION__, remove); m_breakpoints.DisableAllBreakpoints(this); if (remove) m_breakpoints.RemoveDisabled(); } void MachProcess::DisableAllWatchpoints(bool remove) { DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::%s (remove = %d )", __FUNCTION__, remove); m_watchpoints.DisableAllWatchpoints(this); if (remove) m_watchpoints.RemoveDisabled(); } bool MachProcess::DisableBreakpoint(nub_addr_t addr, bool remove) { DNBBreakpoint *bp = m_breakpoints.FindByAddress(addr); if (bp) { // After "exec" we might end up with a bunch of breakpoints that were // disabled // manually, just ignore them if (!bp->IsEnabled()) { // Breakpoint might have been disabled by an exec if (remove && bp->Release() == 0) { m_thread_list.NotifyBreakpointChanged(bp); m_breakpoints.Remove(addr); } return true; } // We have multiple references to this breakpoint, decrement the ref count // and if it isn't zero, then return true; if (remove && bp->Release() > 0) return true; DNBLogThreadedIf( LOG_BREAKPOINTS | LOG_VERBOSE, "MachProcess::DisableBreakpoint ( addr = 0x%8.8llx, remove = %d )", (uint64_t)addr, remove); if (bp->IsHardware()) { bool hw_disable_result = m_thread_list.DisableHardwareBreakpoint(bp); if (hw_disable_result) { bp->SetEnabled(false); // Let the thread list know that a breakpoint has been modified if (remove) { m_thread_list.NotifyBreakpointChanged(bp); m_breakpoints.Remove(addr); } DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::DisableBreakpoint ( " "addr = 0x%8.8llx, remove = %d ) " "(hardware) => success", (uint64_t)addr, remove); return true; } return false; } const nub_size_t break_op_size = bp->ByteSize(); assert(break_op_size > 0); const uint8_t *const break_op = DNBArchProtocol::GetBreakpointOpcode(bp->ByteSize()); if (break_op_size > 0) { // Clear a software breakpoint instruction uint8_t curr_break_op[break_op_size]; bool break_op_found = false; // Read the breakpoint opcode if (m_task.ReadMemory(addr, break_op_size, curr_break_op) == break_op_size) { bool verify = false; if (bp->IsEnabled()) { // Make sure a breakpoint opcode exists at this address if (memcmp(curr_break_op, break_op, break_op_size) == 0) { break_op_found = true; // We found a valid breakpoint opcode at this address, now restore // the saved opcode. if (m_task.WriteMemory(addr, break_op_size, bp->SavedOpcodeBytes()) == break_op_size) { verify = true; } else { DNBLogError("MachProcess::DisableBreakpoint ( addr = 0x%8.8llx, " "remove = %d ) memory write failed when restoring " "original opcode", (uint64_t)addr, remove); } } else { DNBLogWarning("MachProcess::DisableBreakpoint ( addr = 0x%8.8llx, " "remove = %d ) expected a breakpoint opcode but " "didn't find one.", (uint64_t)addr, remove); // Set verify to true and so we can check if the original opcode has // already been restored verify = true; } } else { DNBLogThreadedIf(LOG_BREAKPOINTS | LOG_VERBOSE, "MachProcess::DisableBreakpoint ( addr = 0x%8.8llx, " "remove = %d ) is not enabled", (uint64_t)addr, remove); // Set verify to true and so we can check if the original opcode is // there verify = true; } if (verify) { uint8_t verify_opcode[break_op_size]; // Verify that our original opcode made it back to the inferior if (m_task.ReadMemory(addr, break_op_size, verify_opcode) == break_op_size) { // compare the memory we just read with the original opcode if (memcmp(bp->SavedOpcodeBytes(), verify_opcode, break_op_size) == 0) { // SUCCESS bp->SetEnabled(false); // Let the thread list know that a breakpoint has been modified if (remove && bp->Release() == 0) { m_thread_list.NotifyBreakpointChanged(bp); m_breakpoints.Remove(addr); } DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::DisableBreakpoint ( addr = " "0x%8.8llx, remove = %d ) => success", (uint64_t)addr, remove); return true; } else { if (break_op_found) DNBLogError("MachProcess::DisableBreakpoint ( addr = " "0x%8.8llx, remove = %d ) : failed to restore " "original opcode", (uint64_t)addr, remove); else DNBLogError("MachProcess::DisableBreakpoint ( addr = " "0x%8.8llx, remove = %d ) : opcode changed", (uint64_t)addr, remove); } } else { DNBLogWarning("MachProcess::DisableBreakpoint: unable to disable " "breakpoint 0x%8.8llx", (uint64_t)addr); } } } else { DNBLogWarning("MachProcess::DisableBreakpoint: unable to read memory " "at 0x%8.8llx", (uint64_t)addr); } } } else { DNBLogError("MachProcess::DisableBreakpoint ( addr = 0x%8.8llx, remove = " "%d ) invalid breakpoint address", (uint64_t)addr, remove); } return false; } bool MachProcess::DisableWatchpoint(nub_addr_t addr, bool remove) { DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::%s(addr = 0x%8.8llx, remove = %d)", __FUNCTION__, (uint64_t)addr, remove); DNBBreakpoint *wp = m_watchpoints.FindByAddress(addr); if (wp) { // If we have multiple references to a watchpoint, removing the watchpoint // shouldn't clear it if (remove && wp->Release() > 0) return true; nub_addr_t addr = wp->Address(); DNBLogThreadedIf( LOG_WATCHPOINTS, "MachProcess::DisableWatchpoint ( addr = 0x%8.8llx, remove = %d )", (uint64_t)addr, remove); if (wp->IsHardware()) { bool hw_disable_result = m_thread_list.DisableHardwareWatchpoint(wp); if (hw_disable_result) { wp->SetEnabled(false); if (remove) m_watchpoints.Remove(addr); DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::Disablewatchpoint ( " "addr = 0x%8.8llx, remove = %d ) " "(hardware) => success", (uint64_t)addr, remove); return true; } } // TODO: clear software watchpoints if we implement them } else { DNBLogError("MachProcess::DisableWatchpoint ( addr = 0x%8.8llx, remove = " "%d ) invalid watchpoint ID", (uint64_t)addr, remove); } return false; } uint32_t MachProcess::GetNumSupportedHardwareWatchpoints() const { return m_thread_list.NumSupportedHardwareWatchpoints(); } bool MachProcess::EnableBreakpoint(nub_addr_t addr) { DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::EnableBreakpoint ( addr = 0x%8.8llx )", (uint64_t)addr); DNBBreakpoint *bp = m_breakpoints.FindByAddress(addr); if (bp) { if (bp->IsEnabled()) { DNBLogWarning("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx ): " "breakpoint already enabled.", (uint64_t)addr); return true; } else { if (bp->HardwarePreferred()) { bp->SetHardwareIndex(m_thread_list.EnableHardwareBreakpoint(bp)); if (bp->IsHardware()) { bp->SetEnabled(true); return true; } } const nub_size_t break_op_size = bp->ByteSize(); assert(break_op_size != 0); const uint8_t *const break_op = DNBArchProtocol::GetBreakpointOpcode(break_op_size); if (break_op_size > 0) { // Save the original opcode by reading it if (m_task.ReadMemory(addr, break_op_size, bp->SavedOpcodeBytes()) == break_op_size) { // Write a software breakpoint in place of the original opcode if (m_task.WriteMemory(addr, break_op_size, break_op) == break_op_size) { uint8_t verify_break_op[4]; if (m_task.ReadMemory(addr, break_op_size, verify_break_op) == break_op_size) { if (memcmp(break_op, verify_break_op, break_op_size) == 0) { bp->SetEnabled(true); // Let the thread list know that a breakpoint has been modified m_thread_list.NotifyBreakpointChanged(bp); DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::" "EnableBreakpoint ( addr = " "0x%8.8llx ) : SUCCESS.", (uint64_t)addr); return true; } else { DNBLogError("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx " "): breakpoint opcode verification failed.", (uint64_t)addr); } } else { DNBLogError("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx ): " "unable to read memory to verify breakpoint opcode.", (uint64_t)addr); } } else { DNBLogError("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx ): " "unable to write breakpoint opcode to memory.", (uint64_t)addr); } } else { DNBLogError("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx ): " "unable to read memory at breakpoint address.", (uint64_t)addr); } } else { DNBLogError("MachProcess::EnableBreakpoint ( addr = 0x%8.8llx ) no " "software breakpoint opcode for current architecture.", (uint64_t)addr); } } } return false; } bool MachProcess::EnableWatchpoint(nub_addr_t addr) { DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::EnableWatchpoint(addr = 0x%8.8llx)", (uint64_t)addr); DNBBreakpoint *wp = m_watchpoints.FindByAddress(addr); if (wp) { nub_addr_t addr = wp->Address(); if (wp->IsEnabled()) { DNBLogWarning("MachProcess::EnableWatchpoint(addr = 0x%8.8llx): " "watchpoint already enabled.", (uint64_t)addr); return true; } else { // Currently only try and set hardware watchpoints. wp->SetHardwareIndex(m_thread_list.EnableHardwareWatchpoint(wp)); if (wp->IsHardware()) { wp->SetEnabled(true); return true; } // TODO: Add software watchpoints by doing page protection tricks. } } return false; } // Called by the exception thread when an exception has been received from // our process. The exception message is completely filled and the exception // data has already been copied. void MachProcess::ExceptionMessageReceived( const MachException::Message &exceptionMessage) { PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex); if (m_exception_messages.empty()) m_task.Suspend(); DNBLogThreadedIf(LOG_EXCEPTIONS, "MachProcess::ExceptionMessageReceived ( )"); // Use a locker to automatically unlock our mutex in case of exceptions // Add the exception to our internal exception stack m_exception_messages.push_back(exceptionMessage); } task_t MachProcess::ExceptionMessageBundleComplete() { // We have a complete bundle of exceptions for our child process. PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex); DNBLogThreadedIf(LOG_EXCEPTIONS, "%s: %llu exception messages.", __PRETTY_FUNCTION__, (uint64_t)m_exception_messages.size()); bool auto_resume = false; if (!m_exception_messages.empty()) { m_did_exec = false; // First check for any SIGTRAP and make sure we didn't exec const task_t task = m_task.TaskPort(); size_t i; if (m_pid != 0) { bool received_interrupt = false; uint32_t num_task_exceptions = 0; for (i = 0; i < m_exception_messages.size(); ++i) { if (m_exception_messages[i].state.task_port == task) { ++num_task_exceptions; const int signo = m_exception_messages[i].state.SoftSignal(); if (signo == SIGTRAP) { // SIGTRAP could mean that we exec'ed. We need to check the // dyld all_image_infos.infoArray to see if it is NULL and if // so, say that we exec'ed. const nub_addr_t aii_addr = GetDYLDAllImageInfosAddress(); if (aii_addr != INVALID_NUB_ADDRESS) { const nub_addr_t info_array_count_addr = aii_addr + 4; uint32_t info_array_count = 0; if (m_task.ReadMemory(info_array_count_addr, 4, &info_array_count) == 4) { if (info_array_count == 0) { m_did_exec = true; // Force the task port to update itself in case the task port // changed after exec DNBError err; const task_t old_task = m_task.TaskPort(); const task_t new_task = m_task.TaskPortForProcessID(err, true); if (old_task != new_task) DNBLogThreadedIf( LOG_PROCESS, "exec: task changed from 0x%4.4x to 0x%4.4x", old_task, new_task); } } else { DNBLog("error: failed to read all_image_infos.infoArrayCount " "from 0x%8.8llx", (uint64_t)info_array_count_addr); } } break; } else if (m_sent_interrupt_signo != 0 && signo == m_sent_interrupt_signo) { received_interrupt = true; } } } if (m_did_exec) { cpu_type_t process_cpu_type = MachProcess::GetCPUTypeForLocalProcess(m_pid); if (m_cpu_type != process_cpu_type) { DNBLog("arch changed from 0x%8.8x to 0x%8.8x", m_cpu_type, process_cpu_type); m_cpu_type = process_cpu_type; DNBArchProtocol::SetArchitecture(process_cpu_type); } m_thread_list.Clear(); m_activities.Clear(); m_breakpoints.DisableAll(); m_task.ClearAllocations(); } if (m_sent_interrupt_signo != 0) { if (received_interrupt) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::ExceptionMessageBundleComplete(): " "process successfully interrupted with signal %i", m_sent_interrupt_signo); // Mark that we received the interrupt signal m_sent_interrupt_signo = 0; // Not check if we had a case where: // 1 - We called MachProcess::Interrupt() but we stopped for another // reason // 2 - We called MachProcess::Resume() (but still haven't gotten the // interrupt signal) // 3 - We are now incorrectly stopped because we are handling the // interrupt signal we missed // 4 - We might need to resume if we stopped only with the interrupt // signal that we never handled if (m_auto_resume_signo != 0) { // Only auto_resume if we stopped with _only_ the interrupt signal if (num_task_exceptions == 1) { auto_resume = true; DNBLogThreadedIf(LOG_PROCESS, "MachProcess::" "ExceptionMessageBundleComplete(): " "auto resuming due to unhandled " "interrupt signal %i", m_auto_resume_signo); } m_auto_resume_signo = 0; } } else { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::" "ExceptionMessageBundleComplete(): " "didn't get signal %i after " "MachProcess::Interrupt()", m_sent_interrupt_signo); } } } // Let all threads recover from stopping and do any clean up based // on the previous thread state (if any). m_thread_list.ProcessDidStop(this); m_activities.Clear(); // Let each thread know of any exceptions for (i = 0; i < m_exception_messages.size(); ++i) { // Let the thread list figure use the MachProcess to forward all // exceptions // on down to each thread. if (m_exception_messages[i].state.task_port == task) m_thread_list.NotifyException(m_exception_messages[i].state); if (DNBLogCheckLogBit(LOG_EXCEPTIONS)) m_exception_messages[i].Dump(); } if (DNBLogCheckLogBit(LOG_THREAD)) m_thread_list.Dump(); bool step_more = false; if (m_thread_list.ShouldStop(step_more) && !auto_resume) { // Wait for the eEventProcessRunningStateChanged event to be reset // before changing state to stopped to avoid race condition with // very fast start/stops struct timespec timeout; // DNBTimer::OffsetTimeOfDay(&timeout, 0, 250 * 1000); // Wait for 250 // ms DNBTimer::OffsetTimeOfDay(&timeout, 1, 0); // Wait for 250 ms m_events.WaitForEventsToReset(eEventProcessRunningStateChanged, &timeout); SetState(eStateStopped); } else { // Resume without checking our current state. PrivateResume(); } } else { DNBLogThreadedIf( LOG_EXCEPTIONS, "%s empty exception messages bundle (%llu exceptions).", __PRETTY_FUNCTION__, (uint64_t)m_exception_messages.size()); } return m_task.TaskPort(); } nub_size_t MachProcess::CopyImageInfos(struct DNBExecutableImageInfo **image_infos, bool only_changed) { if (m_image_infos_callback != NULL) return m_image_infos_callback(ProcessID(), image_infos, only_changed, m_image_infos_baton); return 0; } void MachProcess::SharedLibrariesUpdated() { uint32_t event_bits = eEventSharedLibsStateChange; // Set the shared library event bit to let clients know of shared library // changes m_events.SetEvents(event_bits); // Wait for the event bit to reset if a reset ACK is requested m_events.WaitForResetAck(event_bits); } void MachProcess::SetExitInfo(const char *info) { if (info && info[0]) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s(\"%s\")", __FUNCTION__, info); m_exit_info.assign(info); } else { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s(NULL)", __FUNCTION__); m_exit_info.clear(); } } void MachProcess::AppendSTDOUT(char *s, size_t len) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (<%llu> %s) ...", __FUNCTION__, (uint64_t)len, s); PTHREAD_MUTEX_LOCKER(locker, m_stdio_mutex); m_stdout_data.append(s, len); m_events.SetEvents(eEventStdioAvailable); // Wait for the event bit to reset if a reset ACK is requested m_events.WaitForResetAck(eEventStdioAvailable); } size_t MachProcess::GetAvailableSTDOUT(char *buf, size_t buf_size) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (&%p[%llu]) ...", __FUNCTION__, static_cast<void *>(buf), (uint64_t)buf_size); PTHREAD_MUTEX_LOCKER(locker, m_stdio_mutex); size_t bytes_available = m_stdout_data.size(); if (bytes_available > 0) { if (bytes_available > buf_size) { memcpy(buf, m_stdout_data.data(), buf_size); m_stdout_data.erase(0, buf_size); bytes_available = buf_size; } else { memcpy(buf, m_stdout_data.data(), bytes_available); m_stdout_data.clear(); } } return bytes_available; } nub_addr_t MachProcess::GetDYLDAllImageInfosAddress() { DNBError err; return m_task.GetDYLDAllImageInfosAddress(err); } /// From dyld SPI header dyld_process_info.h struct dyld_process_state_info { uint64_t timestamp; uint32_t imageCount; uint32_t initialImageCount; // one of dyld_process_state_* values uint8_t dyldState; }; enum { dyld_process_state_not_started = 0x00, dyld_process_state_dyld_initialized = 0x10, dyld_process_state_terminated_before_inits = 0x20, dyld_process_state_libSystem_initialized = 0x30, dyld_process_state_running_initializers = 0x40, dyld_process_state_program_running = 0x50, dyld_process_state_dyld_terminated = 0x60 }; JSONGenerator::ObjectSP MachProcess::GetDyldProcessState() { JSONGenerator::DictionarySP reply_sp(new JSONGenerator::Dictionary()); if (!m_dyld_process_info_get_state) { reply_sp->AddStringItem("error", "_dyld_process_info_get_state unavailable"); return reply_sp; } if (!m_dyld_process_info_create) { reply_sp->AddStringItem("error", "_dyld_process_info_create unavailable"); return reply_sp; } kern_return_t kern_ret; dyld_process_info info = m_dyld_process_info_create(m_task.TaskPort(), 0, &kern_ret); if (!info || kern_ret != KERN_SUCCESS) { reply_sp->AddStringItem( "error", "Unable to create dyld_process_info for inferior task"); return reply_sp; } struct dyld_process_state_info state_info; m_dyld_process_info_get_state(info, &state_info); reply_sp->AddIntegerItem("process_state_value", state_info.dyldState); switch (state_info.dyldState) { case dyld_process_state_not_started: reply_sp->AddStringItem("process_state string", "dyld_process_state_not_started"); break; case dyld_process_state_dyld_initialized: reply_sp->AddStringItem("process_state string", "dyld_process_state_dyld_initialized"); break; case dyld_process_state_terminated_before_inits: reply_sp->AddStringItem("process_state string", "dyld_process_state_terminated_before_inits"); break; case dyld_process_state_libSystem_initialized: reply_sp->AddStringItem("process_state string", "dyld_process_state_libSystem_initialized"); break; case dyld_process_state_running_initializers: reply_sp->AddStringItem("process_state string", "dyld_process_state_running_initializers"); break; case dyld_process_state_program_running: reply_sp->AddStringItem("process_state string", "dyld_process_state_program_running"); break; case dyld_process_state_dyld_terminated: reply_sp->AddStringItem("process_state string", "dyld_process_state_dyld_terminated"); break; }; m_dyld_process_info_release(info); return reply_sp; } size_t MachProcess::GetAvailableSTDERR(char *buf, size_t buf_size) { return 0; } void *MachProcess::STDIOThread(void *arg) { MachProcess *proc = (MachProcess *)arg; DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s ( arg = %p ) thread starting...", __FUNCTION__, arg); #if defined(__APPLE__) pthread_setname_np("stdio monitoring thread"); #endif // We start use a base and more options so we can control if we // are currently using a timeout on the mach_msg. We do this to get a // bunch of related exceptions on our exception port so we can process // then together. When we have multiple threads, we can get an exception // per thread and they will come in consecutively. The main thread loop // will start by calling mach_msg to without having the MACH_RCV_TIMEOUT // flag set in the options, so we will wait forever for an exception on // our exception port. After we get one exception, we then will use the // MACH_RCV_TIMEOUT option with a zero timeout to grab all other current // exceptions for our process. After we have received the last pending // exception, we will get a timeout which enables us to then notify // our main thread that we have an exception bundle available. We then wait // for the main thread to tell this exception thread to start trying to get // exceptions messages again and we start again with a mach_msg read with // infinite timeout. DNBError err; int stdout_fd = proc->GetStdoutFileDescriptor(); int stderr_fd = proc->GetStderrFileDescriptor(); if (stdout_fd == stderr_fd) stderr_fd = -1; while (stdout_fd >= 0 || stderr_fd >= 0) { ::pthread_testcancel(); fd_set read_fds; FD_ZERO(&read_fds); if (stdout_fd >= 0) FD_SET(stdout_fd, &read_fds); if (stderr_fd >= 0) FD_SET(stderr_fd, &read_fds); int nfds = std::max<int>(stdout_fd, stderr_fd) + 1; int num_set_fds = select(nfds, &read_fds, NULL, NULL, NULL); DNBLogThreadedIf(LOG_PROCESS, "select (nfds, &read_fds, NULL, NULL, NULL) => %d", num_set_fds); if (num_set_fds < 0) { int select_errno = errno; if (DNBLogCheckLogBit(LOG_PROCESS)) { err.SetError(select_errno, DNBError::POSIX); err.LogThreadedIfError( "select (nfds, &read_fds, NULL, NULL, NULL) => %d", num_set_fds); } switch (select_errno) { case EAGAIN: // The kernel was (perhaps temporarily) unable to allocate // the requested number of file descriptors, or we have // non-blocking IO break; case EBADF: // One of the descriptor sets specified an invalid descriptor. return NULL; break; case EINTR: // A signal was delivered before the time limit expired and // before any of the selected events occurred. case EINVAL: // The specified time limit is invalid. One of its components // is negative or too large. default: // Other unknown error break; } } else if (num_set_fds == 0) { } else { char s[1024]; s[sizeof(s) - 1] = '\0'; // Ensure we have NULL termination ssize_t bytes_read = 0; if (stdout_fd >= 0 && FD_ISSET(stdout_fd, &read_fds)) { do { bytes_read = ::read(stdout_fd, s, sizeof(s) - 1); if (bytes_read < 0) { int read_errno = errno; DNBLogThreadedIf(LOG_PROCESS, "read (stdout_fd, ) => %zd errno: %d (%s)", bytes_read, read_errno, strerror(read_errno)); } else if (bytes_read == 0) { // EOF... DNBLogThreadedIf( LOG_PROCESS, "read (stdout_fd, ) => %zd (reached EOF for child STDOUT)", bytes_read); stdout_fd = -1; } else if (bytes_read > 0) { proc->AppendSTDOUT(s, bytes_read); } } while (bytes_read > 0); } if (stderr_fd >= 0 && FD_ISSET(stderr_fd, &read_fds)) { do { bytes_read = ::read(stderr_fd, s, sizeof(s) - 1); if (bytes_read < 0) { int read_errno = errno; DNBLogThreadedIf(LOG_PROCESS, "read (stderr_fd, ) => %zd errno: %d (%s)", bytes_read, read_errno, strerror(read_errno)); } else if (bytes_read == 0) { // EOF... DNBLogThreadedIf( LOG_PROCESS, "read (stderr_fd, ) => %zd (reached EOF for child STDERR)", bytes_read); stderr_fd = -1; } else if (bytes_read > 0) { proc->AppendSTDOUT(s, bytes_read); } } while (bytes_read > 0); } } } DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (%p): thread exiting...", __FUNCTION__, arg); return NULL; } void MachProcess::SignalAsyncProfileData(const char *info) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (%s) ...", __FUNCTION__, info); PTHREAD_MUTEX_LOCKER(locker, m_profile_data_mutex); m_profile_data.push_back(info); m_events.SetEvents(eEventProfileDataAvailable); // Wait for the event bit to reset if a reset ACK is requested m_events.WaitForResetAck(eEventProfileDataAvailable); } size_t MachProcess::GetAsyncProfileData(char *buf, size_t buf_size) { DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (&%p[%llu]) ...", __FUNCTION__, static_cast<void *>(buf), (uint64_t)buf_size); PTHREAD_MUTEX_LOCKER(locker, m_profile_data_mutex); if (m_profile_data.empty()) return 0; size_t bytes_available = m_profile_data.front().size(); if (bytes_available > 0) { if (bytes_available > buf_size) { memcpy(buf, m_profile_data.front().data(), buf_size); m_profile_data.front().erase(0, buf_size); bytes_available = buf_size; } else { memcpy(buf, m_profile_data.front().data(), bytes_available); m_profile_data.erase(m_profile_data.begin()); } } return bytes_available; } void *MachProcess::ProfileThread(void *arg) { MachProcess *proc = (MachProcess *)arg; DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s ( arg = %p ) thread starting...", __FUNCTION__, arg); #if defined(__APPLE__) pthread_setname_np("performance profiling thread"); #endif while (proc->IsProfilingEnabled()) { nub_state_t state = proc->GetState(); if (state == eStateRunning) { std::string data = proc->Task().GetProfileData(proc->GetProfileScanType()); if (!data.empty()) { proc->SignalAsyncProfileData(data.c_str()); } } else if ((state == eStateUnloaded) || (state == eStateDetached) || (state == eStateUnloaded)) { // Done. Get out of this thread. break; } timespec ts; { using namespace std::chrono; std::chrono::microseconds dur(proc->ProfileInterval()); const auto dur_secs = duration_cast<seconds>(dur); const auto dur_usecs = dur % std::chrono::seconds(1); DNBTimer::OffsetTimeOfDay(&ts, dur_secs.count(), dur_usecs.count()); } uint32_t bits_set = proc->m_profile_events.WaitForSetEvents(eMachProcessProfileCancel, &ts); // If we got bits back, we were told to exit. Do so. if (bits_set & eMachProcessProfileCancel) break; } return NULL; } pid_t MachProcess::AttachForDebug( pid_t pid, const RNBContext::IgnoredExceptions &ignored_exceptions, char *err_str, size_t err_len) { // Clear out and clean up from any current state Clear(); if (pid != 0) { DNBError err; // Make sure the process exists... if (::getpgid(pid) < 0) { err.SetErrorToErrno(); const char *err_cstr = err.AsString(); ::snprintf(err_str, err_len, "%s", err_cstr ? err_cstr : "No such process"); DNBLogError ("MachProcess::AttachForDebug pid %d does not exist", pid); return INVALID_NUB_PROCESS; } SetState(eStateAttaching); m_pid = pid; if (!m_task.StartExceptionThread(ignored_exceptions, err)) { const char *err_cstr = err.AsString(); ::snprintf(err_str, err_len, "%s", err_cstr ? err_cstr : "unable to start the exception thread"); DNBLogThreadedIf(LOG_PROCESS, "error: failed to attach to pid %d", pid); DNBLogError( "[LaunchAttach] END (%d) MachProcess::AttachForDebug failed to start " "exception thread attaching to pid %i: %s", getpid(), pid, err_str); m_pid = INVALID_NUB_PROCESS; return INVALID_NUB_PROCESS; } DNBLog("[LaunchAttach] (%d) About to ptrace(PT_ATTACHEXC, %d)...", getpid(), pid); errno = 0; int ptrace_result = ::ptrace(PT_ATTACHEXC, pid, 0, 0); int ptrace_errno = errno; DNBLog("[LaunchAttach] (%d) Completed ptrace(PT_ATTACHEXC, %d) == %d", getpid(), pid, ptrace_result); if (ptrace_result != 0) { err.SetError(ptrace_errno); DNBLogError("MachProcess::AttachForDebug failed to ptrace(PT_ATTACHEXC) " "pid %i: %s", pid, err.AsString()); } else { err.Clear(); } if (err.Success()) { m_flags |= eMachProcessFlagsAttached; // Sleep a bit to let the exception get received and set our process // status // to stopped. ::usleep(250000); DNBLog("[LaunchAttach] (%d) Done napping after ptrace(PT_ATTACHEXC)'ing", getpid()); DNBLogThreadedIf(LOG_PROCESS, "successfully attached to pid %d", pid); return m_pid; } else { ::snprintf(err_str, err_len, "%s", err.AsString()); DNBLogError( "[LaunchAttach] (%d) MachProcess::AttachForDebug error: failed to " "attach to pid %d", getpid(), pid); struct kinfo_proc kinfo; int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}; size_t len = sizeof(struct kinfo_proc); if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), &kinfo, &len, NULL, 0) == 0 && len > 0) { if (kinfo.kp_proc.p_flag & P_TRACED) { ::snprintf(err_str, err_len, "%s - process %d is already being debugged", err.AsString(), pid); DNBLogError( "[LaunchAttach] (%d) MachProcess::AttachForDebug pid %d is " "already being debugged", getpid(), pid); } } } } return INVALID_NUB_PROCESS; } Genealogy::ThreadActivitySP MachProcess::GetGenealogyInfoForThread(nub_thread_t tid, bool &timed_out) { return m_activities.GetGenealogyInfoForThread(m_pid, tid, m_thread_list, m_task.TaskPort(), timed_out); } Genealogy::ProcessExecutableInfoSP MachProcess::GetGenealogyImageInfo(size_t idx) { return m_activities.GetProcessExecutableInfosAtIndex(idx); } bool MachProcess::GetOSVersionNumbers(uint64_t *major, uint64_t *minor, uint64_t *patch) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSOperatingSystemVersion vers = [[NSProcessInfo processInfo] operatingSystemVersion]; if (major) *major = vers.majorVersion; if (minor) *minor = vers.minorVersion; if (patch) *patch = vers.patchVersion; [pool drain]; return true; } std::string MachProcess::GetMacCatalystVersionString() { @autoreleasepool { NSDictionary *version_info = [NSDictionary dictionaryWithContentsOfFile: @"/System/Library/CoreServices/SystemVersion.plist"]; NSString *version_value = [version_info objectForKey: @"iOSSupportVersion"]; if (const char *version_str = [version_value UTF8String]) return version_str; } return {}; } #if defined(WITH_SPRINGBOARD) || defined(WITH_BKS) || defined(WITH_FBS) /// Get the app bundle from the given path. Returns the empty string if the /// path doesn't appear to be an app bundle. static std::string GetAppBundle(std::string path) { auto pos = path.rfind(".app"); // Path doesn't contain `.app`. if (pos == std::string::npos) return {}; // Path has `.app` extension. if (pos == path.size() - 4) return path.substr(0, pos + 4); // Look for `.app` before a path separator. do { if (path[pos + 4] == '/') return path.substr(0, pos + 4); path = path.substr(0, pos); pos = path.rfind(".app"); } while (pos != std::string::npos); return {}; } #endif // Do the process specific setup for attach. If this returns NULL, then there's // no // platform specific stuff to be done to wait for the attach. If you get // non-null, // pass that token to the CheckForProcess method, and then to // CleanupAfterAttach. // Call PrepareForAttach before attaching to a process that has not yet // launched // This returns a token that can be passed to CheckForProcess, and to // CleanupAfterAttach. // You should call CleanupAfterAttach to free the token, and do whatever other // cleanup seems good. const void *MachProcess::PrepareForAttach(const char *path, nub_launch_flavor_t launch_flavor, bool waitfor, DNBError &attach_err) { #if defined(WITH_SPRINGBOARD) || defined(WITH_BKS) || defined(WITH_FBS) // Tell SpringBoard to halt the next launch of this application on startup. if (!waitfor) return NULL; std::string app_bundle_path = GetAppBundle(path); if (app_bundle_path.empty()) { DNBLogThreadedIf( LOG_PROCESS, "MachProcess::PrepareForAttach(): path '%s' doesn't contain .app, " "we can't tell springboard to wait for launch...", path); return NULL; } #if defined(WITH_FBS) if (launch_flavor == eLaunchFlavorDefault) launch_flavor = eLaunchFlavorFBS; if (launch_flavor != eLaunchFlavorFBS) return NULL; #elif defined(WITH_BKS) if (launch_flavor == eLaunchFlavorDefault) launch_flavor = eLaunchFlavorBKS; if (launch_flavor != eLaunchFlavorBKS) return NULL; #elif defined(WITH_SPRINGBOARD) if (launch_flavor == eLaunchFlavorDefault) launch_flavor = eLaunchFlavorSpringBoard; if (launch_flavor != eLaunchFlavorSpringBoard) return NULL; #endif CFStringRef bundleIDCFStr = CopyBundleIDForPath(app_bundle_path.c_str(), attach_err); std::string bundleIDStr; CFString::UTF8(bundleIDCFStr, bundleIDStr); DNBLogThreadedIf(LOG_PROCESS, "CopyBundleIDForPath (%s, err_str) returned @\"%s\"", app_bundle_path.c_str(), bundleIDStr.c_str()); if (bundleIDCFStr == NULL) { return NULL; } #if defined(WITH_FBS) if (launch_flavor == eLaunchFlavorFBS) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *stdio_path = nil; NSFileManager *file_manager = [NSFileManager defaultManager]; const char *null_path = "/dev/null"; stdio_path = [file_manager stringWithFileSystemRepresentation:null_path length:strlen(null_path)]; NSMutableDictionary *debug_options = [NSMutableDictionary dictionary]; NSMutableDictionary *options = [NSMutableDictionary dictionary]; DNBLogThreadedIf(LOG_PROCESS, "Calling BKSSystemService openApplication: " "@\"%s\",options include stdio path: \"%s\", " "BKSDebugOptionKeyDebugOnNextLaunch & " "BKSDebugOptionKeyWaitForDebugger )", bundleIDStr.c_str(), null_path); [debug_options setObject:stdio_path forKey:FBSDebugOptionKeyStandardOutPath]; [debug_options setObject:stdio_path forKey:FBSDebugOptionKeyStandardErrorPath]; [debug_options setObject:[NSNumber numberWithBool:YES] forKey:FBSDebugOptionKeyWaitForDebugger]; [debug_options setObject:[NSNumber numberWithBool:YES] forKey:FBSDebugOptionKeyDebugOnNextLaunch]; [options setObject:debug_options forKey:FBSOpenApplicationOptionKeyDebuggingOptions]; FBSSystemService *system_service = [[FBSSystemService alloc] init]; mach_port_t client_port = [system_service createClientPort]; __block dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); __block FBSOpenApplicationErrorCode attach_error_code = FBSOpenApplicationErrorCodeNone; NSString *bundleIDNSStr = (NSString *)bundleIDCFStr; DNBLog("[LaunchAttach] START (%d) requesting FBS launch of app with bundle " "ID '%s'", getpid(), bundleIDStr.c_str()); [system_service openApplication:bundleIDNSStr options:options clientPort:client_port withResult:^(NSError *error) { // The system service will cleanup the client port we // created for us. if (error) attach_error_code = (FBSOpenApplicationErrorCode)[error code]; [system_service release]; dispatch_semaphore_signal(semaphore); }]; const uint32_t timeout_secs = 9; dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, timeout_secs * NSEC_PER_SEC); long success = dispatch_semaphore_wait(semaphore, timeout) == 0; if (!success) { DNBLogError("timed out trying to launch %s.", bundleIDStr.c_str()); attach_err.SetErrorString( "debugserver timed out waiting for openApplication to complete."); attach_err.SetError(OPEN_APPLICATION_TIMEOUT_ERROR, DNBError::Generic); } else if (attach_error_code != FBSOpenApplicationErrorCodeNone) { std::string empty_str; SetFBSError(attach_error_code, empty_str, attach_err); DNBLogError("unable to launch the application with CFBundleIdentifier " "'%s' bks_error = %ld", bundleIDStr.c_str(), (NSInteger)attach_error_code); } dispatch_release(semaphore); [pool drain]; } #endif #if defined(WITH_BKS) if (launch_flavor == eLaunchFlavorBKS) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *stdio_path = nil; NSFileManager *file_manager = [NSFileManager defaultManager]; const char *null_path = "/dev/null"; stdio_path = [file_manager stringWithFileSystemRepresentation:null_path length:strlen(null_path)]; NSMutableDictionary *debug_options = [NSMutableDictionary dictionary]; NSMutableDictionary *options = [NSMutableDictionary dictionary]; DNBLogThreadedIf(LOG_PROCESS, "Calling BKSSystemService openApplication: " "@\"%s\",options include stdio path: \"%s\", " "BKSDebugOptionKeyDebugOnNextLaunch & " "BKSDebugOptionKeyWaitForDebugger )", bundleIDStr.c_str(), null_path); [debug_options setObject:stdio_path forKey:BKSDebugOptionKeyStandardOutPath]; [debug_options setObject:stdio_path forKey:BKSDebugOptionKeyStandardErrorPath]; [debug_options setObject:[NSNumber numberWithBool:YES] forKey:BKSDebugOptionKeyWaitForDebugger]; [debug_options setObject:[NSNumber numberWithBool:YES] forKey:BKSDebugOptionKeyDebugOnNextLaunch]; [options setObject:debug_options forKey:BKSOpenApplicationOptionKeyDebuggingOptions]; BKSSystemService *system_service = [[BKSSystemService alloc] init]; mach_port_t client_port = [system_service createClientPort]; __block dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); __block BKSOpenApplicationErrorCode attach_error_code = BKSOpenApplicationErrorCodeNone; NSString *bundleIDNSStr = (NSString *)bundleIDCFStr; DNBLog("[LaunchAttach] START (%d) requesting BKS launch of app with bundle " "ID '%s'", getpid(), bundleIDStr.c_str()); [system_service openApplication:bundleIDNSStr options:options clientPort:client_port withResult:^(NSError *error) { // The system service will cleanup the client port we // created for us. if (error) attach_error_code = (BKSOpenApplicationErrorCode)[error code]; [system_service release]; dispatch_semaphore_signal(semaphore); }]; const uint32_t timeout_secs = 9; dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, timeout_secs * NSEC_PER_SEC); long success = dispatch_semaphore_wait(semaphore, timeout) == 0; if (!success) { DNBLogError("timed out trying to launch %s.", bundleIDStr.c_str()); attach_err.SetErrorString( "debugserver timed out waiting for openApplication to complete."); attach_err.SetError(OPEN_APPLICATION_TIMEOUT_ERROR, DNBError::Generic); } else if (attach_error_code != BKSOpenApplicationErrorCodeNone) { std::string empty_str; SetBKSError(attach_error_code, empty_str, attach_err); DNBLogError("unable to launch the application with CFBundleIdentifier " "'%s' bks_error = %d", bundleIDStr.c_str(), attach_error_code); } dispatch_release(semaphore); [pool drain]; } #endif #if defined(WITH_SPRINGBOARD) if (launch_flavor == eLaunchFlavorSpringBoard) { SBSApplicationLaunchError sbs_error = 0; const char *stdout_err = "/dev/null"; CFString stdio_path; stdio_path.SetFileSystemRepresentation(stdout_err); DNBLogThreadedIf(LOG_PROCESS, "SBSLaunchApplicationForDebugging ( @\"%s\" " ", NULL, NULL, NULL, @\"%s\", @\"%s\", " "SBSApplicationDebugOnNextLaunch | " "SBSApplicationLaunchWaitForDebugger )", bundleIDStr.c_str(), stdout_err, stdout_err); DNBLog("[LaunchAttach] START (%d) requesting SpringBoard launch of app " "with bundle " "ID '%s'", getpid(), bundleIDStr.c_str()); sbs_error = SBSLaunchApplicationForDebugging( bundleIDCFStr, (CFURLRef)NULL, // openURL NULL, // launch_argv.get(), NULL, // launch_envp.get(), // CFDictionaryRef environment stdio_path.get(), stdio_path.get(), SBSApplicationDebugOnNextLaunch | SBSApplicationLaunchWaitForDebugger); if (sbs_error != SBSApplicationLaunchErrorSuccess) { attach_err.SetError(sbs_error, DNBError::SpringBoard); return NULL; } } #endif // WITH_SPRINGBOARD DNBLogThreadedIf(LOG_PROCESS, "Successfully set DebugOnNextLaunch."); return bundleIDCFStr; #else // !(defined (WITH_SPRINGBOARD) || defined (WITH_BKS) || defined // (WITH_FBS)) return NULL; #endif } // Pass in the token you got from PrepareForAttach. If there is a process // for that token, then the pid will be returned, otherwise INVALID_NUB_PROCESS // will be returned. nub_process_t MachProcess::CheckForProcess(const void *attach_token, nub_launch_flavor_t launch_flavor) { if (attach_token == NULL) return INVALID_NUB_PROCESS; #if defined(WITH_FBS) if (launch_flavor == eLaunchFlavorFBS) { NSString *bundleIDNSStr = (NSString *)attach_token; FBSSystemService *systemService = [[FBSSystemService alloc] init]; pid_t pid = [systemService pidForApplication:bundleIDNSStr]; [systemService release]; if (pid == 0) return INVALID_NUB_PROCESS; else return pid; } #endif #if defined(WITH_BKS) if (launch_flavor == eLaunchFlavorBKS) { NSString *bundleIDNSStr = (NSString *)attach_token; BKSSystemService *systemService = [[BKSSystemService alloc] init]; pid_t pid = [systemService pidForApplication:bundleIDNSStr]; [systemService release]; if (pid == 0) return INVALID_NUB_PROCESS; else return pid; } #endif #if defined(WITH_SPRINGBOARD) if (launch_flavor == eLaunchFlavorSpringBoard) { CFStringRef bundleIDCFStr = (CFStringRef)attach_token; Boolean got_it; nub_process_t attach_pid; got_it = SBSProcessIDForDisplayIdentifier(bundleIDCFStr, &attach_pid); if (got_it) return attach_pid; else return INVALID_NUB_PROCESS; } #endif return INVALID_NUB_PROCESS; } // Call this to clean up after you have either attached or given up on the // attach. // Pass true for success if you have attached, false if you have not. // The token will also be freed at this point, so you can't use it after calling // this method. void MachProcess::CleanupAfterAttach(const void *attach_token, nub_launch_flavor_t launch_flavor, bool success, DNBError &err_str) { if (attach_token == NULL) return; #if defined(WITH_FBS) if (launch_flavor == eLaunchFlavorFBS) { if (!success) { FBSCleanupAfterAttach(attach_token, err_str); } CFRelease((CFStringRef)attach_token); } #endif #if defined(WITH_BKS) if (launch_flavor == eLaunchFlavorBKS) { if (!success) { BKSCleanupAfterAttach(attach_token, err_str); } CFRelease((CFStringRef)attach_token); } #endif #if defined(WITH_SPRINGBOARD) // Tell SpringBoard to cancel the debug on next launch of this application // if we failed to attach if (launch_flavor == eMachProcessFlagsUsingSpringBoard) { if (!success) { SBSApplicationLaunchError sbs_error = 0; CFStringRef bundleIDCFStr = (CFStringRef)attach_token; sbs_error = SBSLaunchApplicationForDebugging( bundleIDCFStr, (CFURLRef)NULL, NULL, NULL, NULL, NULL, SBSApplicationCancelDebugOnNextLaunch); if (sbs_error != SBSApplicationLaunchErrorSuccess) { err_str.SetError(sbs_error, DNBError::SpringBoard); return; } } CFRelease((CFStringRef)attach_token); } #endif } pid_t MachProcess::LaunchForDebug( const char *path, char const *argv[], char const *envp[], const char *working_directory, // NULL => don't change, non-NULL => set // working directory for inferior to this const char *stdin_path, const char *stdout_path, const char *stderr_path, bool no_stdio, nub_launch_flavor_t launch_flavor, int disable_aslr, const char *event_data, const RNBContext::IgnoredExceptions &ignored_exceptions, DNBError &launch_err) { // Clear out and clean up from any current state Clear(); DNBLogThreadedIf(LOG_PROCESS, "%s( path = '%s', argv = %p, envp = %p, " "launch_flavor = %u, disable_aslr = %d )", __FUNCTION__, path, static_cast<const void *>(argv), static_cast<const void *>(envp), launch_flavor, disable_aslr); // Fork a child process for debugging SetState(eStateLaunching); switch (launch_flavor) { case eLaunchFlavorForkExec: m_pid = MachProcess::ForkChildForPTraceDebugging(path, argv, envp, this, launch_err); break; #ifdef WITH_FBS case eLaunchFlavorFBS: { std::string app_bundle_path = GetAppBundle(path); if (!app_bundle_path.empty()) { m_flags |= (eMachProcessFlagsUsingFBS | eMachProcessFlagsBoardCalculated); if (BoardServiceLaunchForDebug(app_bundle_path.c_str(), argv, envp, no_stdio, disable_aslr, event_data, ignored_exceptions, launch_err) != 0) return m_pid; // A successful SBLaunchForDebug() returns and assigns a // non-zero m_pid. } DNBLog("Failed to launch '%s' with FBS", app_bundle_path); } break; #endif #ifdef WITH_BKS case eLaunchFlavorBKS: { std::string app_bundle_path = GetAppBundle(path); if (!app_bundle_path.empty()) { m_flags |= (eMachProcessFlagsUsingBKS | eMachProcessFlagsBoardCalculated); if (BoardServiceLaunchForDebug(app_bundle_path.c_str(), argv, envp, no_stdio, disable_aslr, event_data, ignored_exceptions, launch_err) != 0) return m_pid; // A successful SBLaunchForDebug() returns and assigns a // non-zero m_pid. } DNBLog("Failed to launch '%s' with BKS", app_bundle_path); } break; #endif #ifdef WITH_SPRINGBOARD case eLaunchFlavorSpringBoard: { std::string app_bundle_path = GetAppBundle(path); if (!app_bundle_path.empty()) { if (SBLaunchForDebug(app_bundle_path.c_str(), argv, envp, no_stdio, disable_aslr, ignored_exceptions, launch_err) != 0) return m_pid; // A successful SBLaunchForDebug() returns and assigns a // non-zero m_pid. } DNBLog("Failed to launch '%s' with SpringBoard", app_bundle_path); } break; #endif case eLaunchFlavorPosixSpawn: m_pid = MachProcess::PosixSpawnChildForPTraceDebugging( path, DNBArchProtocol::GetCPUType(), DNBArchProtocol::GetCPUSubType(), argv, envp, working_directory, stdin_path, stdout_path, stderr_path, no_stdio, this, disable_aslr, launch_err); break; default: DNBLog("Failed to launch: invalid launch flavor: %d", launch_flavor); launch_err.SetError(NUB_GENERIC_ERROR, DNBError::Generic); return INVALID_NUB_PROCESS; } if (m_pid == INVALID_NUB_PROCESS) { // If we don't have a valid process ID and no one has set the error, // then return a generic error if (launch_err.Success()) launch_err.SetError(NUB_GENERIC_ERROR, DNBError::Generic); } else { m_path = path; size_t i; char const *arg; for (i = 0; (arg = argv[i]) != NULL; i++) m_args.push_back(arg); m_task.StartExceptionThread(ignored_exceptions, launch_err); if (launch_err.Fail()) { if (launch_err.AsString() == NULL) launch_err.SetErrorString("unable to start the exception thread"); DNBLog("Could not get inferior's Mach exception port, sending ptrace " "PT_KILL and exiting."); ::ptrace(PT_KILL, m_pid, 0, 0); m_pid = INVALID_NUB_PROCESS; return INVALID_NUB_PROCESS; } StartSTDIOThread(); if (launch_flavor == eLaunchFlavorPosixSpawn) { SetState(eStateAttaching); errno = 0; DNBLog("[LaunchAttach] (%d) About to ptrace(PT_ATTACHEXC, %d)...", getpid(), m_pid); int err = ::ptrace(PT_ATTACHEXC, m_pid, 0, 0); int ptrace_errno = errno; DNBLog("[LaunchAttach] (%d) Completed ptrace(PT_ATTACHEXC, %d) == %d", getpid(), m_pid, err); if (err == 0) { m_flags |= eMachProcessFlagsAttached; DNBLogThreadedIf(LOG_PROCESS, "successfully spawned pid %d", m_pid); launch_err.Clear(); } else { SetState(eStateExited); DNBError ptrace_err(ptrace_errno, DNBError::POSIX); DNBLogThreadedIf(LOG_PROCESS, "error: failed to attach to spawned pid " "%d (err = %i, errno = %i (%s))", m_pid, err, ptrace_err.Status(), ptrace_err.AsString()); launch_err.SetError(NUB_GENERIC_ERROR, DNBError::Generic); } } else { launch_err.Clear(); } } return m_pid; } pid_t MachProcess::PosixSpawnChildForPTraceDebugging( const char *path, cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, char const *argv[], char const *envp[], const char *working_directory, const char *stdin_path, const char *stdout_path, const char *stderr_path, bool no_stdio, MachProcess *process, int disable_aslr, DNBError &err) { posix_spawnattr_t attr; short flags; DNBLogThreadedIf(LOG_PROCESS, "%s ( path='%s', argv=%p, envp=%p, " "working_dir=%s, stdin=%s, stdout=%s " "stderr=%s, no-stdio=%i)", __FUNCTION__, path, static_cast<const void *>(argv), static_cast<const void *>(envp), working_directory, stdin_path, stdout_path, stderr_path, no_stdio); err.SetError(::posix_spawnattr_init(&attr), DNBError::POSIX); if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS)) err.LogThreaded("::posix_spawnattr_init ( &attr )"); if (err.Fail()) return INVALID_NUB_PROCESS; flags = POSIX_SPAWN_START_SUSPENDED | POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETPGROUP; if (disable_aslr) flags |= _POSIX_SPAWN_DISABLE_ASLR; sigset_t no_signals; sigset_t all_signals; sigemptyset(&no_signals); sigfillset(&all_signals); ::posix_spawnattr_setsigmask(&attr, &no_signals); ::posix_spawnattr_setsigdefault(&attr, &all_signals); err.SetError(::posix_spawnattr_setflags(&attr, flags), DNBError::POSIX); if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS)) err.LogThreaded( "::posix_spawnattr_setflags ( &attr, POSIX_SPAWN_START_SUSPENDED%s )", flags & _POSIX_SPAWN_DISABLE_ASLR ? " | _POSIX_SPAWN_DISABLE_ASLR" : ""); if (err.Fail()) return INVALID_NUB_PROCESS; // Don't do this on SnowLeopard, _sometimes_ the TASK_BASIC_INFO will fail // and we will fail to continue with our process... // On SnowLeopard we should set "DYLD_NO_PIE" in the inferior environment.... if (cpu_type != 0) { size_t ocount = 0; bool slice_preference_set = false; if (cpu_subtype != 0) { typedef int (*posix_spawnattr_setarchpref_np_t)( posix_spawnattr_t *, size_t, cpu_type_t *, cpu_subtype_t *, size_t *); posix_spawnattr_setarchpref_np_t posix_spawnattr_setarchpref_np_fn = (posix_spawnattr_setarchpref_np_t)dlsym( RTLD_DEFAULT, "posix_spawnattr_setarchpref_np"); if (posix_spawnattr_setarchpref_np_fn) { err.SetError((*posix_spawnattr_setarchpref_np_fn)( &attr, 1, &cpu_type, &cpu_subtype, &ocount)); slice_preference_set = err.Success(); if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS)) err.LogThreaded( "::posix_spawnattr_setarchpref_np ( &attr, 1, cpu_type = " "0x%8.8x, cpu_subtype = 0x%8.8x, count => %llu )", cpu_type, cpu_subtype, (uint64_t)ocount); if (err.Fail() != 0 || ocount != 1) return INVALID_NUB_PROCESS; } } if (!slice_preference_set) { err.SetError( ::posix_spawnattr_setbinpref_np(&attr, 1, &cpu_type, &ocount), DNBError::POSIX); if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS)) err.LogThreaded( "::posix_spawnattr_setbinpref_np ( &attr, 1, cpu_type = " "0x%8.8x, count => %llu )", cpu_type, (uint64_t)ocount); if (err.Fail() != 0 || ocount != 1) return INVALID_NUB_PROCESS; } } PseudoTerminal pty; posix_spawn_file_actions_t file_actions; err.SetError(::posix_spawn_file_actions_init(&file_actions), DNBError::POSIX); int file_actions_valid = err.Success(); if (!file_actions_valid || DNBLogCheckLogBit(LOG_PROCESS)) err.LogThreaded("::posix_spawn_file_actions_init ( &file_actions )"); int pty_error = -1; pid_t pid = INVALID_NUB_PROCESS; if (file_actions_valid) { if (stdin_path == NULL && stdout_path == NULL && stderr_path == NULL && !no_stdio) { pty_error = pty.OpenFirstAvailablePrimary(O_RDWR | O_NOCTTY); if (pty_error == PseudoTerminal::success) { stdin_path = stdout_path = stderr_path = pty.SecondaryName(); } } // if no_stdio or std paths not supplied, then route to "/dev/null". if (no_stdio || stdin_path == NULL || stdin_path[0] == '\0') stdin_path = "/dev/null"; if (no_stdio || stdout_path == NULL || stdout_path[0] == '\0') stdout_path = "/dev/null"; if (no_stdio || stderr_path == NULL || stderr_path[0] == '\0') stderr_path = "/dev/null"; err.SetError(::posix_spawn_file_actions_addopen(&file_actions, STDIN_FILENO, stdin_path, O_RDONLY | O_NOCTTY, 0), DNBError::POSIX); if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS)) err.LogThreaded("::posix_spawn_file_actions_addopen (&file_actions, " "filedes=STDIN_FILENO, path='%s')", stdin_path); err.SetError(::posix_spawn_file_actions_addopen( &file_actions, STDOUT_FILENO, stdout_path, O_WRONLY | O_NOCTTY | O_CREAT, 0640), DNBError::POSIX); if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS)) err.LogThreaded("::posix_spawn_file_actions_addopen (&file_actions, " "filedes=STDOUT_FILENO, path='%s')", stdout_path); err.SetError(::posix_spawn_file_actions_addopen( &file_actions, STDERR_FILENO, stderr_path, O_WRONLY | O_NOCTTY | O_CREAT, 0640), DNBError::POSIX); if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS)) err.LogThreaded("::posix_spawn_file_actions_addopen (&file_actions, " "filedes=STDERR_FILENO, path='%s')", stderr_path); // TODO: Verify if we can set the working directory back immediately // after the posix_spawnp call without creating a race condition??? if (working_directory) ::chdir(working_directory); err.SetError(::posix_spawnp(&pid, path, &file_actions, &attr, const_cast<char *const *>(argv), const_cast<char *const *>(envp)), DNBError::POSIX); if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS)) err.LogThreaded("::posix_spawnp ( pid => %i, path = '%s', file_actions = " "%p, attr = %p, argv = %p, envp = %p )", pid, path, &file_actions, &attr, argv, envp); } else { // TODO: Verify if we can set the working directory back immediately // after the posix_spawnp call without creating a race condition??? if (working_directory) ::chdir(working_directory); err.SetError(::posix_spawnp(&pid, path, NULL, &attr, const_cast<char *const *>(argv), const_cast<char *const *>(envp)), DNBError::POSIX); if (err.Fail() || DNBLogCheckLogBit(LOG_PROCESS)) err.LogThreaded("::posix_spawnp ( pid => %i, path = '%s', file_actions = " "%p, attr = %p, argv = %p, envp = %p )", pid, path, NULL, &attr, argv, envp); } // We have seen some cases where posix_spawnp was returning a valid // looking pid even when an error was returned, so clear it out if (err.Fail()) pid = INVALID_NUB_PROCESS; if (pty_error == 0) { if (process != NULL) { int primary_fd = pty.ReleasePrimaryFD(); process->SetChildFileDescriptors(primary_fd, primary_fd, primary_fd); } } ::posix_spawnattr_destroy(&attr); if (pid != INVALID_NUB_PROCESS) { cpu_type_t pid_cpu_type = MachProcess::GetCPUTypeForLocalProcess(pid); DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s ( ) pid=%i, cpu_type=0x%8.8x", __FUNCTION__, pid, pid_cpu_type); if (pid_cpu_type) DNBArchProtocol::SetArchitecture(pid_cpu_type); } if (file_actions_valid) { DNBError err2; err2.SetError(::posix_spawn_file_actions_destroy(&file_actions), DNBError::POSIX); if (err2.Fail() || DNBLogCheckLogBit(LOG_PROCESS)) err2.LogThreaded("::posix_spawn_file_actions_destroy ( &file_actions )"); } return pid; } uint32_t MachProcess::GetCPUTypeForLocalProcess(pid_t pid) { int mib[CTL_MAXNAME] = { 0, }; size_t len = CTL_MAXNAME; if (::sysctlnametomib("sysctl.proc_cputype", mib, &len)) return 0; mib[len] = pid; len++; cpu_type_t cpu; size_t cpu_len = sizeof(cpu); if (::sysctl(mib, static_cast<u_int>(len), &cpu, &cpu_len, 0, 0)) cpu = 0; return cpu; } pid_t MachProcess::ForkChildForPTraceDebugging(const char *path, char const *argv[], char const *envp[], MachProcess *process, DNBError &launch_err) { PseudoTerminal::Status pty_error = PseudoTerminal::success; // Use a fork that ties the child process's stdin/out/err to a pseudo // terminal so we can read it in our MachProcess::STDIOThread // as unbuffered io. PseudoTerminal pty; pid_t pid = pty.Fork(pty_error); if (pid < 0) { //-------------------------------------------------------------- // Status during fork. //-------------------------------------------------------------- return pid; } else if (pid == 0) { //-------------------------------------------------------------- // Child process //-------------------------------------------------------------- ::ptrace(PT_TRACE_ME, 0, 0, 0); // Debug this process ::ptrace(PT_SIGEXC, 0, 0, 0); // Get BSD signals as mach exceptions // If our parent is setgid, lets make sure we don't inherit those // extra powers due to nepotism. if (::setgid(getgid()) == 0) { // Let the child have its own process group. We need to execute // this call in both the child and parent to avoid a race condition // between the two processes. ::setpgid(0, 0); // Set the child process group to match its pid // Sleep a bit to before the exec call ::sleep(1); // Turn this process into ::execv(path, const_cast<char *const *>(argv)); } // Exit with error code. Child process should have taken // over in above exec call and if the exec fails it will // exit the child process below. ::exit(127); } else { //-------------------------------------------------------------- // Parent process //-------------------------------------------------------------- // Let the child have its own process group. We need to execute // this call in both the child and parent to avoid a race condition // between the two processes. ::setpgid(pid, pid); // Set the child process group to match its pid if (process != NULL) { // Release our primary pty file descriptor so the pty class doesn't // close it and so we can continue to use it in our STDIO thread int primary_fd = pty.ReleasePrimaryFD(); process->SetChildFileDescriptors(primary_fd, primary_fd, primary_fd); } } return pid; } #if defined(WITH_SPRINGBOARD) || defined(WITH_BKS) || defined(WITH_FBS) // This returns a CFRetained pointer to the Bundle ID for app_bundle_path, // or NULL if there was some problem getting the bundle id. static CFStringRef CopyBundleIDForPath(const char *app_bundle_path, DNBError &err_str) { CFBundle bundle(app_bundle_path); CFStringRef bundleIDCFStr = bundle.GetIdentifier(); std::string bundleID; if (CFString::UTF8(bundleIDCFStr, bundleID) == NULL) { struct stat app_bundle_stat; char err_msg[PATH_MAX]; if (::stat(app_bundle_path, &app_bundle_stat) < 0) { err_str.SetError(errno, DNBError::POSIX); snprintf(err_msg, sizeof(err_msg), "%s: \"%s\"", err_str.AsString(), app_bundle_path); err_str.SetErrorString(err_msg); DNBLogThreadedIf(LOG_PROCESS, "%s() error: %s", __FUNCTION__, err_msg); } else { err_str.SetError(-1, DNBError::Generic); snprintf(err_msg, sizeof(err_msg), "failed to extract CFBundleIdentifier from %s", app_bundle_path); err_str.SetErrorString(err_msg); DNBLogThreadedIf( LOG_PROCESS, "%s() error: failed to extract CFBundleIdentifier from '%s'", __FUNCTION__, app_bundle_path); } return NULL; } DNBLogThreadedIf(LOG_PROCESS, "%s() extracted CFBundleIdentifier: %s", __FUNCTION__, bundleID.c_str()); CFRetain(bundleIDCFStr); return bundleIDCFStr; } #endif // #if defined (WITH_SPRINGBOARD) || defined (WITH_BKS) || defined // (WITH_FBS) #ifdef WITH_SPRINGBOARD pid_t MachProcess::SBLaunchForDebug(const char *path, char const *argv[], char const *envp[], bool no_stdio, bool disable_aslr, const RNBContext::IgnoredExceptions &ignored_exceptions, DNBError &launch_err) { // Clear out and clean up from any current state Clear(); DNBLogThreadedIf(LOG_PROCESS, "%s( '%s', argv)", __FUNCTION__, path); // Fork a child process for debugging SetState(eStateLaunching); m_pid = MachProcess::SBForkChildForPTraceDebugging(path, argv, envp, no_stdio, this, launch_err); if (m_pid != 0) { m_path = path; size_t i; char const *arg; for (i = 0; (arg = argv[i]) != NULL; i++) m_args.push_back(arg); m_task.StartExceptionThread(ignored_exceptions, launch_err); if (launch_err.Fail()) { if (launch_err.AsString() == NULL) launch_err.SetErrorString("unable to start the exception thread"); DNBLog("Could not get inferior's Mach exception port, sending ptrace " "PT_KILL and exiting."); ::ptrace(PT_KILL, m_pid, 0, 0); m_pid = INVALID_NUB_PROCESS; return INVALID_NUB_PROCESS; } StartSTDIOThread(); SetState(eStateAttaching); DNBLog("[LaunchAttach] (%d) About to ptrace(PT_ATTACHEXC, %d)...", getpid(), m_pid); int err = ::ptrace(PT_ATTACHEXC, m_pid, 0, 0); DNBLog("[LaunchAttach] (%d) Completed ptrace(PT_ATTACHEXC, %d) == %d", getpid(), m_pid, err); if (err == 0) { m_flags |= eMachProcessFlagsAttached; DNBLogThreadedIf(LOG_PROCESS, "successfully attached to pid %d", m_pid); } else { SetState(eStateExited); DNBLogThreadedIf(LOG_PROCESS, "error: failed to attach to pid %d", m_pid); } } return m_pid; } #include <servers/bootstrap.h> pid_t MachProcess::SBForkChildForPTraceDebugging( const char *app_bundle_path, char const *argv[], char const *envp[], bool no_stdio, MachProcess *process, DNBError &launch_err) { DNBLogThreadedIf(LOG_PROCESS, "%s( '%s', argv, %p)", __FUNCTION__, app_bundle_path, process); CFAllocatorRef alloc = kCFAllocatorDefault; if (argv[0] == NULL) return INVALID_NUB_PROCESS; size_t argc = 0; // Count the number of arguments while (argv[argc] != NULL) argc++; // Enumerate the arguments size_t first_launch_arg_idx = 1; CFReleaser<CFMutableArrayRef> launch_argv; if (argv[first_launch_arg_idx]) { size_t launch_argc = argc > 0 ? argc - 1 : 0; launch_argv.reset( ::CFArrayCreateMutable(alloc, launch_argc, &kCFTypeArrayCallBacks)); size_t i; char const *arg; CFString launch_arg; for (i = first_launch_arg_idx; (i < argc) && ((arg = argv[i]) != NULL); i++) { launch_arg.reset( ::CFStringCreateWithCString(alloc, arg, kCFStringEncodingUTF8)); if (launch_arg.get() != NULL) CFArrayAppendValue(launch_argv.get(), launch_arg.get()); else break; } } // Next fill in the arguments dictionary. Note, the envp array is of the form // Variable=value but SpringBoard wants a CF dictionary. So we have to // convert // this here. CFReleaser<CFMutableDictionaryRef> launch_envp; if (envp[0]) { launch_envp.reset( ::CFDictionaryCreateMutable(alloc, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); const char *value; int name_len; CFString name_string, value_string; for (int i = 0; envp[i] != NULL; i++) { value = strstr(envp[i], "="); // If the name field is empty or there's no =, skip it. Somebody's // messing with us. if (value == NULL || value == envp[i]) continue; name_len = value - envp[i]; // Now move value over the "=" value++; name_string.reset( ::CFStringCreateWithBytes(alloc, (const UInt8 *)envp[i], name_len, kCFStringEncodingUTF8, false)); value_string.reset( ::CFStringCreateWithCString(alloc, value, kCFStringEncodingUTF8)); CFDictionarySetValue(launch_envp.get(), name_string.get(), value_string.get()); } } CFString stdio_path; PseudoTerminal pty; if (!no_stdio) { PseudoTerminal::Status pty_err = pty.OpenFirstAvailablePrimary(O_RDWR | O_NOCTTY); if (pty_err == PseudoTerminal::success) { const char *secondary_name = pty.SecondaryName(); DNBLogThreadedIf(LOG_PROCESS, "%s() successfully opened primary pty, secondary is %s", __FUNCTION__, secondary_name); if (secondary_name && secondary_name[0]) { ::chmod(secondary_name, S_IRWXU | S_IRWXG | S_IRWXO); stdio_path.SetFileSystemRepresentation(secondary_name); } } } if (stdio_path.get() == NULL) { stdio_path.SetFileSystemRepresentation("/dev/null"); } CFStringRef bundleIDCFStr = CopyBundleIDForPath(app_bundle_path, launch_err); if (bundleIDCFStr == NULL) return INVALID_NUB_PROCESS; // This is just for logging: std::string bundleID; CFString::UTF8(bundleIDCFStr, bundleID); DNBLogThreadedIf(LOG_PROCESS, "%s() serialized launch arg array", __FUNCTION__); // Find SpringBoard SBSApplicationLaunchError sbs_error = 0; sbs_error = SBSLaunchApplicationForDebugging( bundleIDCFStr, (CFURLRef)NULL, // openURL launch_argv.get(), launch_envp.get(), // CFDictionaryRef environment stdio_path.get(), stdio_path.get(), SBSApplicationLaunchWaitForDebugger | SBSApplicationLaunchUnlockDevice); launch_err.SetError(sbs_error, DNBError::SpringBoard); if (sbs_error == SBSApplicationLaunchErrorSuccess) { static const useconds_t pid_poll_interval = 200000; static const useconds_t pid_poll_timeout = 30000000; useconds_t pid_poll_total = 0; nub_process_t pid = INVALID_NUB_PROCESS; Boolean pid_found = SBSProcessIDForDisplayIdentifier(bundleIDCFStr, &pid); // Poll until the process is running, as long as we are getting valid // responses and the timeout hasn't expired // A return PID of 0 means the process is not running, which may be because // it hasn't been (asynchronously) started // yet, or that it died very quickly (if you weren't using waitForDebugger). while (!pid_found && pid_poll_total < pid_poll_timeout) { usleep(pid_poll_interval); pid_poll_total += pid_poll_interval; DNBLogThreadedIf(LOG_PROCESS, "%s() polling Springboard for pid for %s...", __FUNCTION__, bundleID.c_str()); pid_found = SBSProcessIDForDisplayIdentifier(bundleIDCFStr, &pid); } CFRelease(bundleIDCFStr); if (pid_found) { if (process != NULL) { // Release our primary pty file descriptor so the pty class doesn't // close it and so we can continue to use it in our STDIO thread int primary_fd = pty.ReleasePrimaryFD(); process->SetChildFileDescriptors(primary_fd, primary_fd, primary_fd); } DNBLogThreadedIf(LOG_PROCESS, "%s() => pid = %4.4x", __FUNCTION__, pid); } else { DNBLogError("failed to lookup the process ID for CFBundleIdentifier %s.", bundleID.c_str()); } return pid; } DNBLogError("unable to launch the application with CFBundleIdentifier '%s' " "sbs_error = %u", bundleID.c_str(), sbs_error); return INVALID_NUB_PROCESS; } #endif // #ifdef WITH_SPRINGBOARD #if defined(WITH_BKS) || defined(WITH_FBS) pid_t MachProcess::BoardServiceLaunchForDebug( const char *path, char const *argv[], char const *envp[], bool no_stdio, bool disable_aslr, const char *event_data, const RNBContext::IgnoredExceptions &ignored_exceptions, DNBError &launch_err) { DNBLogThreadedIf(LOG_PROCESS, "%s( '%s', argv)", __FUNCTION__, path); // Fork a child process for debugging SetState(eStateLaunching); m_pid = BoardServiceForkChildForPTraceDebugging( path, argv, envp, no_stdio, disable_aslr, event_data, launch_err); if (m_pid != 0) { m_path = path; size_t i; char const *arg; for (i = 0; (arg = argv[i]) != NULL; i++) m_args.push_back(arg); m_task.StartExceptionThread(ignored_exceptions, launch_err); if (launch_err.Fail()) { if (launch_err.AsString() == NULL) launch_err.SetErrorString("unable to start the exception thread"); DNBLog("[LaunchAttach] END (%d) Could not get inferior's Mach exception " "port, " "sending ptrace " "PT_KILL to pid %i and exiting.", getpid(), m_pid); ::ptrace(PT_KILL, m_pid, 0, 0); m_pid = INVALID_NUB_PROCESS; return INVALID_NUB_PROCESS; } StartSTDIOThread(); SetState(eStateAttaching); DNBLog("[LaunchAttach] (%d) About to ptrace(PT_ATTACHEXC, %d)...", getpid(), m_pid); int err = ::ptrace(PT_ATTACHEXC, m_pid, 0, 0); DNBLog("[LaunchAttach] (%d) Completed ptrace(PT_ATTACHEXC, %d) == %d", getpid(), m_pid, err); if (err == 0) { m_flags |= eMachProcessFlagsAttached; DNBLog("[LaunchAttach] successfully attached to pid %d", m_pid); } else { SetState(eStateExited); DNBLog("[LaunchAttach] END (%d) error: failed to attach to pid %d", getpid(), m_pid); } } return m_pid; } pid_t MachProcess::BoardServiceForkChildForPTraceDebugging( const char *app_bundle_path, char const *argv[], char const *envp[], bool no_stdio, bool disable_aslr, const char *event_data, DNBError &launch_err) { if (argv[0] == NULL) return INVALID_NUB_PROCESS; DNBLogThreadedIf(LOG_PROCESS, "%s( '%s', argv, %p)", __FUNCTION__, app_bundle_path, this); NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; size_t argc = 0; // Count the number of arguments while (argv[argc] != NULL) argc++; // Enumerate the arguments size_t first_launch_arg_idx = 1; NSMutableArray *launch_argv = nil; if (argv[first_launch_arg_idx]) { size_t launch_argc = argc > 0 ? argc - 1 : 0; launch_argv = [NSMutableArray arrayWithCapacity:launch_argc]; size_t i; char const *arg; NSString *launch_arg; for (i = first_launch_arg_idx; (i < argc) && ((arg = argv[i]) != NULL); i++) { launch_arg = [NSString stringWithUTF8String:arg]; // FIXME: Should we silently eat an argument that we can't convert into a // UTF8 string? if (launch_arg != nil) [launch_argv addObject:launch_arg]; else break; } } NSMutableDictionary *launch_envp = nil; if (envp[0]) { launch_envp = [[NSMutableDictionary alloc] init]; const char *value; int name_len; NSString *name_string, *value_string; for (int i = 0; envp[i] != NULL; i++) { value = strstr(envp[i], "="); // If the name field is empty or there's no =, skip it. Somebody's // messing with us. if (value == NULL || value == envp[i]) continue; name_len = value - envp[i]; // Now move value over the "=" value++; name_string = [[NSString alloc] initWithBytes:envp[i] length:name_len encoding:NSUTF8StringEncoding]; value_string = [NSString stringWithUTF8String:value]; [launch_envp setObject:value_string forKey:name_string]; } } NSString *stdio_path = nil; NSFileManager *file_manager = [NSFileManager defaultManager]; PseudoTerminal pty; if (!no_stdio) { PseudoTerminal::Status pty_err = pty.OpenFirstAvailablePrimary(O_RDWR | O_NOCTTY); if (pty_err == PseudoTerminal::success) { const char *secondary_name = pty.SecondaryName(); DNBLogThreadedIf(LOG_PROCESS, "%s() successfully opened primary pty, secondary is %s", __FUNCTION__, secondary_name); if (secondary_name && secondary_name[0]) { ::chmod(secondary_name, S_IRWXU | S_IRWXG | S_IRWXO); stdio_path = [file_manager stringWithFileSystemRepresentation:secondary_name length:strlen(secondary_name)]; } } } if (stdio_path == nil) { const char *null_path = "/dev/null"; stdio_path = [file_manager stringWithFileSystemRepresentation:null_path length:strlen(null_path)]; } CFStringRef bundleIDCFStr = CopyBundleIDForPath(app_bundle_path, launch_err); if (bundleIDCFStr == NULL) { [pool drain]; return INVALID_NUB_PROCESS; } // Instead of rewriting CopyBundleIDForPath for NSStrings, we'll just use // toll-free bridging here: NSString *bundleIDNSStr = (NSString *)bundleIDCFStr; // Okay, now let's assemble all these goodies into the BackBoardServices // options mega-dictionary: NSMutableDictionary *options = nullptr; pid_t return_pid = INVALID_NUB_PROCESS; bool success = false; #ifdef WITH_BKS if (ProcessUsingBackBoard()) { options = BKSCreateOptionsDictionary(app_bundle_path, launch_argv, launch_envp, stdio_path, disable_aslr, event_data); success = BKSCallOpenApplicationFunction(bundleIDNSStr, options, launch_err, &return_pid); } #endif #ifdef WITH_FBS if (ProcessUsingFrontBoard()) { options = FBSCreateOptionsDictionary(app_bundle_path, launch_argv, launch_envp, stdio_path, disable_aslr, event_data); success = FBSCallOpenApplicationFunction(bundleIDNSStr, options, launch_err, &return_pid); } #endif if (success) { int primary_fd = pty.ReleasePrimaryFD(); SetChildFileDescriptors(primary_fd, primary_fd, primary_fd); CFString::UTF8(bundleIDCFStr, m_bundle_id); } [pool drain]; return return_pid; } bool MachProcess::BoardServiceSendEvent(const char *event_data, DNBError &send_err) { bool return_value = true; if (event_data == NULL || *event_data == '\0') { DNBLogError("SendEvent called with NULL event data."); send_err.SetErrorString("SendEvent called with empty event data"); return false; } NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; if (strcmp(event_data, "BackgroundApplication") == 0) { // This is an event I cooked up. What you actually do is foreground the system // app, so: #ifdef WITH_BKS if (ProcessUsingBackBoard()) { return_value = BKSCallOpenApplicationFunction(nil, nil, send_err, NULL); } #endif #ifdef WITH_FBS if (ProcessUsingFrontBoard()) { return_value = FBSCallOpenApplicationFunction(nil, nil, send_err, NULL); } #endif if (!return_value) { DNBLogError("Failed to background application, error: %s.", send_err.AsString()); } } else { if (m_bundle_id.empty()) { // See if we can figure out the bundle ID for this PID: DNBLogError( "Tried to send event \"%s\" to a process that has no bundle ID.", event_data); return false; } NSString *bundleIDNSStr = [NSString stringWithUTF8String:m_bundle_id.c_str()]; NSMutableDictionary *options = [NSMutableDictionary dictionary]; #ifdef WITH_BKS if (ProcessUsingBackBoard()) { if (!BKSAddEventDataToOptions(options, event_data, send_err)) { [pool drain]; return false; } return_value = BKSCallOpenApplicationFunction(bundleIDNSStr, options, send_err, NULL); DNBLogThreadedIf(LOG_PROCESS, "Called BKSCallOpenApplicationFunction to send event."); } #endif #ifdef WITH_FBS if (ProcessUsingFrontBoard()) { if (!FBSAddEventDataToOptions(options, event_data, send_err)) { [pool drain]; return false; } return_value = FBSCallOpenApplicationFunction(bundleIDNSStr, options, send_err, NULL); DNBLogThreadedIf(LOG_PROCESS, "Called FBSCallOpenApplicationFunction to send event."); } #endif if (!return_value) { DNBLogError("Failed to send event: %s, error: %s.", event_data, send_err.AsString()); } } [pool drain]; return return_value; } #endif // defined(WITH_BKS) || defined (WITH_FBS) #ifdef WITH_BKS void MachProcess::BKSCleanupAfterAttach(const void *attach_token, DNBError &err_str) { bool success; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Instead of rewriting CopyBundleIDForPath for NSStrings, we'll just use // toll-free bridging here: NSString *bundleIDNSStr = (NSString *)attach_token; // Okay, now let's assemble all these goodies into the BackBoardServices // options mega-dictionary: // First we have the debug sub-dictionary: NSMutableDictionary *debug_options = [NSMutableDictionary dictionary]; [debug_options setObject:[NSNumber numberWithBool:YES] forKey:BKSDebugOptionKeyCancelDebugOnNextLaunch]; // That will go in the overall dictionary: NSMutableDictionary *options = [NSMutableDictionary dictionary]; [options setObject:debug_options forKey:BKSOpenApplicationOptionKeyDebuggingOptions]; success = BKSCallOpenApplicationFunction(bundleIDNSStr, options, err_str, NULL); if (!success) { DNBLogError("error trying to cancel debug on next launch for %s: %s", [bundleIDNSStr UTF8String], err_str.AsString()); } [pool drain]; } #endif // WITH_BKS #ifdef WITH_FBS void MachProcess::FBSCleanupAfterAttach(const void *attach_token, DNBError &err_str) { bool success; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Instead of rewriting CopyBundleIDForPath for NSStrings, we'll just use // toll-free bridging here: NSString *bundleIDNSStr = (NSString *)attach_token; // Okay, now let's assemble all these goodies into the BackBoardServices // options mega-dictionary: // First we have the debug sub-dictionary: NSMutableDictionary *debug_options = [NSMutableDictionary dictionary]; [debug_options setObject:[NSNumber numberWithBool:YES] forKey:FBSDebugOptionKeyCancelDebugOnNextLaunch]; // That will go in the overall dictionary: NSMutableDictionary *options = [NSMutableDictionary dictionary]; [options setObject:debug_options forKey:FBSOpenApplicationOptionKeyDebuggingOptions]; success = FBSCallOpenApplicationFunction(bundleIDNSStr, options, err_str, NULL); if (!success) { DNBLogError("error trying to cancel debug on next launch for %s: %s", [bundleIDNSStr UTF8String], err_str.AsString()); } [pool drain]; } #endif // WITH_FBS void MachProcess::CalculateBoardStatus() { if (m_flags & eMachProcessFlagsBoardCalculated) return; if (m_pid == 0) return; #if defined (WITH_FBS) || defined (WITH_BKS) bool found_app_flavor = false; #endif #if defined(WITH_FBS) if (!found_app_flavor && IsFBSProcess(m_pid)) { found_app_flavor = true; m_flags |= eMachProcessFlagsUsingFBS; } #endif #if defined(WITH_BKS) if (!found_app_flavor && IsBKSProcess(m_pid)) { found_app_flavor = true; m_flags |= eMachProcessFlagsUsingBKS; } #endif m_flags |= eMachProcessFlagsBoardCalculated; } bool MachProcess::ProcessUsingBackBoard() { CalculateBoardStatus(); return (m_flags & eMachProcessFlagsUsingBKS) != 0; } bool MachProcess::ProcessUsingFrontBoard() { CalculateBoardStatus(); return (m_flags & eMachProcessFlagsUsingFBS) != 0; } int MachProcess::GetInferiorAddrSize(pid_t pid) { int pointer_size = 8; int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}; struct kinfo_proc processInfo; size_t bufsize = sizeof(processInfo); if (sysctl(mib, (unsigned)(sizeof(mib) / sizeof(int)), &processInfo, &bufsize, NULL, 0) == 0 && bufsize > 0) { if ((processInfo.kp_proc.p_flag & P_LP64) == 0) pointer_size = 4; } return pointer_size; } ```
Henry Arthur Herbert the elder (c. 1756 – 21 June 1821, Westminster) was a major landowner in County Kerry, Ireland, and a member of the Parliament of the United Kingdom. He was educated at St John's College, Cambridge and studied law at the Middle Temple. Henry Arthur was the son of Thomas Herbert, who had amassed a fortune by exploiting the copper mines of the Muckross Peninsula and Ross Island areas of the Lakes of Killarney in Kerry. The Herbert family had originally come from Montgomeryshire in Wales in the 17th century. In 1770 the Herberts inherited the large estates of the MacCarthy family in the Killarney area. He was Member of the Parliament of the United Kingdom for County Kerry and Tralee in Ireland between 1806 and 1813. He commenced the building of Muckross House on his estate in Killarney. He died in Westminster in 1821. He had married Elizabeth, daughter of George Germain, 1st Viscount Sackville. They had a son, Charles John. He should not be confused with his grandson, also Henry Arthur Herbert (the younger), who married Mary Balfour Herbert with whom he built the present Muckross House. Henry Jnr became Chief Secretary for Ireland from 1857 to 1858 and hosted Queen Victoria on her visit to his estate at Muckross in 1861. References External links Muckross House: The Herberts 1756 births 1821 deaths Alumni of St John's College, Cambridge Members of the Middle Temple British MPs 1780–1784 British MPs 1784–1790 Members of the Parliament of Great Britain for English constituencies Members of the Parliament of the United Kingdom for County Kerry constituencies (1801–1922) UK MPs 1806–1807 UK MPs 1807–1812 UK MPs 1812–1818
The men's trials, 20 inch is a trials event at the annual UCI Urban Cycling World Championships. It has been a UCI World Championship event since 1986. From 1986 to 1994 there was no separate 26-inch category in the world championships. From 1986 to 1999, the UCI world championships in trials were run as the UCI Trials World Championships. From 2000 to 2016, the world championships in trials were held alongside other mountain-biking disciplines as the UCI Mountain Bike & Trials World Championships. Beginning in 2017, the UCI World Championships in trials are being run as part of the UCI Urban Cycling World Championships. Medalists Medal table References 1986-2014 UCI Trials World Championships medal winners from the Union Cycliste Internationale's website. Results from the Union Cycliste Internationale's website. Events at the UCI Mountain Bike & Trials World Championships
The canton of Saint-Cloud is an administrative division of the Hauts-de-Seine department in northern France. Its borders were modified at the French canton reorganisation which came into effect in March 2015. Its seat is in Saint-Cloud. It lies within two arrondissements, Nanterre and Boulogne-Billancourt. It consists of the following communes: Garches Marnes-la-Coquette Saint-Cloud Vaucresson Ville-d'Avray References Cantons of Hauts-de-Seine
Flame of Youth may refer to: Flame of Youth (1949 film), an American drama film Flame of Youth (1920 film), an American silent drama film The Flame of Youth, a 1917 American silent adventure film
Somnology is the scientific study of sleep. It includes clinical study and treatment of sleep disorders and irregularities. Sleep medicine is a subset of somnology. History After the invention of the EEG, the stages of sleep were determined in 1936 by Harvey and Loomis, the first descriptions of delta and theta waves were made by Walter and Dovey, and REM sleep was discovered in 1953. Sleep apnea was identified in 1965. In 1970, the first clinical sleep laboratory was developed at Stanford. The first actigraphy device was made in 1978 by Krupke, and continuous positive airway pressure therapy and uvulopalatopharyngoplasty were created in 1981. The Examination Committee of the Association of Sleep Disorders Centers, which is now the American Academy of Sleep Medicine, was established in 1978 and administered the sleep administration test until 1990. In 1989, the American Board of Sleep Medicine was created to administer the tests and eventually assumed all the duties of the Examination committee in 1991. In the United States, the American Board of Sleep Medicine grants certification for sleep medicine to both physicians and non-physicians. However, the board does not allow one to practice sleep medicine without a medical license. The International Classification of Sleep Disorders Created in 1990 by the American Academy of Sleep Medicine (with assistance from European Sleep Research Society, the Japanese Society of Sleep Research, and the Latin American Sleep Society), the International Classification of Sleep Disorders is the primary reference for scientists and diagnosticians. Sleep disorders are separated into four distinct categories: parasomnias; dyssomnias; sleep disorders associated with mental, neurological, or other medical conditions; and sleep disorders that do not have enough data available to be counted as definitive sleep disorders. The ICSD has created a comprehensive description for each sleep disorder with the following information. Synonyms and Key Words – This section describes the terms and phrases used to describe the disorder and also includes an explanation on the preferred name of the disorder when appropriate. Essential Features – This section describes the main symptoms and features of the disorder. Associated Features – This section describes the features that appear often but not always present. Furthermore, complications that are caused directly by the disorder are listed here. Course – This section describes the clinical course and the outcome of an untreated disorder. Predisposing Factors – This section describes internal and external factors that increase the chances of a patient developing the sleep disorder. Prevalence – This section, if known, describes the proportion of people who have or had this disorder. Age of Onset – This section describes the age range when the clinical features first appear. Sex Ratio – This section describes the relative frequency that the disorder is diagnosed in each sex. Familial Pattern – This section describes whether the disorder is found among family members. Pathology – This section describes the microscopic pathologic features of the disorder. If this is not known, the pathology of the disorder is described instead. Complications – This section describes any possible disorders or complications that can occur because of the disease. Polysomnographic Features – This section describes how the disorder appears under a polysomnograph. Other Laboratory Features - This section describes other laboratory test such as blood tests and brain imaging. Differential Diagnosis – This section describes disorders with similar symptoms. Diagnostic Criteria – This section has the criteria that can make a clear-cut diagnosis. Minimal Criteria – This section is used for general clinical practice and is used to make a provisional diagnosis. Severity Criteria – This section has a three-part classification into “mild,” “moderate,” and “severe” and also describes the criteria for the severity. Duration Criteria – This section allows a clinician to determine how long a disorder has been present and separates the durations into “acute,” “subacute,” and “chronic. Bibliography – This section contains the references. Diagnostic tools Somnologists employ various diagnostic tools to determine the nature of a sleep disorder or irregularity. Some of these tools can be subjective such as the sleep diaries or the sleep questionnaire. Other diagnostic tools are used while the patient is asleep such as the polysomnograph and actigraphy. Sleep diaries A sleep diary is a daily log made by the patient that contains information about the quality and quantity of sleep. The information includes sleep onset time, sleep latency, number of awakenings in a night, time in bed, daytime napping, sleep quality assessment, use of hypnotic agents, use of alcohol and cigarettes, and unusual events which may influence a person's sleep. Such a log is usually made for one or two weeks before visiting a somnologist. The sleep diary may be used in conjunction with actigraphy. Sleep questionnaires Sleep questionnaires help determine the presence of a sleep disorder by asking a patient to fill out a questionnaire about a certain aspect of their sleep such as daytime sleepiness. These questionnaires include the Epworth Sleepiness Scale, the Stanford Sleepiness Scale, and the Sleep Timing Questionnaire. The Epworth Sleepiness Scale measures general sleep propensity and asks the patient to rate their chances of dozing off in eight different situations. The Stanford Sleepiness Scale asks the patient to note their perception of sleepiness by using a seven-point test. The Sleep Timing Questionnaire is a 10-minute self-administration test that can be used in place of a 2-week sleep diary. The questionnaire can be a valid determinate of sleep parameters such as bed time, wake time, sleep latency, and wake after sleep onset. Actigraphy Actigraphy can assess sleep/wake patterns without confining one to the laboratory. The monitors are small, wrist-worn movement monitors that can record activity for up to several weeks. Sleep and wakefulness are determined by using an algorithm that analyzes the movement of the patient and the input of bed and wake times from a sleep diary. Physical examination A physical examination can determine the presence of other medical conditions that can cause a sleep disorder. Polysomnography Polysomnography involves the continuous monitoring of multiple physiological variables during sleep. These variables include electroencephalography, electrooculography, electromyography, and electrocardiography as well as airflow, oxygenation, and ventilation measurements. Electroencephalography measures the voltage activity of neuronal somas and dendrites within the cortex, electro-oculography measures the potential between cornea and retina, electromyography is used to identify REM sleep by measuring the electrical potential of skeletal muscle, and electrocardiography measures cardiac rate and rhythm. It is important to point out that EEG, in particular, always refers to a collective of neurons firing as EEG equipment is not sensitive enough to measure a single neuron. Airflow measurements Airflow measurement can be used to indirectly determine the presence of an apnea; measurements are taken by pneumotachography, nasal pressure, thermal sensors, and expired carbon dioxide. Pneumotachography measures the difference in pressure between inhalation and exhalation, nasal pressure can help determine the presence of airflow similar to pneumotachography, thermal sensors detect the difference in temperature between inhaled and exhaled air, and expired carbon dioxide monitoring detect the difference in carbon dioxide between inhaled and exhaled air. Oxygenation and ventilation measurements The monitoring of oxygenation and ventilation is important in the assessment of sleep-related breathing disorders. However, because oxygen values can change often during the course of sleep, repeated measurements must be taken to ensure accuracy. The direct measurements of arterial oxygen tension only offer a static glimpse, and repeated measurements from invasive procedures such as sampling arterial blood for oxygen will disturb the patient's sleep; therefore, noninvasive methods are preferred such as pulse oximetry, transcutaneous oxygen monitoring, transcutaneous carbon dioxide, and pulse transit time. Pulse oximetry measures the oxygenation in peripheral capillaries (such as the fingers); however, an article written by Bohning states that pulse oximetry may be imprecise for use in diagnosing obstructive sleep-apnea, due to the differences in signal processing in the devices. Transcutaneous oxygen and carbon dioxide monitoring measure the oxygen and carbon dioxide tension on the skin surface respectively, and the pulse transit time measures the transmission time of an arterial pulse transit wave. For the lattermost, pulse transit time increases when one is aroused from sleep, making it useful in determining sleep apnea. Snoring Snoring can be detected by a microphone and may be a symptom of obstructive sleep-apnea. Multiple Sleep Latency Test The Multiple Sleep Latency Test (MSLT) measures a person's physiological tendency to fall asleep during a quiet period in terms of sleep latency, the amount of time it takes for someone. An MSLT is normally performed after a nocturnal polysomnography to ensure both an adequate duration of sleep and to exclude other sleep disorders. Maintenance of Wakefulness Test The Maintenance of Wakefulness Test (MWT) measures a person's ability to stay awake for a certain period of time, essentially measuring the time one can stay awake during the day. The test isolates a person from factors that can influence sleep such as temperature, light, and noise. Furthermore, the patient is also highly suggested to not take any hypnotics, drink alcohol, or smoke before or during the test. After allowing the patient to lie down on the bed, the time between lying down and falling asleep is measured and used to determine one's daytime sleepiness. Treatments Though somnology does not necessarily mean sleep medicine, somnologists can use behavioral, mechanical, or pharmacological means to correct a sleep disorder. Behavioral treatments Behavioral treatments tend to be the most prescribed and the most cost-efficient of all treatments; these treatments include exercise, cognitive behavioral therapy, relaxation therapy, meditation, and improving sleep hygiene. Improving sleep hygiene includes making the patient sleep regularly, discourage the patient from taking daytime naps, or suggesting they sleep in a different position. Mechanical treatments Mechanical treatments are primarily used to reduce or eliminate snoring and can be either invasive or non-invasive. Surgical procedures for treating snoring include palatal stiffening techniques, uvulopalatopharyngoplasty and uvulectomy while non-invasive procedures include continuous positive airway pressure, mandibular advancement splints, and tongue-retaining devices. Pharmacological treatments Pharmacological treatments are used to chemically treat sleep disturbances such as insomnia or excessive daytime sleepiness. The kinds of drugs used to treat sleep disorders include: anticonvulsants, anti-narcoleptics, anti-Parkinsonian drugs, benzodiazepines, non-benzodiazepine hypnotics, and opiates as well as the hormone melatonin and melatonin receptor agonists. Anticonvulsants, opioids, and anti-Parkinsonian drugs are often used to treat restless legs syndrome. Furthermore, melatonin, benzodiazepines hypnotics, and non-benzodiazepine hypnotics may be used to treat insomnia. Finally, anti-narcoleptics help treat narcolepsy and excessive daytime sleepiness. Of particular interest are the benzodiazepine drugs which reduce insomnia by increasing the efficiency of GABA. GABA decreases the excitability of neurons by increasing the firing threshold. Benzodiazepine causes the GABA receptor to better bind to GABA, allowing the medication to induce sleep. Generally, these treatments are given after the behavioral treatment has failed. Drugs such as tranquilizers, though they may work well in treating insomnia, have a risk of abuse which is why these treatments are not the first resort. Some sleep disorders such as narcolepsy do require pharmacological treatment. See also Sleep disorder Sleep medicine Snoring References External links Sleep disorders sv:Somnologi
Adrienne Clostre (9 October 1921 – 5 August 2006) was a French composer. She was born in Thomery, Seine-et-Marne, and studied at the Conservatoire de Paris with Yves Nat, Darius Milhaud, Jean Rivier and Olivier Messiaen. After completing her studies, Clostre worked as a composer. She won the Grand Prix de Rome in 1949, the Grand Music Prize of the City of Paris in 1955, the Florence Gould Prize in 1976 and the SACD Prix Musique in 1987. Clostre married architect Robert Biset in 1951 and had two daughters. She died in Serrières. Works Selected works include: Le chant du cygne Lux mundi, children's orch, 1985 Modal Magic, 1986 Symphony for Strings, 1949 Concerto for oboe and chamber orchestra References 1921 births 2006 deaths 20th-century classical composers French classical composers French women classical composers People from Seine-et-Marne Conservatoire de Paris alumni Prix de Rome for composition Pupils of Darius Milhaud 20th-century women composers 20th-century French women
On June 28, 2018, a mass shooting occurred at the offices of The Capital, a newspaper serving Annapolis, Maryland, United States. The gunman, Jarrod Ramos, killed five employees with a shotgun and injured two others who were trying to escape. Ramos was arrested shortly thereafter. He pleaded guilty but not criminally responsible to 23 charges; in July 2021, a jury found him criminally responsible. The Capital had published an article in 2011 about Ramos being put on probation for harassing an acquaintance from high school through social media and email. Ramos, angered by the article, brought a defamation lawsuit against the newspaper but a judge later dismissed the suit. Ramos is alleged to have sent enraged letters and messages to The Capital threatening to attack its newsroom and staff, but no legal action was taken after the threats were received. Capital Gazette Communications, owned by Tribune Publishing through its subsidiary the Baltimore Sun Media Group, publishes the daily newspapers The Capital and the Maryland Gazette and the weekly Crofton-West County Gazette. At the time of the shooting, its offices were located at 888 Bestgate Road in Parole, an unincorporated area of Anne Arundel County just outside Annapolis. Incident Around 2:34 pm (EDT), the Anne Arundel County Police Department reported that a shooting began, resulting in five fatalities and the wounding of several other victims. Before the shooting, the gunman had barricaded the rear exit of the office to prevent people from escaping. Sources reported that the weapon was a "long gun" which would later be identified as a 12-gauge Mossberg 500 pump-action shotgun. Police later said that the long gun had been purchased legally some time within the eighteen months prior to the shooting. The gunman used the weapon to fire repeatedly after shooting out the office's glass door. Phil Davis, a courts and crime reporter at the site of the shooting for The Capital, tweeted that the gunman "shot through the glass door to the office and opened fire on multiple employees". Davis also described the newspapers' offices as a "war zone" after the shooting and described hearing the gunman reload. He said the male gunman was alone. During a pause in the shooting, survivors moved to take refuge between filing cabinets; Wendi Winters confronted the gunman, causing the pause. Winters charged the gunman with a trash can and recycling bin, screaming at him, distracting him long enough for survivors to escape before she was shot. Several injured victims were sent to the Anne Arundel Medical Center for treatment. County police evacuated 170 people from the building to a reunification center set up at the nearby Westfield Annapolis shopping center. The police reportedly had a one-minute response time, and interviewed survivors in the criminal investigations unit of the Anne Arundel County Police Department. The police discovered the suspect underneath a desk in the office, and surveillance within the office documented the incident and helped identify Ramos as the perpetrator. An indictment was handed up on July 20, 2018, included five counts of first-degree murder, one count of attempted first-degree murder, six counts of first-degree assault, and 11 counts of the use of a firearm in the commission of a felony. Victims Five people were killed and two others were injured in the attack. Those killed were: Gerald Fischman, age 61, columnist and editorial page editor for The Capital Rob Hiaasen, age 59, assistant editor and weekend columnist for The Capital John McNamara, age 56, sports reporter for The Capital and editor and primary reporter for The Bowie Blade-News Rebecca Smith, age 34, sales assistant who had just started working for Capital Gazette Communications Wendi Winters, age 65, community beat reporter and special publication editor for The Capital According to the Committee to Protect Journalists, the Capital Gazette shooting was one of two incidents in which multiple journalists were killed in the United States since the organization began compiling data in 1992. The other incident was the murders of Alison Parker and Adam Ward during a live television interview in 2015. Perpetrator Jarrod Warren Ramos (born December 21, 1979) was captured by police and taken into custody as a suspect, but refused to identify himself. Early reports said that the gunman mutilated his fingertips to avoid identification, but a law-enforcement official later stated that an issue with the fingerprint machine had caused the difficulties in identifying the suspect, and that his fingertips had not been mutilated. The suspect was also carrying a backpack with smoke bombs, flashbang devices, and grenades. The police later announced that the attack had been targeted specifically at Capital Gazette Communications. In a court filing, Ramos stated he had seen five mental health professionals for at least 75 visits before the shooting, and exhibited a pattern of threats. Many of those around Ramos believed him to be a calculated, manipulative loner, who would become angry when things did not go his way, with those afflicted by him convinced he would one day hurt someone. None of Ramos's immediate family responded to requests for comment and other relatives have stated that they have not had contact with him for several years. Previous dispute with newspaper In 2012, Ramos sued The Capital in a defamation case he brought over a 2011 newspaper article reporting on his guilty plea for criminal harassment. After multiple appeals from Ramos, the defamation case against the newspaper was dismissed in 2015 by Prince George's County circuit court judge Maureen M. Lamasney, who ruled in favor of the paper because their reporting was based on publicly available records and Ramos had produced no evidence that the article was inaccurate. Lamasney wrote in her court opinion that Ramos's complaint was "a fundamental failure to understand what defamation law is, and more particularly, what defamation law is not". Former Capital editor and publisher Thomas Marquardt said Ramos began harassing the staff of the newspaper after the article on him was published in 2011. In 2013, Marquardt contacted the Anne Arundel County Police Department about Ramos's behavior, but the department did not pursue the report. Marquardt also consulted the newspaper's attorneys about filing a restraining order against Ramos, and recalled telling them, "This is a guy who is going to come in and shoot us". After his lawsuit against the newspaper was dismissed, Ramos opened a Twitter account, which he used to attack the newspaper and taunt its owners and staff. A former FBI senior profiler speculated that Ramos was "an injustice collector", whom she described as "someone who goes through life ... collect[ing] injustices, real or imagined". Ramos reportedly previously sent threatening letters to the newspaper's former attorney, to the Maryland Court of Special Appeals, and to Charles Moylan Jr., the appellate judge who had ruled against Ramos in his defamation case. Other lawsuits Ramos's use of the justice system as a form of attempting to get his way was seen in at least two other cases. When he was dismissed from his job at the Bureau of Labor Statistics, over "suitability concerns", he sued the agency and won the case, yet was still dismissed from the agency. In 2009, a former classmate took out peace orders (used to prevent contact between people), followed by criminal harassment charges, which he lost. In an affidavit, the harassment victim wrote, "I am physically afraid of Mr. Ramos, and that he may cause me serious physical injury and/or death". June 28, 2018, letters On Thursday, June 28, police reported that Ramos sent letters to three people who had been involved in his defamation lawsuit, with a packet being received by The Capital former attorney that included a letter addressed to Judge Moylan, who wrote the opinion upholding the dismissal of his defamation case. In it, he wrote, "Welcome, Mr. Moylan, to your unexpected legacy: YOU should have died ... Friends forever, Jarrod W. Ramos". The letter continues; "I further certify I then did proceed to the office of respondent Capital-Gazette Communications ... with the objective of killing every person present". One of the letters thought to have been written by the suspect was published by other news sources. Guilty plea and trial Jarrod W. Ramos was indicted on 23 counts by Anne Arundel County prosecutors in July 2018. Ramos was charged with five counts of first-degree murder; one count of attempted first-degree murder, for shooting at photographer Paul Gillespie; six counts of first-degree assault related to the attacks on Gillespie, staff writers Selene San Felice, Phil Davis, and Rachael Pacella, reporting intern Anthony Messenger, and sales associate Janel Cooley; and 11 counts of using a firearm in the commission of a felony or violent crime. He was ordered to be held without bail after he was determined to be a flight risk and a danger to the community, and was placed on suicide watch while in custody of law enforcement. On August 20, 2018, Ramos pleaded not guilty to all charges. On April 29, 2019, Ramos entered a plea of not guilty and not criminally responsible, and the judge ordered that he be evaluated by the Department of Health and Mental Hygiene. At a pretrial hearing held on October 21, 2019, the judge ruled that based on the Health Department's report, Ramos is legally sane and can be held criminally responsible for his actions and his pending trial should proceed. The following week, Ramos pleaded guilty but not responsible by reason of insanity to all 23 counts. Since he pleaded not criminally responsible, the remaining legal issue was whether Ramos is legally responsible for the multiple murders. A trial date was delayed several times due to the large quantity of evidence, the COVID-19 pandemic, and the reassignment of a judge. At a two-week trial, six survivors of the shooting gave evidence, and expert witnesses on both sides also gave testimony. Expert witnesses for the defense determined that Ramos had autism spectrum disorder, obsessive-compulsive disorder, delusional disorder and narcissistic personality disorder; expert witnesses for the prosecution determined that Ramos had schizotypal personality disorder and narcissistic personality disorder with obsessive compulsive personality traits but found no signs of autism and had a fairly normal childhood. A neuropsychologist questioned the diagnosis of autism testifying that they did not adequately test him and did not have all the information from relatives to determine autism. Psychologist Marshall Cowan also disagreed with his autism diagnosis, stating that the absence of medical and academic records makes it unlikely Ramos has autism. They also found that his behaviors were inconsistent with obsessive-compulsive disorder, with the OCD symptoms Ramos reported having been contradicted by correctional officers and did not have delusional disorder or psychotic disorders. They testified that he was sane at the time of the killings. A court-appointed forensic psychiatrist, Dr. Sameer Patel, testified that Ramos suffered a "severe narcissistic injury" from the Capital Gazette article about his harassment allegations in 2011 and was motivated by a fixation on revenge; that Ramos had expressed regret that he had been unable to kill everyone in the newsroom and the state's attorney; and that Ramos had carefully planned the attack on the newspaper's office after determining that a courthouse, his initial target, was too secure. In July 2021, the jury found Ramos criminally responsible, rejecting Ramos's insanity defense and determining that he committed the killings while mentally competent and capable of conforming his actions to the law. On September 28, 2021, Ramos was sentenced to five life terms plus 345 years in prison. Reactions Law enforcement in other locations Police were also sent to the offices of The Baltimore Sun, which owns Capital Gazette Communications, as a precaution, although no threat was registered there. The New York City Police Department also deployed counter-terrorism units to the headquarters of major news outlets in New York City as a precaution against similar attacks. The Chicago Police Department took similar actions. Political President Donald Trump was briefed on the shooting and offered his thoughts and prayers by tweet. He later declined to lower US flags to half-staff, as is custom for mass shootings, despite requests from Annapolis mayor Gavin Buckley and the lowering of Maryland flags by the Governor of Maryland, Larry Hogan. On July 3, the White House was reported to have permitted the lowering of the US flags on federal buildings for the day, with the President then issuing a proclamation for the flags to be lowered nationwide until sunset on July 3. Some commentators have called the shooting an attack on the media, and framed it alongside comments by Trump that the "fake news media" (The New York Times, The Washington Post, ABC, CBS, CNN, NBC News) are the "enemy of the people". A Reuters journalist apologized for his comments blaming Trump. Reuters said it did not condone his behavior. The Sunday after the shooting, the staff of the Capital Gazette wrote: "We won't forget being called an enemy of the people". Days before, right-wing commentator Milo Yiannopoulos wrote that he "can't wait for vigilante squads to start gunning journalists down on sight" in text messages to reporters. After the shooting, Yiannopoulos said the texts were just a joke. On Reason.com, Elizabeth Nolan Brown criticized the media response to the shooting, pointing out that "[Ramos'] motive doesn't seem related to any of the political agendas offered up in the immediate aftermath by hacks and provocateurs", and that the shooter's anger against the newspaper derived from a personal grudge rather than political motivations. Similarly, the Franklin Daily Journal wrote "the shooting had nothing to do with Trump or his ongoing battle with the press ... the crisis in Maryland allowed people to criticize political opponents who had nothing to do with the actual events". Governor Hogan tweeted that he was "[a]bsolutely devastated to learn of this tragedy in Annapolis", and asked residents to "heed all warnings and stay away from the area". In a press conference, he praised local law enforcement for responding within 60 seconds. In March and April 2019, the Maryland General Assembly voted unanimously to designate June 28 "Freedom of the Press Day" in honor of the victims. Journalism After the shooting, Justin Dearborn, the chairman and CEO of Tronc, said: "We are focused now on providing our employees and their families with support during this tragic time. We commend the police and first responders for their quick response". The owner of the Capital Gazette created a fund for the families, victims, and survivors of the shooting, in addition to a scholarship memorial fund for journalism students. A separate GoFundMe fundraiser, created by a Bloomberg Government reporter, hit the initial target and grew to almost $200,000 by July 1, 2019. Reporters for The Capital and Gazette began coverage of the shooting as it happened, from the newsroom and while returning from the field. Despite the shooting, journalists and staff at The Capital insisted on putting out the next edition of their paper only hours after the fatal shootings. The edition's opinion page was left blank to commemorate the victims, with the exception of a small note stating that the staff members "are speechless". The Capital published an editorial on July 1, 2018, signed by its entire staff of reporters and editors, thanking the citizens of Annapolis and Anne Arundel County for their support following the shooting. In December 2018, the staff of Capital Gazette Communications was selected as a recipient of Time's Person of the Year 2018, as one of "The Guardians", a collection of journalists from around the world in their fight against the "War on Truth". On April 2, 2019, the News Leaders Association selected the staff of the Capital Gazette and The Baltimore Sun as the winners of the Al Neuharth Breaking News Reporting Award for their coverage of the shootings. The Capital Gazette staff were also named as finalists for the Burl Osborne Award for Editorial Leadership – Small, and the Visual Journalism Award – Small. The Capital was awarded a Pulitzer Prize Special Citation on April 15, 2019, to "honor the journalists, staff and editorial board of the Capital Gazette, Annapolis, Maryland, for their courageous response to the largest killing of journalists in U.S. history in their newsroom on June 28, 2018, and for demonstrating unflagging commitment to covering the news and serving their community at a time of unspeakable grief". The citation also included a $100,000 bequest "to further the newspaper's journalistic mission", and the editorial staff were named as finalists for the Pulitzer Prize in Editorial Writing. Vigils and memorials Colleagues, friends, and family members of the deceased victims held a candlelit vigil on the streets of Annapolis on June 29, to honor the deceased. Capital Gazette reporter Phil Davis read the names of the deceased, and told the crowds that they were here "to honor who (the victims) were and what their families did not have to go through". Annapolis mayor Gavin Buckley announced that the city planned to hold a summer music festival that will act as a celebration of the freedom of the press and as a memorial for the journalists who were killed. The concert was held on July 28, 2018, under the title Annapolis Rising: A Benefit for The Capital Gazette and Free Press. The event featured performances by the rock bands Good Charlotte and Less Than Jake, a presentation by comedian Jordan Klepper, and a speech by Washington Post editor-in-chief Martin Baron. Proceeds from this event will be used to benefit a fund established for the victims and survivors, as well as journalism scholarships. In July 2018, the equipment manager of the Washington Capitals, the 2018 Stanley Cup champions, brought the Stanley Cup to the Capital Gazette's temporary office to boost the employees' morale. In December 2020, Wendi Winters, who rushed the shooter and was credited with saving the lives of her colleagues by allowing them time to escape, was posthumously awarded the Carnegie Medal by the Carnegie Hero Fund Commission. Physical memorial sites Nearly one year after the shooting, Tribune Publishing Chairman David Dreier established the Fallen Journalists Memorial Foundation (FJM Foundation), which aims to construct a memorial in Washington, D.C. to honor journalists who have died in pursuit of the truth. Congress unanimously passed the Fallen Journalists Memorial Act in December 2020. In the same month, President Donald Trump signed the act into law, authorizing the FJM Foundation to establish a commemorative work honoring fallen journalists. A memorial to the five murdered Capital Gazette staffers, entitled Guardians of the First Amendment, was unveiled in Newman Park in Annapolis on June 28, 2021, the third anniversary of the shooting. It consists of five pillars and a stone with an engraving of the text of the First Amendment. See also Charlie Hebdo shooting Aberdeen, Maryland shooting Mass shootings in the United States List of journalists killed in the United States Fallen Journalists Memorial Foundation References External links Jarrod W. Ramos v. Eric Thomas Hartley, et al. Unreported in the Court of Special Appeals of Maryland, No. 2281, September Term, 2013 NPR Podcast episode 1: Capital Gazette: "A Damn Paper" NPR Podcast episode 2: Capital Gazette: "It's OK That We're Alive" NPR Podcast episode 3: Capital Gazette: "I Know He Did It" NPR Podcast episode 4: Capital Gazette: "We Are The Newsroom" Five years after the Capital Gazette murders, we’ve scattered. Remembering brings us together. 2018 in Maryland 2018 mass shootings in the United States Annapolis, Maryland Attacks on buildings and structures in the United States Attacks in the United States in 2018 Deaths by firearm in Maryland Journalists killed in the United States June 2018 crimes in the United States Mass shootings in Maryland Mass shootings in the United States Tribune Publishing Workplace violence in the United States Attacks on mass media offices
Ponnani Lighthouse is situated in Ponnani, Malappuram district, Kerala on the south bank of the Bharathappuzha river. It was commissioned on 17 April 1983. The tower has a circular cross-section and a height of 30 meters. The light source is a metal halide lamp. The lighthouse has direct drive facility. The Ponnani port is located on the estuary of River Bharathappuzha (the longest river of Kerala) and Tirur River. A flag staff used to assist the craft to negotiate the entrance to the port prior to a steel mast with an oil wick being hoisted in 1937. In 1948 a steel trestle was with a gas flasher was installed. After the present tower was constructed in 1983, the light source was replaced on 23 July 1995. See also Ports in Kerala List of lighthouses in India References External links Directorate General of Lighthouses and Lightships Remaining Date for Ponnani Municipality Election 2020 Lighthouses in Kerala Buildings and structures in Malappuram district Transport in Malappuram district Lighthouses completed in 1983 1983 establishments in Kerala
Thomas Mostyn may refer to: Sir Thomas Mostyn, 2nd Baronet (1651–1692), one of the Mostyn baronets Thomas Mostyn (sea captain) (fl. 1695–1697), sea captain and slave trader Sir Thomas Mostyn, 4th Baronet (1704–1758), British landowner and politician Sir Thomas Mostyn, 6th Baronet (1776–1831), Welsh politician Thomas Lloyd-Mostyn (1830–1861), British politician
C. O. Bigelow Apothecaries is an American pharmacy and beauty brand currently owned and operated by Ian Ginsberg. C. O. Bigelow was founded, as The Village Apothecary Shop, by Dr. Galen Hunter in 1838 in New York's Greenwich Village and is the oldest surviving apothecary–pharmacy in the United States. In the late 1800's, the pharmacy was purchased by Clarence Otis Bigelow, who renamed the store after himself. He subsequently built the Bigelow Building at 414 Sixth Avenue, and in 1902 the pharmacy moved into the new location where it has remained ever since. During the Great Depression, the store had become run-down, and it was sold to William B. Ginsberg, an Eastern-European immigrant who came to New York and earned his Doctorate of Pharmacy from Columbia University. The Ginsberg family has owned and operated the apothecary since 1939, passing from William, to his son Jerry Ginsberg, and eventually to his son Ian Ginsberg. Alec Ginsberg, Ian's son and fourth generation pharmacist, currently serves as the company's Chief Operating Officer after joining full-time in 2016. Limited Brands had an agreement to open and operate other stores bearing the Bigelow name, which were operated as upscale beauty and skin care stores to compete with other stores such as Sephora and Neiman Marcus. However, all of these stores were closed, leaving only the original shop. Certain products from the line are sold in Bath and Body Works stores throughout the United States, as well as many other retail stores worldwide. Due to its longevity and popularity, C. O. Bigelow was honored with a Village Award from the Greenwich Village Society for Historic Preservation in 2002. History Dr. Galen Hunter, a Vermont native, established The Village Apothecary Shop in 1838, although he did not operate the store himself. His employee, Clarence Otis Bigelow, purchased the business in 1880, eight years after Hunter's death, and renamed it C. O. Bigelow Apothecaries. He also moved the business two doors north, to a new home at 106–108 Sixth Avenue (today number 414, after the street's renumbering in 1929). In 1939, William Ginsberg became the owner. Since then, it has been passed down through the Ginsberg family, and as of 2023 it is in the hands of Ian, grandson of William. Stores There was formerly a chain of stores; however, the only store still operating is the original Sixth Avenue store in Greenwich Village. Its chandeliers, though now electrified, still have their gas fittings. During the extensive blackouts on the East Coast in 1965 and 1977, Bigelow's was the only pharmacy between Maine and the Carolinas with enough light to remain open for business. All of the other stores have closed. The Easton Town Center store in Columbus, Ohio, closed its doors in February 2012. Several stores closed in 2009: Northshore Mall in Peabody, Massachusetts, closed June 28, 2009; Westfield Garden State Plaza in Paramus, New Jersey, closed September 4, 2009; and Plaza at King of Prussia in King of Prussia, Pennsylvania/Upper Merion Township, Pennsylvania, closed July 1, 2009. Other closed stores were located in Copley Place in Boston, Westfield Hawthorn Center in Vernon Hills, Illinois, and Water Tower Place in Chicago, which closed in 2010. The location at Woodfield Mall in Schaumburg, Illinois, closed on August 18, 2012. A C. O. Bigelow store was to be built in Tysons Corner Center in Tysons Corner, Virginia, but the scheduled construction was canceled. Advertising Famous patrons of C. O. Bigelow (as featured in advertisements) include Thomas Edison, Eleanor Roosevelt, and Mark Twain. Twain lived around the corner, at 21 Fifth Avenue. References External links BigelowChemists.com Companies based in New York City
Marcus Taylor Paige (; born September 11, 1993) is an American-Serbian professional basketball coach and former player. He played college basketball for the University of North Carolina, where he helped lead the Tar Heels to the 2016 NCAA championship game, and now serves in a support staff role at his alma mater. In addition to being a citizen of the United States, Paige also has Serbian citizenship. High school career Paige was rated as the number 22 overall player (and the best point guard) in the class of 2012 in the ESPNU 100, the number 35 player by Scout.com, and the number 34 player by Rivals.com. In his junior year, Paige led Linn-Mar High School to an undefeated season and the 2011 4-A state title. Considered by scouts to be an excellent ball handler with shooting range to the three-point line, Paige also played on the AAU circuit with Martin Brothers Select. On January 8, 2011, Paige verbally committed to play college basketball for North Carolina, turning down scholarship offers from Iowa State, Kansas, Minnesota, Virginia, Illinois, and Iowa. In his senior season, Paige was the leader of his Linn-Mar team, as he averaged over 28 points per game. He also recorded the most single-game points total in school history with 49 against Cedar Rapids Kennedy in Substate. Paige's high school career ended when Linn-Mar was defeated by Iowa City West in the state semi-finals. College recruitment |} College career Freshman season During his freshman season at North Carolina, Paige averaged 8.6 points and 4.6 assists per game and started 34 of 36 games for the Tar Heels. Throughout the season, his assist-to-turnover ratio was 1.8:1, which was sixth best in the Atlantic Coast Conference. His season high for points in a game was against Virginia Tech, with 19, and a season high for assists against Notre Dame with 10. Paige led the Tar Heels to the round of thirty-two where they eventually lost to the Kansas Jayhawks 70–58. At season's end, he was elected to both the ACC All-Academic Team and the Freshman All-American team. Sophomore season Paige improved his statistics from his freshman season. During his sophomore season, he averaged 17.5 points per game and 4.2 assists per game. Throughout the season, he shot 44% from the field, 39% from three-point range, and 87.7% from the free throw line. His points-per-game average was fourth in the ACC, and his free throw percentage was the highest in the entire conference. Paige led the Tar Heels to the NCAA tournament, where for a second year in a row, they lost in the round of thirty-two, this time against Iowa State 85–83. He was named second-team All-American, first-team All-ACC, and was awarded the ACC's Most Improved Player. Junior season Paige finished his junior season averaging 14.1 points and 4.5 assists per game. After a stellar sophomore season, Paige had a dip in offensive production. He managed to shoot 39.5% from three-point range while shooting only 41.3% from the field. For the season, Paige fell only one three-pointer short of tying Shammond Williams's record for most three-pointers made in a single season (which is now held by Justin Jackson at 101). Paige earned himself second-team Academic All-American honors for the second consecutive year, as he managed to also earn second-team All-ACC honors. His statistical drops are in part credited to a case of plantar fasciitis that Paige was fighting all year long. Senior season Paige was named preseason ACC player of the year. Early in the season, he was widely regarded to have been in a shooting slump. He broke the UNC record for the most career three-pointers made (299). However, he recovered late in the season and helped the Tar Heels win the 2016 ACC tournament and lead them to the 2016 NCAA championship game, where they faced Villanova. In the game, Paige scored 21 points and hit a game-tying circus three-pointer with 4.7 seconds left in the second half of regulation. However, Villanova's Kris Jenkins went on to score a buzzer beater to win the game 77–74. Professional career Salt Lake City Stars (2016–2017) On June 23, 2016, Paige was selected by the Brooklyn Nets with the 55th overall pick in the 2016 NBA draft. He was later traded to the Utah Jazz the following day. He signed with the Jazz on August 22, 2016, but was waived on October 13. On October 31, he was acquired by the Salt Lake City Stars of the NBA Development League. Paige appeared in 46 games and started 40 for the Salt Lake City Stars in the 2016–17 NBA Development league season. His season averages were 12.1 points, 2.1 rebounds, 2.2 assists in 32.7 minutes per game. Paige joined the Minnesota Timberwolves for the 2017 NBA Summer League in Las Vegas. Charlotte Hornets (2017–2018) On August 1, 2017, Paige signed a two-way contract by the Charlotte Hornets. Under the terms of the deal, he and fellow two-way affiliate Mangok Mathiang split time between the Hornets and their G League affiliate, the Greensboro Swarm. Paige averaged 15.2 points, 3.0 rebounds, and 4.5 assists per game in 46 games with Greensboro. On June 29, 2018, the Hornets announced that they would decline a qualifying offer to Paige, making him a free agent. Partizan Belgrade (2018–2021) On July 11, 2018, Paige signed a two-year contract with the Serbian club Partizan Belgrade of the ABA League. On February 12, 2019, Paige obtained a Serbian passport and Serbian citizenship. He signed a two-year deal on May 9, 2020. On May 9, 2020, Paige signed a second two-year contract after helping the club to both the Serbian Cup and ABA League Supercup in 2019 and a second Serbian Cup in 2020. Partizan parted ways with him in August 2021. Orléans Loiret (2021–2022) On September 16, 2021, Paige signed with French club Orléans Loiret Basket of the LNB Pro A. Monbus Obradoiro (2022–2023) On July 17, 2022, Paige signed with Spanish club Monbus Obradoiro od the Liga ACB. Coaching career Return to North Carolina (2023–present) On April 26, 2023, Paige agreed to join coach Hubert Davis's UNC coaching staff as director of team and player development. Paige fills a role vacated by another former Tar Heel in Jackie Manuel, who left his alma mater to take an on-the-bench coaching position at American University. Paige's hiring was officially announced by the school in June. Career statistics College |- | style="text-align:left;"| 2012–13 | style="text-align:left;"| North Carolina | 35 || 34 || 29.2 || .356 || .344 || .836 || 2.7 || 4.6 || 1.4 || .1 || 8.2 |- | style="text-align:left;"| 2013–14 | style="text-align:left;"| North Carolina | 34 || 33 || 35.6 || .440 || .389 || .877 || 3.2 || 4.2 || 1.5 || .2 || 17.5 |- | style="text-align:left;"| 2014–15 | style="text-align:left;"| North Carolina | 38 || 38 || 33.2 || .413 || .395 || .865 || 2.9 || 4.5 || 1.7 || .2 || 14.1 |- | style="text-align:left;"| 2015–16 | style="text-align:left;"| North Carolina | 34 || 34 || 31.6 || .397 || .355 || .796 || 2.5 || 3.7 || 1.1 || .4 || 13.4 |- class="sortbottom" | style="text-align:center;" colspan="2"| Career | 141 || 139 || 32.4 || .407 || .374 || .848 || 2.8 || 4.3 || 1.4 || .2 || 13.3 Source: sports-reference.com Professional career |- | style="text-align:center;"| | style="text-align:left|Salt Lake City Stars | NBA D-League | 46 || 32.7 || .398 || .354 || .837 || 2.2 || 2.3 || .9 || .3 || 12.1 |- | style="text-align:center;"| | style="text-align:left;"|Greensboro Swarm | NBA G League | 46 || 32.6 || .428 || .373 || .847 || 3.0 || 4.4 || 1.4 || .2 || 15.2 |- | style="text-align:center;"| | style="text-align:left;"| Charlotte Hornets | NBA | 5 || 5.6 || .286 || .250 || 1.000 || .8 || .6 || .0 || .0 || 2.4 |- | style="text-align:center;"|2018–19 | style="text-align:left;"|Partizan | ABA League | 60 || 24.2 || .405 || .375 || .792 || 2.4 || 3.7 || 1.1 || .3 || 10.2 |- | style="text-align:center;"|2019–20 | style="text-align:left;"|Partizan | ABA League | 42 || 22.3 || .461 || .462 || .857 || 1.5 || 1.9 || .8 || .3 || 9.9 |- | style="text-align:center;"|2020–21 | style="text-align:left;"|Partizan | ABA League | 43 || 25.8 || .424 || .422 || .767 || 1.3 || 2.4 || .9 || .3 || 8.9 |- | style="text-align:center;"|2021–22 | style="text-align:left;"|Orléans Loiret Basket | LNB Pro A | 27 || 29.9 || .454 || .423 || .860 || 1.8 || 3.4 || 1.1 || .2 || 9.9 |- | style="text-align:center;"|2022–23 | style="text-align:left;"|Monbus Obradoiro | ACB | 6 || 18.6 || .294 || .235 || .857 || .5 || 1.7 || .8 || .0 || 5.0 |- References External links ABA League profile North Carolina Tar Heels bio 1993 births Living people 21st-century African-American sportspeople ABA League players African-American basketball players All-American college men's basketball players American emigrants to Serbia American expatriate basketball people in France American expatriate basketball people in Serbia American expatriate basketball people in Spain American men's basketball players Basketball League of Serbia players Basketball players from Iowa Brooklyn Nets draft picks Charlotte Hornets players Greensboro Swarm players KK Partizan players Linn-Mar High School alumni McDonald's High School All-Americans Naturalized citizens of Serbia North Carolina Tar Heels men's basketball players Obradoiro CAB players Orléans Loiret Basket players Parade High School All-Americans (boys' basketball) People from Marion, Iowa Point guards Salt Lake City Stars players Serbian men's basketball players Serbian people of African-American descent Sportspeople from Cedar Rapids, Iowa
Portraits is the seventh album by R&B group Side Effect. Released in 1981, this was their second album for Elektra Records. Track listing I Can't Play (Miki Howard) 3:33 Do It 4:16 Make You Mine 4:14 I Need Your Lovin' 3:52 Midnight Lover (Miki Howard) 4:46 It's Got To Be Love 3:54 Reggae Dancin' 4:58 If You Believe 2:47 The Loneliest Man In Town 4:05 The Lord's Prayer 1:51 Charts Singles References External links Side Effect-Portraits at Discogs 1981 albums Elektra Records albums Side Effect albums Albums recorded at Total Experience Recording Studios
Lorenzo Stovini (born 24 November 1976) is a former Italian footballer who played as a defender. Career He made his Serie A debut on 31 August 1997 playing for Vicenza against Sampdoria in Stadio Luigi Ferraris (3–1). In the past, he was also Lecce captain. Calcio Catania Since he joined Calcio Catania, he is currently competing in the Italian Serie A. Since joining the Sicilian side from US Lecce, Stovini has been a big part of the club's first team. He was an influential part of there Serie A survival in the center of defence, along with Christian Terlizzi, during the 2006–07 Serie A campaign as well as the 2007–08 Serie A season. Empoli On 4 November 2009, he signed with Serie B team Empoli. External links Italian men's footballers AS Roma players LR Vicenza players LFA Reggio Calabria players US Lecce players Empoli FC players Catania FC players Brescia Calcio players Serie A players Serie B players Men's association football defenders Footballers from Florence 1976 births Living people
Safi Asfia (; 1916–2008) was an Iranian mining engineer, technocrat and politician who held several cabinet posts during the reign of Shah Mohammad Reza Pahlavi. He was arrested in 1979 when an Islamic revolution took place in Iran and was imprisoned for five years. Following his release Asfia did not leave Iran and involved in computer programming. Early life and education Asfia was born in Tehran in 1916. Following his graduation from high school he was sent by the state to France for higher education in 1932. He attended Ecole Polytechnique of Paris in 1934 and Mines Paris - PSL in 1936. Career Following his graduation Asfia joined the University of Tehran where he taught mathematics and geology. At age 23 he was promoted to the professorship. In 1955 he began to work as an adviser at the Planning Organization and became its director in 1961. When he was in office he extensively dealt with the Iran's early nuclear program. Asfia was appointed deputy prime minister in 1966. He also served as the director of Planning Organization until 1969 when he was replaced by Mehdi Samii in the post. Asfia continued to serve in different cabinet posts until 1979 when the Shah was removed from power. He also served as a board member of the royal organization of social welfare headed by Ashraf Pahlavi. Later years Asfia was arrested during the regime change in 1979 and was imprisoned for five years. He began to deal with computer programming after he was freed and joined the Zirakzadeh Science Foundation as one of its board members. The foundation was established by Ahmad Zirakzadeh, one of his polytechnic fellows, and dealt with the creation of science centers for children and youngsters. He developed a computer software used for the calculations of the astronomical objects which was designed for astronomers. Personal life and death Asfia was married and had three daughters. His wife died in October 2007. Their eldest daughter died in 2001. As of 2008 one of his daughters was living in Tehran and the other one in Paris. He died in Tehran on 11 April 2008. Awards Asfia was the recipient of the following French awards: Legion of Honour (rank of Commander) and of the Ordre national du Mérite (Grand Cross). References External links 20th-century Iranian engineers 1916 births 2008 deaths Government ministers of Iran Mining engineers Politicians from Tehran Academic staff of the University of Tehran Commanders of the Legion of Honour École Polytechnique alumni Iranian computer programmers People of Pahlavi Iran Iranian prisoners and detainees
Filippa Curmark (born 2 August 1995) is a Swedish footballer midfielder who plays for BK Häcken. International goal External links 1995 births Living people Swedish women's footballers Jitex BK players BK Häcken FF players Damallsvenskan players Women's association football midfielders Sportspeople from Jönköping 21st-century Swedish women
My Valentine Girls is a romantic comedy film directed by Dominic Zapata, Andoy Ranay and Chris Martinez, starring Richard Gutierrez, Rhian Ramos, Solenn Heussaff, Lovi Poe and Eugene Domingo. The film was released in 2011. The film was produced by GMA Pictures. Plot Richard is a novelist who wants to write the perfect love story. The movie tells a trilogy of stories. The movie started with Richard being bothered and insulted by his little sister as he writes his novel. After this, the little girl decided to read the second part of the story as Richard takes a break. Richard returns and is thinking of making a horrific story to end his novel. He originally wanted to make a story with a vampire and werewolf but decided that it just sounds like Twilight so he decided to make an apocalyptic story. At the end, Richard has finally released his book and on his book celebration party. With the re-appearance of all the leading ladies of the three stories there is an announcement of the world coming to an end because of North Korea launching its nuclear missiles. Soulmates Oslec is a taxi driver who cares for his mom and his sister. Aia on the other hand is rich clothing designer. One night while on shift Oslec gets a flat tire and while trying to fix, he is hit by a car driven by Aia. Aia awakens and is yelled at by Oslec on her way home saying that he can't get home ever since he was hit by Aia. Oslec follows Aia to her house and discovers he is dead and is now a ghost. Aia helps Oslec get home and is guilty that she killed Oslec. Oslec goes back to Aia's house saying he got lonely and had no one to talk to. The two eventually become friends and learn more about each other they fall in love with one another. Oslec goes home and over hears that he is not dead. Aia and Oslec visit Osclec's body in the hospital and promise each other once Oslec wakes up they will do everything they did together when Oslec was a ghost. Oslec wakes up but Aia discovers that she is also a ghost when Oslec's mother and sister walk right through her. Oslec is now alive and well but is sad when his mom tells him that she heard that Aia died the other day, so Oslec decides to visit Aia's house and is informed by her father that she is not dead. Oslec goes to the hospital and tells Aia to wake up and that they'll do everything they did in their dreams and leaves her a note. A couple weeks later Oslec is at Enchanted Kingdom with his family when he sees Aia well again. And the two reunite and admit that they love each other. BBF The story starts on Valentine's Day. Where everyone is so busy with all the usual rituals couples do. On the other hand. Zach is an attorney at the Public Attorney's Office who always takes his best friend Andie on a date during Valentine's Day for the last 3 years. This has become a usual thing for them during this day. Zach is becoming worried about the real status of the relationship that he and Andie holds. On Valentine's Day while on their date with Andie, Andie introduced Zach to her girl best friend Ruby. Ruby on the other hand, is a brokenhearted girl. She was about to marry her fiancé but the guy left him on the same day. Being bored at the bar where she meets Zach, Zach and Ruby decide to go out and they got the chance to talk and learn more about their lives. They decide to come by the house of Ruby's ex-fiancé. She got excited with the rock and she throw it at his car. The alarm of the car was turned on immediately. They were in panic that Ruby's shoe was almost lost and so is Zach's sentimental wrist watch. They swore that they will never ever forget each other and maybe they'll see each other again if Ruby dreams of Zach that night. The next day, Andie and Zach spent the whole day together. Clearly states that Zach really loves Andie. Ruby was at Zach's court case to see him. Zach told Ruby that he will be giving up his job at the Public Attorney's Office and will be working at an aw firm after the current case he's handing. The two went on several dates and eventually fall in love and became lovers. Andie was so happy to hear the news that her best friends worked out together but she was kind of upset that Zach doesn't do the usual things they do before he had a girlfriend. Zach comforted her and she eventually got over it. They became close again but Ruby was so insecure about their friendship. One day, Ruby got Zach a wrist watch for his birthday and he was confused on what to do with his two wrist watches. On his surprise birthday party, Ruby heard Zach's grandfather talking to Andie about the sentimental watch she gave him on his last birthday. Ruby approached Zach and she saw that he was not wearing the watch that she gave him. She was so upset and walked out the birthday party. She was followed by Zach. They talked about Zach's real feelings for Andie and he doesn't love her. During a traffic fight, Ruby was caught in the middle and got shot. Zach was sorry because Ruby got hurt and Andie also admitted to Ruby that she was scared that's why she can't show her love to Zach. Valentine's Day was upon them once more. Ruby has already moved on and is dating her ex-fiancé. Zach finally admitted his real feelings for Andie and Andie told Zach that "I could tell you over and over how much I love you but I'd rather show it". They share a passionate kiss. Gunaw The last story of the film. It started up on a Valentine's Day in Korea where a guard monkeys around with his lover and accidentally pressing the button launching their nuclear missiles towards other countries which resulted a counterattack from all over the world and started a Nuclear War that destroyed humanity itself. The after effect caused death all over the world and started a Zombie Apocalypse to those who did not fully died. The story continued three years later with the main Character Aidan by himself surviving by himself and looking for other survivor. Later on crossed path with Ivy who foolishly devoted herself to Aidan declaring that they have the responsibility to repopulate the world. Ivy tagged along with Aidan to prove him that she was right and they are the key of restarting the human race. After a long journey and annoying seductive attempts of Ivy to Aidan. They met up with a group of male survivors that automatically worshiped Ivy as their Goddess. Aiden thought they were crazy and decided to leave the group and right as he was leaving, no matter how much Ivy loved being worship she went with Aiden because of their growing love for each other. A few years passed and the short movie ended with Aiden and Ivy and their female child in the car. Episodes Soulmates Richard Gutierrez as Oslec Rhian Ramos as Aia Jillian Ward as Ishi Princess Punzalan as Cion Cacai Bautista as Maan Lloyd Samartino Lui Manansala Shey Bustamante BBF Richard Gutierrez as Zach Solenn Heussaff as Andie Lovi Poe as Ruby Rocco Nacino as Marvin Akihiro Sato as Tommy Chinggoy Alonzo as Grandpa Teryo Tess Antonio as Myrna Gunaw Richard Gutierrez as Aidan Eugene Domingo as Ivy Michelle Madrigal John Lapus Maureen Larrazabal Jon Hall Melinda Bona as Maria Flores Cast Richard Gutierrez as Oslec/Zach/Aidan Jillian Ward as Ishi/Lily Rhian Ramos as Aia Solenn Heussaff as Andi Lovi Poe as Ruby Eugene Domingo as Ivy Princess Punzalan as Cion Cacai Bautista as Maan Lloyd Samartino Lui Manansala Shey Bustamante Rocco Nacino as Marvin Akihiro Sato as Tommy Chinggoy Alonzo as Grandpa Teryo Tess Antonio as Myrna Michelle Madrigal John Lapus Maureen Larrazabal Jon Hall References External links 2011 films 2010s Tagalog-language films 2010s English-language films Philippine romance films Regal Entertainment films GMA Pictures films 2011 romance films Films about nuclear war and weapons Philippine post-apocalyptic films Filipino zombie films 2011 multilingual films Philippine multilingual films Films directed by Chris Martinez Films directed by Andoy Ranay
During the Bourbon Restoration (1814–1830) and the July Monarchy (1830–1848), the Doctrinals () were a group of French royalists who hoped to reconcile the monarchy with the French Revolution and power with liberty. Headed by Royer-Collard, these liberal royalists were in favor of a constitutional monarchy, but with a heavily restricted census suffrage—Louis XVIII, who had been restored to the throne, had granted a Charter to the French with a Chamber of Peers and a Chamber of Deputies elected under tight electoral laws (only around 100,000 Frenchmen had at the time the right to vote). The Doctrinaires were a centrist, as well as a conservative-liberal group, but at that time, liberal was considered to be the mainstream political left, so the group was considered a centre-left group. During the July Monarchy, they were an intellectual and political group within the Resistance Party. Led by the Duke of Broglie and François Guizot, the Doctrinaires held powerful posts throughout the reign of Louis-Philippe. Broglie (1835–1836) and Guizot (1847–1848) were both Prime Ministers of France, although Guizot and the Doctrinaires dominated the political scenery during the premiership of Marshal Jean-de-Dieu Soult (1840–1847). History and characteristics Origins The Doctrinaires first obtained in 1816 the co-operation of Louis XVIII, who had been frightened by the violence of the Ultra-royalists in the Chambre introuvable of 1815. However, the Ultras quickly came back to government, headed by the comte de Villèle. The Doctrinaires were then in the opposition, although they remained quite close to the government, especially to Decazes who assumed some governmental offices. The Doctrinaires were opposed on their left by republicans and liberals, and on their right by the Ultras. Finally, the Doctrinaires were destroyed by Charles X, the reactionary successor of his brother Louis XVIII. Charles took the ultra prince de Polignac as his minister. This nomination in part caused the 1830 July Revolution, during which the Doctrinaires became absorbed in the Orléanists, from whom they had never been separated on any ground of principle. According to René Rémond's famous classification of the various right-wing families in France, the Orléanists became the second right-wing tradition to emerge after the Legitimists, a term used to refer to the Ultras after the July Revolution. Doctrinaires, a pejorative word quickly reappropriated As has often been the case with party designations, the name was at first given in derision and by an enemy. In 1816, the Nain jaune réfugié, a French paper, published at Brussels by Bonapartist and liberal exiles, began to speak of Royer-Collard as the doctrinaire and also as le Pierre Royer-Collard de la doctrine chrétienne, a name which came from Royer-Collard's studies under the Prêtres de la doctrine chrétienne, a French religious order founded in 1592 by César de Bus and popularly known as the doctrinaires. The choice of a nickname for Royer-Collard does credit to the journalistic insight of the contributors to the Nain jaune réfugié, for he was emphatically a man who made it his business to preach a doctrine and an orthodoxy. The term quickly became popular and was extended to Royer-Collard's colleagues, who came from different horizons. The duc de Richelieu and Hercule de Serre had been royalist émigrés during the revolutionary and imperial epoch. Nationalize the monarchy and royalize France Royer-Collard himself, Jean Maximilien Lamarque and Maine de Biran had sat in the revolutionary Assemblies. Pasquier, the comte de Beugnot, the baron de Barante, Georges Cuvier, Mounier, Guizot and Decazes had been imperial officials, but they were closely united by political principle and also by a certain similarity of method. Some of them, notably Guizot and Maine de Biran, were theorists and commentators on the principles of government. The baron de Barante was an eminent man of letters. All were noted for the doctrinal coherence of their principles and the dialectical rigidity of their arguments. The object of the party as defined by the future duc Decazes was to "nationalize the monarchy and to royalize France". The king, who had been king of France during the Ancien Régime, ultimately became king of the French under the July Monarchy. This illustrated the change from the divine right of kings to national sovereignty as sovereignty was not derived from God anymore, but from the people. The means by which they hoped to attain this end were a loyal application of the Charter granted by Louis XVIII and the steady co-operation of the king with themselves to defeat the Ultra-royalists, a group of counterrevolutionaries who aimed at the complete undoing of the political and social work of the French Revolution. The Doctrinaires were ready to allow the king a large discretion in the choice of his ministers and the direction of national policy. They refused the principle of parliamentary responsibility, that is to allow that ministers should be removed in obedience to a hostile vote in the chamber. Their ideal in fact was a combination of a king who frankly accepted the results of the Revolution and who governed in a liberal spirit, with the advice of a chamber elected by a very limited constituency in which men of property and education formed, if not the wholes at least the very great majority of the voters. This king was not to be found until Louis-Philippe's reign during the July Monarchy. Guizot set forth the Doctrinaires' ideology in his 1816 treatise Du gouvernement représentatif et de l'état actuel de la France. The chief organs of the party in the press were the Indépendant (renamed the Constitutionnel in 1817) and the Journal des Débats. The Doctrinaires were chiefly supported by ex officials of the empire who believed in the necessity for monarchical government, but had a lively memory of Napoleon's authoritative rule and a no less lively hatred of the Ancien Régime — merchants, manufacturers and members of the liberal professions, particularly the lawyers. English terminology The word doctrinaire has become naturalized in English terminology as applied in a slightly contemptuous sense to a theorist as distinguished from a practical man of affairs. Prominent members The Baron of Barante Jacques Claude Beugnot Louis Becquey Maine de Biran The Duke of Broglie Pierre Paul Royer-Collard Benjamin Constant Victor Cousin Georges Cuvier Élie Decazes The Marquis Dessolles Tanneguy Duchâtel François Guizot Prosper Duvergier de Hauranne Hippolyte François Jaubert Camille Jordan Théodore Simon Jouffroy The Marquis of Lafayette Jean Maximilien Lamarque Étienne-Denis Pasquier The Count of Rémusat The Duke of Richelieu Hercule de Serre Charles Maurice de Talleyrand Abel-François Villemain Chateaubriand, himself a classical conservative, sided with the ultra-royalistes but joined the liberal-doctrinaire opposition against ultras minister Villèle Electoral results See also Modification of political parties under the Restoration References Further reading Craiutu, Aurelian. Liberalism under Siege: The Political Thought of the French Doctrinaires. Lexington Books, 2003. Rosanvallon, Pierre. Le Moment Guizot. Gallimard, 1985. Siedentop, Larry. "Two Liberal Traditions". The Idea of Freedom: Essays in Honour of Isaiah Berlin. Oxford University Press, 1979. Starzinger, Vincent E. The Politics of the Center: The Juste Milieu in Theory and Practice, France and England, 1815-1848. Transaction Publishers, 1991. Bourbon Restoration Classical liberal parties Conservative liberal parties Conservative liberalism Centre-left parties in Europe Centrist parties in France Orléanist parties Political parties of the Bourbon Restoration
Danger Mouse is a reboot animated television series developed by Brian Cosgrove. It first premiered on 28 September 2015. A reboot of the 1981 television series of the same name, the series centres around Danger Mouse (Alexander Armstrong), the self-proclaimed "World's Greatest Secret Agent", who fights against injustice with his cowardly and clumsy yet loyal sidekick Ernest Penfold (Kevin Eldon). They are employed by the absent-minded but slightly firm Colonel K (Stephen Fry) and usually assisted by the inventions of short-tempered genius Professor Squawkencluck (Shauna Macdonald). With these assets, the duo are able to defeat their adversaries, such as arch-enemy Baron Silas von Greenback (Ed Gaughan). In April 2016, the series was renewed for a second season. As of April 2019, two series of Danger Mouse have been produced totalling 99 episodes. Series overview Episodes Series 1 (2015–16) Series 1 premiered on the 34 anniversary of the 1981 series of the same name: 28 September 2015. Originally planned to consist of 52 episodes, the series in the end would only consist of 50 episodes. The opening episode being a double length special. The first of two. A Christmas special, the second of the two double-length episodes, this with Richard Ayoade and Brian Blessed was confirmed: "The Snowman Cometh". Series 2 (2017–19) The first two episodes of series 2 were supposed to have premiered on 24 May 2017 as part of CBBC's "Danger Mouse Day", followed by the rest of the series from 4 September 2017. However, "Danger Mouse Day" was later postponed until 14 June 2017. Originally planned to consist of 3 series across 102 episodes (50 episodes of Series 1 and two further series each of 26 episodes). It was later decided that the 26 episodes of 11 minutes making up a planned third series would be dropped and to instead extend Series 2 to include 49 episodes with 3 being double length specials. The series would now have a total of 99 episodes. The first 5 new episodes of the series were shown on the BBC iPlayer, with new episode being screened on CBBC from 17 September 2018. References Lists of British children's television series episodes Lists of British animated television series episodes Danger Mouse
Tajuria albiplaga, the pallid royal , is a species of lycaenid or blue butterfly found in the Indomalayan realm. Subspecies T. a. albiplaga Sikkim, Assam T. a. pallescens Druce, [1903] Assam, Burma, Thailand T. a. alixae Eliot, 1973 Peninsular Malaya T. a. tura de Nicéville, 1895 Java, Sumatra References Tajuria Butterflies described in 1887
Alangan (, also Romanized as Ālāngān) is a village in Alamut-e Pain Rural District, Rudbar-e Alamut District, Qazvin County, Qazvin Province, Iran. The 2006 census acknowledges its existence without report of population count. References Populated places in Qazvin County
East Firsby and West Firsby are two hamlets in the West Lindsey district of Lincolnshire, England. They are situated about north from the city of Lincoln, and set in the Lincolnshire Wolds, a designated Area of Outstanding Natural Beauty. East Firsby lies between Saxby and Spridlington, with West Firsby about to the west, near the A15 road. East Firsby civil parish was abolished to enlarge that of West Firsby in 1936. There is no church. The hamlet of Firsby is listed in the 1086 Domesday Book as "Frisebi", with 22 households, of meadow and a church, with Ilbert of Lacy as Lord of the Manor. The Manor House at West Firsby fell into disrepair and was demolished during the 1990s. At East Firsby is the mid 18th-century Grade II listed Manor Farmhouse, and at West Firsby is a site of a deserted medieval village. There is an oilfield at West Firsby. References External links Saxby and East Firsby website Saxon House website West Lindsey District
King's Wood may refer to in England King's Wood, Heath and Reach, Bedfordshire King's Wood, part of the King's Wood and Urchin Wood SSSI, North Somerset King's Wood School, Harold Hill, Essex King's Wood, a forest near Molash, Kent King's Wood, a wood at Micklefield, High Wycombe, Buckinghamshire King's Wood, Corby, a local nature reserve in Northamptonshire King's Wood, on the Trentham Estate, Staffordshire and part of the King's and Hargreaves Woods SSSI other things King's Wood Symphony, a musical composition See also Kingswood (disambiguation)
A symphony is an extended piece of music for orchestra, especially one in sonata form. Symphony or Symphonic may also refer to: Music Symphony orchestra, an orchestra, which specializes in the performance of post-17th-century orchestral repertoire Symphony song, genre in the age of Purcell Symphonia, a name applied to several kinds of musical instruments in ancient times Symphonic metal, a genre of metal that incorporates its style from symphonies Symphony (El Khoury), a 1985 symphony by Bechara El Khoury Symphonies (Sallinen), compositions by Aulis Sallinen Bands Symphony X, a progressive metal band Albums Symphony (album), a 2008 album by Sarah Brightman Symphonic (Falco album), a live performance recorded in 1994 and released in 2008 Symphonic (Jorn album), released in 2013 Symphonies (EP), a 2011 remix EP by In Fear and Faith Songs "Symphony" (Clean Bandit song), a 2017 song by Clean Bandit and Zara Larsson "Symphony", a 1992 song by Donell Rush "Symphony", a 1999 song by EPMD from the album Out of Business "Symphony" (Sarah Brightman song), on the same-named album from 2008 "Symphony", a 2022 song by Imagine Dragons from the album Mercury – Acts 1 & 2 "Symphonie", a 2004 song by Silbermond from the album "Symphonies" (song), a 2009 song by British artist Dan Black from the album UN "The Symphony" (song), a song by Marley Marl from the 1988 album In Control, Volume 1 Computer science Symphony Communication a communication tool Symphony (software), a distributed computing software IBM Lotus Symphony, an office suite for Windows, Macintosh and Linux Lotus Symphony (DOS), an office suite for DOS from the 1980s Symphony, codename for Windows XP Media Center Edition 2005 COIN-OR SYMPHONY, a software library for solving a specific class of operations research problems Symfony, a web application framework written in PHP Radio, film and games Symphony 92.4FM, a Singaporean radio channel Symphony (video game), a 2012 music-based shoot-em-up video game Symphony (film), a 2004 Malayalam-language Indian feature film directed by I. V. Sasi Technology and brands Symphony (MBTA station), an underground subway stop in Boston, Massachusetts Symphony Aircraft Industries, a light aircraft manufacturer Symphony Technology Group, a private company based in Palo Alto, California Symphonic, a defunct electronics brand formerly manufactured by Funai Symphony, a turbofan engine under development by Boom Supersonic Other Symphony (grape), a type of grape used to make white wine Symphony, the ring name of professional wrestling valet Alicia Webb Symphony (Agendia), a suite of gene assays Symphony, the magazine of the League of American Orchestras Symphony (candy), a chocolate candy bar manufactured by Hershey's , a huge 2018 cruise ship See also Symphonia (disambiguation) Symphonie, communications satellites from a Franco-German program Symphogear, a 2012 musical action anime series
Aspergillus nomius is a species of fungus in the genus Aspergillus. It is from the Flavi section. The species was first described in 1987. It has been reported to produce aflatoxin B1, aflatoxin B2, aflatoxin G1, aflatoxin G2, aspergillic acid, kojic acid, nominine, paspaline, pseurotin, and tenuazonic acid. A. nomius has been identified as the cause of human infections. Growth and morphology A. nomius has been cultivated on both Czapek yeast extract agar (CYA) plates and Malt Extract Agar Oxoid® (MEAOX) plates. The growth morphology of the colonies can be seen in the pictures below. References nomius Fungi described in 1987
The Pittsburgh Comicon, later known as Wizard World Comic Con Pittsburgh and since succeeded by Steel-City Con, was a comic book convention held in Monroeville, Pennsylvania, United States. It was founded in 1994 by Michael and Renee George. It was traditionally a three-day event (Friday through Sunday) and featured a fan-friendly experience that allowed the fans to interact with comic professionals at all levels. Though it primarily focused on comic books, the convention featured a large range of pop culture elements, such as professional wrestling, science fiction/fantasy, film/television, animation, anime, manga, toys, collectible card games, video games, webcomics, and fantasy novels. Given Pittsburgh's connection to George A. Romero's zombie apocalypse films (with Romero's Dawn of the Dead being filmed in the Monroeville Mall), horror fans were also welcomed at the convention to meet and greet with the film's actors that regularly attended. The show also made a concerted effort to promote local-area talent and publishers. The show raised money for various charities; over the years the show had supported local literacy organizations, the Comic book Legal Defense Fund, local Food Banks, and had raised more than $250,000 for the Pittsburgh chapter of the Make-A-Wish Foundation. History Windber, Pennsylvania-based comics retailers Michael and Renée George (proprietors of Comics World) staged the first Pittsburgh Comicon in April 1994 at the Radisson Hotel Pittsburgh ExpoMart in Monroeville. It was the first major show staged in Pittsburgh for the comic community since the 1970s. From the beginning, a major focus for the show has been giving to charity, the Make-A-Wish Foundation in particular, which is the primary beneficiary of the Annual Comicon Auction. The Pittsburgh Comicon hosted the Harvey Award ceremonies from 2000–2002, with Evan Dorkin serving as master of ceremonies. Jeff Smith was the keynote speaker of the 2000 awards. Superstar creator Frank Miller gave the keynote speech at the 2001 award ceremony in which he vilified the comic book speculating industry, in particular Wizard magazine. He ended his speech by tearing up a copy of Wizard. Tony Millionaire gave the keynote speech at the 2002 awards ceremony. In 2003, due to a cancellation from scheduled keynote speaker Neil Gaiman, funding shortages forced a cancellation of that year's Harvey Awards ceremony and banquet (which had also been scheduled for the Pittsburgh Comicon), although award-winners were still named. The 2000 edition of the show raised $26,000 for the Pittsburgh chapter of the Make-A-Wish Foundation. The 2003 show raised $27,000 for the Make-A-Wish Foundation. The 2007 show raised $30,000 for the Make-A-Wish Foundation and $5,000 for the Comic Book Legal Defense Fund. In 2006, Comic Geek Speak was named the Official Comics Podcast for the Pittsburgh Comicon and has held that title ever since. In 2009, the show moved from the defunct Pittsburgh ExpoMart to the new Monroeville Convention Center, welcoming Stan Lee as their guest of honor to inaugurate their first show in the new venue. In 2015, Pittsburgh Comicon was acquired by Wizard World, becoming Wizard World Comic Con Pittsburgh. In addition, the convention moved to the David L. Lawrence Convention Center in Pittsburgh. Wizard World held the convention there for two years, but did not hold one in 2017 or 2018. The convention returned to Pittsburgh in 2019. After the 2019 show, the official website URL, PittsburghComicon.com, redirected to the Steel City Con, held at the Monroeville Convention Center, leading to the assumption that the Pittsburgh Comicon was defunct. Dates and locations Events Along with panels, seminars, and workshops with comic book professionals, there were previews of upcoming feature films, portfolio review sessions with top comic book and video game companies, and such evening events as a costume contest, featuring dedicated cosplayers who put great effort into their costumes and props. Traditional events included gaming and hours of other programming on all aspects of comic books and pop culture. One popular annual event was the Comic Book Legal Defense Fund Quick-Sketch, which usually raised between $5,000 to $6,000 per show. Other charity events taking place during the Pittsburgh Comicon were the annual "Casino Night," and various drawings and donations from attendees. These events benefited such charities as The Hero Initiative and local food banks. Like most comic-book conventions, the Pittsburgh Comicon featured a large floorspace for exhibitors. These included media companies such as movie studios and TV networks, as well as comic-book dealers and collectibles merchants. Like most comics conventions, the Pittsburgh show included an autograph area, as well as the Artists' Alley where comics artists could sign autographs and sell or do free sketches. Despite the name, Artists' Alley could include writers and even glamour models. Charity The Pittsburgh Comicon supported many charities through its fund raising efforts. The primary charity of the Comicon was the Make-A-Wish Foundation. Since the show's inception, the Comicon had raised enough funds to fulfill a number of wishes. The show's Annual Charity Auction was main fundraising event during the show for this charity. It had been privileged over the years to be the recipient of the works of many of our talented guests willing to provide artwork and other items to be auctioned off to benefit this deserving charity. The Comicon also held 'Charity Quick Sketch' events featuring numerous guests that volunteered to attend the hour-long events and provide original art, usually created in front of a live audience, for the event. During the event, raffle tickets could be purchased by attendees for a sum, which was donated to the charity featured at the event, and each piece of art created during the event was raffled off by picking a ticket from those sold. Gallery References External links Comics conventions in the United States Defunct multigenre conventions Defunct gaming conventions Defunct science fiction conventions in the United States Recurring events established in 1994 Culture of Pittsburgh Tourist attractions in Pittsburgh 1994 establishments in Pennsylvania Conventions in Pennsylvania
Andhra Jyothi (; ) is the third largest circulated Telugu language daily newspaper of India sold mostly in the states of Andhra Pradesh and Telangana. It was founded by K. L. N. Prasad, an Industrialist on 1 July 1960. It is also one of the oldest running Telugu language daily newspapers. It was taken over by Vemuri Radha Krishna, also known as R. K. in 2002 who also works as the Managing Director. Details It is published from 21 centers across the states of Andhra Pradesh, Telangana, Karnataka, and Tamil Nadu. Vemuri Radhakrishna, a senior journalist turned entrepreneur is its Managing Director and noted litterateur K. Srinivas is its Editor. It is the third-largest circulated Telugu daily, according to the Audit Bureau of Circulation (ABC) and is known for its dynamic political reporting. Andhra Jyothi has a vast reporting network in every nook and corner of Andhra Pradesh and Telangana and also has a considerable presence in New Delhi, Tamil Nadu, Karnataka, Orissa, and Chhattisgarh. The group also owns a Telugu TV news channel ABN Andhra Jyothi and a weekly magazine Navya. According to the Audit bureau of circulation for the H12022, Andhrajyothi had a circulation of 375,661, ranked at 17th place among daily newspapers in India. Its circulation during Q2 2019 was 664,352. Circulation dropped by 43.45% over three year period. Political Impact Though initially started out as a neutral and non-political party oriented newspaper and was later taken over by a different organisations, the newspaper under this organization became an arch-rival to the current Chief Minister of Andhra Pradesh Y. S. Jagan Mohan Reddy and his political party YSR Congress Party. The newspaper and its Managing Director Vemuri Radha Krishna are often criticized for publishing news in the support of Chandrababu Naidu led Telugu Desam Party. See also Eenadu Sakshi (newspaper) References External links Andhra Jyothi official website Telugu-language newspapers 1960 establishments in Andhra Pradesh Newspapers published in India Newspapers published in Vijayawada Newspapers published in Hyderabad
The bat (also called the , , or ) is a heraldic symbol sometimes used as a charge, but most prominently used as a crest on or around the crown in municipal arms of the former Crown of Aragon—specifically in Valencia, Catalonia and the Balearic Islands. Origins The heraldic use of the bat has its origins in the "royal dragon" crest () of the coat of arms of the Kings of Aragon. The royal helmet has a , a traditional Catalan dragon, emerging from a crown as its crest. Although traditionally the dragon helmet is ascribed to king James I of Aragon (1208 – 1276), reliable documents state that the winged dragon did not appear over the helmet until Peter IV of Aragon's reign (1319 – 1387). This crest was then transformed into a bat by municipalities. There is also a legend of a bat that landed on the flag of King James I of Aragon in 1238 before he won a crucial battle against the Saracens in which he captured Valencia for his kingdom. In another legend, a bat landed on his tent; James I ordered it to be killed but it was not; later, the bat alerted the king to the Saracens’ surprise night raid. Another version has it that bats’ nighttime routines inspired James I to attack the Saracens at night. Or perhaps a bat flew in front of him as he entered Valencia after capturing it. In any case, the bat, formerly a sign of bad luck, became a symbol of good fortune. However, original documents state that the animal was a swallow and not a bat. The heraldic bat of Albacete has a different origin. It comes from the transformation over time of two "winged hands", the heraldic emblem of the lords of Villena. Because bats eat mosquitos, a notable pest in these regions of Spain, some authors propose that bats on crests honor this ecological role in the local food chain. The bat in official heraldry The coats of arms of certain cities in eastern Spain, like Valencia, Palma, Mallorca and Fraga have the bat over the shield. Some smaller towns, like Catarroja and Novallas, also use this symbol. Formerly the Barcelona city coat of arms had a bat crowning it as well, but the bat was removed at the beginning of the 20th century for unknown reasons. The city of Teruel used to have the bat surmounting the coat of arms' crown. There the bat represents a commemoration of the role of this city in the conquest of Valencia. The bat now rests just below the crown in Teruel's seal. While the use of the bat as a heraldic symbol is prevalent in the territories of the former Crown of Aragon it is rarely used elsewhere. However, it can be found in a few places, including in the coats of arms of the city of Albacete in Spain, the town of Montchauvet, Yvelines in France, Fiefbergen in Schleswig-Holstein, Germany and the former Borough of Brecknock and historic county of Brecknockshire in Wales, UK. Outside of Europe, the coat of arms of Santa Fe de Antioquia, Colombia includes multiple bats; it was granted to the town in 1545 by Charles I of Castile and Aragon and his mother, Joanna of Castile. Other uses Based on the heraldic symbol of their city, certain Spanish association football club badges, like Albacete Balompié, CD Alcoyano, Levante UD and Valencia CF, have a bat on them. The oldest badge of FC Barcelona used between 1899 and 1910 had a small bat crowning it as well. Valencia FC first used the bat on its badge from its foundation in 1919. DC Comics has raised suits against Valencia FC with the European Union Intellectual Property Office in 2013 and 2019, claiming commonality with the Batman logo, but these have not been successful. The Burgee of the Royal Valencia Yacht Club (Reial Club Nàutic de València) displays a bat on a golden field in its center. Lo Rat Penat, a political organization based in Valencia in 1878, was named after the heraldic bat. Established by Constantí Llombart, Teodor Llorente and Fèlix Pizcueta, its aim was originally to foster a movement similar to the Catalan Renaixença in the region of Valencia. The No. 9 Squadron RAF adopted the bat badge in 1917 along with the Latin motto Per Noctem Volamus "We fly through the night". The badge was approved by King Edward VIII in November 1936. Gallery See also Dragon Dragons in Catalan mythology Catalan symbols James I of Aragon Crown of Aragon References Barça N. 20 External links Blason de Valence Cimera del Casal de Barcelona Cimera de la Festa de l'Estendard Barcelona coat of arms FC Barcelona, old badges Lo Rat Penat El ratpenat - Homenatge indirecte al València CF Heraldic beasts Bats and humans Catalan symbols Legendary mammals Bats in popular culture Fictional bats
BIM is a distinguished "little magazine" first published in Barbados in 1942. It was one of two pioneering Caribbean literary journals to have been established in the 1940s, the other being A. J. Seymour's Kyk-Over-Al in British Guiana in 1945. According to the Barbados National Register, on the submission of 16 volumes of BIM magazine together with the associated Frank Collymore Collection of correspondence in 2008: "The importance of the magazine is that it provides a miniature history of primary sources in West Indian literature. In the mid twentieth century the magazine fostered the idea, new in the region at that time, that the profession of writing is an honorable one. The magazine was the chief meeting place for Anglophone literary ideas thus enabling the writers to overcome their isolation. Bim provided also an opportunity for new writers to appear in print alongside more established Caribbean writers who had published abroad. The magazine was thus a major force for regional dialogue, championing regionalism by its actions. Almost every important West Indian writer contributed first poems and short stories to Bim. It was here that they obtained their first encouragement and it was from here that links were established with the BBC programme Caribbean Voices and its producer Henry Swanzy who championed the development of Caribbean writing abroad." The founding editor of BIM was Frank Collymore. Subsequent editors have included A. N. Forde, Edward Kamau Brathwaite, John Wickham and E. L. Cozier. The current editor is Esther Phillips. History Begun as an offshoot of the journal of the Young Men's Progressive Club, BIM magazine first appeared in December 1942, after which it continued regular publication (originally four times a year) until 1996. Many of the Caribbean writers who later received international recognition in the 1950s and '60s published work in BIM in its early years. Notable contributors included Michael Anthony, Ian McDonald, Sam Selvon, and George Lamming, and Monica Skeete. Lamming wrote (in an introduction to the issue of June 1955): "There are not many West Indian writers today who did not use Bim as a kind of platform, the surest, if not the only avenue, by which they might reach a literate and sensitive reading public, and almost all of the West Indians who are now writers in a more professional sense and whose work has compelled the attention of readers and writers in other countries, were introduced, so to speak, by Bim." After a decade of silence, BIM was relaunched in 2007, now subtitled "Arts for the 21st Century", and published twice a year (in May and November) by the Errol Barrow Centre for Creative Imagination, the University of the West Indies (UWI), Cave Hill, Bridgetown, Barbados, in collaboration with the Office of the Prime Minister, Government of Barbados. The magazine frequently produces special themed issues, for instance, one on Haiti in 2010. In November 2016, at UWI, Cave Hill, a special Independence edition of the magazine was launched, featuring writers including Esther Phillips, George Lamming, Kamau Brathwaite, Austin Clarke, Anthony Kellman, Linda Deane, Sir Henry Fraser, Sir Hilary Beckles, Mark McWatt and Adrian Greene. See also Savacou Kyk-Over-Al The Beacon References External links BIM issues from the Digital Library of the Caribbean. Official website BIM magazine, University of the West Indies at Cave Hill, Barbados. Reinhard W. Sander, Index to Bim, 1942–1972. University of Florida Digital Collections. Barbadian literature Biannual magazines Literary magazines Magazines established in 1942
```smalltalk namespace DataStructures.DisjointSet; /// <summary> /// node class to be used by disjoint set to represent nodes in Disjoint Set forest. /// </summary> /// <typeparam name="T">generic type for data to be stored.</typeparam> public class Node<T> { public int Rank { get; set; } public Node<T> Parent { get; set; } public T Data { get; set; } public Node(T data) { Data = data; Parent = this; } } ```
The SWTPC 6800 Computer System, simply referred to as SWTPC 6800, is an early microcomputer developed by the Southwest Technical Products Corporation and introduced in 1975. Built around the Motorola 6800 microprocessor from which it gets its name, the SWTPC 6800 was one of the first microcomputers based around that microprocessor. It is the progenitor of the widely used and broadly supported SS-50 bus. The SWTPC 6800 became one of the most popular 6800-based systems of its time, owing to its ease of use and ample documentation. Though rudimentary, the MIKBUG resident monitor built into ROM allows the immediate entry of program data after power-up, as opposed to other microcomputers of its day which required bootstrapping such software. Southwest Technical Products introduced the SWTPC 6800 in November 1975 for US$450 () in kit form only. Any contemporary ASCII terminal can be used to interface with the SWTPC 6800. SWTPC sold their own television-set-based terminal, for $275; a crude dot-matrix printer was another optional accessory, for $250. Southwest Technical Products followed up the 6800 with the S/09 in 1979 and the 69/K, 69/A, and 69/56 in 1980. All four replaced the Motorola 6800 processor of the original with its successor the 6809. The SWTPC 6800 can be converted to a S/09 with a system board kit sold by Southwest Technical Products, which is also compatible with existing 6800 peripherals and cards; while the 69/K, 69/A, and 69/56 features a redesigned system board and chassis that is incompatible with the 6800. The 69/K was sold as a kit, while the 69/A and 69/56 came pre-assembled (the latter featuring 56 KB of RAM as opposed to the 69/A's 8 KB). Specifications See also Chieftain, a clone by Smoke Signal Broadcasting FLEX (operating system) References External links Information and documentation on the SWTPC 6800 at DeRamp 68xx-based computers Computer-related introductions in 1975 Early microcomputers
The 1958 U.S. Open was the 58th U.S. Open, held June 12–14 at Southern Hills Country Club in Tulsa, Oklahoma. Amid oppressive heat and high winds that created difficult scoring conditions, native Oklahoman Tommy Bolt won his only major championship, four strokes ahead of Gary Player. It was Player's debut in the U.S. Open at age 22. Bolt owned the 36-hole lead at 142 (+2), a stroke ahead of Player. After a third round 69 on Saturday morning, Bolt was at 211 (+1) and three strokes ahead of Gene Littler, who carded a 67 for 214 (+4). Littler fell back in the final round in the afternoon, shooting a 76 to finish in fourth place. Bolt ran away from the field with a final round 72 for 283 (+3), four ahead of Player. Bolt was the only player not to record a round of 75 or over during the championship. Ben Hogan, in search of his fifth U.S. Open title, was hampered by an injured left wrist and finished eleven strokes back in a tie for tenth. Eighteen-year-old Jack Nicklaus, in his second U.S. Open, made his first cut and finished in 41st place. Sam Snead missed the cut for the first time in 18 Open appearances. Two-time champion Gene Sarazen missed the cut in his final appearance, while three-time Masters champion Jimmy Demaret also played his final Open, withdrawing after the third round. It was the first of eight major championships at Southern Hills. The U.S. Open returned in 1977 and 2001 and the PGA Championship has been played at the course five times: 1970, 1982, 1994, 2007 and 2022. Course layout Round summaries First round Thursday, June 12, 1958 (a) denotes amateur Source: Second round Friday, June 13, 1958 (a) denotes amateur Source: Third round Saturday, June 14, 1958   (morning) (a) denotes amateur Source: Final round Saturday, June 14, 1958   (afternoon) Source: References External links USGA Championship Database USOpen.com – 1958 U.S. Open (golf) Golf in Oklahoma Sports in Tulsa, Oklahoma U.S. Open U.S. Open U.S. Open
"There Is a Party" is a song by Swiss artist DJ BoBo, released in May 1995 as the third single from his 1994 album by the same name. The song features vocals by American singer Lori Glori (a.k.a. Lori Hölzel) and peaked at number nine in Belgium, number 13 in Switzerland, number 15 in Finland and number 17 in Germany. On the Eurochart Hot 100, it reached number 33. Outside Europe, the single peaked at number 89 in Australia. It sold to Gold in Germany. Critical reception In their review of There Is a Party, Pan-European magazine Music & Media wrote, "A truly new musical direction is distinct by the reggae-tinged title track. We hear a guitar and it's like the Boney M girls are looking over Bobo's shoulders. One key to Euro's future is in Bobo's hands." Music video The music video for "There Is a Party" was directed by Frank Paul Husmann-Labusga and was filmed in Miami, Florida. He also directed the videos for "Freedom" and "Let the Dream Come True". Track listing Charts Weekly charts Year-end charts References 1995 singles 1995 songs DJ BoBo songs English-language Swiss songs Music videos directed by Frank Paul Husmann Songs written by Axel Breitung Songs written by DJ BoBo
The Vlădila is a right tributary of the river Olt in Romania. It flows into the Olt in Scărișoara. Its length is and its basin size is . References Rivers of Romania Rivers of Olt County
Pedro Lopes de Sousa (Bordonhos, Portugal - Danture, present day Sri Lanka, 1594) was the 1st Governor of Portuguese Ceylon. The office of Captain-major was abolished in 1594 and de Sousa was appointed in the same year under Philip I of Portugal. He died that year in the Campaign of Danture. Biography He was the second-born son of Diogo Lopes de Sousa, lord of the town of Bordonhos and of the Patronage of its Churches and of his wife and cousin, Dona Isabel de Sousa. He made his career in the Portuguese Estado da India, where he served as captain of Malacca. In 1594, following political developments in Ceylon – which the Portuguese crown interpreted as an opportunity to extend Portuguese rule to the entire territory of the island, namely through the subjugation of the Kingdom of Kandy, which until then had successfully resisted the expansion of the Portuguese – Pedro Lopes de Sousa was appointed to the new post of capitão-geral da conquista do Ceilão ("captain-general of the conquest of Ceylon" – the maximum representatives of the Portuguese crown in Ceylon, based in Kotte, had used the designation of "Captain" between 1518 and 1551 and that of "Captain-major" after that date). He arrived in Colombo from Goa, with fresh troops to reinforce the Portuguese military potential, in May 1594. A few months later, he commanded an army composed of Portuguese and local auxiliaries, known by the name of Lascarins, which invaded the Kingdom of Kandy, with the aim of placing on the throne the legitimate queen, Dona Catarina – a child in her early teens, who was under Portuguese protection and had changed her birth name from Kusumasani Devi when she was baptized. The first phase of this ambitious military and political operation was largely successful: the king of Kandy, Vimaladharmasurya, who had recently usurped the throne, fled to the mountains around the capital and Pedro Lopes de Sousa was thus able to install his Protégé, the princess Dona Catarina, on the Kingdom's throne. This initial success, however, would not last long. The Portuguese made it difficult for the population of Kandy to have access to the queen – and this caused rumors to circulate, accusing the Portuguese of planning to have Dona Catarina marry a Portuguese nobleman (perhaps the governor himself). This created a climate of general anxiety and dissatisfaction among the people and the ruling elite of Kandy. In addition, Pedro Lopes de Sousa had the main commander of the Lascarins executed, on suspicion of being in collusion with Vimaladharmasurya. This execution led to the immediate mass desertion of the Lascarin auxiliaries of the Portuguese army. Faced with a new reality in the correlation of military force, which had become highly unfavorable for the Portuguese, Lopes de Sousa decided that the only viable option would be to withdraw as quickly as possible from the capital of Kandy. But Vimaladharmasurya's army followed his withdrawal closely, cut off his retreat at Danture, near the capital, and annihilated the Portuguese army, including its commander, on 9 October 1594. The Battle of Danture was an important turning point in the History of the Kingdom of Kandy. It ensured an independence that Kandy would be able to keep for more than two centuries – despite repeated attempts at annexation by Portugal, and later by the Netherlands and the British Empire – until the year 1815. The Portuguese crown reacted to the defeat at Danture with the appointment of a new captain-general (D. Jerónimo de Azevedo) who arrived in Colombo, with military reinforcements, in December 1594. Marriage and children He married twice. His first wife was Bárbara de Melo, daughter of Gaspar de Melo São Payo (or Sampaio) and great-niece of Fernão Vaz de Sampaio, lord of the house of Vila Flor. Their son, Diogo Lopes de Sousa, was wounded in the battle of Danture and later died of these wounds. He left no issue. His second wife was Dona Brites de Ataíde, daughter of Dom Diogo de Ataíde, captain of Baçaim (who was the paternal grandson of Dom Álvaro de Ataíde, lord of the towns of Castanheira, Povos and Cheleiros and great-grandson of the 1st Count of Atouguia) and his wife Maria Antunes, with the following offspring: Fradique Lopes de Sousa, captain of Malacca. Dona Isabel de Sousa, who married Jorge de Albuquerque, son of the governor of Estado da India, Fernão de Albuquerque, with issue. References Governors of Portuguese Ceylon 16th-century Portuguese people 17th-century Portuguese people 1594 deaths
Tom O'Sullivan is an Australian television, film and theatre actor. O’Sullivan was born in Perth, Western Australia, and later relocated to Sydney to study at the National Institute of Dramatic Art where he graduated in 2003. His first television role was a guest role on the soap opera Home and Away and was followed by playing Tom Huppatz in the ABC TV mini-series Rain Shadow. In 2010, O'Sullivan played Sean 'Grunter' Sinclair in the crime drama Underbelly: The Golden Mile and joined the main cast of Nine Network drama Cops LAC playing Senior Constable Nathan Holt. He has also portrayed William Chambers in the TVNZ 1 drama When We Go To War and Michael Shrimpton in the Seven Network drama series Molly. Aside from his television work, O'Sullivan has appeared in mainstream films and independent short films. The actor has also concentrated on theatre work throughout his career. His involvement at the 2006 Short and Sweet theatre festival helped boost his profile and he gained numerous other stage roles. Early life O’Sullivan was born in Perth, Western Australia, and went to Guildford Grammar School. All four of his grandparents served Australia in World War II. When he finished studying he spent one year travelling. O'Sullivan moved from Perth to study acting at the National Institute of Dramatic Art in Sydney. He completed his training and graduated in 2003. He resides in Balmain, New South Wales. Career Television and film O'Sullivan has appeared in numerous television series, films and theatre works. He has also contributed to some as a writer. The actor believed that by gaining experience in all three would be the best way to further his career. O’Sullivan's first television role was playing Keith Harris, a reporter who was punched in the face by the character Alf Stewart (Ray Meagher) following a helicopter crash, on the soap opera Home and Away. He also did voice work on the 2006 animated film Happy Feet. O'Sullivan secured the role of Tom Huppatz in the mini-series Rain Shadow, which aired on ABC TV from 7 October 2007. He also gained small roles in the mainstream films Fool's Gold (2008) and X-Men Origins: Wolverine (2009). In 2010, O'Sullivan took a role on crime drama Underbelly: The Golden Mile playing Sean 'Grunter' Sinclair. To prepare for his role in Underbelly, the actor read books written by policemen who were involved with the subject matter of the show. He then secured a role in the main cast of Nine Network drama Cops LAC playing Senior Constable Nathan Holt. The character was described as an officer with ten years of experience in the police force. Nine Network decided not to renew the show for a second season. At the time O'Sullivan stated that Nathan had been his most high-profile role. He felt at ease playing Nathan because of his research into his role in Underbelly and similar characters he played in theatre. In 2013, he played the role of Craig in the Seven Network drama Packed to the Rafters. He also appeared in the short film Invisible playing Mitch. The film was an official selection at various independent film festivals. He also played Adam Evans in the Network Ten comedy drama series Wonderland. Next came a guest appearance in the drama A Place to Call Home playing Jack Duncan Snr in the episode titled "The Ghosts of Christmas Past", which aired on 8 June 2014. O'Sullivan played the role of Connor in The Reckoning. He also appeared in the short film A Man on the Edge, playing the male lead Adam Western. The film was selected for the 2015 Flickerfest International Short Film Festival. In 2015, the actor secured the role of William Chambers in the TVNZ 1 drama When We Go To War, which aired in New Zealand. The character is a "proud and intelligent" Australian doctor who resides in New Zealand and served in the Gallipoli Campaign. That year he gained more film appearances as Bret Buchanan in Observance and a newscaster in Truth. In 2016, O'Sullivan secured the role of Michael Shrimpton in the Seven Network drama series Molly. The show focuses on the Molly Meldrum's rise to fame via the show Countdown, which Shrimpton created. In 2017, O'Sullivan returned to Home and Away, this time playing Brian Gilbert. In addition was a small role in the film Alien: Covenant. The actor secured the supporting role of Nate Sabo in the 2018 Network Ten drama series Playing for Keeps. He also played Michael Gibson in the first episode of Nine Network drama Bite Club and played a doctor in an episode of Preacher. Theatre O'Sullivan has also concentrated on theatre work gaining roles in various productions. In 2005, he played an officer in the East Coast Theatre Company production, Terminus. He then took part in the 2006 Short and Sweet theatre festival which helped launch his stage career. Notable works include playing Ferdinand and Caliban in Harlos Productions 2007 stagings of Shakespeare's The Tempest and Peter in Dying City. In 2009, O'Sullivan took the role of Craig in the Black Swan State Theatre Company production of The Dark Room, an original Australian play. In February 2010, he took a lead role of Mitchell in The Little Dog Laughed at the Cremorne Theatre. That year he took on Freddy Page in The Deep Blue Sea at The Playhouse Theatre. In September 2011, the actor starred in a Cat On A Hot Tin Roof at Perth's State Theatre Centre of Western Australia. From January to February 2012, O'Sullivan appeared as Stanley Saunders in Hillary Bell's The White Divers of Broome at the Heath Ledger Theatre. In September 2015, he starred in the theatre productions Ride and Fourplay which opened at the Eternity Playhouse, Sydney. In November 2018, O'Sullivan appeared in 80 Minutes No Interval at Theatre Works, St. Kilda. Filmography Sources: References External links Living people 21st-century Australian male actors Australian male television actors Year of birth missing (living people) Male actors from Perth, Western Australia
Adam Kluger is a music manager, and the founder and CEO of the Kluger Agency, an agency that arranges product placements in music videos and on musical recordings. Early career Kluger grew up in Tampa, Florida. Between 2004 and 2006 Kluger attended Santa Fe College in Gainesville, Florida and attended a certificate program in music business and production in Los Angeles, taking classes on topics including royalties and audio engineering. In 2008 he formed his own boutique advertising firm, focusing on product placement in music videos and song recordings called the Kluger Agency. Brand and talent management Kluger's first client was Interscope Records, who hired Kluger to find placement for the artist Lady Gaga for one of her first music videos, before her album The Fame launched the artist's career. Kluger placed the brand Vixen's Visions at the tail end of the video "Beautiful, Dirty, Rich". His next placement was for the brand Drank in a series of hip hop videos. The success of his business plan caused some controversy among music industry observers. A Wired magazine blog, for example, criticized the concept of having artists paid for using brand names in their songs, writing that if an artist chooses to use product names in their songs they should not be compensated. Kluger works out of his offices in Los Angeles. In addition to serving as CEO of his own company, he manages musical artists individually. While not all of Kluger's clients are known, it was reported that his clients have included Lady Gaga, Kesha, Britney Spears, and Jennifer Lopez, in addition to artists like Christina Aguilera, Beyoncé and Eminem. Kluger is also responsible for discovering and managing controversial social media star Bhad Bhabie, who signed a multimillion-dollar recording contract with Atlantic Records in 2017. She currently holds the record as the youngest female rapper of all time to chart on the Billboard Hot 100, and has subsequently reached multi-platinum sales status. His work has been used as a case study in several books and articles on music marketing. In 2012 Forbes named Kluger one of their 30 most influential people in the music industry under the age of 30, citing that he brought in more than five million dollars a year in net revenues. The magazine has also interviewed Kluger in response to current events pertaining to the music and entertainment industries, as has Us Weekly. He had previously been nominated for the Billboard 30 under 30 in the music industry in 2011. In 2019 Kluger launched Nontra Records, an independent record label and management company that manages several musical acts such as Lil Yachty and Bhad Bhabie. In 2021 Kluger launched Scoop Investments which together with his celebrity clients made its first investment of US$1 Million into Jewish dating app Lox Club. In 2021 Variety listed Kluger as one of the new leaders of Hollywood in its annual Hollywood New Leaders List References External links Kluger Agency homepage American company founders American marketing businesspeople Businesspeople from Tampa, Florida American music people Place of birth missing (living people) Living people Year of birth missing (living people)
Bronwyn Roye (born 18 July 1970 in Sydney) is an Australian former rower. She is a six-time national champion, a medalist at World Championships and a dual Olympian who raced in two Australian sculling events at the 1996 Summer Olympics. Club and state rowing Roye's senior club rowing was initially from the St George Rowing Club on Sydney's Cooks River and then from the UTS Haberfield Rowing Club. Roye made state selection for New South Wales in 1994 in the state women's coxless four to contest the ULVA Trophy at the Interstate Regatta within the Australian Rowing Championships. In 1995 she was the New South Wales single sculls entrant selected to race for the Nell Slatter Trophy at the Interstate Regatta. In 1996 she raced both the state coxless four and the single scull, winning the Nell Slatter Trophy in the single. She again contested the interstate single sculls title from 1997 to 2000 winning that title in 1997 and 1999. In UTS Haberfield colours she contested the open women's single scull title at the Australian Rowing Championships on seven consecutive occasion from 1994 to 2000. She won that national title in 1996, 1999 and 2000. International representative rowing Roye's Australian representative debut came in 1994 as a single sculler. At the 1994 World Rowing Championships in Indianapolis she was Australia's single sculls entrant and finished in fifth place. In 1995 she rowed in the Australian senior women's double scull. She raced with West Australian Emmy Snook at 1995 World Rowing Championships in Tampere to fourth place. She then moved in to the Australian women's quad scull and with Sally Newmarch, Marina Hatzakis and Jane Robinson she competed at the 1996 Atlanta Olympics finishing ninth overall. In Atlanta Roye also doubled up with Marina Hatzakis in the women's double scull and finished in fourth place. In 1997 Roye rowed in the double scull at the World Rowing Cup I but not at the World Championships. She came back into the senior quad in 1998 with Hatzakis, Robinson and Newmarch and after racing at the World Rowing Cup III in Lucerne, they competed at the 1998 World Rowing Championships in Cologne and won a bronze medal. Roye's final two years of representative rowing was with Hatzakis in the Australian women's double scull. They raced at the 1999 World Rowing Cup III in Lucerne and then at the 1999 World Rowing Championships in St Catharines, Canada to a sixth place finish. Their campaign in the 2000 Olympic year started at two World Rowing Cups in Europe and then at Sydney 2000 they placed fourth in their heat and fought through a repechage to make the final in which they finished last for an overall sixth ranking. It was the conclusion of Roye's representative career. References External links 1970 births Living people Australian female rowers Sportswomen from New South Wales Olympic rowers for Australia Rowers at the 1996 Summer Olympics Rowers at the 2000 Summer Olympics Rowers from Sydney World Rowing Championships medalists for Australia 20th-century Australian women
Łukoszyno-Biki is a village in the administrative district of Gmina Mochowo, within Sierpc County, Masovian Voivodeship, in east-central Poland. It lies approximately south of Sierpc and north-west of Warsaw. References Villages in Sierpc County
Red Alert is the fourth album by British jazz pianist Janette Mason. It is the first of her albums to be released on vinyl as well as in digital format and as a CD. Dot Time Records issued the CD (and accompanying digital release) in 2017 and the vinyl recording in March 2018. Reception Reviewing the album for The Guardian, John Fordham said: "With album Red Alert, London pianist Janette Mason’s trio – fuelled by energies from the Bad Plus, David Bowie, Goldfrapp, Robert Wyatt and plenty more – uncork a typically eclectic, skilful and audience-friendly brew." Track listing All tracks written by Janette Mason, except where noted. "Pent Up" – 5:51 "Skating on Thin Ice" – 6:34 "Evil of All Roots" – 5:02 "Bridge 2 – London" (traditional; arranged by Janette Mason) – 0:30 "SiSi" – 5:17 "Red Alert" – 6:22 "Bridge 1 – Westminster" (traditional; arranged by Janette Mason) – 0:49 "The Yearning" – 8:25 "Altered Reality" – 3:41 "I See Seven" – 5:33 Personnel Janette Mason – piano and synthesiser Jack Pollitt – drums Tom Mason – acoustic and electric bass References 2017 albums Janette Mason albums Funk albums by British artists Jazz albums by British artists
Emmet may refer to: Places Australia Emmet, Queensland Germany Emmet (Upland), a mountain in Hesse United States Emmet, Arkansas Emmet, Nebraska Emmet, North Dakota Emmet, South Dakota Emmet, Dodge County, Wisconsin, a town Emmet, Marathon County, Wisconsin, a town Emmet County, Iowa Emmet County, Michigan Emmet Township (disambiguation) People Surname A. Maitland Emmet, entomologist and school teacher Christopher Temple Emmet, Irish barrister and poet Devereux Emmet, golf course architect Grenville T. Emmet, American attorney and diplomat Katherine Emmet (1878–1960), American actress Lydia Field Emmet, American artist Richard S. Emmet Jr. (1871–1897), New York assemblyman Robert Emmet, leader of the 1803 Irish rebellion Robert Temple Emmet, US Medal of Honor winner Thomas Addis Emmet, lawyer and politician Thomas Addis Emmet (bishop), American-born Roman Catholic bishop in Jamaica William Le Roy Emmet, electrical engineer Given name Emmet Birk (1914–2000), American basketball player Emmet Bolton (born 1985), Gaelic footballer Emmet D. Boyle (1879–1926), American politician Emmet Byrne (1896–1974), American politician Emmet Byrne, Irish rugby union player Emmet Crawford (1844–1886), American soldier Emmet Dalton (1898–1978), Irish soldier and film producer Emmet Densmore (1837–1911), American businessman and physician Emmet Flood, American attorney Emmet Fox (1886–1951), New Thought spiritual leader Emmet French, (1886–1947) American golfer Emmet Friars (born 1985), footballer Emmet Gowin (born 1941), American photographer Emmet Hayes (born 1951), American lobbyist and politician Emmet Heidrick (1876–1916), American baseball player Emmet John Hughes (1920–1982), American editor, speechwriter and author Emmet Kirwan, Irish actor, playwright and screenwriter Emmet Lanigan (1909–1989), Australian cricketer Emmet Lavery (1902–1986), American playwright and screenwriter Emmet G. Lavery Jr. (1927–2014), American producer and attorney Emmet Malone, Irish football correspondent Emmet McDermott (1911–2002), Australian dentist and politician Emmet McHardy (1904–1933), New Zealand missionary Emmet McLoughlin, amateur football player Emmet McNamara (born 1990), Irish jockey Emmet Nolan (born 1995), Irish hurler Emmet O'Brien (born 1981), Irish auto racing driver Emmet O'Neal (1853–1922), American politician and lawyer Emmet O'Neal (Kentucky politician) (1887–1967), American politician and ambassador Emmet M. Reily (1866–1954), American politician Emmet Sargeant, musician Emmet Stagg (1944), Irish politician Emmet Sullivan (sculptor), (1887–1970), American sculptor Emmet G. Sullivan (born 1947), American judge Emmet M. Walsh (1892–1968), American prelate Emmet Wan (born 1992), football midfielder Fictional characters Emmet Brickowski, the protagonist of The Lego Movie and its sequel The Lego Movie 2: The Second Part Emmet Cole, in ABC's The River Emmet Hawksworth, a character in the sitcom Keeping Up Appearances Emmet Lefebvre, a character in the American sitcom Top of the Heap Emmet Otter, the protagonist of Emmet Otter's Jug-Band Christmas Emmet Ray, the protagonist of Sweet and Lowdown Other uses Emmet, an archaic English word for ant Emmet (heraldry), the heraldic ant Emmet (Cornish), a nickname for tourists Emmet (software), a set of tools for HTML and CSS coders, formerly known as Zen Coding See also T. Emmet Clarie (1913–1997), American judge M. Emmet Walsh, (born 1935) American actor Emmett (disambiguation)
Vojislav Stanimirović (19 March 1937 – 13 June 2022) was a Serbian-born American journalist and one-time crime figure, most famous for his leading role in The Vizcaya Heist. He emigrated to the United States in 1952. Stanimirović was also later involved with YACS and the Pink Panthers among Serbian mafia figures. He is the father of Pavle Stanimirović. He died of mesothelioma on June 13, 2022 in Novi Sad, Serbia. The Vizcaya Heist On 22 March 1971, three individuals from New York City raided the Villa Vizcaya in Miami and stole approximately $1,500,000 in artwork and silver items, some of which were of historical value. This trio of reputed jewel thieves was arrested on 25 March 1971. The New York Police Department raided the luxurious Manhattan apartment of Vojislav Stanimirović and his wife Branka, and arrested them. The couple's accomplice, Aleksandar Karanović, was also arrested, and all three were charged with suspicion of stolen property and possession of a dangerous weapon. From the Stanimirovićs' apartment approximately $250,000 of the stolen goods was recovered. Sergeant Connolly stated that included in the theft was a silver bowl that once belonged to Napoleon Bonaparte and was virtually priceless. According to Connolly, the three perpetrators had been under surveillance for four months for unrelated jewel burglaries that they had carried out in the Manhattan Diamond District. NYPD Captain Thomas Kissane said that the vast majority of the precious items stolen from the Vizcaya have never been recovered. References 1937 births 2022 deaths 20th-century criminals Serbian criminals Crimes in New York (state) Serbian expatriates in the United States Deaths from mesothelioma
The Memphis Zoo is a zoo in Midtown, Memphis, Tennessee, United States. It is home to more than 3,500 animals representing over 500 different species. Created in April 1906, the zoo has been a major tenant of Overton Park for more than 100 years. The land currently designated to the Memphis Zoo was defined by the Overton Park master plan in 1888, it is owned by the City of Memphis. The zoo is set on , of which approximately are developed. In 2008, the Memphis Zoo was ranked "#1 Zoo in the U.S." by TripAdvisor. The ranking was based on visitor opinions. Since the early 1990s, the Memphis Zoo has invested over $77 million for renovation and expansion. The zoo's animal inhabitants reside in three zones with 19 exhibits, such as Teton Trek, Northwest Passage and China, home to giant pandas Ya Ya and Le Le The Memphis Zoo is an accredited member of the Association of Zoos and Aquariums (AZA). History Early 1900s The zoo was established on April 4, 1906, with $1,200 from the Memphis Park Commission. In August 1906, 23 cages and concrete bear enclosures were built with another $3,628 thanks to the head of the Commission, Col. Robert Galloway. Galloway Hall, the Memphis Zoo's first building, was finished in 1907. It was named in honor of Col. Galloway, but was later demolished to make room for newer exhibits. The Carnivora Building was constructed in 1909 to house the first cats at the zoo. It was later replaced by Cat Country, and converted into an inner-zoo restaurant. The Elephant House opened in 1910. The building is still used as the main building of the zoo's educational department, but the elephants were moved to the African Veldt exhibit. In 1916, the Botanical Display Building opened. It was later converted into the Tropical Bird House. The Memphis Zoo acquired a round barn from the Memphis Police Department in 1923, who used the building as their stable for the mounted horse patrol in the early 1900s. The zoo's round barn exhibit is a collection of exotic hoofstock and birds. In 1936, the zoo's first primate exhibit, Monkey Island, was built. It was replaced in 1995 by Primate Canyon. Mid-1900s The Aquarium was completed in 1959. It is one of the oldest exhibits at the Memphis Zoo. The building houses aquatic life from both fresh and salt water environments. In 1979, it had major renovations. The Herpetarium was constructed in 1960, located across from the Tropical Bird House. The Herpetarium is home to the zoo's snakes, alligators, lizards and frogs. Later in the year, the Pachyderm/Elephant exhibit was finished, and the elephants moved in from the old elephant house. Late 1900s to present The zoo renovated its entrance in 1990. The main entrance way was designed by architect, Jeffery Borchardt. It was dubbed as the "Avenue of the Animals" which displays a grand Egyptian motif modeled after the Avenue of Sphinxes in Egypt. The zoo portal facade features a 40' by 163' wall with hieroglyphics of all the animals in the zoo. In the top panels, the Memphis Zoo Mission Statement is written in hieroglyphics. Cat Country, a , open-air exhibit focused on both predators and prey of the cat world, opened in 1993. Tigers and lions share common space with fennec foxes and meerkats. An Education Complex, Discovery Center, and the Elephant's Trunk Zoo Shop also opened at this time. The Carnivora Building that formerly housed the zoo's large cats was remodeled into The Cat House Cafe, which opened in 1994. Three new exhibits opened in 1995. Animals of the Night is devoted to nocturnal animals, and reverses their hours from normal so visitors can see them at their most active. Once Upon A Farm was built to resemble an early 1900s farm. Primate Canyon features naturalistic, outdoor exhibit areas for a variety of monkeys and apes. Dragon's Lair was opened in 1998 for the zoo's three Komodo dragons, and includes outdoor and indoor areas, allowing them to stay warm during the cool winter months. A new animal hospital was also finished in 1998, with separate holding and quarantine wings built on opposite ends of the building. The sick wing separates sick or injured animals from others and allows for proper recovery time. The quarantine wing is used for newly acquired animals, which are quarantined for at least 30 days upon arrival at the zoo before being introduced to their new homes. On September 18, 1998, two plaques were dedicated in memory of musician Jeff Buckley in the Memphis Zoo's Sumatran tiger exhibit. His mother chose that location because of his great love of the Memphis Zoo and the tigers in particular. Jeff frequently visited the zoo, had plans to become a volunteer in 1997 and, according to his mother, never left the zoo without visiting the Butterflies: In Living Color exhibit, which also opened early in 1998. The exhibit was replaced by "Birds and Bees" in late May 2009. In April 2003, the Memphis Zoo became one of only four U.S. zoos to exhibit the giant panda as a part of a 20 year loan. One male and one female giant panda ("Ya Ya" and "Le Le") share their home with several other species native to China, in the first Memphis Zoo exhibit to be built as zoogeographical exhibit. The buildings, plant life and even the sounds of China are represented in this $16 million exhibit. In February 2023, a few months before the Pandas were set to be returned to China, Le Le passed away leading to concerns about the treatment the pandas were getting in the Zoo. In May 2023, Ya Ya was successfully sent back to China after the end of the loan agreement. The Northwest Passage exhibit opened on March 1, 2006, with underwater viewing for polar bears and sea lions. The animals frequently interact with visitors, and the sea lions are fond of following and mimicking small children. Butterflies: In Living Color! was renovated in 2007. The exhibit housed as many as 1,000 butterflies of 35 different species. There were 56 varieties of plants for the butterflies to feed on. Construction of the Teton Trek exhibit started in February 2008. The decision to clearcut of old growth forest in the Old Forest Arboretum in order to build the exhibit drew sustained criticism by Citizens to Preserve Overton Park, which was reorganized in response to the forest reduction, and by Park Friends, Inc. Approximately 14 acres of forest adjacent to the zoo were left out of the protective area to ease opposition from former Memphis Mayor A C Wharton and zoo officials. The zoo had its largest single day attendance ever on March 17, 2009, with more than 20,450 visitors. In late May 2009, the Birds and Bees exhibit opened in the former butterfly exhibit. The butterfly garden moved outside the aviary, and is still close to the original exhibit. Longtime zoo favorite "Ann" the reticulated python died on July 28, 2009. She was 18 years old. Teton Trek was opened on October 10, 2009, and winning artists of the Teton Trek Art Contest were recognized. The zoo's second African exhibit, Zambezi River Hippo Camp, opened to the public on April 29, 2016. Exhibits The zoo hosts modern exhibits that mimic the animals' natural habitats, such as Once Upon A Farm, Cat Country, Primate Canyon, Dragon's Lair, Animals of the Night, Tropical Bird House, Herpetarium, Aquarium, African Veldt, Zambezi River Hippo Camp, China, Northwest Passage, and Teton Trek. Viewing all the exhibits requires a walk of about . Operating seasonally, trams provide visitors with guided tours of exhibits for a small daily fee; the trams are also useful for shuttling visitors between distant exhibits. Other attractions at the zoo include a carousel, an area with rides, a miniature train offering a scenic view of the Once Upon A Farm exhibit, and several theme-oriented gift shops and eateries; many of these amenities operate seasonally. A children's playground is located next to the Cat House Cafe, and several family picnic areas are maintained beneath groves of mature trees. An ice skating rink is operated seasonally at the zoo; the tented rink has an area of 5,400 square feet for skating. Camel rides and giraffe feeding are offered from March to October 2012 for a fee. The zoo is divided into three zones that showcase a total of 19 different exhibits. East zone Teton Trek The exhibit, which opened October 2009, brings hallmark features of the Yellowstone National Park to the Memphis Zoo. "Teton" refers to the Teton Range in Wyoming. Teton Trek begins with a replica of the Old Faithful Geyser and a replica of the Old Faithful Inn called the Great Lodge, where interpretive information is presented in an interactive format. The exhibit is home to some of the keystone species of the Yellowstone ecosystem: grizzly bears, elk, timber wolves, trumpeter swans, a North American porcupine, black bears and sandhill cranes. The exhibit's trail provides visitors with an underwater look at the bears' fishing pond and a prominent overlook atop the replica of Yellowstone's Firehole Falls. Northwest Passage Home to the zoo's polar bears, this $23 million exhibit opened on March 1, 2006, and features an underwater viewing building, sea lion observation bubble and a 500-seat amphitheater for daily sea lion shows. This exhibit's theme is a tribute to the First Nations culture in Canada's western province British Columbia, animals that inhabit the Pacific Northwest, and its horticulture. Messages of conservation inspired by Chief Seattle, a famous Native American chief, are sprinkled throughout the exhibit. Six hand-carved totem poles that stand throughout the area received a Native American blessing ceremony when they arrived at the zoo. The Northwest Passage is also home to the zoo's American bald eagles, and white-necked ravens. African Veldt African elephants, white rhinos, and giraffe are joined by zebras, Grant's gazelle, and ostriches in this area. African cranes, bontebok, lechwe, bongo and scimitar oryx also live here. The zoo finished enlarging the elephant exhibit in 2006; it now features a pool that allows elephants to submerse and bathe. World of Waterfowl In this exhibit, two wooden bridges take visitors through a wetland. It is home to around 30 Chilean flamingos and a variety of other waterfowl. Birds and Bees This exhibit opened in May 2009. It features an up-close look at two honey bee hives. Displays inside the exhibit explain what makes bees special and the role they play in agriculture. The indoor bee exhibit leads to an outdoor aviary that features approximately 500 budgies, commonly known as parakeets. In addition to viewing these colorful birds, visitors can feed them using millet seed-heads attached to sticks that are available for a small fee. Central zone China Opened in April 2003, this $16 million exhibit is a zoogeographical area the Memphis Zoo constructed after it became one of only four U.S. zoos to exhibit the giant panda. Other animals showcased in this effort to preserve Chinese species include Sulawesi Black-crested macaques, Père David's deer, Red pandas, François' langurs, and an assortment of colorful birds such as the golden pheasant and red-crowned crane. Primate Canyon This exhibit was opened in 1995 and features naturalistic, outdoor exhibit areas for western lowland gorillas, Sumatran orangutans and siamang gibbons. Other animals in the area are lion-tailed macaques, black-and-white ruffed lemurs, Mona monkeys, Sulawesi macaques, red ruffed lemurs, lesser spot-nosed monkeys, eastern black-and-white colobus, and savanna baboons. Commercial Appeal Cat Country This , open-air exhibit houses African lions, cheetahs, Capybara, Amur leopards, meerkats, caracals, capybaras, Bat-eared Foxs, cougars, Sumatran tigers, Bengal tigers, jaguars, snow leopards, and Red pandas. The zoo employed cultural architecture native to the land of the species on exhibit (for example, temple ruins surround the Sumatran tiger exhibit). The old Carnivora Building, where the cats used to live, was renovated to become the Memphis Zoo's primary restaurant – the Cat House Café. Zambezi River Hippo Camp This African exhibit opened in 2016. Its location is adjacent to the Primate Pavilion and south entrance to the African Veldt. It is home to hippos, Nile crocodiles, okapi, yellow-backed duikers, Cape vultures, taveta weavers, nyalas, mandrills, blue-bellied rollers, patas monkeys, Chilean and lesser flamingos. Bonobos Six bonobos (including a baby bonobo born in 2005) live in this indoor/outdoor hybrid exhibit across from the China exhibit. The bonobo is endangered and is found in the wild only in the Democratic Republic of Congo. Animals of the Night This exhibit reverses the daily cycle of nocturnal animals, giving visitors the chance to see night-dwellers at their most active. The exhibit is developed around a central bat flyway which enables visitors to get a close-up view of the bats in flight or feeding. Also exhibited are a wide range of other species—from aardvark to wombat.The exhibit also features the Bear cuscus which is featured in only 4 other zoos around the world. West zone Dragon's Lair This exhibit was specifically built for the Komodo dragon, the largest lizard in the world. The zoo's three dragons share a special exhibit with outdoor and indoor areas allowing them to stay warm during the cool winter months. Keepers hold a feeding demonstration of the Komodo dragons on Saturdays. Currently, a visiting Komodo dragon from the St. Louis Zoo is visiting for breeding purposes (2013). Tropical Bird House A variety of colorful birds in outdoor enclosures can be seen by visitors at the entrance to the zoo's Tropical Bird House. The building is home to exotic bird species from around the world such as the pygmy falcon, Burrowing owl, azure-winged magpie, Bali myna, crested coua, golden white-eye, Jambu fruit dove, Mariana fruit dove, plush-crested jay, purple-throated fruitcrow, red-billed hornbill, Tinian monarch, Toco toucan, and the white-tailed trogon. The exhibit features a walk-through aviary which allows visitors close contact to a number of birds, especially during feeding time. Aquarium The Aquarium is one of the oldest exhibits at the Memphis Zoo and houses aquatic life from both fresh and salt water environments. Some of the more notable animals include: Fly River turtles, electric eels, red bellied piranhas, archer fish, green moray eels, porcupine pufferfish, Arapaima and Volitan lionfish, The electric eel exhibit has a unique feature that converts the eel's electric pulses into a sound and visual display. Penguin Rock Over 30 African penguins live across from the zoo's rides area at Penguin Rock. American white pelicans are located nearby. Once Upon A Farm This exhibit was built to resemble an early 1900s farm. It is home to Caspian horses, domestic goats, prairie dogs, domestic chickens, Babydoll sheep, miniature cows, guinea pigs, Pekin ducks and miniature donkeys. In addition to farm animals, a vegetable garden, a cotton patch, and rows of corn provide visitors with some of the essential elements of a southern farm during the growing season. Herpetarium Located across from the Tropical Bird House, the herpetarium is home to the zoo's snakes such as the Burmese python, American alligators, lizards such as the Prehensile-tailed skink, and frogs such as the azure poison dart frog, Bell's horned frog, and milk frog. It includes the rare Louisiana pine snake and the axolotl, in addition to some of the most venomous snakes in the world, including the green mamba, Eastern diamondback rattlesnake, and Gaboon viper. It is home to an alligator snapping turtle and Galápagos tortoises. In a seasonal exhibit, a simulated shallow pond provides favorable breeding habitat for the highly endangered Mississippi gopher frog; this exhibit also features a slide presentation describing the zoo's participation in the frog's recovery program. The exhibit also includes a selection of Crocodiles which includes Dwarf crocodiles, West African slender-snouted crocodiles, and an American alligator. Round Barn The Round Barn is home to gerenuks, which are known by their extremely long necks. Keepers encourage their foraging behavior by placing tall bamboo stems in their exhibit. This exhibit also houses Abyssinian ground-hornbills, warthogs, red river hogs, Grey crowned crane, nyalas, yellow-backed duikers, dik diks, klipspringers, and dama gazelles. Other features Landscaping Landscaping plays a key role in each of the zoo's three zones, both within exhibits and along the interconnecting trails. Water features, such as ponds, waterfalls, fountains, and streams, are dominant elements of the overall design, in addition to artificial rock formations which blend into the containment walls of the animals' enclosures. Other key elements of the landscaping are a diverse mix of trees, shrubs, and seasonal herbaceous plants. Most of the larger trees are native species, which include sweetgum, sycamore, tulip poplar and a host of different oaks and hickories. Common shrubs include colorful native species, such as American beautyberry, oakleaf hydrangea, southern bayberry, and witch hazel, plus numerous exotic shrubs selected for their individual merits. Some exhibits feature plants that support the exhibit's theme, such as the Chinese fringetrees and Chinese snowball viburnums in the China Exhibit and several species of western conifers, maples, and birches in the Northwest Passage and Teton Trek Exhibits. Several gardens are maintained within the zoo, where the plants are the featured items. In addition, tropical plants are grown in several areas during summer months; species include banana plants, elephant ears, hibiscuses, and oleanders growing above a groundcover of coleus and ornamental sweet potato. Events The Memphis Zoo sponsors a wide variety of special events with the overall theme—Always Something To Do. These include: Horticultural Tours (periodic), Plant Sale (April), Zoo Boo with its Haunted Forest (October), Zoo Lights with over 1 million holiday lights, Santa, live reindeer, and magic show (November/December), Zoo Rendezvous (September), Zoo Snooze (periodic), and many more. There are also a wide assortment of educational activities throughout the year for school-aged children. Magazine Exzoobrance is a bimonthly magazine published by the Memphis Zoological Society to keep patrons informed about zoo-related activities and information. Each edition includes a calendar of events, a description of special events, news about educational and conservation programs, information about the animals and their exhibits, and a kid's activity page. Copies are archived online beginning in 2009. Incidents On January 8, 2008, a stray dog entered the Memphis Zoo through a service door and leapt into the tiger exhibit before officials could apprehend it. Zoo staff distracted the tigers, allowing the dog to walk out of the exhibit and survive with several injuries. In May 2009, a zoo keeper was bitten by a Bengal tiger after failing to close two internal safety doors, allowing a tiger to enter an unsecured hallway. The tiger, named Kumari, was sedated and safely placed back in her exhibit. In 2019, a man entering the Memphis Zoo shot himself in the upper thigh with a handgun hidden in his pocket. This incident brought attention to the zoo's firearm policies and zoo officials stated that they would look into it. Future projects The Memphis Zoo has a few projects in their future plans with funding efforts currently underway. A new major attraction, expected to be complete by the spring of 2022, is underway with plans to renovate the Hippo Barn Enclosure as well as other unannounced parts of the zoo. Many new jobs will be created from this project. An indoor coffee shop is expected to be built by summer 2021. Located near the front entrance of the zoo, it will sell coffee and pastries. References External links MemphisZoo.org – Official Website Memphis Zoo Tourist attractions in Memphis, Tennessee Buildings and structures in Memphis, Tennessee 1906 establishments in Tennessee Zoos established in 1906
A xhamadan or xhamadani is a traditional wool garment worn by Albanian men. It can be sleeved or sleeveless. The sleeveless xhamadan is only one type of the Albanian vest, the other two being the xhamadani me reshme, and the xhamadani fermele. The xhamadani me reshme went out of use around the beginning of the 20th century. whereas the xhamadan and the xhamadani fermele continue to be used in traditional festivities. A good xhamadan is usually richly embroidered, sometimes in gold: in the past its quality revealed social rank. History The xhamadani originated in the northeastern parts of Albania, but is worn throughout the country and in other territories inhabited by Albanians. The xhamadan appears to be the jacket to which 16th-century English poet Edmund Spenser refers in a line of his Faerie Queene, published in the 1590s, where he mentions the sleeves-dependent, Albanese wise. It is mentioned several times by British travel writers, such as John Foster Fraser, who in the first (1906) edition of his book, Pictures from the Balkans, observes the preferences of Albanian men for xhamadans embroidered in gold or silver. Types of xhamadan There were three types of xhamadanis in Albania: the xhamadan, the xhamadani me reshme and the xhamadani fermele, of which only the fermele and xhamadan are still in use, the jermele having fallen out of favour around the beginning of the 20th century. The xhamadan usually can be closed on the left side, it has usually two pockets, an outside and an inside one, and is adorned with embroidery. In winter time the Albanians would wear the tallagan, a heavy coat, on top of the xhamadan. The embroidery can be in silk or cotton braids. Northern and southern Albanians each had several types of xhamadan, which differed in color and cut. Northern Albanians would usually wear a xhamadan of red velvet, embroidered in black silk or, sometimes, gold. The quality of the embroidery itself indicates social rank. In particular, the xhamadan worn by Albanians in the region of Tetovo (now North Macedonia), is white, or creamy, and richly embroidered. It is sleeveless, and open on the chest, but it can be closed, with special fastenings. It has been a tradition that the bridegroom would wear it on his wedding day. The southern Albanian version of the xhamadan for men is no longer red like the northern one, but creamy or dark blue. The northern Albanian xhamadan would usually have one pocket for the pocketwatch, or two, if the watch had a chain. In southern Albania the chain would be worn diagonally, instead. Trivia The song "Xhamadani vija vija" (), composed in 1993 by Zef Çoba, refers to the xhamadan, and envisions the union of Albania and Kosovo, united under a common vest. See also Culture of Albania Qeleshe Opinga Albanian traditional clothing References Sources Albanian clothing Vests
Sir Nicholas Roger Warren (born 20 May 1949), styled The Hon. Mr Justice Warren, is a judge of the High Court of England and Wales. He was educated at Bryanston School and University College, Oxford. He was called to the bar at Middle Temple in 1972 and made a bencher there in 2001. He was made a QC in 1993, recorder 1999 to 2005, and judge of the High Court of Justice (Chancery Division) since 2005. References 1949 births Living people People educated at Bryanston School Alumni of University College, Oxford Members of the Middle Temple Chancery Division judges Knights Bachelor
Kevin Carmichael (born 30 December 1970), is an Australian former professional rugby league footballer who played in the 1990s and 2000s. He played for the South Queensland Crushers from 1995 to 1996 and then the Melbourne Storm in 2000. Carmichael was Norths Devils player of the year in 1993, 1998–99, and 2001. He was a member of the Norths 1998 Queensland Cup premiership team, scoring a try in the Grand Final win over Wests Panthers. As of 2010, he was a coach for the Norths Devils, guiding the team to the 2010 Queensland Cup Grand Final, where they lost 30–20 to Northern Pride. In 2019, he was awarded life membership of Norths. References 1970 births Living people Australian rugby league players South Queensland Crushers players Melbourne Storm players Place of birth missing (living people) Rugby league halfbacks
Harriet Fasenfest (born 1953) is an American writer, urban gardener, and food preservation educator in Portland, Oregon. A former owner/operator of several restaurants and cafes, she uses the term "householding" when referring to the practice of home food growing, canning and storage. She published her first book, A Householder's Guide to the Universe, in 2010. Biography Fasenfest was born and raised in Bronx, New York. She moved to the Northwest in 1978 where she owned and operated the Bertie Lou's and Harriet's Eat Now cafes. In 1990 she went back to traveling the country, married, moved back to California, and then moved to Georgia in 1992. While there, she began working with Habitat for Humanity International. In 1997 Fasenfest returned to Portland to work as director of the Performance Salon Series at North Portland's North Star Ballroom, an events arena which combined art and performance with social activism, and in 2000 opened her last cafe, Groundswell. In 2004 she transformed her backyard in Northern Portland into a producing garden. She grows produce with an eye to home canning and storing, and teaches classes in food preservation and backyard gardening. She is the co-owner of Preserve, an educational center for home gardening and food preservation, and creator of the www.portlandpreserve.com website, on which she writes a blog called The Householder's Grab Bag. She also blogs for Culinate.com. Fasenfest regards home food preservation as a political and economic statement. She uses the term "householding" rather than "homemaking" or "home economics" to describe her work. She published her views on home gardening and food preservation in A Householder's Guide to the Universe: A Calendar of Basics for the Home and Beyond. The book is organized by month and season. She lives in Portland, Oregon Bibliography Book reviews References External links www.householdinguniverse.com/ Householder's Grab Bag Posts by Harriet Fasenfest on Culinate "Preserving Food and Friendship" (video) American food writers People from the Bronx Writers from Portland, Oregon Food preservation 1953 births Living people
Vârteșcoiu is a commune located in Vrancea County, Romania. It is composed of six villages: Beciu, Faraoanele, Olteni, Pietroasa, Râmniceanca and Vârteșcoiu. References Communes in Vrancea County Localities in Muntenia
Pure Moxie is a memoir by Leda Sanford, the first female publisher of a major national magazine, The American Home. The memoir - self-published in 2010 by iUniverse - highlights Sanford's career in magazine publishing. A review that ran in the Pacific Sun (newspaper) said Pure Moxie "is a book that is both a nostalgic look back (it's dedicated to Betty Friedan) at the post-Mad Men era—when General Motors and magazines were a big deal—and a nod toward the future, especially for increasingly creaky baby boomers, as Sanford became something of a visionary on promoting a new idea of aging and re-invention late in life." References 2010 non-fiction books American memoirs
Suhail Warraich (; born 8 November 1961) is a Pakistani journalist, television host, analyst and media personality. Warraich's most popular programme is Aik Din Geo Kay Sath on Geo News every Saturday and Sunday. He also shares his opinions on the talk show Meray Mutabiq along with host Maria Memon and on many other Pakistani television programs. He is nominated for president pride of performance award on August 14,2023. The ceremony to be held on March 23, 2024 Early life and career Warraich was born in Jauharabd , Khushab (a district in Punjab, Pakistan). He belongs to Warraich clan of the Jat community. Warraich holds a master's degree in English literature from the University of the Punjab. He has been affiliated with GEO TV since its inception and had started his career in journalism through print media in December 1985. He is one of the most popular host of the GEO TV Programmes Ek Din Geo k Sath, an interview-based TV program on lifestyles of celebrities. He also used to host Left Right, a political talk show posing right-wing and left-wing political arguments. Warraich used to support the left wing on this TV show. He used to come on a programme Meray Mutabiq every Sunday, an opinionated interview/talk show based on Warraich's analytical views on current issues along with TV journalists Hassan Nisar and Iftikhar Ahmad. Sohail Warraich is also a human rights activist responsible for Amnesty International Pakistan's Human Rights Project. Senior journalist and analyst Sohail Warraich joined Dunya News in capacity of Executive Director on 23 January 2017. "Dunya Media Group announced the affiliation with the prominent media personality. The celebrated analyst took responsibility of Executive Director of Dunya News while performing duties as Group Editor at "Roznama Dunya". Suhail Warraich rejoined Geo TV and currently is affiliated with Jang Group of Newspapers in 2020. One of the major Pakistani English-language newspapers describes him, "Sohail Warraich is one of the most well-known political reporters, interviewers who, having spent a lifetime in print, took to television like a duck to water". Sohail Warraich is widely considered to be an authority on Punjab's political families, clans or 'biradari' system voting trend prevalent in Punjab's election politics. Publications He is also author of two books Ghaddar Kaun? and Qatil Kaun?. In his book Ghaddar Kaun (Who's the Traitor?), Sohail Warraich writes about the facts that led to the coup d'état of 1999 in Pakistan and in the aftermath of the events on October 12, 1999. Former Prime Minister Mian Nawaz Sharif revealed many new facts about his life and political career in that interview and later included in Warraich's book. Sohail Warraich completed the book after almost three years of work. This book covers the entire life of Mian Nawaz Sharif, the former Prime Minister of Pakistan in 2017. In September 2020, his recent book titled Yeh Company Nahin Chale Gi (this company won't run) was removed from the bookstores in Pakistan due to objections on and reservations about a cartoon on its cover. According to Samaa TV News website, "The cartoon on the cover showed General Bajwa sitting in a chair and PM Khan sitting in his feet. The leaders of the opposition Nawaz Sharif, Asif Ali Zardari, Bilawal Bhutto Zardari and Maryam Nawaz were shown trying to look into the room from a window." Journalism style Warraich is known for his direct and blunt questioning style and sarcastic speaking tone and humour. His tag line 'Kia yeh khula tazzad nahin?' is very famous among the comedians and have been frequently repeated in several TV shows. He has conducted interviews with a number of high-profile personalities and political figures and is given credit for his journalistic skills where he was able to extract interesting revelations from some prominent personalities of Pakistan. Books Qatil Kaun? Ghaddar Kaun? (2006) (based on interviews when Nawaz Sharif was in exile in Saudi Arabia) Gernailun Ki Siasat Adalia Ke Uroojo Ki Kahani Mazhabi Siasat Ke Tazadat Chotay Soobay Punjab Se Naraz Keun The Party is Over (2018) (inside stories of the disqualification of former Prime Minister Nawaz Sharif) References External links Watch Sohail Warraich's TV program 'Ek Din Geo k Sath' 1961 births Living people Pakistani television hosts Pakistani male journalists Geo News newsreaders and journalists Punjabi people People from Sargodha District Central Model School, Lahore alumni University of the Punjab alumni Pakistani columnists People from Lahore
The Narrows is the name given to a geological feature located east of Benjamin in Knox County, Texas. It is a narrow crest running east-to-west along a hogback dividing the watershed of the Wichita River to the north from that of the Brazos River to the south. That is, precipitation falling to the north of the crest will flow into the Wichita River, and thence into the Red River and ultimately the Mississippi, while precipitation falling to the south will flow into the Brazos and then directly into the Gulf of Mexico. Before white settlers arrived in the area, buffalo were drawn to the spot due to the presence of buffalo grass and fresh springs, with the result that the area was known as prime hunting ground to several tribes of Indians, including the Comanche, Wichita, Kiowa, Apache, Seminole, and Tonkawa. Evidence of their battles and campgrounds is still being discovered. The new settlers used these same Indian-worn trails to traverse the area. Today the canyons and ravines of the area's badlands topography are used for ranching purposes. US 82 runs directly along the crest, and the area, being picturesque, has become a popular tourist attraction; a roadside park and historical marker have been set up along the highway. References Geology of Texas Landforms of Knox County, Texas Rock formations of Texas
Rohrbrunn () is a village in Burgenland, Austria. It is part of the municipality of Deutsch Kaltenbrunn in the district of Jennersdorf. Rohrbrunn is located near the border of Styria by the river Lafnitz. History Rohrbrunn was part of the Kingdom of Hungary until the Treaty of Trianon in 1920. It belonged to Vas county. The small village has been inhabited by ethnic Germans since its establishment in the Middle Ages. According to the Roman Catholic ecclesiastic administration Rohrbrunn always belonged to the nearby parish of Deutsch Kaltenbrunn. "Nádkuth" was given to Ferenc Batthyány in 1524. The ownership of the noble Batthyány family lasted about 350 years. In 1605 the army of Stephen Bocskay destroyed almost the whole village. In 1851 Elek Fényes recorded that Rohrbrunn was populated by 428 people (almost exclusively Roman Catholic Germans). There was a toll-house in the village due to its proximity to the border of Styria. The Batthyánys remained the main landowners. The peasants earned their livelihood from growing wheat, tobacco, hemp and fruits or making a small amount of wine. Alois Brunner, one of the most infamous Austrian Nazi war criminals, was born in Nádkút in 1912. In World War I a total of 31 men perished. Name In 18th and 19th century sources both the traditional German and Hungarian names of the village are mentioned. Rohrbrunn and Nádkút have the same meaning: "reed-well" which refers to the marshes of the Lafnitz valley. The German name was recorded in 1427 as Rohrprunn. The Hungarian name was recorded as Nádkuth in 1524. The German version became the sole official name of the village after 1920. Population Notable people from Rohrbrunn Born in Rohrbrunn Alois Brunner, Austrian Nazi war criminal (1912–2001) Cities and towns in Jennersdorf District
Agetus is a genus of copepods belonging to the family Corycaeidae. The genus has almost cosmopolitan distribution. Species: Agetus flaccus Agetus limbatus Agetus typicus References Copepods
KF Vora is an Albanian football club based in Vorë in the Tirana District. The club was founded in 1989 and they currently participate in the Kategoria e Parë. Current squad Honours Kategoria e Dytë: (3) 2017–18, 2019–20, 2022–23 Kategoria e Tretë: (1) 2011–12 References Football clubs in Albania Association football clubs established in 2011 2011 establishments in Albania FK Vora Albanian Third Division clubs Kategoria e Dytë clubs
The Capivari River (Portuguese, Rio Capivari) is a river of São Paulo state in southeastern Brazil. It is a tributary of the Tietê River. See also List of rivers of São Paulo Tributaries of the Río de la Plata References Brazilian Ministry of Transport Rivers of São Paulo (state) Tributaries of the Tietê
The Center for the Study of Southern Culture (CSSC), located in Barnard Observatory on the University of Mississippi campus in Oxford, Mississippi, is an academic organization dedicated to the investigation, documentation, interpretation and teaching of the Southern United States, including its culture. The CSSC includes the Southern Documentary Project division and the Southern Foodways Alliance institute, and a partner publication, Living Blues magazine. Over the years it has hosted countless programs, including the Oxford Conference for the Book, the Music of the South Concert Series and Symposium, the Gilder-Jordan Lecture in Southern Cultural History, the Blues Today Symposium, and the Southern Documentary Festival. The center supports an undergraduate and graduate Southern Studies academic department, granting Bachelor of Arts, Master of Arts, and Master of Fine Arts degrees. Former directors of the Center include William Ferris, Charles Reagan Wilson, and Ted Ownby. Kathryn McKee is the current director, and James G. Thomas, Jr. and Afton Thomas are the associate directors. CSSC published the award-winning Encyclopedia of Southern Culture and The New Encyclopedia of Southern Culture. In 2014, the CSSC launched the online journal Study the South. In Barnard Observatory, the center's Gammill Gallery hosts changing exhibits of documentary photography of the American South. Among the many collections permanently housed at the center is the Kenneth S. Goldstein Folklore Collection. Study the South Launched in 2014, Study the South is a peer-reviewed multimedia online journal, focusing on the culture of the American South. The academic approach is interdisciplinary, with a particular focus on history, anthropology, sociology, music, literature, documentary studies, gender studies, religion, geography, media studies, race studies, ethnicity, folklife, and art. Programs and lecture series Oxford Conference for the Book SouthTalks Music of the South Series and Symposium Gilder-Jordan Lecture in Southern Cultural History Blues Today Symposium Southern Documentary Festival Publications Study the South journal The Mississippi Encyclopedia Living Blues magazine The New Encyclopedia of Southern Culture Encyclopedia of Southern Culture The Southern Register The Faulkner & Yoknapatawpha Series See also Center for the Study of the American South at the University of North Carolina. References External links Center for the Study of Southern Culture official web site Gammill Gallery University of Mississippi Research institutes in Mississippi Museums in Lafayette County, Mississippi History museums in Mississippi
The Under Secretary for Arms Control and International Security (T) is a position within the U.S. Department of State that serves as Senior Adviser to the President and the Secretary of State for Arms Control, Nonproliferation, and Disarmament. In this capacity, the Under Secretary (U/S) attends and participates, at the direction of the President, in National Security Council (NSC) and subordinate meetings pertaining to arms control, nonproliferation, and disarmament and has the right to communicate, through the Secretary of State, with the President and members of the NSC on arms control, nonproliferation, and disarmament concerns. The U/S also leads the interagency policy process on nonproliferation and manages global U.S. security policy, principally in the areas of nonproliferation, arms control, regional security and defense relations, and arms transfers and security assistance. The U/S provides policy direction in the following areas: nonproliferation, including the missile and nuclear areas, as well as chemical, biological, and conventional weapons proliferation; arms control, including negotiation, ratification, verification and compliance, and implementation of agreements on strategic, non-conventional, and conventional forces; regional security and defense relations, involving policy regarding U.S. security commitments worldwide as well as on the use of U.S. military forces in unilateral or international peacekeeping roles; and arms transfers and security assistance programs and arms transfer policies. By delegation from the Secretary, the U/S performs a range of functions under the Foreign Assistance Act, Arms Export Control Act, and related legislation. The bureaus of International Security and Nonproliferation, Political-Military Affairs, and Arms Control, Verification, and Compliance are under the policy oversight of the Under Secretary for Arms Control and International Security. By statute, the Assistant Secretary for Arms Control, Verification, and Compliance, the Assistant Secretary of State for International Security and Nonproliferation, and the Assistant Secretary for Political-Military Affairs all report to the Under Secretary for Arms Control and International Security. According to the Office of the Historian of the U.S. Department of State, the Under Secretary first received the permanent title "Senior Adviser to the President and the Secretary of State for Arms Control, Nonproliferation and Disarmament" when the Clinton administration decided to merge the Arms Control and Disarmament Agency and the United States Information Agency into the State Department, as well as realigning the United States Agency for International Development with it. List of Under Secretaries of State for International Security Affairs, 1972–1993 List of Under Secretaries of State for Arms Control and International Security, 1993–present References External links The website of the Under Secretary for Arms Control and International Security The Office of the Historian's page on Department of State organizational changes during the Clinton administration 1972 introductions Arms control people United States national security policy
Zygostates is a genus of orchids widespread across much of South America from Guyana to Argentina. The word is from the Greek ζυγοστάτης (zygostates, weigher, balance) and refers to the projections from the base of the column which resemble a balance. References Orchids of South America Oncidiinae Oncidiinae genera
```shell Interactively unstage changes Check the reflog Specify a commit by its ancestry Useful stashing options Sign your work (using GPG) ```
Aleksei Filippov may refer to: Aleksei Filippov (footballer born 1973), Russian footballer who most notably played for FC Dynamo Moscow Aleksei Filippov (footballer born 1975), Russian footballer with FC Druzhba Maykop Aleksei Filippov (writer), Russian writer nominated for Anti-Booker prize in 2000 Aleksei Fedorovich Filippov (1923 – 2006), Russian mathematician, professor of Moscow State University
The women's discus throw event at the 2003 Summer Universiade was held on 28 August in Daegu, South Korea. Results References Results Athletics at the 2003 Summer Universiade 2003 in women's athletics 2003
The Lyu-Chuan Canal () is a canal in Taichung, Taiwan. History The canal is the birthplace of the development of Taichung as a city during Japanese colonial era. As time passed by, the canal started to get polluted due to the urban development and industrialization of Taichung in the 1980s. However since 2014, the Taichung City Government initiated a 17-month project to revitalize the canal, which included works to improve the canal flood mitigation capability, improve the water quality and create a water-friendly environment for the area along the canal. Polluted water is diverted to a nearby Zhonghua water treatment plant to be processed before being released back to the waterway. A 610-meter long walking path was also designed along the canal. The project cost about NT$850 million. The canal was then reopened to the public on 10 February 2018. In the same month, the canal was featured at an exhibition in Taichung, which was promoted as a canal with a trademark, the first of its kind in Taiwan. Geology The canal spans over a length of 6.1 km. It is currently being used to regulate the water flow between high flow and low flow seasons. Ecology The canal features various species of fish. See also Geography of Taiwan Water supply and sanitation in Taiwan References Canals in Taiwan Geography of Taichung Year of establishment missing
The Count of Monte Cristo is a British 12-part dramatization of Alexandre Dumas's 1844 novel of the same name. It was made by the BBC and was screened in the autumn of 1964. The series starred Alan Badel in the title role. As well as being the only BBC version, the serial survived the corporation's junking policy intact and is available on DVD. Premise Edmond Dantes, a sailor, is falsely accused and imprisoned by three men who have various reasons to be jealous of him. After 14 years imprisoned in the Chateau d'If he escapes, and, after recovering a treasure hidden on the island of Monte Cristo revealed to him by the Abbe Faria, a fellow prisoner, he embarks on a campaign of revenge against those who have wronged him. Cast Alan Badel as Edmond Dantes Natasha Parry as Mercédès Philip Madoc as Fernand Mondego Morris Perry as Danglars Michael Gough as Villefort Michael Robbins as Caderousse Anthony Newlands as M. Morel John Wentworth as Abbe Faria David Calderisi as Jacopo Cyril Shaps as Bertuccio Rosalie Crutchley as Mme. Danglars Patricia English as Mme. Villefort Sandor Eles as Albert Morcerf Isobel Black as Eugenie Danglars Anna Palk as Valentine Villefort Edward de Souza as Maximilian Morel Austin Trevor as Cavalcanti Richard Kay as Benedetto Valerie Sarruf as Haydee Production The series was made in 12 episodes of 25 minutes each, with a total run time of 300 minutes. It was filmed in black and white and had an intense, theatrical style. The script remained largely faithful to the original plot, and is regarded as the best screen version of the story, with Badel as the definitive Count. The series was produced by Campbell Logan, and directed by Peter Hammond. The screenplay was by Anthony Steven. It is unknown if the production was broadcast live with pre-film inserts or if it was broadcast from 405-line videotapes which were wiped at a later date, although all episodes survive as 35mm telerecordings. Episodes References External links 1960s British drama television series BBC television dramas Black-and-white British television shows Television shows based on The Count of Monte Cristo Television series set in the 1810s Television series set in the 1820s Television series set in the 1830s
QQ Music () is one of three Chinese freemium music streaming services owned by Tencent Music, a joint venture between Tencent and Spotify. As of 2018, the service is set to reach over 700 million users with an estimated 120 million subscribers. The service merged with China Music Corporation, owners of KuGou and KuWo, the second and the third largest streaming services respectively in the country, in 2016. By 2018, QQ Music's market share among Mainland China's music platforms increased to 75%. Outside of streaming, the service leverages its brand to the public through the annual QQ Music Awards. Business service QQ Music operates under a freemium business model in which basic services are free whilst enhanced features are available on a subscription. However unlike similar subscription service Spotify, labels have the ability to restrict its content to be restricted to subscribing users (known as VIPs or green diamonds) or be purchasable on their website which usually costs around 19 to 20 yuan. Artists using this strategy include Noah Cyrus, Ariana Grande and Taylor Swift in which certain albums are restricted to be purchased only. QQ Music generally encourages users to purchase their VIP subscription service. Accounts and subscriptions As of March 2020, QQ Music offers three subscription types. Listening limitations (聆听限制) QQ Music only operates in China, however, for an uncertain amount of time, the free service was freely available to be used worldwide, and many international users used the service in order to circumvent paid services such as Apple Music or Spotify. In 2016, to strengthen copyright restrictions, QQ Music blocked international users, and users overseas will generally receive an error when trying to play music such as this one: '抱歉,应版权方要求,暂无法在当前国家或地区提供此歌曲服务' ('Sorry, this song is not yet available in the current country or region at the request of the copyright owner'). In 2017, Alibaba Music and Tencent Music had a deal to collaborate on music copyright allowing Alibaba Music service Xiami and QQ Music to share exclusive copyright deals. However, Alibaba Music has exclusive rights to certain SM Entertainment Korean releases (such as Luna, EXO, EXO-CBX, Girls' Generation) meaning that QQ Music and other competing service's users will not be able to stream these songs. The rights to SM Entertainment music were returned as a shared entity to QQ Music when Tencent Music Entertainment and SM Entertainment signed a deal in 2019. Downloads Downloads on QQ Music are limited to some songs for free users. Labels can control whether free users can download their songs on the free plan or restrict downloading to the VIP plan. Downloads on the free plan are DRM-protected on both desktop and mobile whilst VIP downloads are free from DRM on desktops but are still protected over mobile platforms. When purchasing an album, a user is automatically entitled to the album and thus even if a VIP subscription ends, the user is still able to listen to the songs they purchased free of charge. Technical information QQ Music is proprietary and generally uses Digital Rights Management (DRM) protection. Streams and downloads are in two formats, the MP3 media file system is used for standard quality streams and downloads at 128 kbit/s and 320 kbit/s for High Quality (abbreviated as HQ in China). The FLAC media file system is used for SQ streams and downloads. HQ and SQ streams and downloads are only available for the VIP and Luxury plans. SQ streams are not available on the QQMusic web player. QQ Music also connects to the Music app on iOS systems and allows for users to combine their Local Files library with their QQ Music library through the download section of the app. Such feature also works on the desktop application where the QQ Music application will scan for local music files and allow users to play it via the application. Ban in India In June 2020, the Government of India banned QQ Music with 58 other Chinese origin apps citing data and privacy issues. The border tensions in 2020 between India and China might have also played a role in the ban. See also JOOX (Tencent's foreign music streaming service) References External links Tencent Music Music streaming services Online music stores of China Internet censorship in India
Dame Shan Elizabeth Morgan (born 12 March 1955) is a former British civil servant. Formerly the Deputy Permanent Representative, UK Representation to the European Union, she was the Permanent Secretary to the Welsh Government until October 2021. Early life Dame Shan Morgan was born in London, the daughter of Air Commodore Alun Morgan CBE and Yvonne Davies. She attended South Park Girls' High School (a girls' grammar school) in Lincoln, Wycombe High School (a girls' grammar school), and then the Royal Latin School, a coeducational grammar school in Buckingham. Morgan studied French Literature and Language at the University of Kent, gaining a BA in 1977. Career Morgan joined the Manpower Services Commission in 1977. In 1984 she worked at the European Commission in Brussels. In 1987 she returned to the UK, and became the Private Secretary to the Permanent Secretary at the Department of Employment. In 1991 she became a policy analyst in the National Training Task Force. In 1992 Morgan became the Head of the Employment and Training Strategy Unit at the Government Office for London. In 1994 at the Department for Education and Employment, she was the UK's delegate to the International Labour Organization's governing body. FCO In 1997 Morgan became an attaché at the British Embassy in Paris. In 2001 she returned to Brussels, becoming Director for the European Union at the FCO in 2006. Ambassador It was announced that Morgan would become the Ambassador to Argentina on 5 September 2008, and she took up the post in October 2008. On 22 July 2009 she kissed hands with the Queen at Buckingham Palace, to officially become the Ambassador to the Argentine Republic and to the Republic of Paraguay (a combined post, based in Buenos Aires). Her time in office coincided with sabre-rattling by President Cristina Fernández de Kirchner, who described the British as "an occupying colonial force in the Falkland Islands" in October 2010, when she complained to the UN about "militarisation of the South Atlantic". Britain has over 1,000 troops on the Falkland Islands, and four Eurofighter Typhoons (No. 1435 Flight RAF) at RAF Mount Pleasant. She left Argentina in May 2012. From 2012 to 2016, Morgan was UK representative to the EU Council's Committee of the Deputy Representatives of the Member States (Coreper) in Brussels. Permanent Secretary On 9 November 2016 it was announced that Morgan had been appointed as the new Permanent Secretary for the Welsh Government. She assumed her post in February 2017. She retired from the role in October 2021. Honours Morgan was appointed Companion of the Order of St Michael and St George (CMG) in the 2012 New Year Honours and Dame Commander of the Order of St Michael and St George (DCMG) in the 2017 Birthday Honours. See also Falkland Islands sovereignty dispute Argentina–United Kingdom relations References External links FCO BBC Wales Flickr 1955 births Living people People educated at Wycombe High School People educated at the Royal Latin School Alumni of the University of Kent Ambassadors of the United Kingdom to Argentina Ambassadors of the United Kingdom to Paraguay Dames Commander of the Order of St Michael and St George British women ambassadors
Gary Russell (born 18 September 1963) is a British freelance writer, producer and former child actor. As a writer, he is best known for his work in connection with the television series Doctor Who and its spin-offs in other media. As an actor, he is best known for playing Dick Kirrin in the British 1978 television series The Famous Five. Biography Russell was born in Maidenhead, Berkshire. His on-screen acting career included leading roles in the BBC's adaptation of E. Nesbit's novel The Phoenix and the Carpet as Cyril, ITV's adaptations of Enid Blyton's Famous Five novels (as Dick) and the BBC's Look & Read schools series, playing Lord Edward Dark in Dark Towers. He also spent seasons performing with Prospect Theatre Company and the Royal National Theatre. He has written guide books, under the pseudonym Warren Martyn, to Frasier and The Simpsons for Virgin Publishing. He was editor of Doctor Who Magazine between 1992 and 1995. He was the producer for the Doctor Who licensed audio drama tie-ins at Big Finish Productions from its inception in 1998 until July 2006, when he stepped down to work for BBC Wales as a Script Editor on Doctor Who The Sarah Jane Adventures and Torchwood. He has written a number of Doctor Who spin-off novels and in 2000 co-wrote with executive producer Philip Segal the book Doctor Who: Regeneration (HarperCollins, ), the making-of book of the 1996 Doctor Who television movie, as well as the TV movie's novelisation in 1996. He wrote a series of The Art of The Lord of the Rings, one per film, plus a fourth featuring material that could not be fitted into the individual volumes, and contributed to Gollum: How We Made Movie Magic with Andy Serkis. He also wrote the behind-the-scenes book on the making of the Matthew Warchus directed 2007 stage musical version of The Lord of the Rings. His behind-the-scenes book Doctor Who: The Inside Story was published in October 2006, coinciding with his joining the Doctor Who production team. His most recent reference work was also for Doctor Who; published in 2007 by BBC Books, The Doctor Who Encyclopedia is a guide to the current Doctor Who series (2005–present), which has been regularly updated (most recently in 2012) and published both in hardback and via an app. He also wrote a similar encyclopedia for Torchwood and The Torchwood Archive, a semi-fictional guide to the show. He also co-produced and directed the animated mini series The Infinite Quest and Dreamland, which tied in with the current television series of Doctor Who as well as a series of award-winning animated online games also based on the show. In 2011, having left BBC Wales, he briefly returned to Big Finish to produce the Bernice Summerfield and Gallifrey audios, before moving to Australia and becoming the Executive Producer at animation company Planet 55 Studios. There he has overseen the development and production of a new children's sci-fi cartoon Prisoner Zero for ABC Television. He returned to the UK in 2016. Credits Film and TV Stage Bibliography Comics Doctor Who (in Doctor Who Magazine No. 173, 235–237, 1991, 1996, and in Radio Times issues dated 1 June 1996 – 2 March 1997) IDW Doctor Who comic book At the 2007 San Diego Comic Con, IDW Publishing announced their intention to publish a new series of Doctor Who comics, which will follow the adventures of the Tenth Doctor and Martha Jones. The first six issues of this series, later collected as Agent Provocateur, were scripted by Russell and published in early 2008. He has also written a number of Torchwood strips for Titan Publishing. Books Directing credits Awards In April 2022, Gary Russell was given the inaugural Terrance Dicks Award For Writers by the Doctor Who Appreciation Society. References External links Scales of Injustice E-book on the BBC website Interview with Russell on the BBC Doctor Who website Interview with Russell in the Pantechnicon Magazine 1963 births English book editors English male child actors English comics writers English male film actors English magazine editors English science fiction writers English male television actors Living people People from Maidenhead Writers of Doctor Who novels 20th-century English novelists 21st-century British novelists
Events in the year 1759 in Norway. Incumbents Monarch: Frederick V Events Arts and literature Births 23 May – Johan Ernst Mowinckel, merchant and consul (died 1816). 2 July – Niels Andreas Vibe, military officer (died 1814). 2 August – Johan Christopher Haar Daae, priest and politician (died 1827) 13 August – Niels Hertzberg, priest and politician (died 1841). 23 October – Sivert Aarflot, educator (died 1817) 26 October – Haagen Mathiesen, timber merchant (died 1842). 9 November – Frederik Petersen, painter (died 1825) 30 November - Just Henrik Ely, military officer (died 1824). Full date unknown Lars Larsen Forsæth, farmer and politician (died 1839). Deaths 8 January - Rasmus Paludan, bishop (b. 1702). 24 March - Mathias Collett, civil servant (b. 1708). See also References
The 9th Indie Series Awards were held on April 4, 2018, at The Colony Theatre in Los Angeles, with the ceremony hosted by Emmy Award-winner Patrika Darbo. Presented by We Love Soaps, the awards recognize independently produced, scripted entertainment created for the web. Ladies of the Lake led all series with 18 total nominations, followed by The Bay with 16. Filth City led all comedies with 12 nominations. The first ever category for unscripted shows was added this year. Awards The awards were given on April 4, 2017. Winners are listed first and highlighted in boldface: References External links Indie Series Awards History and Archive of Past Winners Indie Series Awards 2018 film awards
Rosemary Turare-Omundsen (born 6 June 1964) is a Papua New Guinean former middle-distance runner. She competed in the women's 1500 metres at the 1992 Summer Olympics. References External links 1964 births Living people Athletes (track and field) at the 1992 Summer Olympics Papua New Guinean female middle-distance runners Papua New Guinean female long-distance runners Olympic athletes for Papua New Guinea Athletes (track and field) at the 1994 Commonwealth Games Commonwealth Games competitors for Papua New Guinea Place of birth missing (living people)
Markes International, headquartered in the UK, develops and manufactures scientific instruments for thermal desorption. Markes’ factory, technical centre and headquarters is near Cardiff, UK. In 2011, they expanded this and their US operation in Cincinnati, Ohio (Markes International, Inc.), adding extra laboratory and demonstration facilities. In 2017 the Cincinnati office was closed and the US operations transferred to a new office in Gold River, Sacramento, California. In 2013, Markes became a company of the Schauenburg International Group, and opened a technical centre near Frankfurt as part of their German operation (Markes International GmbH). The company has arrangements for distribution and market development with Agilent Technologies, ThermoFisher Scientific, and a number of other distributors. Markes International holds patents for a number of technological innovations, including diffusion-locking caps and inserts for sorbent tubes, RFID tags for sorbent tubes, and a soft electron ionisation source. In 2015 Markes International received a Queen's Award for Enterprise in the "International Trade" category (2015). References See also Scientific instrument Thermal desorption Companies of Wales 1997 establishments in Wales Companies based in Rhondda Cynon Taf Instrument-making corporations Manufacturing companies established in 1997 Welsh brands
Bigotti, also known as Bigotti Exclusive, is a Romanian brand of men's clothing manufacturer owned by Graftex Prodcom SRL. Bigotti is promoted as a luxury ready-made clothes and leather goods for men, offering style, quality and diversity for an original, successful image. Other brands owned by Graftex Prodcom SRL are Massini Camicia, Egobigotti, Artigiani and Il Capo Uomo. References External links bigotti.eu bigotti.ro Graftex Prodcom Clothing brands of Romania Clothing companies of Romania
```javascript !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.AFRAME=e()}}(function(){var t;return function i(e,t,r){function n(a,s){if(!t[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=t[a]={exports:{}};e[a][0].call(l.exports,function(t){var i=e[a][1][t];return n(i?i:t)},l,l.exports,i,e,t,r)}return t[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)n(r[a]);return n}({1:[function(e,t){"use strict";t.exports={createLink:function(e,t){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("link");r.href=e,r.rel="stylesheet";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];r.setAttribute("data-"+n,o)}i.appendChild(r)},createStyle:function(e,t){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];r.setAttribute("data-"+n,o)}r.sheet?(r.innerHTML=e,r.sheet.cssText=e,i.appendChild(r)):r.styleSheet?(i.appendChild(r),r.styleSheet.cssText=e):(r.appendChild(document.createTextNode(e)),i.appendChild(r))}}},{}],2:[function(e,t){function i(){u=!1,a.length?c=a.concat(c):l=-1,c.length&&r()}function r(){if(!u){var e=setTimeout(i);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,u=!1,clearTimeout(e)}}function n(e,t){this.fun=e,this.array=t}function o(){}var a,s=t.exports={},c=[],u=!1,l=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];c.push(new n(e,t)),1!==c.length||u||setTimeout(r,0)},n.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=o,s.addListener=o,s.once=o,s.off=o,s.removeListener=o,s.removeAllListeners=o,s.emit=o,s.binding=function(){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],3:[function(e,t,i){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function n(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+i.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0,o=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))}),e.splice(o,0,r),e}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{null==e?i.storage.removeItem("debug"):i.storage.debug=e}catch(t){}}function s(){var e;try{e=i.storage.debug}catch(t){}return e}function c(){try{return window.localStorage}catch(e){}}i=t.exports=e("./debug"),i.log=o,i.formatArgs=n,i.save=a,i.load=s,i.useColors=r,i.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),i.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],i.formatters.j=function(e){return JSON.stringify(e)},i.enable(s())},{"./debug":4}],4:[function(e,t,i){function r(){return i.colors[l++%i.colors.length]}function n(e){function t(){}function n(){var e=n,t=+new Date,o=t-(u||t);e.diff=o,e.prev=u,e.curr=t,u=t,null==e.useColors&&(e.useColors=i.useColors()),null==e.color&&e.useColors&&(e.color=r());var a=Array.prototype.slice.call(arguments);a[0]=i.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var s=0;a[0]=a[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;s++;var n=i.formatters[r];if("function"==typeof n){var o=a[s];t=n.call(e,o),a.splice(s,1),s--}return t}),"function"==typeof i.formatArgs&&(a=i.formatArgs.apply(e,a));var c=n.log||i.log||console.log.bind(console);c.apply(e,a)}t.enabled=!1,n.enabled=!0;var o=i.enabled(e)?n:t;return o.namespace=e,o}function o(e){i.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,n=0;r>n;n++)t[n]&&(e=t[n].replace(/\*/g,".*?"),"-"===e[0]?i.skips.push(new RegExp("^"+e.substr(1)+"$")):i.names.push(new RegExp("^"+e+"$")))}function a(){i.enable("")}function s(e){var t,r;for(t=0,r=i.skips.length;r>t;t++)if(i.skips[t].test(e))return!1;for(t=0,r=i.names.length;r>t;t++)if(i.names[t].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}i=t.exports=n,i.coerce=c,i.disable=a,i.enable=o,i.enabled=s,i.humanize=e("ms"),i.names=[],i.skips=[],i.formatters={};var u,l=0},{ms:5}],5:[function(e,t){function i(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var i=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return i*l;case"days":case"day":case"d":return i*u;case"hours":case"hour":case"hrs":case"hr":case"h":return i*c;case"minutes":case"minute":case"mins":case"min":case"m":return i*s;case"seconds":case"second":case"secs":case"sec":case"s":return i*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i}}}}function r(e){return e>=u?Math.round(e/u)+"d":e>=c?Math.round(e/c)+"h":e>=s?Math.round(e/s)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function n(e){return o(e,u,"day")||o(e,c,"hour")||o(e,s,"minute")||o(e,a,"second")||e+" ms"}function o(e,t,i){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+i:Math.ceil(e/t)+" "+i+"s"}var a=1e3,s=60*a,c=60*s,u=24*c,l=365.25*u;t.exports=function(e,t){return t=t||{},"string"==typeof e?i(e):t["long"]?n(e):r(e)}},{}],6:[function(e,t){"use strict";function i(e){if(null===e||void 0===e)throw new TypeError("Sources cannot be null or undefined");return Object(e)}function r(e,t,i){var r=t[i];if(void 0!==r&&null!==r){if(a.call(e,i)&&(void 0===e[i]||null===e[i]))throw new TypeError("Cannot convert undefined or null to object ("+i+")");e[i]=a.call(e,i)&&o(r)?n(Object(e[i]),t[i]):r}}function n(e,t){if(e===t)return e;t=Object(t);for(var i in t)a.call(t,i)&&r(e,t,i);if(Object.getOwnPropertySymbols)for(var n=Object.getOwnPropertySymbols(t),o=0;o<n.length;o++)s.call(t,n[o])&&r(e,t,n[o]);return e}var o=e("is-obj"),a=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;t.exports=function(e){e=i(e);for(var t=1;t<arguments.length;t++)n(e,arguments[t]);return e}},{"is-obj":7}],7:[function(e,t){"use strict";t.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},{}],8:[function(){!function(t,i,r,n){"use strict";function o(e,t){for(var i=0,r=e.length;r>i;i++)v(e[i],t)}function a(e){for(var t,i=0,r=e.length;r>i;i++)t=e[i],b(t,P[c(t)])}function s(e){return function(t){ne(t)&&(v(t,e),o(t.querySelectorAll(F),e))}}function c(e){var t=se.call(e,"is"),i=e.nodeName.toUpperCase(),r=V.call(U,t?k+t.toUpperCase():z+i);return t&&r>-1&&!u(i,t)?-1:r}function u(e,t){return-1<F.indexOf(e+'[is="'+t+'"]')}function l(e){var t=e.currentTarget,i=e.attrChange,r=e.attrName,n=e.target;ve&&(!n||n===t)&&t.attributeChangedCallback&&"style"!==r&&e.prevValue!==e.newValue&&t.attributeChangedCallback(r,i===e[S]?null:e.prevValue,i===e[I]?null:e.newValue)}function h(e){var t=s(e);return function(e){y.push(t,e.target)}}function d(e){ge&&(ge=!1,e.currentTarget.removeEventListener(_,d)),o((e.target||i).querySelectorAll(F),e.detail===D?D:L),re&&m()}function p(e,t){var i=this;ce.call(i,e,t),M.call(i,{target:i})}function f(e,t){ee(e,t),w?w.observe(e,he):(me&&(e.setAttribute=p,e[T]=x(e),e.addEventListener(O,M)),e.addEventListener(j,l)),e.createdCallback&&ve&&(e.created=!0,e.createdCallback(),e.created=!1)}function m(){for(var e,t=0,i=oe.length;i>t;t++)e=oe[t],G.contains(e)||(i--,oe.splice(t--,1),v(e,D))}function g(e){throw new Error("A "+e+" type is already registered")}function v(e,t){var i,r=c(e);r>-1&&(E(e,P[r]),r=0,t!==L||e[L]?t===D&&!e[D]&&(e[L]=!1,e[D]=!0,r=1):(e[D]=!1,e[L]=!0,r=1,re&&V.call(oe,e)<0&&oe.push(e)),r&&(i=e[t+"Callback"])&&i.call(e))}if(!(n in i)){var y,M,A,x,w,E,b,T="__"+n+(1e5*Math.random()>>0),L="attached",D="detached",N="extends",S="ADDITION",C="MODIFICATION",I="REMOVAL",j="DOMAttrModified",_="DOMContentLoaded",O="DOMSubtreeModified",z="<",k="=",R=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,B=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],U=[],P=[],F="",G=i.documentElement,V=U.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},Q=r.prototype,Y=Q.hasOwnProperty,H=Q.isPrototypeOf,W=r.defineProperty,X=r.getOwnPropertyDescriptor,q=r.getOwnPropertyNames,Z=r.getPrototypeOf,K=r.setPrototypeOf,J=!!r.__proto__,$=r.create||function ye(e){return e?(ye.prototype=e,new ye):this},ee=K||(J?function(e,t){return e.__proto__=t,e}:q&&X?function(){function e(e,t){for(var i,r=q(t),n=0,o=r.length;o>n;n++)i=r[n],Y.call(e,i)||W(e,i,X(t,i))}return function(t,i){do e(t,i);while((i=Z(i))&&!H.call(i,t));return t}}():function(e,t){for(var i in t)e[i]=t[i];return e}),te=t.MutationObserver||t.WebKitMutationObserver,ie=(t.HTMLElement||t.Element||t.Node).prototype,re=!H.call(ie,G),ne=re?function(e){return 1===e.nodeType}:function(e){return H.call(ie,e)},oe=re&&[],ae=ie.cloneNode,se=ie.getAttribute,ce=ie.setAttribute,ue=ie.removeAttribute,le=i.createElement,he=te&&{attributes:!0,characterData:!0,attributeOldValue:!0},de=te||function(){me=!1,G.removeEventListener(j,de)},pe=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,10)},fe=!1,me=!0,ge=!0,ve=!0;K||J?(E=function(e,t){H.call(t,e)||f(e,t)},b=f):(E=function(e,t){e[T]||(e[T]=r(!0),f(e,t))},b=E),re?(me=!1,function(){var t=X(ie,"addEventListener"),i=t.value,r=function(e){var t=new CustomEvent(j,{bubbles:!0});t.attrName=e,t.prevValue=se.call(this,e),t.newValue=null,t[I]=t.attrChange=2,ue.call(this,e),this.dispatchEvent(t)},n=function(t,i){var r=this.hasAttribute(t),n=r&&se.call(this,t);e=new CustomEvent(j,{bubbles:!0}),ce.call(this,t,i),e.attrName=t,e.prevValue=r?n:null,e.newValue=i,r?e[C]=e.attrChange=1:e[S]=e.attrChange=0,this.dispatchEvent(e)},o=function(e){var t,i=e.currentTarget,r=i[T],n=e.propertyName;r.hasOwnProperty(n)&&(r=r[n],t=new CustomEvent(j,{bubbles:!0}),t.attrName=r.name,t.prevValue=r.value||null,t.newValue=r.value=i[n]||null,null==t.prevValue?t[S]=t.attrChange=0:t[C]=t.attrChange=1,i.dispatchEvent(t))};t.value=function(e,t,a){e===j&&this.attributeChangedCallback&&this.setAttribute!==n&&(this[T]={className:{name:"class",value:this.className}},this.setAttribute=n,this.removeAttribute=r,i.call(this,"propertychange",o)),i.call(this,e,t,a)},W(ie,"addEventListener",t)}()):te||(G.addEventListener(j,de),G.setAttribute(T,1),G.removeAttribute(T),me&&(M=function(e){var t,i,r,n=this;if(n===e.target){t=n[T],n[T]=i=x(n);for(r in i){if(!(r in t))return A(0,n,r,t[r],i[r],S);if(i[r]!==t[r])return A(1,n,r,t[r],i[r],C)}for(r in t)if(!(r in i))return A(2,n,r,t[r],i[r],I)}},A=function(e,t,i,r,n,o){var a={attrChange:e,currentTarget:t,attrName:i,prevValue:r,newValue:n};a[o]=e,l(a)},x=function(e){for(var t,i,r={},n=e.attributes,o=0,a=n.length;a>o;o++)t=n[o],i=t.name,"setAttribute"!==i&&(r[i]=t.value);return r})),i[n]=function(e,t){if(r=e.toUpperCase(),fe||(fe=!0,te?(w=function(e,t){function i(e,t){for(var i=0,r=e.length;r>i;t(e[i++]));}return new te(function(r){for(var n,o,a,s=0,c=r.length;c>s;s++)n=r[s],"childList"===n.type?(i(n.addedNodes,e),i(n.removedNodes,t)):(o=n.target,ve&&o.attributeChangedCallback&&"style"!==n.attributeName&&(a=se.call(o,n.attributeName),a!==n.oldValue&&o.attributeChangedCallback(n.attributeName,n.oldValue,a)))})}(s(L),s(D)),w.observe(i,{childList:!0,subtree:!0})):(y=[],pe(function v(){for(;y.length;)y.shift().call(null,y.shift());pe(v)}),i.addEventListener("DOMNodeInserted",h(L)),i.addEventListener("DOMNodeRemoved",h(D))),i.addEventListener(_,d),i.addEventListener("readystatechange",d),i.createElement=function(e,t){var r=le.apply(i,arguments),n=""+e,o=V.call(U,(t?k:z)+(t||n).toUpperCase()),a=o>-1;return t&&(r.setAttribute("is",t=t.toLowerCase()),a&&(a=u(n.toUpperCase(),t))),ve=!i.createElement.innerHTMLHelper,a&&b(r,P[o]),r},ie.cloneNode=function(e){var t=ae.call(this,!!e),i=c(t);return i>-1&&b(t,P[i]),e&&a(t.querySelectorAll(F)),t}),-2<V.call(U,k+r)+V.call(U,z+r)&&g(e),!R.test(r)||-1<V.call(B,r))throw new Error("The type "+e+" is invalid");var r,n,l=function(){return f?i.createElement(m,r):i.createElement(m)},p=t||Q,f=Y.call(p,N),m=f?t[N].toUpperCase():r;return f&&-1<V.call(U,z+m)&&g(m),n=U.push((f?k:z)+r)-1,F=F.concat(F.length?",":"",f?m+'[is="'+e.toLowerCase()+'"]':m),l.prototype=P[n]=Y.call(p,"prototype")?p.prototype:$(ie),o(i.querySelectorAll(F),L),l}}}(window,document,Object,"registerElement")},{}],9:[function(e,t){"use strict";function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e){for(var t,o,a=i(e),s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var c in t)r.call(t,c)&&(a[c]=t[c]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(t);for(var u=0;u<o.length;u++)n.call(t,o[u])&&(a[o[u]]=t[o[u]])}}return a}},{}],10:[function(e,t){(function(e){var i=e.performance||{},r=function(){for(var e=["now","webkitNow","msNow","mozNow","oNow"];e.length;){var t=e.shift();if(t in i)return i[t].bind(i)}var r=Date.now||function(){return(new Date).getTime()},n=(i.timing||{}).navigationStart||r();return function(){return r()-n}}();r.performanceNow=i.now,r.noConflict=function(){i.now=r.performanceNow},r.conflict=function(){i.now=r},r.conflict(),t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t){!function(e){function i(e,t){return function(){e.apply(t,arguments)}}function r(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],u(e,i(o,this),i(a,this))}function n(e){var t=this;return null===this._state?void this._deferreds.push(e):void h(function(){var i=t._state?e.onFulfilled:e.onRejected;if(null===i)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=i(t._value)}catch(n){return void e.reject(n)}e.resolve(r)})}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void u(i(t,e),i(o,this),i(a,this))}this._state=!0,this._value=e,s.call(this)}catch(r){a.call(this,r)}}function a(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;t>e;e++)n.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,i,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=i,this.reject=r}function u(e,t,i){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,i(e))})}catch(n){if(r)return;r=!0,i(n)}}var l=setTimeout,h="function"==typeof setImmediate&&setImmediate||function(e){l(e,1)},d=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};r.prototype["catch"]=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var i=this;return new r(function(r,o){n.call(i,new c(e,t,r,o))})},r.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&d(arguments[0])?arguments[0]:arguments);return new r(function(t,i){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},i)}e[o]=a,0===--n&&t(e)}catch(c){i(c)}}if(0===e.length)return t([]);for(var n=e.length,o=0;o<e.length;o++)r(o,e[o])})},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r(function(t){t(e)})},r.reject=function(e){return new r(function(t,i){i(e)})},r.race=function(e){return new r(function(t,i){for(var r=0,n=e.length;n>r;r++)e[r].then(t,i)})},r._setImmediateFn=function(e){h=e},"undefined"!=typeof t&&t.exports?t.exports=r:e.Promise||(e.Promise=r)}(this)},{}],12:[function(e,t){function i(e){var t=function(e){return e.trim()},i={};return r(e).map(t).filter(Boolean).forEach(function(e){var t=e.indexOf(":"),r=e.substr(0,t).trim(),n=e.substr(t+1).trim();i[r]=n}),i}function r(e){for(var t,i=[],r=0,n=";",o=/url\([^\)]+$/,a="";r<e.length;)t=e.indexOf(n,r),-1===t&&(t=e.length),a+=e.substring(r,t),o.test(a)?(a+=";",r=t+1):(i.push(a),a="",r=t+1);return i}function n(e){return Object.keys(e).map(function(t){return t+":"+e[t]}).join(";")}function o(e){return n(i(e))}t.exports.parse=i,t.exports.stringify=n,t.exports.normalize=o},{}],13:[function(){THREE.BlendCharacter=function(){this.weightSchedule=[],this.warpSchedule=[],this.load=function(e,t){var i=this,r=new THREE.ObjectLoader;r.load(e,function(r){if(r.traverse(function(e){e instanceof THREE.SkinnedMesh&&(i.skinnedMesh=e)}),THREE.SkinnedMesh.call(i,i.skinnedMesh.geometry,i.skinnedMesh.material),void 0==i.skinnedMesh)return void console.log("unable to find skinned mesh in "+e);i.material.skinning=!0,i.mixer=new THREE.AnimationMixer(i),i.mixer=i.mixer;for(var n=0;n<i.geometry.animations.length;++n)i.mixer.clipAction(i.geometry.animations[n]);void 0!==t&&t()})},this.update=function(e){this.mixer.update(e)},this.play=function(e,t){return this.mixer.clipAction(e).setEffectiveWeight(t).play()},this.crossfade=function(e,t,i){this.mixer.stopAllAction();var r=this.play(e,1),n=this.play(t,1);r.crossFadeTo(n,i,!1)},this.warp=function(e,t,i){this.mixer.stopAllAction();var r=this.play(e,1),n=this.play(t,1);r.crossFadeTo(n,i,!0)},this.applyWeight=function(e,t){this.mixer.clipAction(e).setEffectiveWeight(t)},this.getWeight=function(e){return this.mixer.clipAction(e).getEffectiveWeight()},this.pauseAll=function(){this.mixer.timeScale=0},this.unPauseAll=function(){this.mixer.timeScale=1},this.stopAll=function(){this.mixer.stopAllAction()},this.showModel=function(e){this.visible=e}},THREE.BlendCharacter.prototype=Object.create(THREE.SkinnedMesh.prototype),THREE.BlendCharacter.prototype.constructor=THREE.BlendCharacter,THREE.BlendCharacter.prototype.getForward=function(){var e=new THREE.Vector3;return function(){return e.set(-this.matrix.elements[8],-this.matrix.elements[9],-this.matrix.elements[10]),e}}},{}],14:[function(){THREE.ColladaLoader=function(){function e(e,i,r,n){var o=0;if(document.implementation&&document.implementation.createDocument){var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState?0===a.status||200===a.status?a.response?(Be=i,t(a.response,void 0,e)):n?n({type:"error",url:e}):console.error("ColladaLoader: Empty or non-existing file ("+e+")"):n?n({type:"error",url:e}):console.error("ColladaLoader: Couldn't load \""+e+'" ('+a.status+")"):3===a.readyState&&r&&(0===o&&(o=a.getResponseHeader("Content-Length")),r({total:o,loaded:a.responseText.length}))},a.open("GET",e,!0),a.send(null)}else alert("Don't know how to parse XML!")}function t(e,t,i){if(ke=(new DOMParser).parseFromString(e,"text/xml"),t=t||Be,void 0!==i){var c=i.split("/");c.pop(),_e=(c.length<1?".":c.join("/"))+"/"}r(),Ae(),Pe=n("library_images image",L,"image"),Qe=n("library_materials material",H,"material"),Ye=n("library_effects effect",K,"effect"),Ve=n("library_geometries geometry",k,"geometry"),He=n("library_cameras camera",re,"camera"),We=n("library_lights light",oe,"light"),Ge=n("library_controllers controller",D,"controller"),Fe=n("library_animations animation",$,"animation"),Ie=n("library_visual_scenes visual_scene",C,"visual_scene"),je=n("library_kinematics_models kinematics_model",se,"kinematics_model"),Oe=[],ze=[],De=o(),Re=new THREE.Group;for(var u=0;u<De.nodes.length;u++)Re.add(v(De.nodes[u]));Re.scale.multiplyScalar(Ze),s(),Ne=a(),g();var l={scene:Re,morphs:Oe,skins:ze,animations:Se,kinematics:Ce,dae:{images:Pe,materials:Qe,cameras:He,lights:We,effects:Ye,geometries:Ve,controllers:Ge,animations:Fe,visualScenes:Ie,visualScene:De,scene:De,kinematicsModels:je,kinematicsModel:Ne}};return t&&t(l),l}function i(e){Xe=e}function r(){var e=ke.querySelectorAll("asset"),t=e[0];if(t&&t.childNodes)for(var i=0;i<t.childNodes.length;i++){var r=t.childNodes[i];switch(r.nodeName){case"unit":var n=r.getAttribute("meter");n&&(Ze=parseFloat(n));break;case"up_axis":Ke=r.textContent.charAt(0)}}}function n(e,t,i){for(var r=ke.querySelectorAll(e),n={},o=0,a=r.length,s=0;a>s;s++){var c=r[s],u=(new t).parse(c);u.id&&0!==u.id.length||(u.id=i+o++),n[u.id]=u}return n}function o(){var e=ke.querySelectorAll("scene instance_visual_scene")[0];if(e){var t=e.getAttribute("url").replace(/^#/,"");return Ie[t.length>0?t:"visual_scene0"]}return null}function a(){var e=ke.querySelectorAll("instance_kinematics_model")[0];if(e){var t=e.getAttribute("url").replace(/^#/,"");return je[t.length>0?t:"kinematics_model0"]}return null}function s(){Se=[],c(Re)}function c(e){var t=De.getChildById(e.colladaId,!0),i=null;if(t&&t.keys){i={fps:60,hierarchy:[{node:t,keys:t.keys,sids:t.sids}],node:e,name:"animation_"+e.name,length:0},Se.push(i);for(var r=0,n=t.keys.length;n>r;r++)i.length=Math.max(i.length,t.keys[r].time)}else i={hierarchy:[{keys:[],sids:[]}]};for(var r=0,n=e.children.length;n>r;r++)for(var o=c(e.children[r]),a=0,s=o.hierarchy.length;s>a;a++)i.hierarchy.push({keys:[],sids:[]});return i}function u(){var e,t=1e6,i=-t,r=0;for(var n in Fe){var o=Fe[n];e=e||o.id;for(var a=0;a<o.sampler.length;a++){var s=o.sampler[a];s.create(),t=Math.min(t,s.startTime),i=Math.max(i,s.endTime),r=Math.max(r,s.input.length)}}return{start:t,end:i,frames:r,ID:e}}function l(e,t){var i=t instanceof _?Ge[t.url]:t;if(!i||!i.morph)return void console.log("could not find morph controller!");for(var r=i.morph,n=0;n<r.targets.length;n++){var o=r.targets[n],a=Ve[o];if(a.mesh&&a.mesh.primitives&&a.mesh.primitives.length){var s=a.mesh.primitives[0].geometry;s.vertices.length===e.vertices.length&&e.morphTargets.push({name:"target_1",vertices:s.vertices})}}e.morphTargets.push({name:"target_Z",vertices:e.vertices})}function h(e,t,i,r){if(e.world=e.world||new THREE.Matrix4,e.localworld=e.localworld||new THREE.Matrix4,e.world.copy(e.matrix),e.localworld.copy(e.matrix),e.channels&&e.channels.length){var n=e.channels[0],o=n.sampler.output[i];o instanceof THREE.Matrix4&&(e.world.copy(o),e.localworld.copy(o),0===i&&e.matrix.copy(o))}r&&e.world.multiplyMatrices(r,e.world),t.push(e);for(var a=0;a<e.nodes.length;a++)h(e.nodes[a],t,i,e.world)}function d(e,t){for(var i=0;i<e.length;i++){var r=e[i],n=-1;if("JOINT"==r.type){for(var o=0;o<t.joints.length;o++)if(r.sid===t.joints[o]){n=o;break}if(n>=0){var a=t.invBindMatrices[n];r.invBindMatrix=a,r.skinningMatrix=new THREE.Matrix4,r.skinningMatrix.multiplyMatrices(r.world,a),r.animatrix=new THREE.Matrix4,r.animatrix.copy(r.localworld),r.weights=[];for(var o=0;o<t.weights.length;o++)for(var s=0;s<t.weights[o].length;s++){var c=t.weights[o][s];c.joint===n&&r.weights.push(c)}}else console.warn("ColladaLoader: Could not find joint '"+r.sid+"'."),r.skinningMatrix=new THREE.Matrix4,r.weights=[]}}}function p(e){var t=[],i=function(e,t,r){var n={};n.name=t.sid,n.parent=e,n.matrix=t.matrix;var o=[new THREE.Vector3,new THREE.Quaternion,new THREE.Vector3];n.matrix.decompose(o[0],o[1],o[2]),n.pos=[o[0].x,o[0].y,o[0].z],n.scl=[o[2].x,o[2].y,o[2].z],n.rotq=[o[1].x,o[1].y,o[1].z,o[1].w],r.push(n);for(var a in t.nodes)i(t.sid,t.nodes[a],r)};return i(-1,e,t),t}function f(e,t,i){var r=[];h(t,r,-1),d(r,i.skin);for(var n=new THREE.Vector3,o=[],a=0;a<e.vertices.length;a++)o.push(new THREE.Vector3);for(a=0;a<r.length;a++)if("JOINT"==r[a].type)for(var s=0;s<r[a].weights.length;s++){var c=r[a].weights[s],u=c.index,l=c.weight,p=e.vertices[u],f=o[u];n.x=p.x,n.y=p.y,n.z=p.z,n.applyMatrix4(r[a].skinningMatrix),f.x+=n.x*l,f.y+=n.y*l,f.z+=n.z*l}for(var a=0;a<e.vertices.length;a++)e.vertices[a]=o[a]}function m(e,t,i){var r=Ge[t.url];if(i=void 0!==i?i:40,!r||!r.skin)return void console.log("ColladaLoader: Could not find skin controller.");if(!t.skeleton||!t.skeleton.length)return void console.log("ColladaLoader: Could not find the skeleton for the skin. ");for(var n=u(),o=De.getChildById(t.skeleton[0],!0)||De.getChildBySid(t.skeleton[0],!0),a=p(o),s=r.skin.joints,c=[],l=0;l<s.length;l++)for(var m=0;m<a.length;m++)a[m].name===s[l]&&(c[l]=a[m]);for(var l=0;l<c.length;l++)for(var m=0;m<c.length;m++)c[l].parent===c[m].name&&(c[l].parent=m);{var l,m,g;new THREE.Vector3}for(l=0;l<e.vertices.length;l++)e.vertices[l].applyMatrix4(r.skin.bindShapeMatrix);for(var v=[],y=[],M=r.skin.weights,l=0;l<M.length;l++){var A=new THREE.Vector4(M[l][0]?M[l][0].joint:0,M[l][1]?M[l][1].joint:0,M[l][2]?M[l][2].joint:0,M[l][3]?M[l][3].joint:0),g=new THREE.Vector4(M[l][0]?M[l][0].weight:0,M[l][1]?M[l][1].weight:0,M[l][2]?M[l][2].weight:0,M[l][3]?M[l][3].weight:0);v.push(A),y.push(g)}e.skinIndices=v,e.skinWeights=y,e.bones=c;for(var x={name:n.ID,fps:30,length:n.frames/30,hierarchy:[]},m=0;m<c.length;m++)x.hierarchy.push({parent:c[m].parent,name:c[m].name,keys:[]});for(console.log("ColladaLoader:",n.ID+" has "+c.length+" bones."),f(e,o,r),i=0;i<n.frames;i++){var w=[];h(o,w,i),d(w,r.skin);for(var l=0;l<w.length;l++)for(var m=0;m<x.hierarchy.length;m++)if(x.hierarchy[m].name===w[l].sid){var E={};E.time=i/30,E.matrix=w[l].animatrix,0===i&&(w[l].matrix=E.matrix);var b=[new THREE.Vector3,new THREE.Quaternion,new THREE.Vector3];E.matrix.decompose(b[0],b[1],b[2]),E.pos=[b[0].x,b[0].y,b[0].z],E.scl=[b[2].x,b[2].y,b[2].z],E.rot=b[1],x.hierarchy[m].keys.push(E)}e.animation=x}}function g(){if(Ne&&0===Ne.joints.length)return void(Ce=void 0);var e={},t=function(t,i){var r=i.getAttribute("id"),n=De.getChildById(r,!0),o=Ne.joints[t];Re.traverse(function(i){i.colladaId==r&&(e[t]={node:i,transforms:n.transforms,joint:o,position:o.zeroPosition})})};Ce={joints:Ne&&Ne.joints,getJointValue:function(t){var i=e[t];return i?i.position:void console.log("getJointValue: joint "+t+" doesn't exist")},setJointValue:function(t,i){var n=e[t];if(n){var o=n.joint;if(i>o.limits.max||i<o.limits.min)console.log("setJointValue: joint "+t+" value "+i+" outside of limits (min: "+o.limits.min+", max: "+o.limits.max+")");else if(o["static"])console.log("setJointValue: joint "+t+" is static");else{var a=n.node,s=o.axis,c=n.transforms,u=new THREE.Matrix4;for(r=0;r<c.length;r++){var l=c[r];if(l.sid&&-1!==l.sid.indexOf("joint"+t))switch(o.type){case"revolute":u.multiply(h.makeRotationAxis(s,THREE.Math.degToRad(i)));break;case"prismatic":u.multiply(h.makeTranslation(s.x*i,s.y*i,s.z*i));break;default:console.warn("setJointValue: unknown joint type: "+o.type)}else{var h=new THREE.Matrix4;switch(l.type){case"matrix":u.multiply(l.obj);break;case"translate":u.multiply(h.makeTranslation(l.obj.x,l.obj.y,l.obj.z));break;case"rotate":u.multiply(h.makeRotationAxis(l.obj,l.angle))}}}var d=u.elements,p=Array.prototype.slice.call(d),f=[p[0],p[4],p[8],p[12],p[1],p[5],p[9],p[13],p[2],p[6],p[10],p[14],p[3],p[7],p[11],p[15]];a.matrix.set.apply(a.matrix,f),a.matrix.decompose(a.position,a.quaternion,a.scale)}}else console.log("setJointValue: joint "+t+" doesn't exist")}};var i=ke.querySelector("scene instance_kinematics_scene");if(i)for(var r=0;r<i.childNodes.length;r++){var n=i.childNodes[r];if(1==n.nodeType)switch(n.nodeName){case"bind_joint_axis":var o=n.getAttribute("target").split("/").pop(),a=n.querySelector("axis param").textContent,s=parseInt(a.split("joint").pop().split(".")[0]),c=ke.querySelector('[sid="'+o+'"]');if(c){var u=c.parentElement;t(s,u)}}}}function v(e){var t,i,r,n,o=new THREE.Object3D,a=!1;for(r=0;r<e.controllers.length;r++){var s=Ge[e.controllers[r].url];switch(s.type){case"skin":if(Ve[s.skin.source]){var c=new z;c.url=s.skin.source,c.instance_material=e.controllers[r].instance_material,e.geometries.push(c),a=!0,t=e.controllers[r]}else if(Ge[s.skin.source]){var u=Ge[s.skin.source];if(i=u,u.morph&&Ve[u.morph.source]){var c=new z;c.url=u.morph.source,c.instance_material=e.controllers[r].instance_material,e.geometries.push(c)}}break;case"morph":if(Ve[s.morph.source]){var c=new z;c.url=s.morph.source,c.instance_material=e.controllers[r].instance_material,e.geometries.push(c),i=e.controllers[r]}console.log("ColladaLoader: Morph-controller partially supported.")}}var h={};for(r=0;r<e.geometries.length;r++){var d,p=e.geometries[r],f=p.instance_material,g=Ve[p.url],y={},M=[],A=0;if(g){if(!g.mesh||!g.mesh.primitives)continue;if(0===o.name.length&&(o.name=g.id),f)for(n=0;n<f.length;n++){var x=f[n],w=Qe[x.target],E=w.instance_effect.url,b=Ye[E].shader,T=b.material;if(g.doubleSided){if(!(x.symbol in h)){var L=T.clone();L.side=THREE.DoubleSide,h[x.symbol]=L}T=h[x.symbol]}T.opacity=T.opacity?T.opacity:1,y[x.symbol]=A,M.push(T),d=T,d.name=null===w.name||""===w.name?w.id:w.name,A++}var D,N=d||new THREE.MeshLambertMaterial({color:14540253,side:g.doubleSided?THREE.DoubleSide:THREE.FrontSide}),S=g.mesh.geometry3js;if(A>1)for(N=new THREE.MultiMaterial(M),n=0;n<S.faces.length;n++){var C=S.faces[n];C.materialIndex=y[C.daeMaterial]}void 0!==t?(m(S,t),S.morphTargets.length>0?(N.morphTargets=!0,N.skinning=!1):(N.morphTargets=!1,N.skinning=!0),D=new THREE.SkinnedMesh(S,N,!1),D.name="skin_"+ze.length,ze.push(D)):void 0!==i?(l(S,i),N.morphTargets=!0,D=new THREE.Mesh(S,N),D.name="morph_"+Oe.length,Oe.push(D)):D=S.isLineStrip===!0?new THREE.Line(S):new THREE.Mesh(S,N),o.add(D)}}for(r=0;r<e.cameras.length;r++){var I=e.cameras[r],j=He[I.url],_=new THREE.PerspectiveCamera(j.yfov,parseFloat(j.aspect_ratio),parseFloat(j.znear),parseFloat(j.zfar));o.add(_)}for(r=0;r<e.lights.length;r++){var O=null,k=e.lights[r],R=We[k.url];if(R&&R.technique){var B=R.color.getHex(),U=R.intensity,P=R.distance,F=R.falloff_angle;switch(R.technique){case"directional":O=new THREE.DirectionalLight(B,U,P),O.position.set(0,0,1);break;case"point":O=new THREE.PointLight(B,U,P);break;case"spot":O=new THREE.SpotLight(B,U,P,F),O.position.set(0,0,1);break;case"ambient":O=new THREE.AmbientLight(B)}}O&&o.add(O)}if(o.name=e.name||e.id||"",o.colladaId=e.id||"",o.layer=e.layer||"",o.matrix=e.matrix,o.matrix.decompose(o.position,o.quaternion,o.scale),qe.centerGeometry&&o.geometry){var G=o.geometry.center();G.multiply(o.scale),G.applyQuaternion(o.quaternion),o.position.sub(G)}for(r=0;r<e.nodes.length;r++)o.add(v(e.nodes[r],e));return o}function y(e){for(var t=ke.querySelectorAll("library_nodes node"),i=0;i<t.length;i++){var r=t[i].attributes.getNamedItem("id");if(r&&r.value===e)return t[i]}return void 0}function M(e){var t=[],i=1e6,r=-1e6;for(var n in Fe)for(var o=Fe[n],a=0;a<o.channel.length;a++){var s=o.channel[a],c=o.sampler[a],n=s.target.split("/")[0];n==e.id&&(c.create(),s.sampler=c,i=Math.min(i,c.startTime),r=Math.max(r,c.endTime),t.push(s))}return t.length&&(e.startTime=i,e.endTime=r),t}function A(e){if(e.channels&&e.channels.length){for(var t=[],i=[],r=0,n=e.channels.length;n>r;r++){var o,a=e.channels[r],s=a.fullSid,c=a.sampler,u=c.input,l=e.getTransformBySid(a.sid);if(a.arrIndices){o=[];for(var h=0,d=a.arrIndices.length;d>h;h++)o[h]=Te(a.arrIndices[h])}else o=Le(a.member);if(l){-1===i.indexOf(s)&&i.push(s);for(var h=0,d=u.length;d>h;h++){var p=u[h],f=c.getData(l.type,h,o),m=x(t,p);if(!m){m=new ie(p);var g=w(t,p);t.splice(-1===g?t.length:g,0,m)}m.addTarget(s,l,o,f)}}else console.log('Could not find transform "'+a.sid+'" in node '+e.id)}for(var r=0;r<i.length;r++)for(var v=i[r],h=0;h<t.length;h++){var m=t[h];m.hasTarget(v)||E(t,m,h,v)}e.keys=t,e.sids=i; }}function x(e,t){for(var i=null,r=0,n=e.length;n>r&&null===i;r++){var o=e[r];if(o.time===t)i=o;else if(o.time>t)break}return i}function w(e,t){for(var i=-1,r=0,n=e.length;n>r&&-1===i;r++){var o=e[r];o.time>=t&&(i=r)}return i}function E(e,t,i,r){var n=T(e,r,i?i-1:0),o=b(e,r,i+1);if(n&&o){var a,s=(t.time-n.time)/(o.time-n.time),c=n.getTarget(r),u=o.getTarget(r).data,l=c.data;if("matrix"===c.type)a=l;else if(l.length){a=[];for(var h=0;h<l.length;++h)a[h]=l[h]+(u[h]-l[h])*s}else a=l+(u-l)*s;t.addTarget(r,c.transform,c.member,a)}}function b(e,t,i){for(;i<e.length;i++){var r=e[i];if(r.hasTarget(t))return r}return null}function T(e,t,i){for(i=i>=0?i:i+e.length;i>=0;i--){var r=e[i];if(r.hasTarget(t))return r}return null}function L(){this.id="",this.init_from=""}function D(){this.id="",this.name="",this.type="",this.skin=null,this.morph=null}function N(){this.method=null,this.source=null,this.targets=null,this.weights=null}function S(){this.source="",this.bindShapeMatrix=null,this.invBindMatrices=[],this.joints=[],this.weights=[]}function C(){this.id="",this.name="",this.nodes=[],this.scene=new THREE.Group}function I(){this.id="",this.name="",this.sid="",this.nodes=[],this.controllers=[],this.transforms=[],this.geometries=[],this.channels=[],this.matrix=new THREE.Matrix4}function j(){this.sid="",this.type="",this.data=[],this.obj=null}function _(){this.url="",this.skeleton=[],this.instance_material=[]}function O(){this.symbol="",this.target=""}function z(){this.url="",this.instance_material=[]}function k(){this.id="",this.mesh=null}function R(e){this.geometry=e.id,this.primitives=[],this.vertices=null,this.geometry3js=null}function B(){this.material="",this.count=0,this.inputs=[],this.vcount=null,this.p=[],this.geometry=new THREE.Geometry}function U(){B.call(this),this.vcount=[]}function P(){B.call(this),this.vcount=1}function F(){B.call(this),this.vcount=3}function G(){this.source="",this.count=0,this.stride=0,this.params=[]}function V(){this.input={}}function Q(){this.semantic="",this.offset=0,this.source="",this.set=0}function Y(e){this.id=e,this.type=null}function H(){this.id="",this.name="",this.instance_effect=null}function W(){this.color=new THREE.Color,this.color.setRGB(Math.random(),Math.random(),Math.random()),this.color.a=1,this.texture=null,this.texcoord=null,this.texOpts=null}function X(e,t){this.type=e,this.effect=t,this.material=null}function q(e){this.effect=e,this.init_from=null,this.format=null}function Z(e){this.effect=e,this.source=null,this.wrap_s=null,this.wrap_t=null,this.minfilter=null,this.magfilter=null,this.mipfilter=null}function K(){this.id="",this.name="",this.shader=null,this.surface={},this.sampler={}}function J(){this.url=""}function $(){this.id="",this.name="",this.source={},this.sampler=[],this.channel=[]}function ee(e){this.animation=e,this.source="",this.target="",this.fullSid=null,this.sid=null,this.dotSyntax=null,this.arrSyntax=null,this.arrIndices=null,this.member=null}function te(e){this.id="",this.animation=e,this.inputs=[],this.input=null,this.output=null,this.strideOut=null,this.interpolation=null,this.startTime=null,this.endTime=null,this.duration=0}function ie(e){this.targets=[],this.time=e}function re(){this.id="",this.name="",this.technique=""}function ne(){this.url=""}function oe(){this.id="",this.name="",this.technique=""}function ae(){this.url=""}function se(){this.id="",this.name="",this.joints=[],this.links=[]}function ce(){this.sid="",this.name="",this.axis=new THREE.Vector3,this.limits={min:0,max:0},this.type="",this["static"]=!1,this.zeroPosition=0,this.middlePosition=0}function ue(){this.sid="",this.name="",this.transforms=[],this.attachments=[]}function le(){this.joint="",this.transforms=[],this.links=[]}function he(e){var t=e.getAttribute("id");return void 0!=Ue[t]?Ue[t]:(Ue[t]=new Y(t).parse(e),Ue[t])}function de(e){for(var t=me(e),i=[],r=0,n=t.length;n>r;r++)i.push("true"===t[r]||"1"===t[r]?!0:!1);return i}function pe(e){for(var t=me(e),i=[],r=0,n=t.length;n>r;r++)i.push(parseFloat(t[r]));return i}function fe(e){for(var t=me(e),i=[],r=0,n=t.length;n>r;r++)i.push(parseInt(t[r],10));return i}function me(e){return e.length>0?ge(e).split(/\s+/):[]}function ge(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function ve(e,t,i){return e.hasAttribute(t)?parseInt(e.getAttribute(t),10):i}function ye(e,t){var i=new THREE.ImageLoader;i.load(t,function(t){e.image=t,e.needsUpdate=!0})}function Me(e,t){e.doubleSided=!1;var i=t.querySelectorAll("extra double_sided")[0];i&&i&&1===parseInt(i.textContent,10)&&(e.doubleSided=!0)}function Ae(){if(qe.convertUpAxis!==!0||Ke===qe.upAxis)Je=null;else switch(Ke){case"X":Je="Y"===qe.upAxis?"XtoY":"XtoZ";break;case"Y":Je="X"===qe.upAxis?"YtoX":"YtoZ";break;case"Z":Je="X"===qe.upAxis?"ZtoX":"ZtoY"}}function xe(e,t){if(qe.convertUpAxis===!0&&Ke!==qe.upAxis)switch(Je){case"XtoY":var i=e[0];e[0]=t*e[1],e[1]=i;break;case"XtoZ":var i=e[2];e[2]=e[1],e[1]=e[0],e[0]=i;break;case"YtoX":var i=e[0];e[0]=e[1],e[1]=t*i;break;case"YtoZ":var i=e[1];e[1]=t*e[2],e[2]=i;break;case"ZtoX":var i=e[0];e[0]=e[1],e[1]=e[2],e[2]=i;break;case"ZtoY":var i=e[1];e[1]=e[2],e[2]=t*i}}function we(e,t){if(qe.convertUpAxis!==!0||Ke===qe.upAxis)return t;switch(e){case"X":t="XtoY"===Je?-1*t:t;break;case"Y":t="YtoZ"===Je||"YtoX"===Je?-1*t:t;break;case"Z":t="ZtoY"===Je?-1*t:t}return t}function Ee(e,t){var i=[e[t],e[t+1],e[t+2]];return xe(i,-1),new THREE.Vector3(i[0],i[1],i[2])}function be(e){if(qe.convertUpAxis){var t=[e[0],e[4],e[8]];xe(t,-1),e[0]=t[0],e[4]=t[1],e[8]=t[2],t=[e[1],e[5],e[9]],xe(t,-1),e[1]=t[0],e[5]=t[1],e[9]=t[2],t=[e[2],e[6],e[10]],xe(t,-1),e[2]=t[0],e[6]=t[1],e[10]=t[2],t=[e[0],e[1],e[2]],xe(t,-1),e[0]=t[0],e[1]=t[1],e[2]=t[2],t=[e[4],e[5],e[6]],xe(t,-1),e[4]=t[0],e[5]=t[1],e[6]=t[2],t=[e[8],e[9],e[10]],xe(t,-1),e[8]=t[0],e[9]=t[1],e[10]=t[2],t=[e[3],e[7],e[11]],xe(t,-1),e[3]=t[0],e[7]=t[1],e[11]=t[2]}return(new THREE.Matrix4).set(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Te(e){if(e>-1&&3>e){var t=["X","Y","Z"],i={X:0,Y:1,Z:2};e=Le(t[e]),e=i[e]}return e}function Le(e){if(qe.convertUpAxis)switch(e){case"X":switch(Je){case"XtoY":case"XtoZ":case"YtoX":e="Y";break;case"ZtoX":e="Z"}break;case"Y":switch(Je){case"XtoY":case"YtoX":case"ZtoX":e="X";break;case"XtoZ":case"YtoZ":case"ZtoY":e="Z"}break;case"Z":switch(Je){case"XtoZ":e="X";break;case"YtoZ":case"ZtoX":case"ZtoY":e="Y"}}return e}var De,Ne,Se,Ce,Ie,je,_e,Oe,ze,ke=null,Re=null,Be=null,Ue={},Pe={},Fe={},Ge={},Ve={},Qe={},Ye={},He={},We={},Xe=THREE.SmoothShading,qe={centerGeometry:!1,convertUpAxis:!1,subdivideFaces:!0,upAxis:"Y",defaultEnvMap:null},Ze=1,Ke="Y",Je=null;return L.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];"init_from"===i.nodeName&&(this.init_from=i.textContent)}return this},D.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.type="none";for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"skin":this.skin=(new S).parse(i),this.type=i.nodeName;break;case"morph":this.morph=(new N).parse(i),this.type=i.nodeName}}return this},N.prototype.parse=function(e){var t,i={},r=[];for(this.method=e.getAttribute("method"),this.source=e.getAttribute("source").replace(/^#/,""),t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];if(1==n.nodeType)switch(n.nodeName){case"source":var o=(new Y).parse(n);i[o.id]=o;break;case"targets":r=this.parseInputs(n);break;default:console.log(n.nodeName)}}for(t=0;t<r.length;t++){var a=r[t],o=i[a.source];switch(a.semantic){case"MORPH_TARGET":this.targets=o.read();break;case"MORPH_WEIGHT":this.weights=o.read()}}return this},N.prototype.parseInputs=function(e){for(var t=[],i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"input":t.push((new Q).parse(r))}}return t},S.prototype.parse=function(e){var t,i,r={};this.source=e.getAttribute("source").replace(/^#/,""),this.invBindMatrices=[],this.joints=[],this.weights=[];for(var n=0;n<e.childNodes.length;n++){var o=e.childNodes[n];if(1==o.nodeType)switch(o.nodeName){case"bind_shape_matrix":var a=pe(o.textContent);this.bindShapeMatrix=be(a);break;case"source":var s=(new Y).parse(o);r[s.id]=s;break;case"joints":t=o;break;case"vertex_weights":i=o;break;default:console.log(o.nodeName)}}return this.parseJoints(t,r),this.parseWeights(i,r),this},S.prototype.parseJoints=function(e,t){for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"input":var n=(new Q).parse(r),o=t[n.source];"JOINT"===n.semantic?this.joints=o.read():"INV_BIND_MATRIX"===n.semantic&&(this.invBindMatrices=o.read())}}},S.prototype.parseWeights=function(e,t){for(var i,r,n=[],o=0;o<e.childNodes.length;o++){var a=e.childNodes[o];if(1==a.nodeType)switch(a.nodeName){case"input":n.push((new Q).parse(a));break;case"v":i=fe(a.textContent);break;case"vcount":r=fe(a.textContent)}}for(var s=0,o=0;o<r.length;o++){for(var c=r[o],u=[],l=0;c>l;l++){for(var h={},d=0;d<n.length;d++){var p=n[d],f=i[s+p.offset];switch(p.semantic){case"JOINT":h.joint=f;break;case"WEIGHT":h.weight=t[p.source].data[f]}}u.push(h),s+=n.length}for(var l=0;l<u.length;l++)u[l].index=o;this.weights.push(u)}},C.prototype.getChildById=function(e,t){for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildById(e,t);if(r)return r}return null},C.prototype.getChildBySid=function(e,t){for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildBySid(e,t);if(r)return r}return null},C.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.nodes=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"node":this.nodes.push((new I).parse(i))}}return this},I.prototype.getChannelForTransform=function(e){for(var t=0;t<this.channels.length;t++){var i,r,n=this.channels[t],o=n.target.split("/"),a=(o.shift(),o.shift()),s=a.indexOf(".")>=0,c=a.indexOf("(")>=0;if(s)o=a.split("."),a=o.shift(),r=o.shift();else if(c){i=a.split("("),a=i.shift();for(var u=0;u<i.length;u++)i[u]=parseInt(i[u].replace(/\)/,""))}if(a===e)return n.info={sid:a,dotSyntax:s,arrSyntax:c,arrIndices:i},n}return null},I.prototype.getChildById=function(e,t){if(this.id===e)return this;if(t)for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildById(e,t);if(r)return r}return null},I.prototype.getChildBySid=function(e,t){if(this.sid===e)return this;if(t)for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildBySid(e,t);if(r)return r}return null},I.prototype.getTransformBySid=function(e){for(var t=0;t<this.transforms.length;t++)if(this.transforms[t].sid===e)return this.transforms[t];return null},I.prototype.parse=function(e){var t;this.id=e.getAttribute("id"),this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.type=e.getAttribute("type"),this.layer=e.getAttribute("layer"),this.type="JOINT"===this.type?this.type:"NODE",this.nodes=[],this.transforms=[],this.geometries=[],this.cameras=[],this.lights=[],this.controllers=[],this.matrix=new THREE.Matrix4;for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"node":this.nodes.push((new I).parse(r));break;case"instance_camera":this.cameras.push((new ne).parse(r));break;case"instance_controller":this.controllers.push((new _).parse(r));break;case"instance_geometry":this.geometries.push((new z).parse(r));break;case"instance_light":this.lights.push((new ae).parse(r));break;case"instance_node":t=r.getAttribute("url").replace(/^#/,"");var n=y(t);n&&this.nodes.push((new I).parse(n));break;case"rotate":case"translate":case"scale":case"matrix":case"lookat":case"skew":this.transforms.push((new j).parse(r));break;case"extra":break;default:console.log(r.nodeName)}}return this.channels=M(this),A(this),this.updateMatrix(),this},I.prototype.updateMatrix=function(){this.matrix.identity();for(var e=0;e<this.transforms.length;e++)this.transforms[e].apply(this.matrix)},j.prototype.parse=function(e){return this.sid=e.getAttribute("sid"),this.type=e.nodeName,this.data=pe(e.textContent),this.convert(),this},j.prototype.convert=function(){switch(this.type){case"matrix":this.obj=be(this.data);break;case"rotate":this.angle=THREE.Math.degToRad(this.data[3]);case"translate":xe(this.data,-1),this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;case"scale":xe(this.data,1),this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;default:console.log("Can not convert Transform of type "+this.type)}},j.prototype.apply=function(){var e=new THREE.Matrix4;return function(t){switch(this.type){case"matrix":t.multiply(this.obj);break;case"translate":t.multiply(e.makeTranslation(this.obj.x,this.obj.y,this.obj.z));break;case"rotate":t.multiply(e.makeRotationAxis(this.obj,this.angle));break;case"scale":t.scale(this.obj)}}}(),j.prototype.update=function(e,t){var i=["X","Y","Z","ANGLE"];switch(this.type){case"matrix":if(t)if(1===t.length)switch(t[0]){case 0:this.obj.n11=e[0],this.obj.n21=e[1],this.obj.n31=e[2],this.obj.n41=e[3];break;case 1:this.obj.n12=e[0],this.obj.n22=e[1],this.obj.n32=e[2],this.obj.n42=e[3];break;case 2:this.obj.n13=e[0],this.obj.n23=e[1],this.obj.n33=e[2],this.obj.n43=e[3];break;case 3:this.obj.n14=e[0],this.obj.n24=e[1],this.obj.n34=e[2],this.obj.n44=e[3]}else if(2===t.length){var r="n"+(t[0]+1)+(t[1]+1);this.obj[r]=e}else console.log("Incorrect addressing of matrix in transform.");else this.obj.copy(e);break;case"translate":case"scale":switch("[object Array]"===Object.prototype.toString.call(t)&&(t=i[t[0]]),t){case"X":this.obj.x=e;break;case"Y":this.obj.y=e;break;case"Z":this.obj.z=e;break;default:this.obj.x=e[0],this.obj.y=e[1],this.obj.z=e[2]}break;case"rotate":switch("[object Array]"===Object.prototype.toString.call(t)&&(t=i[t[0]]),t){case"X":this.obj.x=e;break;case"Y":this.obj.y=e;break;case"Z":this.obj.z=e;break;case"ANGLE":this.angle=THREE.Math.degToRad(e);break;default:this.obj.x=e[0],this.obj.y=e[1],this.obj.z=e[2],this.angle=THREE.Math.degToRad(e[3])}}},_.prototype.parse=function(e){this.url=e.getAttribute("url").replace(/^#/,""),this.skeleton=[],this.instance_material=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1===i.nodeType)switch(i.nodeName){case"skeleton":this.skeleton.push(i.textContent.replace(/^#/,""));break;case"bind_material":for(var r=i.querySelectorAll("instance_material"),n=0;n<r.length;n++){var o=r[n];this.instance_material.push((new O).parse(o))}break;case"extra":}}return this},O.prototype.parse=function(e){return this.symbol=e.getAttribute("symbol"),this.target=e.getAttribute("target").replace(/^#/,""),this},z.prototype.parse=function(e){this.url=e.getAttribute("url").replace(/^#/,""),this.instance_material=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType&&"bind_material"===i.nodeName){for(var r=i.querySelectorAll("instance_material"),n=0;n<r.length;n++){var o=r[n];this.instance_material.push((new O).parse(o))}break}}return this},k.prototype.parse=function(e){this.id=e.getAttribute("id"),Me(this,e);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"mesh":this.mesh=new R(this).parse(i);break;case"extra":}}return this},R.prototype.parse=function(e){this.primitives=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"source":he(i);break;case"vertices":this.vertices=(new V).parse(i);break;case"linestrips":this.primitives.push((new P).parse(i));break;case"triangles":this.primitives.push((new F).parse(i));break;case"polygons":this.primitives.push((new B).parse(i));break;case"polylist":this.primitives.push((new U).parse(i))}}if(this.geometry3js=new THREE.Geometry,null===this.vertices)return this;for(var r=Ue[this.vertices.input.POSITION.source].data,t=0;t<r.length;t+=3)this.geometry3js.vertices.push(Ee(r,t).clone());for(var t=0;t<this.primitives.length;t++){var n=this.primitives[t];n.setVertices(this.vertices),this.handlePrimitive(n,this.geometry3js)}return this.geometry3js.calcNormals&&(this.geometry3js.computeVertexNormals(),delete this.geometry3js.calcNormals),this},R.prototype.handlePrimitive=function(e,t){if(e instanceof P)return void(t.isLineStrip=!0);var i,r,n,o,a,s,c,u=e.p,l=e.inputs,h=0,d=3,p=0,f=[];for(i=0;i<l.length;i++){n=l[i];var m=n.offset+1;switch(p=m>p?m:p,n.semantic){case"TEXCOORD":f.push(n.set)}}for(var g=0;g<u.length;++g)for(var v=u[g],y=0;y<v.length;){var M=[],A=[],x=null,w=[];for(d=e.vcount?e.vcount.length?e.vcount[h++]:e.vcount:v.length/p,i=0;d>i;i++)for(r=0;r<l.length;r++)switch(n=l[r],s=Ue[n.source],o=v[y+i*p+n.offset],c=s.accessor.params.length,a=o*c,n.semantic){case"VERTEX":M.push(o);break;case"NORMAL":A.push(Ee(s.data,a));break;case"TEXCOORD":x=x||{},void 0===x[n.set]&&(x[n.set]=[]),x[n.set].push(new THREE.Vector2(s.data[a],s.data[a+1]));break;case"COLOR":w.push((new THREE.Color).setRGB(s.data[a],s.data[a+1],s.data[a+2]))}if(0===A.length)if(n=this.vertices.input.NORMAL){s=Ue[n.source],c=s.accessor.params.length;for(var E=0,b=M.length;b>E;E++)A.push(Ee(s.data,M[E]*c))}else t.calcNormals=!0;if(!x&&(x={},n=this.vertices.input.TEXCOORD)){f.push(n.set),s=Ue[n.source],c=s.accessor.params.length;for(var E=0,b=M.length;b>E;E++)a=M[E]*c,void 0===x[n.set]&&(x[n.set]=[]),x[n.set].push(new THREE.Vector2(s.data[a],1-s.data[a+1]))}if(0===w.length&&(n=this.vertices.input.COLOR)){s=Ue[n.source],c=s.accessor.params.length;for(var E=0,b=M.length;b>E;E++)a=M[E]*c,w.push((new THREE.Color).setRGB(s.data[a],s.data[a+1],s.data[a+2]))}var T,L,D=null,N=[];if(3===d)N.push(new THREE.Face3(M[0],M[1],M[2],A,w.length?w:new THREE.Color));else if(4===d)N.push(new THREE.Face3(M[0],M[1],M[3],A.length?[A[0].clone(),A[1].clone(),A[3].clone()]:[],w.length?[w[0],w[1],w[3]]:new THREE.Color)),N.push(new THREE.Face3(M[1],M[2],M[3],A.length?[A[1].clone(),A[2].clone(),A[3].clone()]:[],w.length?[w[1],w[2],w[3]]:new THREE.Color));else if(d>4&&qe.subdivideFaces){var S=w.length?w:new THREE.Color;for(r=1;d-1>r;)N.push(new THREE.Face3(M[0],M[r],M[r+1],A.length?[A[0].clone(),A[r++].clone(),A[r].clone()]:[],S))}if(N.length)for(var E=0,b=N.length;b>E;E++)for(D=N[E],D.daeMaterial=e.material,t.faces.push(D),r=0;r<f.length;r++)T=x[f[r]],L=d>4?[T[0],T[E+1],T[E+2]]:4===d?0===E?[T[0],T[1],T[3]]:[T[1].clone(),T[2],T[3].clone()]:[T[0],T[1],T[2]],void 0===t.faceVertexUvs[r]&&(t.faceVertexUvs[r]=[]),t.faceVertexUvs[r].push(L);else console.log("dropped face with vcount "+d+" for geometry with id: "+t.id);y+=p*d}},B.prototype.setVertices=function(e){for(var t=0;t<this.inputs.length;t++)this.inputs[t].source===e.id&&(this.inputs[t].source=e.input.POSITION.source)},B.prototype.parse=function(e){this.material=e.getAttribute("material"),this.count=ve(e,"count",0);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"input":this.inputs.push((new Q).parse(e.childNodes[t]));break;case"vcount":this.vcount=fe(i.textContent);break;case"p":this.p.push(fe(i.textContent));break;case"ph":console.warn("polygon holes not yet supported!")}}return this},U.prototype=Object.create(B.prototype),U.prototype.constructor=U,P.prototype=Object.create(B.prototype),P.prototype.constructor=P,F.prototype=Object.create(B.prototype),F.prototype.constructor=F,G.prototype.parse=function(e){this.params=[],this.source=e.getAttribute("source"),this.count=ve(e,"count",0),this.stride=ve(e,"stride",0);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if("param"===i.nodeName){var r={};r.name=i.getAttribute("name"),r.type=i.getAttribute("type"),this.params.push(r)}}return this},V.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++)if("input"===e.childNodes[t].nodeName){var i=(new Q).parse(e.childNodes[t]);this.input[i.semantic]=i}return this},Q.prototype.parse=function(e){return this.semantic=e.getAttribute("semantic"),this.source=e.getAttribute("source").replace(/^#/,""),this.set=ve(e,"set",-1),this.offset=ve(e,"offset",0),"TEXCOORD"===this.semantic&&this.set<0&&(this.set=0),this},Y.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"bool_array":this.data=de(i.textContent),this.type=i.nodeName;break;case"float_array":this.data=pe(i.textContent),this.type=i.nodeName;break;case"int_array":this.data=fe(i.textContent),this.type=i.nodeName;break;case"IDREF_array":case"Name_array":this.data=me(i.textContent),this.type=i.nodeName;break;case"technique_common":for(var r=0;r<i.childNodes.length;r++)if("accessor"===i.childNodes[r].nodeName){this.accessor=(new G).parse(i.childNodes[r]);break}}}return this},Y.prototype.read=function(){var e=[],t=this.accessor.params[0];switch(t.type){case"IDREF":case"Name":case"name":case"float":return this.data;case"float4x4":for(var i=0;i<this.data.length;i+=16){var r=this.data.slice(i,i+16),n=be(r);e.push(n)}break;default:console.log("ColladaLoader: Source: Read dont know how to read "+t.type+".")}return e},H.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++)if("instance_effect"===e.childNodes[t].nodeName){this.instance_effect=(new J).parse(e.childNodes[t]);break}return this},W.prototype.isColor=function(){return null===this.texture},W.prototype.isTexture=function(){return null!=this.texture},W.prototype.parse=function(e){"transparent"===e.nodeName&&(this.opaque=e.getAttribute("opaque"));for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"color":var r=pe(i.textContent);this.color=new THREE.Color,this.color.setRGB(r[0],r[1],r[2]),this.color.a=r[3];break;case"texture":this.texture=i.getAttribute("texture"),this.texcoord=i.getAttribute("texcoord"),this.texOpts={offsetU:0,offsetV:0,repeatU:1,repeatV:1,wrapU:1,wrapV:1},this.parseTexture(i)}}return this},W.prototype.parseTexture=function(e){if(!e.childNodes)return this;e.childNodes[1]&&"extra"===e.childNodes[1].nodeName&&(e=e.childNodes[1],e.childNodes[1]&&"technique"===e.childNodes[1].nodeName&&(e=e.childNodes[1]));for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"offsetU":case"offsetV":case"repeatU":case"repeatV":this.texOpts[i.nodeName]=parseFloat(i.textContent);break;case"wrapU":case"wrapV":this.texOpts[i.nodeName]="TRUE"===i.textContent.toUpperCase()?1:parseInt(i.textContent);break;default:this.texOpts[i.nodeName]=i.textContent}}return this},X.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"emission":case"diffuse":case"specular":case"transparent":this[i.nodeName]=(new W).parse(i);break;case"bump":var r=i.getAttribute("bumptype");r?"heightfield"===r.toLowerCase()?this.bump=(new W).parse(i):"normalmap"===r.toLowerCase()?this.normal=(new W).parse(i):(console.error("Shader.prototype.parse: Invalid value for attribute 'bumptype' ("+r+") - valid bumptypes are 'HEIGHTFIELD' and 'NORMALMAP' - defaulting to 'HEIGHTFIELD'"),this.bump=(new W).parse(i)):(console.warn("Shader.prototype.parse: Attribute 'bumptype' missing from bump node - defaulting to 'HEIGHTFIELD'"),this.bump=(new W).parse(i));break;case"shininess":case"reflectivity":case"index_of_refraction":case"transparency":var n=i.querySelectorAll("float");n.length>0&&(this[i.nodeName]=parseFloat(n[0].textContent))}}return this.create(),this},X.prototype.create=function(){var e={},t=!1;if(void 0!==this.transparency&&void 0!==this.transparent){var i=(this.transparent,(this.transparent.color.r+this.transparent.color.g+this.transparent.color.b)/3*this.transparency);i>0&&(t=!0,e.transparent=!0,e.opacity=1-i)}var r={diffuse:"map",ambient:"lightMap",specular:"specularMap",emission:"emissionMap",bump:"bumpMap",normal:"normalMap"};for(var n in this)switch(n){case"ambient":case"emission":case"diffuse":case"specular":case"bump":case"normal":var o=this[n];if(o instanceof W)if(o.isTexture()){var a=o.texture,s=this.effect.sampler[a];if(void 0!==s&&void 0!==s.source){var c=this.effect.surface[s.source];if(void 0!==c){var u=Pe[c.init_from];if(u){var l,h=_e+u.init_from,d=THREE.Loader.Handlers.get(h);null!==d?l=d.load(h):(l=new THREE.Texture,ye(l,h)),l.wrapS=o.texOpts.wrapU?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,l.wrapT=o.texOpts.wrapV?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,l.offset.x=o.texOpts.offsetU,l.offset.y=o.texOpts.offsetV,l.repeat.x=o.texOpts.repeatU,l.repeat.y=o.texOpts.repeatV,e[r[n]]=l,"emission"===n&&(e.emissive=16777215)}}}}else"diffuse"!==n&&t||("emission"===n?e.emissive=o.color.getHex():e[n]=o.color.getHex());break;case"shininess":e[n]=this[n];break;case"reflectivity":e[n]=this[n],e[n]>0&&(e.envMap=qe.defaultEnvMap),e.combine=THREE.MixOperation;break;case"index_of_refraction":e.refractionRatio=this[n],1!==this[n]&&(e.envMap=qe.defaultEnvMap);break;case"transparency":}switch(e.shading=Xe,e.side=this.effect.doubleSided?THREE.DoubleSide:THREE.FrontSide,void 0!==e.diffuse&&(e.color=e.diffuse,delete e.diffuse),this.type){case"constant":void 0!=e.emissive&&(e.color=e.emissive),this.material=new THREE.MeshBasicMaterial(e);break;case"phong":case"blinn":this.material=new THREE.MeshPhongMaterial(e);break;case"lambert":default:this.material=new THREE.MeshLambertMaterial(e)}return this.material},q.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"init_from":this.init_from=i.textContent;break;case"format":this.format=i.textContent;break;default:console.log("unhandled Surface prop: "+i.nodeName)}}return this},Z.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"source":this.source=i.textContent;break;case"minfilter":this.minfilter=i.textContent;break;case"magfilter":this.magfilter=i.textContent;break;case"mipfilter":this.mipfilter=i.textContent;break;case"wrap_s":this.wrap_s=i.textContent;break;case"wrap_t":this.wrap_t=i.textContent;break;default:console.log("unhandled Sampler2D prop: "+i.nodeName)}}return this},K.prototype.create=function(){return null===this.shader?null:void 0},K.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),Me(this,e),this.shader=null;for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(i))}}return this},K.prototype.parseNewparam=function(e){for(var t=e.getAttribute("sid"),i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"surface":this.surface[t]=new q(this).parse(r);break;case"sampler2D":this.sampler[t]=new Z(this).parse(r);break;case"extra":break;default:console.log(r.nodeName)}}},K.prototype.parseProfileCOMMON=function(e){for(var t,i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"profile_COMMON":this.parseProfileCOMMON(r);break;case"technique":t=r;break;case"newparam":this.parseNewparam(r);break;case"image":var n=(new L).parse(r);Pe[n.id]=n;break;case"extra":break;default:console.log(r.nodeName)}}return t},K.prototype.parseTechnique=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"constant":case"lambert":case"blinn":case"phong":this.shader=new X(i.nodeName,this).parse(i);break;case"extra":this.parseExtra(i)}}},K.prototype.parseExtra=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique":this.parseExtraTechnique(i)}}},K.prototype.parseExtraTechnique=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"bump":this.shader.parse(e)}}},J.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},$.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.source={};for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"animation":var r=(new $).parse(i);for(var n in r.source)this.source[n]=r.source[n];for(var o=0;o<r.channel.length;o++)this.channel.push(r.channel[o]),this.sampler.push(r.sampler[o]);break;case"source":var n=(new Y).parse(i);this.source[n.id]=n;break;case"sampler":this.sampler.push(new te(this).parse(i));break;case"channel":this.channel.push(new ee(this).parse(i))}}return this},ee.prototype.parse=function(e){this.source=e.getAttribute("source").replace(/^#/,""),this.target=e.getAttribute("target");var t=this.target.split("/"),i=(t.shift(),t.shift()),r=i.indexOf(".")>=0,n=i.indexOf("(")>=0;if(r)t=i.split("."),this.sid=t.shift(),this.member=t.shift();else if(n){var o=i.split("(");this.sid=o.shift();for(var a=0;a<o.length;a++)o[a]=parseInt(o[a].replace(/\)/,""));this.arrIndices=o}else this.sid=i;return this.fullSid=i,this.dotSyntax=r,this.arrSyntax=n,this},te.prototype.parse=function(e){this.id=e.getAttribute("id"),this.inputs=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"input":this.inputs.push((new Q).parse(i))}}return this},te.prototype.create=function(){for(var e=0;e<this.inputs.length;e++){var t=this.inputs[e],i=this.animation.source[t.source];switch(t.semantic){case"INPUT":this.input=i.read();break;case"OUTPUT":this.output=i.read(),this.strideOut=i.accessor.stride;break;case"INTERPOLATION":this.interpolation=i.read();break;case"IN_TANGENT":break;case"OUT_TANGENT":break;default:console.log(t.semantic)}}if(this.startTime=0,this.endTime=0,this.duration=0,this.input.length){this.startTime=1e8,this.endTime=-1e8;for(var e=0;e<this.input.length;e++)this.startTime=Math.min(this.startTime,this.input[e]),this.endTime=Math.max(this.endTime,this.input[e]);this.duration=this.endTime-this.startTime}},te.prototype.getData=function(e,t,i){var r;if("matrix"===e&&16===this.strideOut)r=this.output[t];else if(this.strideOut>1){r=[],t*=this.strideOut;for(var n=0;n<this.strideOut;++n)r[n]=this.output[t+n];if(3===this.strideOut)switch(e){case"rotate":case"translate":xe(r,-1);break;case"scale":xe(r,1)}else 4===this.strideOut&&"matrix"===e&&xe(r,-1)}else r=this.output[t],i&&"translate"===e&&(r=we(i,r));return r},ie.prototype.addTarget=function(e,t,i,r){this.targets.push({sid:e,member:i,transform:t,data:r})},ie.prototype.apply=function(e){for(var t=0;t<this.targets.length;++t){var i=this.targets[t];e&&i.sid!==e||i.transform.update(i.data,i.member)}},ie.prototype.getTarget=function(e){for(var t=0;t<this.targets.length;++t)if(this.targets[t].sid===e)return this.targets[t];return null},ie.prototype.hasTarget=function(e){for(var t=0;t<this.targets.length;++t)if(this.targets[t].sid===e)return!0;return!1},ie.prototype.interpolate=function(e,t){for(var i=0,r=this.targets.length;r>i;i++){var n,o=this.targets[i],a=e.getTarget(o.sid);if("matrix"!==o.transform.type&&a){var s=(t-this.time)/(e.time-this.time),c=a.data,u=o.data;if(0>s&&(s=0),s>1&&(s=1),u.length){n=[];for(var l=0;l<u.length;++l)n[l]=u[l]+(c[l]-u[l])*s}else n=u+(c-u)*s}else n=o.data;o.transform.update(n,o.member)}},re.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"optics":this.parseOptics(i)}}return this},re.prototype.parseOptics=function(e){for(var t=0;t<e.childNodes.length;t++)if("technique_common"===e.childNodes[t].nodeName)for(var i=e.childNodes[t],r=0;r<i.childNodes.length;r++)if(this.technique=i.childNodes[r].nodeName,"perspective"===this.technique)for(var n=i.childNodes[r],o=0;o<n.childNodes.length;o++){var a=n.childNodes[o];switch(a.nodeName){case"yfov":this.yfov=a.textContent;break;case"xfov":this.xfov=a.textContent;break;case"znear":this.znear=a.textContent;break;case"zfar":this.zfar=a.textContent;break;case"aspect_ratio":this.aspect_ratio=a.textContent}}else if("orthographic"===this.technique)for(var s=i.childNodes[r],o=0;o<s.childNodes.length;o++){ var a=s.childNodes[o];switch(a.nodeName){case"xmag":this.xmag=a.textContent;break;case"ymag":this.ymag=a.textContent;break;case"znear":this.znear=a.textContent;break;case"zfar":this.zfar=a.textContent;break;case"aspect_ratio":this.aspect_ratio=a.textContent}}return this},ne.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},oe.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique_common":this.parseCommon(i);break;case"technique":this.parseTechnique(i)}}return this},oe.prototype.parseCommon=function(e){for(var t=0;t<e.childNodes.length;t++)switch(e.childNodes[t].nodeName){case"directional":case"point":case"spot":case"ambient":this.technique=e.childNodes[t].nodeName;for(var i=e.childNodes[t],r=0;r<i.childNodes.length;r++){var n=i.childNodes[r];switch(n.nodeName){case"color":var o=pe(n.textContent);this.color=new THREE.Color(0),this.color.setRGB(o[0],o[1],o[2]),this.color.a=o[3];break;case"falloff_angle":this.falloff_angle=parseFloat(n.textContent);break;case"quadratic_attenuation":var a=parseFloat(n.textContent);this.distance=a?Math.sqrt(1/a):0}}}return this},oe.prototype.parseTechnique=function(e){this.profile=e.getAttribute("profile");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"intensity":this.intensity=parseFloat(i.textContent)}}return this},ae.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},se.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.joints=[],this.links=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique_common":this.parseCommon(i)}}return this},se.prototype.parseCommon=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(e.childNodes[t].nodeName){case"joint":this.joints.push((new ce).parse(i));break;case"link":this.links.push((new ue).parse(i))}}return this},ce.prototype.parse=function(e){this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.axis=new THREE.Vector3,this.limits={min:0,max:0},this.type="",this["static"]=!1,this.zeroPosition=0,this.middlePosition=0;var t=e.querySelector("axis"),i=pe(t.textContent);this.axis=Ee(i,0);var r=e.querySelector("limits min")?parseFloat(e.querySelector("limits min").textContent):-360,n=e.querySelector("limits max")?parseFloat(e.querySelector("limits max").textContent):360;this.limits={min:r,max:n};for(var o=["prismatic","revolute"],a=0;a<o.length;a++){var s=o[a],c=e.querySelector(s);c&&(this.type=s)}return this.limits.min>=this.limits.max&&(this["static"]=!0),this.middlePosition=(this.limits.min+this.limits.max)/2,this},ue.prototype.parse=function(e){this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.transforms=[],this.attachments=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"attachment_full":this.attachments.push((new le).parse(i));break;case"rotate":case"translate":case"matrix":this.transforms.push((new j).parse(i))}}return this},le.prototype.parse=function(e){this.joint=e.getAttribute("joint").split("/").pop(),this.links=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"link":this.links.push((new ue).parse(i));break;case"rotate":case"translate":case"matrix":this.transforms.push((new j).parse(i))}}return this},{load:e,parse:t,setPreferredShading:i,applySkin:m,geometries:Ve,options:qe}}},{}],15:[function(){THREE.MTLLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager},THREE.MTLLoader.prototype={constructor:THREE.MTLLoader,load:function(e,t,i,r){var n=this,o=new THREE.XHRLoader(this.manager);o.setPath(this.path),o.load(e,function(e){t(n.parse(e))},i,r)},setPath:function(e){this.path=e},setBaseUrl:function(e){this.baseUrl=e},setCrossOrigin:function(e){this.crossOrigin=e},setMaterialOptions:function(e){this.materialOptions=e},parse:function(e){for(var t=e.split("\n"),i={},r=/\s+/,n={},o=0;o<t.length;o++){var a=t[o];if(a=a.trim(),0!==a.length&&"#"!==a.charAt(0)){var s=a.indexOf(" "),c=s>=0?a.substring(0,s):a;c=c.toLowerCase();var u=s>=0?a.substring(s+1):"";if(u=u.trim(),"newmtl"===c)i={name:u},n[u]=i;else if(i)if("ka"===c||"kd"===c||"ks"===c){var l=u.split(r,3);i[c]=[parseFloat(l[0]),parseFloat(l[1]),parseFloat(l[2])]}else i[c]=u}}var h=new THREE.MTLLoader.MaterialCreator(this.baseUrl,this.materialOptions);return h.setCrossOrigin(this.crossOrigin),h.setManager(this.manager),h.setMaterials(n),h}},THREE.MTLLoader.MaterialCreator=function(e,t){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:THREE.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:THREE.RepeatWrapping},THREE.MTLLoader.MaterialCreator.prototype={constructor:THREE.MTLLoader.MaterialCreator,setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var i in e){var r=e[i],n={};t[i]=n;for(var o in r){var a=!0,s=r[o],c=o.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[1]&&(a=!1)}a&&(n[c]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this.materialsInfo[e],i={name:e,side:this.side};for(var r in t){var n=t[r];if(""!==n)switch(r.toLowerCase()){case"kd":i.color=(new THREE.Color).fromArray(n);break;case"ks":i.specular=(new THREE.Color).fromArray(n);break;case"map_kd":i.map=this.loadTexture(this.baseUrl+n),i.map.wrapS=this.wrap,i.map.wrapT=this.wrap;break;case"ns":i.shininess=parseFloat(n);break;case"d":1>n&&(i.opacity=n,i.transparent=!0);break;case"Tr":n>0&&(i.opacity=1-n,i.transparent=!0);break;case"map_bump":case"bump":if(i.bumpMap)break;i.bumpMap=this.loadTexture(this.baseUrl+n),i.bumpMap.wrapS=this.wrap,i.bumpMap.wrapT=this.wrap}}return this.materials[e]=new THREE.MeshPhongMaterial(i),this.materials[e]},loadTexture:function(e,t,i,r,n){var o,a=THREE.Loader.Handlers.get(e),s=void 0!==this.manager?this.manager:THREE.DefaultLoadingManager;return null===a&&(a=new THREE.TextureLoader(s)),a.setCrossOrigin&&a.setCrossOrigin(this.crossOrigin),o=a.load(e,i,r,n),void 0!==t&&(o.mapping=t),o}},THREE.EventDispatcher.prototype.apply(THREE.MTLLoader.prototype)},{}],16:[function(){THREE.OBJLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager,this.materials=null,this.regexp={vertex_pattern:/^v\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,normal_pattern:/^vn\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,uv_pattern:/^vt\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,face_vertex:/^f\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)(?:\s+(-?\d+))?/,face_vertex_uv:/^f\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+))?/,face_vertex_uv_normal:/^f\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+)\/(-?\d+))?/,face_vertex_normal:/^f\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)(?:\s+(-?\d+)\/\/(-?\d+))?/,object_pattern:/^[og]\s*(.+)?/,smoothing_pattern:/^s\s+(\d+|on|off)/,material_library_pattern:/^mtllib /,material_use_pattern:/^usemtl /}},THREE.OBJLoader.prototype={constructor:THREE.OBJLoader,load:function(e,t,i,r){var n=this,o=new THREE.XHRLoader(n.manager);o.setPath(this.path),o.load(e,function(e){t(n.parse(e))},i,r)},setPath:function(e){this.path=e},setMaterials:function(e){this.materials=e},_createParserState:function(){var e={objects:[],object:{},vertices:[],normals:[],uvs:[],materialLibraries:[],startObject:function(e,t){return this.object&&this.object.fromDeclaration===!1?(this.object.name=e,void(this.object.fromDeclaration=t!==!1)):(this.object={name:e||"",geometry:{vertices:[],normals:[],uvs:[]},material:{name:"",smooth:!0},fromDeclaration:t!==!1},void this.objects.push(this.object))},parseVertexIndex:function(e,t){var i=parseInt(e,10);return 3*(i>=0?i-1:i+t/3)},parseNormalIndex:function(e,t){var i=parseInt(e,10);return 3*(i>=0?i-1:i+t/3)},parseUVIndex:function(e,t){var i=parseInt(e,10);return 2*(i>=0?i-1:i+t/2)},addVertex:function(e,t,i){var r=this.vertices,n=this.object.geometry.vertices;n.push(r[e+0]),n.push(r[e+1]),n.push(r[e+2]),n.push(r[t+0]),n.push(r[t+1]),n.push(r[t+2]),n.push(r[i+0]),n.push(r[i+1]),n.push(r[i+2])},addVertexLine:function(e){var t=this.vertices,i=this.object.geometry.vertices;i.push(t[e+0]),i.push(t[e+1]),i.push(t[e+2])},addNormal:function(e,t,i){var r=this.normals,n=this.object.geometry.normals;n.push(r[e+0]),n.push(r[e+1]),n.push(r[e+2]),n.push(r[t+0]),n.push(r[t+1]),n.push(r[t+2]),n.push(r[i+0]),n.push(r[i+1]),n.push(r[i+2])},addUV:function(e,t,i){var r=this.uvs,n=this.object.geometry.uvs;n.push(r[e+0]),n.push(r[e+1]),n.push(r[t+0]),n.push(r[t+1]),n.push(r[i+0]),n.push(r[i+1])},addUVLine:function(e){var t=this.uvs,i=this.object.geometry.uvs;i.push(t[e+0]),i.push(t[e+1])},addFace:function(e,t,i,r,n,o,a,s,c,u,l,h){var d,p=this.vertices.length,f=this.parseVertexIndex(e,p),m=this.parseVertexIndex(t,p),g=this.parseVertexIndex(i,p);if(void 0===r?this.addVertex(f,m,g):(d=this.parseVertexIndex(r,p),this.addVertex(f,m,d),this.addVertex(m,g,d)),void 0!==n){var v=this.uvs.length;f=this.parseUVIndex(n,v),m=this.parseUVIndex(o,v),g=this.parseUVIndex(a,v),void 0===r?this.addUV(f,m,g):(d=this.parseUVIndex(s,v),this.addUV(f,m,d),this.addUV(m,g,d))}if(void 0!==c){var y=this.normals.length;f=this.parseNormalIndex(c,y),m=c===u?f:this.parseNormalIndex(u,y),g=c===l?f:this.parseNormalIndex(l,y),void 0===r?this.addNormal(f,m,g):(d=this.parseNormalIndex(h,y),this.addNormal(f,m,d),this.addNormal(m,g,d))}},addLineGeometry:function(e,t){this.object.geometry.type="Line";for(var i=this.vertices.length,r=this.uvs.length,n=0,o=e.length;o>n;n++)this.addVertexLine(this.parseVertexIndex(e[n],i));for(var a=0,o=t.length;o>a;a++)this.addUVLine(this.parseUVIndex(t[a],r))}};return e.startObject("",!1),e},parse:function(e){console.time("OBJLoader");var t=this._createParserState();-1!==e.indexOf("\r\n")&&(e=e.replace("\r\n","\n"));for(var i=e.split("\n"),r="",n="",o="",a=0,s=[],c="function"==typeof"".trimLeft,u=0,l=i.length;l>u;u++)if(r=i[u],r=c?r.trimLeft():r.trim(),a=r.length,0!==a&&(n=r.charAt(0),"#"!==n))if("v"===n)if(o=r.charAt(1)," "===o&&null!==(s=this.regexp.vertex_pattern.exec(r)))t.vertices.push(parseFloat(s[1]),parseFloat(s[2]),parseFloat(s[3]));else if("n"===o&&null!==(s=this.regexp.normal_pattern.exec(r)))t.normals.push(parseFloat(s[1]),parseFloat(s[2]),parseFloat(s[3]));else{if("t"!==o||null===(s=this.regexp.uv_pattern.exec(r)))throw new Error("Unexpected vertex/normal/uv line: '"+r+"'");t.uvs.push(parseFloat(s[1]),parseFloat(s[2]))}else if("f"===n)if(null!==(s=this.regexp.face_vertex_uv_normal.exec(r)))t.addFace(s[1],s[4],s[7],s[10],s[2],s[5],s[8],s[11],s[3],s[6],s[9],s[12]);else if(null!==(s=this.regexp.face_vertex_uv.exec(r)))t.addFace(s[1],s[3],s[5],s[7],s[2],s[4],s[6],s[8]);else if(null!==(s=this.regexp.face_vertex_normal.exec(r)))t.addFace(s[1],s[3],s[5],s[7],void 0,void 0,void 0,void 0,s[2],s[4],s[6],s[8]);else{if(null===(s=this.regexp.face_vertex.exec(r)))throw new Error("Unexpected face line: '"+r+"'");t.addFace(s[1],s[2],s[3],s[4])}else if("l"===n){var h=r.substring(1).trim().split(" "),d=[],p=[];if(-1===r.indexOf("/"))d=h;else for(var f=0,m=h.length;m>f;f++){var g=h[f].split("/");""!==g[0]&&d.push(g[0]),""!==g[1]&&p.push(g[1])}t.addLineGeometry(d,p)}else if(null!==(s=this.regexp.object_pattern.exec(r))){var v=s[0].substr(1).trim();t.startObject(v)}else if(this.regexp.material_use_pattern.test(r))t.object.material.name=r.substring(7).trim();else if(this.regexp.material_library_pattern.test(r))t.materialLibraries.push(r.substring(7).trim());else{if(null===(s=this.regexp.smoothing_pattern.exec(r))){if("\x00"===r)continue;throw new Error("Unexpected line: '"+r+"'")}var y=s[1].trim().toLowerCase();t.object.material.smooth="1"===y||"on"===y}var M=new THREE.Group;M.materialLibraries=[].concat(t.materialLibraries);for(var u=0,l=t.objects.length;l>u;u++){var A=t.objects[u],x=A.geometry,w="Line"===x.type;if(0!==x.vertices.length){var E=new THREE.BufferGeometry;E.addAttribute("position",new THREE.BufferAttribute(new Float32Array(x.vertices),3)),x.normals.length>0?E.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(x.normals),3)):E.computeVertexNormals(),x.uvs.length>0&&E.addAttribute("uv",new THREE.BufferAttribute(new Float32Array(x.uvs),2));var b;if(null!==this.materials&&(b=this.materials.create(A.material.name),w&&b&&!(b instanceof THREE.LineBasicMaterial))){var T=new THREE.LineBasicMaterial;T.copy(b),b=T}b||(b=w?new THREE.LineBasicMaterial:new THREE.MeshPhongMaterial,b.name=A.material.name),b.shading=A.material.smooth?THREE.SmoothShading:THREE.FlatShading;var L=w?new THREE.Line(E,b):new THREE.Mesh(E,b);L.name=A.name,M.add(L)}}return console.timeEnd("OBJLoader"),M}}},{}],17:[function(e,i,r){var n={REVISION:"76"};"function"==typeof t&&t.amd?t("three",n):"undefined"!=typeof r&&"undefined"!=typeof i&&(i.exports=n),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Math.sign&&(Math.sign=function(e){return 0>e?-1:e>0?1:+e}),void 0===Function.prototype.name&&void 0!==Object.defineProperty&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]}}),void 0===Object.assign&&Object.defineProperty(Object,"assign",{writable:!0,configurable:!0,value:function(e){"use strict";if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),i=1,r=arguments.length;i!==r;++i){var n=arguments[i];if(void 0!==n&&null!==n){n=Object(n);for(var o=Object.keys(n),a=0,s=o.length;a!==s;++a){var c=o[a],u=Object.getOwnPropertyDescriptor(n,c);void 0!==u&&u.enumerable&&(t[c]=n[c])}}}return t}}),n.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},n.CullFaceNone=0,n.CullFaceBack=1,n.CullFaceFront=2,n.CullFaceFrontBack=3,n.FrontFaceDirectionCW=0,n.FrontFaceDirectionCCW=1,n.BasicShadowMap=0,n.PCFShadowMap=1,n.PCFSoftShadowMap=2,n.FrontSide=0,n.BackSide=1,n.DoubleSide=2,n.FlatShading=1,n.SmoothShading=2,n.NoColors=0,n.FaceColors=1,n.VertexColors=2,n.NoBlending=0,n.NormalBlending=1,n.AdditiveBlending=2,n.SubtractiveBlending=3,n.MultiplyBlending=4,n.CustomBlending=5,n.AddEquation=100,n.SubtractEquation=101,n.ReverseSubtractEquation=102,n.MinEquation=103,n.MaxEquation=104,n.ZeroFactor=200,n.OneFactor=201,n.SrcColorFactor=202,n.OneMinusSrcColorFactor=203,n.SrcAlphaFactor=204,n.OneMinusSrcAlphaFactor=205,n.DstAlphaFactor=206,n.OneMinusDstAlphaFactor=207,n.DstColorFactor=208,n.OneMinusDstColorFactor=209,n.SrcAlphaSaturateFactor=210,n.NeverDepth=0,n.AlwaysDepth=1,n.LessDepth=2,n.LessEqualDepth=3,n.EqualDepth=4,n.GreaterEqualDepth=5,n.GreaterDepth=6,n.NotEqualDepth=7,n.MultiplyOperation=0,n.MixOperation=1,n.AddOperation=2,n.NoToneMapping=0,n.LinearToneMapping=1,n.ReinhardToneMapping=2,n.Uncharted2ToneMapping=3,n.CineonToneMapping=4,n.UVMapping=300,n.CubeReflectionMapping=301,n.CubeRefractionMapping=302,n.EquirectangularReflectionMapping=303,n.EquirectangularRefractionMapping=304,n.SphericalReflectionMapping=305,n.CubeUVReflectionMapping=306,n.CubeUVRefractionMapping=307,n.RepeatWrapping=1e3,n.ClampToEdgeWrapping=1001,n.MirroredRepeatWrapping=1002,n.NearestFilter=1003,n.NearestMipMapNearestFilter=1004,n.NearestMipMapLinearFilter=1005,n.LinearFilter=1006,n.LinearMipMapNearestFilter=1007,n.LinearMipMapLinearFilter=1008,n.UnsignedByteType=1009,n.ByteType=1010,n.ShortType=1011,n.UnsignedShortType=1012,n.IntType=1013,n.UnsignedIntType=1014,n.FloatType=1015,n.HalfFloatType=1025,n.UnsignedShort4444Type=1016,n.UnsignedShort5551Type=1017,n.UnsignedShort565Type=1018,n.AlphaFormat=1019,n.RGBFormat=1020,n.RGBAFormat=1021,n.LuminanceFormat=1022,n.LuminanceAlphaFormat=1023,n.RGBEFormat=n.RGBAFormat,n.DepthFormat=1026,n.RGB_S3TC_DXT1_Format=2001,n.RGBA_S3TC_DXT1_Format=2002,n.RGBA_S3TC_DXT3_Format=2003,n.RGBA_S3TC_DXT5_Format=2004,n.RGB_PVRTC_4BPPV1_Format=2100,n.RGB_PVRTC_2BPPV1_Format=2101,n.RGBA_PVRTC_4BPPV1_Format=2102,n.RGBA_PVRTC_2BPPV1_Format=2103,n.RGB_ETC1_Format=2151,n.LoopOnce=2200,n.LoopRepeat=2201,n.LoopPingPong=2202,n.InterpolateDiscrete=2300,n.InterpolateLinear=2301,n.InterpolateSmooth=2302,n.ZeroCurvatureEnding=2400,n.ZeroSlopeEnding=2401,n.WrapAroundEnding=2402,n.TrianglesDrawMode=0,n.TriangleStripDrawMode=1,n.TriangleFanDrawMode=2,n.LinearEncoding=3e3,n.sRGBEncoding=3001,n.GammaEncoding=3007,n.RGBEEncoding=3002,n.LogLuvEncoding=3003,n.RGBM7Encoding=3004,n.RGBM16Encoding=3005,n.RGBDEncoding=3006,n.BasicDepthPacking=3200,n.RGBADepthPacking=3201,n.Color=function(e){return 3===arguments.length?this.fromArray(arguments):this.set(e)},n.Color.prototype={constructor:n.Color,r:1,g:1,b:1,set:function(e){return e instanceof n.Color?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){this.r=e,this.g=e,this.b=e},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,i){return this.r=e,this.g=t,this.b=i,this},setHSL:function(){function e(e,t,i){return 0>i&&(i+=1),i>1&&(i-=1),1/6>i?e+6*(t-e)*i:.5>i?t:2/3>i?e+6*(t-e)*(2/3-i):e}return function(t,i,r){if(t=n.Math.euclideanModulo(t,1),i=n.Math.clamp(i,0,1),r=n.Math.clamp(r,0,1),0===i)this.r=this.g=this.b=r;else{var o=.5>=r?r*(1+i):r+i-r*i,a=2*r-o;this.r=e(a,o,t+1/3),this.g=e(a,o,t),this.b=e(a,o,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var s=parseFloat(r[1])/360,c=parseInt(r[2],10)/100,u=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(s,c,u)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=i[1],h=l.length;if(3===h)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}if(e&&e.length>0){var l=n.ColorKeywords[e];void 0!==l?this.setHex(l):console.warn("THREE.Color: Unknown color "+e)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var i=t>0?1/t:1;return this.r=Math.pow(e.r,i),this.g=Math.pow(e.g,i),this.b=Math.pow(e.b,i),this},convertGammaToLinear:function(){var e=this.r,t=this.g,i=this.b;return this.r=e*e,this.g=t*t,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t,i,r=e||{h:0,s:0,l:0},n=this.r,o=this.g,a=this.b,s=Math.max(n,o,a),c=Math.min(n,o,a),u=(c+s)/2;if(c===s)t=0,i=0;else{var l=s-c;switch(i=.5>=u?l/(s+c):l/(2-s-c),s){case n:t=(o-a)/l+(a>o?6:0);break;case o:t=(a-n)/l+2;break;case a:t=(n-o)/l+4}t/=6}return r.h=t,r.s=i,r.l=u,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,i){var r=this.getHSL();return r.h+=e,r.s+=t,r.l+=i,this.setHSL(r.h,r.s,r.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}},n.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},n.Quaternion=function(e,t,i,r){this._x=e||0,this._y=t||0,this._z=i||0,this._w=void 0!==r?r:1},n.Quaternion.prototype={constructor:n.Quaternion,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get w(){return this._w},set w(e){this._w=e,this.onChangeCallback()},set:function(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(e instanceof n.Euler==!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var i=Math.cos(e._x/2),r=Math.cos(e._y/2),o=Math.cos(e._z/2),a=Math.sin(e._x/2),s=Math.sin(e._y/2),c=Math.sin(e._z/2),u=e.order;return"XYZ"===u?(this._x=a*r*o+i*s*c,this._y=i*s*o-a*r*c,this._z=i*r*c+a*s*o,this._w=i*r*o-a*s*c):"YXZ"===u?(this._x=a*r*o+i*s*c,this._y=i*s*o-a*r*c,this._z=i*r*c-a*s*o,this._w=i*r*o+a*s*c):"ZXY"===u?(this._x=a*r*o-i*s*c,this._y=i*s*o+a*r*c,this._z=i*r*c+a*s*o,this._w=i*r*o-a*s*c):"ZYX"===u?(this._x=a*r*o-i*s*c,this._y=i*s*o+a*r*c,this._z=i*r*c-a*s*o,this._w=i*r*o+a*s*c):"YZX"===u?(this._x=a*r*o+i*s*c,this._y=i*s*o+a*r*c,this._z=i*r*c-a*s*o,this._w=i*r*o-a*s*c):"XZY"===u&&(this._x=a*r*o-i*s*c,this._y=i*s*o-a*r*c,this._z=i*r*c+a*s*o,this._w=i*r*o+a*s*c),t!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,i=e.elements,r=i[0],n=i[4],o=i[8],a=i[1],s=i[5],c=i[9],u=i[2],l=i[6],h=i[10],d=r+s+h;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(l-c)*t,this._y=(o-u)*t,this._z=(a-n)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(l-c)/t,this._x=.25*t,this._y=(n+a)/t,this._z=(o+u)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(o-u)/t,this._x=(n+a)/t,this._y=.25*t,this._z=(c+l)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(a-n)/t,this._x=(o+u)/t,this._y=(c+l)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t,i=1e-6;return function(r,o){return void 0===e&&(e=new n.Vector3),t=r.dot(o)+1,i>t?(t=0,Math.abs(r.x)>Math.abs(r.z)?e.set(-r.y,r.x,0):e.set(0,-r.z,r.y)):e.crossVectors(r,o),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e._x,r=e._y,n=e._z,o=e._w,a=t._x,s=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-n*s,this._y=r*u+o*s+n*a-i*c,this._z=n*u+o*c+i*s-r*a,this._w=o*u-i*a-r*s-n*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this._x,r=this._y,n=this._z,o=this._w,a=o*e._w+i*e._x+r*e._y+n*e._z;if(0>a?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=n,this;var s=Math.sqrt(1-a*a);if(Math.abs(s)<.001)return this._w=.5*(o+this._w),this._x=.5*(i+this._x),this._y=.5*(r+this._y),this._z=.5*(n+this._z),this;var c=Math.atan2(s,a),u=Math.sin((1-t)*c)/s,l=Math.sin(t*c)/s;return this._w=o*u+this._w*l,this._x=i*u+this._x*l,this._y=r*u+this._y*l,this._z=n*u+this._z*l,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}},Object.assign(n.Quaternion,{slerp:function(e,t,i,r){return i.copy(e).slerp(t,r)},slerpFlat:function(e,t,i,r,n,o,a){var s=i[r+0],c=i[r+1],u=i[r+2],l=i[r+3],h=n[o+0],d=n[o+1],p=n[o+2],f=n[o+3];if(l!==f||s!==h||c!==d||u!==p){var m=1-a,g=s*h+c*d+u*p+l*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var M=Math.sqrt(y),A=Math.atan2(M,g*v);m=Math.sin(m*A)/M,a=Math.sin(a*A)/M}var x=a*v;if(s=s*m+h*x,c=c*m+d*x,u=u*m+p*x,l=l*m+f*x,m===1-a){var w=1/Math.sqrt(s*s+c*c+u*u+l*l);s*=w,c*=w,u*=w,l*=w}}e[t]=s,e[t+1]=c,e[t+2]=u,e[t+3]=l}}),n.Vector2=function(e,t){this.x=e||0,this.y=t||0},n.Vector2.prototype={constructor:n.Vector2,get width(){return this.x},set width(e){this.x=e},get height(){return this.y},set height(e){this.y=e},set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return isFinite(e)?(this.x*=e,this.y*=e):(this.x=0,this.y=0),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(){var e,t;return function(i,r){return void 0===e&&(e=new n.Vector2,t=new n.Vector2),e.set(i,i),t.set(r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.multiplyScalar(Math.max(e,Math.min(t,i))/i),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){ return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var e=Math.atan2(this.y,this.x);return 0>e&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e),this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromAttribute:function(e,t,i){return void 0===i&&(i=0),t=t*e.itemSize+i,this.x=e.array[t],this.y=e.array[t+1],this},rotateAround:function(e,t){var i=Math.cos(t),r=Math.sin(t),n=this.x-e.x,o=this.y-e.y;return this.x=n*i-o*r+e.x,this.y=n*r+o*i+e.y,this}},n.Vector3=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0},n.Vector3.prototype={constructor:n.Vector3,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(){var e;return function(t){return t instanceof n.Euler==!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),void 0===e&&(e=new n.Quaternion),this.applyQuaternion(e.setFromEuler(t)),this}}(),applyAxisAngle:function(){var e;return function(t,i){return void 0===e&&(e=new n.Quaternion),this.applyQuaternion(e.setFromAxisAngle(t,i)),this}}(),applyMatrix3:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6]*r,this.y=n[1]*t+n[4]*i+n[7]*r,this.z=n[2]*t+n[5]*i+n[8]*r,this},applyMatrix4:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[4]*i+n[8]*r+n[12],this.y=n[1]*t+n[5]*i+n[9]*r+n[13],this.z=n[2]*t+n[6]*i+n[10]*r+n[14],this},applyProjection:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements,o=1/(n[3]*t+n[7]*i+n[11]*r+n[15]);return this.x=(n[0]*t+n[4]*i+n[8]*r+n[12])*o,this.y=(n[1]*t+n[5]*i+n[9]*r+n[13])*o,this.z=(n[2]*t+n[6]*i+n[10]*r+n[14])*o,this},applyQuaternion:function(e){var t=this.x,i=this.y,r=this.z,n=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*r-a*i,u=s*i+a*t-n*r,l=s*r+n*i-o*t,h=-n*t-o*i-a*r;return this.x=c*s+h*-n+u*-a-l*-o,this.y=u*s+h*-o+l*-n-c*-a,this.z=l*s+h*-a+c*-o-u*-n,this},project:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyProjection(e)}}(),unproject:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyProjection(e)}}(),transformDirection:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[4]*i+n[8]*r,this.y=n[1]*t+n[5]*i+n[9]*r,this.z=n[2]*t+n[6]*i+n[10]*r,this.normalize(),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(){var e,t;return function(i,r){return void 0===e&&(e=new n.Vector3,t=new n.Vector3),e.set(i,i,i),t.set(r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.multiplyScalar(Math.max(e,Math.min(t,i))/i),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e),this},cross:function(e,t){if(void 0!==t)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var i=this.x,r=this.y,n=this.z;return this.x=r*e.z-n*e.y,this.y=n*e.x-i*e.z,this.z=i*e.y-r*e.x,this},crossVectors:function(e,t){var i=e.x,r=e.y,n=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-n*a,this.y=n*o-i*s,this.z=i*a-r*o,this},projectOnVector:function(){var e,t;return function(i){return void 0===e&&(e=new n.Vector3),e.copy(i).normalize(),t=this.dot(e),this.copy(e).multiplyScalar(t)}}(),projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new n.Vector3),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new n.Vector3),this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(n.Math.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromMatrixPosition:function(e){return this.setFromMatrixColumn(e,3)},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this},setFromMatrixColumn:function(e,t){return"number"==typeof e&&(console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),e=arguments[1],t=arguments[0]),this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromAttribute:function(e,t,i){return void 0===i&&(i=0),t=t*e.itemSize+i,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this}},n.Vector4=function(e,t,i,r){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1},n.Vector4.prototype={constructor:n.Vector4,set:function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return isFinite(e)?(this.x*=e,this.y*=e,this.z*=e,this.w*=e):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(e){var t=this.x,i=this.y,r=this.z,n=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*n,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*n,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*n,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*n,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return 1e-4>t?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,i,r,n,o=.01,a=.1,s=e.elements,c=s[0],u=s[4],l=s[8],h=s[1],d=s[5],p=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(u-h)<o&&Math.abs(l-f)<o&&Math.abs(p-m)<o){if(Math.abs(u+h)<a&&Math.abs(l+f)<a&&Math.abs(p+m)<a&&Math.abs(c+d+g-3)<a)return this.set(1,0,0,0),this;t=Math.PI;var v=(c+1)/2,y=(d+1)/2,M=(g+1)/2,A=(u+h)/4,x=(l+f)/4,w=(p+m)/4;return v>y&&v>M?o>v?(i=0,r=.707106781,n=.707106781):(i=Math.sqrt(v),r=A/i,n=x/i):y>M?o>y?(i=.707106781,r=0,n=.707106781):(r=Math.sqrt(y),i=A/r,n=w/r):o>M?(i=.707106781,r=.707106781,n=0):(n=Math.sqrt(M),i=x/n,r=w/n),this.set(i,r,n,t),this}var E=Math.sqrt((m-p)*(m-p)+(l-f)*(l-f)+(h-u)*(h-u));return Math.abs(E)<.001&&(E=1),this.x=(m-p)/E,this.y=(l-f)/E,this.z=(h-u)/E,this.w=Math.acos((c+d+g-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(i,r){return void 0===e&&(e=new n.Vector4,t=new n.Vector4),e.set(i,i,i,i),t.set(r,r,r,r),this.clamp(e,t)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e),this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromAttribute:function(e,t,i){return void 0===i&&(i=0),t=t*e.itemSize+i,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this.w=e.array[t+3],this}},n.Euler=function(e,t,i,r){this._x=e||0,this._y=t||0,this._z=i||0,this._order=r||n.Euler.DefaultOrder},n.Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],n.Euler.DefaultOrder="XYZ",n.Euler.prototype={constructor:n.Euler,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get order(){return this._order},set order(e){this._order=e,this.onChangeCallback()},set:function(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,i){var r=n.Math.clamp,o=e.elements,a=o[0],s=o[4],c=o[8],u=o[1],l=o[5],h=o[9],d=o[2],p=o[6],f=o[10];return t=t||this._order,"XYZ"===t?(this._y=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(c,f),this._z=Math.atan2(u,l)):(this._y=Math.atan2(-d,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(u,a))):"ZYX"===t?(this._y=Math.asin(-r(d,-1,1)),Math.abs(d)<.99999?(this._x=Math.atan2(p,f),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-s,l))):"YZX"===t?(this._z=Math.asin(r(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-d,a)):(this._x=0,this._y=Math.atan2(c,f))):"XZY"===t?(this._z=Math.asin(-r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(p,l),this._y=Math.atan2(c,a)):(this._x=Math.atan2(-h,f),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,i!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var e;return function(t,i,r){return void 0===e&&(e=new n.Matrix4),e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,i,r),this}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new n.Quaternion;return function(t){e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new n.Vector3(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}},n.Line3=function(e,t){this.start=void 0!==e?e:new n.Vector3,this.end=void 0!==t?t:new n.Vector3},n.Line3.prototype={constructor:n.Line3,set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},center:function(e){var t=e||new n.Vector3;return t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){var t=e||new n.Vector3;return t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var i=t||new n.Vector3;return this.delta(i).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new n.Vector3,t=new n.Vector3;return function(i,r){e.subVectors(i,this.start),t.subVectors(this.end,this.start);var o=t.dot(t),a=t.dot(e),s=a/o;return r&&(s=n.Math.clamp(s,0,1)),s}}(),closestPointToPoint:function(e,t,i){var r=this.closestPointToPointParameter(e,t),o=i||new n.Vector3;return this.delta(o).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}},n.Box2=function(e,t){this.min=void 0!==e?e:new n.Vector2(+(1/0),+(1/0)),this.max=void 0!==t?t:new n.Vector2(-(1/0),-(1/0))},n.Box2.prototype={constructor:n.Box2,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;i>t;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new n.Vector2;return function(t,i){var r=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=+(1/0),this.max.x=this.max.y=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(e){var t=e||new n.Vector2;return t.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){var t=e||new n.Vector2;return t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y?!1:!0},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y?!0:!1},getParameter:function(e,t){var i=t||new n.Vector2;return i.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y?!1:!0},clampPoint:function(e,t){var i=t||new n.Vector2;return i.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new n.Vector2;return function(t){var i=e.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},n.Box3=function(e,t){this.min=void 0!==e?e:new n.Vector3(+(1/0),+(1/0),+(1/0)),this.max=void 0!==t?t:new n.Vector3(-(1/0),-(1/0),-(1/0))},n.Box3.prototype={constructor:n.Box3,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=+(1/0),i=+(1/0),r=+(1/0),n=-(1/0),o=-(1/0),a=-(1/0),s=0,c=e.length;c>s;s+=3){var u=e[s],l=e[s+1],h=e[s+2];t>u&&(t=u),i>l&&(i=l),r>h&&(r=h),u>n&&(n=u),l>o&&(o=l),h>a&&(a=h)}this.min.set(t,i,r),this.max.set(n,o,a)},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;i>t;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new n.Vector3;return function(t,i){var r=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(){var e=new n.Vector3;return function(t){var i=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse(function(t){var r=t.geometry;if(void 0!==r)if(r instanceof n.Geometry)for(var o=r.vertices,a=0,s=o.length;s>a;a++)e.copy(o[a]),e.applyMatrix4(t.matrixWorld),i.expandByPoint(e);else if(r instanceof n.BufferGeometry&&void 0!==r.attributes.position)for(var c=r.attributes.position.array,a=0,s=c.length;s>a;a+=3)e.fromArray(c,a),e.applyMatrix4(t.matrixWorld),i.expandByPoint(e)}),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=+(1/0),this.max.x=this.max.y=this.max.z=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(e){var t=e||new n.Vector3;return t.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){var t=e||new n.Vector3;return t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z?!1:!0},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z?!0:!1},getParameter:function(e,t){var i=t||new n.Vector3;return i.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z?!1:!0},intersectsSphere:function(){var e;return function(t){return void 0===e&&(e=new n.Vector3),this.clampPoint(t.center,e),e.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(e){var t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=e.constant&&i>=e.constant},clampPoint:function(e,t){var i=t||new n.Vector3;return i.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new n.Vector3;return function(t){var i=e.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),getBoundingSphere:function(){var e=new n.Vector3;return function(t){var i=t||new n.Sphere;return i.center=this.center(),i.radius=.5*this.size(e).length(),i}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3];return function(t){return this.isEmpty()?this:(e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e),this)}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},n.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")},n.Matrix3.prototype={constructor:n.Matrix3,set:function(e,t,i,r,n,o,a,s,c){var u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=n,u[5]=s,u[6]=i,u[7]=o,u[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToVector3Array:function(){var e;return function(t,i,r){void 0===e&&(e=new n.Vector3),void 0===i&&(i=0),void 0===r&&(r=t.length);for(var o=0,a=i;r>o;o+=3,a+=3)e.fromArray(t,a),e.applyMatrix3(this),e.toArray(t,a);return t}}(),applyToBuffer:function(){var e;return function(t,i,r){void 0===e&&(e=new n.Vector3),void 0===i&&(i=0),void 0===r&&(r=t.length/t.itemSize);for(var o=0,a=i;r>o;o++,a++)e.x=t.getX(a),e.y=t.getY(a),e.z=t.getZ(a),e.applyMatrix3(this),t.setXYZ(e.x,e.y,e.z);return t}}(),multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],i=e[1],r=e[2],n=e[3],o=e[4],a=e[5],s=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*n*u+i*a*s+r*n*c-r*o*s},getInverse:function(e,t){e instanceof n.Matrix4&&console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");var i=e.elements,r=this.elements,o=i[0],a=i[1],s=i[2],c=i[3],u=i[4],l=i[5],h=i[6],d=i[7],p=i[8],f=p*u-l*d,m=l*h-p*c,g=d*c-u*h,v=o*f+a*m+s*g;if(0===v){var y="THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(y);return console.warn(y),this.identity()}return r[0]=f,r[1]=s*d-p*a,r[2]=l*a-s*u,r[3]=m,r[4]=p*o-s*h,r[5]=s*c-l*o,r[6]=g,r[7]=a*h-d*o,r[8]=u*o-a*c,this.multiplyScalar(1/v)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset is deprecated - just use .toArray instead."),this.toArray(e,t)},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},fromArray:function(e){return this.elements.set(e),this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}},n.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")},n.Matrix4.prototype={constructor:n.Matrix4,set:function(e,t,i,r,n,o,a,s,c,u,l,h,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=n,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=u,g[10]=l,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new n.Matrix4).fromArray(this.elements)},copy:function(e){return this.elements.set(e.elements),this},copyPosition:function(e){var t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this},extractBasis:function(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this},extractRotation:function(){var e;return function(t){void 0===e&&(e=new n.Vector3);var i=this.elements,r=t.elements,o=1/e.setFromMatrixColumn(t,0).length(),a=1/e.setFromMatrixColumn(t,1).length(),s=1/e.setFromMatrixColumn(t,2).length();return i[0]=r[0]*o,i[1]=r[1]*o,i[2]=r[2]*o,i[4]=r[4]*a,i[5]=r[5]*a,i[6]=r[6]*a,i[8]=r[8]*s,i[9]=r[9]*s,i[10]=r[10]*s,this}}(),makeRotationFromEuler:function(e){e instanceof n.Euler==!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,i=e.x,r=e.y,o=e.z,a=Math.cos(i),s=Math.sin(i),c=Math.cos(r),u=Math.sin(r),l=Math.cos(o),h=Math.sin(o);if("XYZ"===e.order){var d=a*l,p=a*h,f=s*l,m=s*h;t[0]=c*l,t[4]=-c*h,t[8]=u,t[1]=p+f*u,t[5]=d-m*u,t[9]=-s*c,t[2]=m-d*u,t[6]=f+p*u,t[10]=a*c}else if("YXZ"===e.order){var g=c*l,v=c*h,y=u*l,M=u*h;t[0]=g+M*s,t[4]=y*s-v,t[8]=a*u,t[1]=a*h,t[5]=a*l,t[9]=-s,t[2]=v*s-y,t[6]=M+g*s,t[10]=a*c}else if("ZXY"===e.order){var g=c*l,v=c*h,y=u*l,M=u*h;t[0]=g-M*s,t[4]=-a*h,t[8]=y+v*s,t[1]=v+y*s,t[5]=a*l,t[9]=M-g*s,t[2]=-a*u,t[6]=s,t[10]=a*c}else if("ZYX"===e.order){var d=a*l,p=a*h,f=s*l,m=s*h;t[0]=c*l,t[4]=f*u-p,t[8]=d*u+m,t[1]=c*h,t[5]=m*u+d,t[9]=p*u-f,t[2]=-u,t[6]=s*c,t[10]=a*c}else if("YZX"===e.order){var A=a*c,x=a*u,w=s*c,E=s*u;t[0]=c*l,t[4]=E-A*h,t[8]=w*h+x,t[1]=h,t[5]=a*l,t[9]=-s*l,t[2]=-u*l,t[6]=x*h+w,t[10]=A-E*h}else if("XZY"===e.order){var A=a*c,x=a*u,w=s*c,E=s*u;t[0]=c*l,t[4]=-h,t[8]=u*l,t[1]=A*h+E,t[5]=a*l,t[9]=x*h-w,t[2]=w*h-x,t[6]=s*l,t[10]=E*h+A}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,i=e.x,r=e.y,n=e.z,o=e.w,a=i+i,s=r+r,c=n+n,u=i*a,l=i*s,h=i*c,d=r*s,p=r*c,f=n*c,m=o*a,g=o*s,v=o*c;return t[0]=1-(d+f),t[4]=l-v,t[8]=h+g,t[1]=l+v,t[5]=1-(u+f),t[9]=p-m,t[2]=h-g,t[6]=p+m,t[10]=1-(u+d),t[3]=0,t[7]=0,t[11]=0,t[12]=0, t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e,t,i;return function(r,o,a){void 0===e&&(e=new n.Vector3),void 0===t&&(t=new n.Vector3),void 0===i&&(i=new n.Vector3);var s=this.elements;return i.subVectors(r,o).normalize(),0===i.lengthSq()&&(i.z=1),e.crossVectors(a,i).normalize(),0===e.lengthSq()&&(i.x+=1e-4,e.crossVectors(a,i).normalize()),t.crossVectors(i,e),s[0]=e.x,s[4]=t.x,s[8]=i.x,s[1]=e.y,s[5]=t.y,s[9]=i.y,s[2]=e.z,s[6]=t.z,s[10]=i.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var i=e.elements,r=t.elements,n=this.elements,o=i[0],a=i[4],s=i[8],c=i[12],u=i[1],l=i[5],h=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],M=i[11],A=i[15],x=r[0],w=r[4],E=r[8],b=r[12],T=r[1],L=r[5],D=r[9],N=r[13],S=r[2],C=r[6],I=r[10],j=r[14],_=r[3],O=r[7],z=r[11],k=r[15];return n[0]=o*x+a*T+s*S+c*_,n[4]=o*w+a*L+s*C+c*O,n[8]=o*E+a*D+s*I+c*z,n[12]=o*b+a*N+s*j+c*k,n[1]=u*x+l*T+h*S+d*_,n[5]=u*w+l*L+h*C+d*O,n[9]=u*E+l*D+h*I+d*z,n[13]=u*b+l*N+h*j+d*k,n[2]=p*x+f*T+m*S+g*_,n[6]=p*w+f*L+m*C+g*O,n[10]=p*E+f*D+m*I+g*z,n[14]=p*b+f*N+m*j+g*k,n[3]=v*x+y*T+M*S+A*_,n[7]=v*w+y*L+M*C+A*O,n[11]=v*E+y*D+M*I+A*z,n[15]=v*b+y*N+M*j+A*k,this},multiplyToArray:function(e,t,i){var r=this.elements;return this.multiplyMatrices(e,t),i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToVector3Array:function(){var e;return function(t,i,r){void 0===e&&(e=new n.Vector3),void 0===i&&(i=0),void 0===r&&(r=t.length);for(var o=0,a=i;r>o;o+=3,a+=3)e.fromArray(t,a),e.applyMatrix4(this),e.toArray(t,a);return t}}(),applyToBuffer:function(){var e;return function(t,i,r){void 0===e&&(e=new n.Vector3),void 0===i&&(i=0),void 0===r&&(r=t.length/t.itemSize);for(var o=0,a=i;r>o;o++,a++)e.x=t.getX(a),e.y=t.getY(a),e.z=t.getZ(a),e.applyMatrix4(this),t.setXYZ(e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],i=e[4],r=e[8],n=e[12],o=e[1],a=e[5],s=e[9],c=e[13],u=e[2],l=e[6],h=e[10],d=e[14],p=e[3],f=e[7],m=e[11],g=e[15];return p*(+n*s*l-r*c*l-n*a*h+i*c*h+r*a*d-i*s*d)+f*(+t*s*d-t*c*h+n*o*h-r*o*d+r*c*u-n*s*u)+m*(+t*c*l-t*a*d-n*o*l+i*o*d+n*a*u-i*c*u)+g*(-r*a*u-t*s*l+t*a*h+r*o*l-i*o*h+i*s*u)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset is deprecated - just use .toArray instead."),this.toArray(e,t)},getPosition:function(){var e;return function(){return void 0===e&&(e=new n.Vector3),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),e.setFromMatrixColumn(this,3)}}(),setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var i=this.elements,r=e.elements,n=r[0],o=r[1],a=r[2],s=r[3],c=r[4],u=r[5],l=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],M=r[15],A=p*y*h-v*f*h+v*l*m-u*y*m-p*l*M+u*f*M,x=g*f*h-d*y*h-g*l*m+c*y*m+d*l*M-c*f*M,w=d*v*h-g*p*h+g*u*m-c*v*m-d*u*M+c*p*M,E=g*p*l-d*v*l-g*u*f+c*v*f+d*u*y-c*p*y,b=n*A+o*x+a*w+s*E;if(0===b){var T="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(T);return console.warn(T),this.identity()}return i[0]=A,i[1]=v*f*s-p*y*s-v*a*m+o*y*m+p*a*M-o*f*M,i[2]=u*y*s-v*l*s+v*a*h-o*y*h-u*a*M+o*l*M,i[3]=p*l*s-u*f*s-p*a*h+o*f*h+u*a*m-o*l*m,i[4]=x,i[5]=d*y*s-g*f*s+g*a*m-n*y*m-d*a*M+n*f*M,i[6]=g*l*s-c*y*s-g*a*h+n*y*h+c*a*M-n*l*M,i[7]=c*f*s-d*l*s+d*a*h-n*f*h-c*a*m+n*l*m,i[8]=w,i[9]=g*p*s-d*v*s-g*o*m+n*v*m+d*o*M-n*p*M,i[10]=c*v*s-g*u*s+g*o*h-n*v*h-c*o*M+n*u*M,i[11]=d*u*s-c*p*s-d*o*h+n*p*h+c*o*m-n*u*m,i[12]=E,i[13]=d*v*a-g*p*a+g*o*f-n*v*f-d*o*y+n*p*y,i[14]=g*u*a-c*v*a-g*o*l+n*v*l+c*o*y-n*u*y,i[15]=c*p*a-d*u*a+d*o*l-n*p*l-c*o*f+n*u*f,this.multiplyScalar(1/b)},scale:function(e){var t=this.elements,i=e.x,r=e.y,n=e.z;return t[0]*=i,t[4]*=r,t[8]*=n,t[1]*=i,t[5]*=r,t[9]*=n,t[2]*=i,t[6]*=r,t[10]*=n,t[3]*=i,t[7]*=r,t[11]*=n,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))},makeTranslation:function(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var i=Math.cos(t),r=Math.sin(t),n=1-i,o=e.x,a=e.y,s=e.z,c=n*o,u=n*a;return this.set(c*o+i,c*a-r*s,c*s+r*a,0,c*a+r*s,u*a+i,u*s-r*o,0,c*s-r*a,u*s+r*o,n*s*s+i,0,0,0,0,1),this},makeScale:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},compose:function(e,t,i){return this.makeRotationFromQuaternion(t),this.scale(i),this.setPosition(e),this},decompose:function(){var e,t;return function(i,r,o){void 0===e&&(e=new n.Vector3),void 0===t&&(t=new n.Matrix4);var a=this.elements,s=e.set(a[0],a[1],a[2]).length(),c=e.set(a[4],a[5],a[6]).length(),u=e.set(a[8],a[9],a[10]).length(),l=this.determinant();0>l&&(s=-s),i.x=a[12],i.y=a[13],i.z=a[14],t.elements.set(this.elements);var h=1/s,d=1/c,p=1/u;return t.elements[0]*=h,t.elements[1]*=h,t.elements[2]*=h,t.elements[4]*=d,t.elements[5]*=d,t.elements[6]*=d,t.elements[8]*=p,t.elements[9]*=p,t.elements[10]*=p,r.setFromRotationMatrix(t),o.x=s,o.y=c,o.z=u,this}}(),makeFrustum:function(e,t,i,r,n,o){var a=this.elements,s=2*n/(t-e),c=2*n/(r-i),u=(t+e)/(t-e),l=(r+i)/(r-i),h=-(o+n)/(o-n),d=-2*o*n/(o-n);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(e,t,i,r){var o=i*Math.tan(n.Math.DEG2RAD*e*.5),a=-o,s=a*t,c=o*t;return this.makeFrustum(s,c,a,o,i,r)},makeOrthographic:function(e,t,i,r,n,o){var a=this.elements,s=1/(t-e),c=1/(i-r),u=1/(o-n),l=(t+e)*s,h=(i+r)*c,d=(o+n)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(e){for(var t=this.elements,i=e.elements,r=0;16>r;r++)if(t[r]!==i[r])return!1;return!0},fromArray:function(e){return this.elements.set(e),this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},n.Ray=function(e,t){this.origin=void 0!==e?e:new n.Vector3,this.direction=void 0!==t?t:new n.Vector3},n.Ray.prototype={constructor:n.Ray,set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){var i=t||new n.Vector3;return i.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){this.direction.copy(e).sub(this.origin).normalize()},recast:function(){var e=new n.Vector3;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var i=t||new n.Vector3;i.subVectors(e,this.origin);var r=i.dot(this.direction);return 0>r?i.copy(this.origin):i.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new n.Vector3;return function(t){var i=e.subVectors(t,this.origin).dot(this.direction);return 0>i?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(i).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Vector3;return function(r,n,o,a){e.copy(r).add(n).multiplyScalar(.5),t.copy(n).sub(r).normalize(),i.copy(this.origin).sub(e);var s,c,u,l,h=.5*r.distanceTo(n),d=-this.direction.dot(t),p=i.dot(this.direction),f=-i.dot(t),m=i.lengthSq(),g=Math.abs(1-d*d);if(g>0)if(s=d*f-p,c=d*p-f,l=h*g,s>=0)if(c>=-l)if(l>=c){var v=1/g;s*=v,c*=v,u=s*(s+d*c+2*p)+c*(d*s+c+2*f)+m}else c=h,s=Math.max(0,-(d*c+p)),u=-s*s+c*(c+2*f)+m;else c=-h,s=Math.max(0,-(d*c+p)),u=-s*s+c*(c+2*f)+m;else-l>=c?(s=Math.max(0,-(-d*h+p)),c=s>0?-h:Math.min(Math.max(-h,-f),h),u=-s*s+c*(c+2*f)+m):l>=c?(s=0,c=Math.min(Math.max(-h,-f),h),u=c*(c+2*f)+m):(s=Math.max(0,-(d*h+p)),c=s>0?h:Math.min(Math.max(-h,-f),h),u=-s*s+c*(c+2*f)+m);else c=d>0?-h:h,s=Math.max(0,-(d*c+p)),u=-s*s+c*(c+2*f)+m;return o&&o.copy(this.direction).multiplyScalar(s).add(this.origin),a&&a.copy(t).multiplyScalar(c).add(e),u}}(),intersectSphere:function(){var e=new n.Vector3;return function(t,i){e.subVectors(t.center,this.origin);var r=e.dot(this.direction),n=e.dot(e)-r*r,o=t.radius*t.radius;if(n>o)return null;var a=Math.sqrt(o-n),s=r-a,c=r+a;return 0>s&&0>c?null:0>s?this.at(c,i):this.at(s,i)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null},intersectPlane:function(e,t){var i=this.distanceToPlane(e);return null===i?null:this.at(i,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);if(0===t)return!0;var i=e.normal.dot(this.direction);return 0>i*t?!0:!1},intersectBox:function(e,t){var i,r,n,o,a,s,c=1/this.direction.x,u=1/this.direction.y,l=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),u>=0?(n=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(n=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),i>o||n>r?null:((n>i||i!==i)&&(i=n),(r>o||r!==r)&&(r=o),l>=0?(a=(e.min.z-h.z)*l,s=(e.max.z-h.z)*l):(a=(e.max.z-h.z)*l,s=(e.min.z-h.z)*l),i>s||a>r?null:((a>i||i!==i)&&(i=a),(r>s||r!==r)&&(r=s),0>r?null:this.at(i>=0?i:r,t)))},intersectsBox:function(){var e=new n.Vector3;return function(t){return null!==this.intersectBox(t,e)}}(),intersectTriangle:function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Vector3,r=new n.Vector3;return function(n,o,a,s,c){t.subVectors(o,n),i.subVectors(a,n),r.crossVectors(t,i);var u,l=this.direction.dot(r);if(l>0){if(s)return null;u=1}else{if(!(0>l))return null;u=-1,l=-l}e.subVectors(this.origin,n);var h=u*this.direction.dot(i.crossVectors(e,i));if(0>h)return null;var d=u*this.direction.dot(t.cross(e));if(0>d)return null;if(h+d>l)return null;var p=-u*e.dot(r);return 0>p?null:this.at(p/l,c)}}(),applyMatrix4:function(e){return this.direction.add(this.origin).applyMatrix4(e),this.origin.applyMatrix4(e),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},n.Sphere=function(e,t){this.center=void 0!==e?e:new n.Vector3,this.radius=void 0!==t?t:0},n.Sphere.prototype={constructor:n.Sphere,set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new n.Box3;return function(t,i){var r=this.center;void 0!==i?r.copy(i):e.setFromPoints(t).center(r);for(var n=0,o=0,a=t.length;a>o;o++)n=Math.max(n,r.distanceToSquared(t[o]));return this.radius=Math.sqrt(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(this.center.dot(e.normal)-e.constant)<=this.radius},clampPoint:function(e,t){var i=this.center.distanceToSquared(e),r=t||new n.Vector3;return r.copy(e),i>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(e){var t=e||new n.Box3;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},n.Frustum=function(e,t,i,r,o,a){this.planes=[void 0!==e?e:new n.Plane,void 0!==t?t:new n.Plane,void 0!==i?i:new n.Plane,void 0!==r?r:new n.Plane,void 0!==o?o:new n.Plane,void 0!==a?a:new n.Plane]},n.Frustum.prototype={constructor:n.Frustum,set:function(e,t,i,r,n,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(n),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,i=0;6>i;i++)t[i].copy(e.planes[i]);return this},setFromMatrix:function(e){var t=this.planes,i=e.elements,r=i[0],n=i[1],o=i[2],a=i[3],s=i[4],c=i[5],u=i[6],l=i[7],h=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return t[0].setComponents(a-r,l-s,f-h,y-m).normalize(),t[1].setComponents(a+r,l+s,f+h,y+m).normalize(),t[2].setComponents(a+n,l+c,f+d,y+g).normalize(),t[3].setComponents(a-n,l-c,f-d,y-g).normalize(),t[4].setComponents(a-o,l-u,f-p,y-v).normalize(),t[5].setComponents(a+o,l+u,f+p,y+v).normalize(),this},intersectsObject:function(){var e=new n.Sphere;return function(t){var i=t.geometry;return null===i.boundingSphere&&i.computeBoundingSphere(),e.copy(i.boundingSphere),e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,i=e.center,r=-e.radius,n=0;6>n;n++){var o=t[n].distanceToPoint(i);if(r>o)return!1}return!0},intersectsBox:function(){var e=new n.Vector3,t=new n.Vector3;return function(i){for(var r=this.planes,n=0;6>n;n++){var o=r[n];e.x=o.normal.x>0?i.min.x:i.max.x,t.x=o.normal.x>0?i.max.x:i.min.x,e.y=o.normal.y>0?i.min.y:i.max.y,t.y=o.normal.y>0?i.max.y:i.min.y,e.z=o.normal.z>0?i.min.z:i.max.z,t.z=o.normal.z>0?i.max.z:i.min.z;var a=o.distanceToPoint(e),s=o.distanceToPoint(t);if(0>a&&0>s)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,i=0;6>i;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}},n.Plane=function(e,t){this.normal=void 0!==e?e:new n.Vector3(1,0,0),this.constant=void 0!==t?t:0},n.Plane.prototype={constructor:n.Plane,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new n.Vector3,t=new n.Vector3;return function(i,r,n){var o=e.subVectors(n,r).cross(t.subVectors(i,r)).normalize();return this.setFromNormalAndCoplanarPoint(o,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(e,t){var i=this.distanceToPoint(e),r=t||new n.Vector3;return r.copy(this.normal).multiplyScalar(i)},intersectLine:function(){var e=new n.Vector3;return function(t,i){var r=i||new n.Vector3,o=t.delta(e),a=this.normal.dot(o);if(0===a)return 0===this.distanceToPoint(t.start)?r.copy(t.start):void 0;var s=-(t.start.dot(this.normal)+this.constant)/a;return 0>s||s>1?void 0:r.copy(o).multiplyScalar(s).add(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return 0>t&&i>0||0>i&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){var t=e||new n.Vector3;return t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new n.Vector3,t=new n.Matrix3;return function(i,r){var n=this.coplanarPoint(e).applyMatrix4(i),o=r||t.getNormalMatrix(i),a=this.normal.applyMatrix3(o).normalize();return this.constant=-n.dot(a),this}}(),translate:function(e){return this.constant=this.constant-e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},n.Spherical=function(e,t,i){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==i?i:0,this},n.Spherical.prototype={constructor:n.Spherical,set:function(e,t,i){this.radius=e,this.phi=t,this.theta=i},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius.copy(e.radius),this.phi.copy(e.phi),this.theta.copy(e.theta),this},makeSafe:function(){var e=1e-6;this.phi=Math.max(e,Math.min(Math.PI-e,this.phi))},setFromVector3:function(e){return this.radius=e.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e.x,e.z),this.phi=Math.acos(n.Math.clamp(e.y/this.radius,-1,1))),this}},n.Math={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=new Array(36),r=0;return function(){for(var n=0;36>n;n++)8===n||13===n||18===n||23===n?i[n]="-":14===n?i[n]="4":(2>=r&&(r=33554432+16777216*Math.random()|0),e=15&r,r>>=4,i[n]=t[19===n?3&e|8:e]);return i.join("")}}(),clamp:function(e,t,i){return Math.max(t,Math.min(i,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,i,r,n){return r+(e-t)*(n-r)/(i-t)},smoothstep:function(e,t,i){return t>=e?0:e>=i?1:(e=(e-t)/(i-t),e*e*(3-2*e))},smootherstep:function(e,t,i){return t>=e?0:e>=i?1:(e=(e-t)/(i-t),e*e*e*(e*(6*e-15)+10))},random16:function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*n.Math.DEG2RAD},radToDeg:function(e){return e*n.Math.RAD2DEG},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}},n.Spline=function(e){function t(e,t,i,r,n,o,a){var s=.5*(i-e),c=.5*(r-t);return(2*(t-i)+s+c)*a+(-3*(t-i)-2*s-c)*o+s*n+t}this.points=e;var i,r,o,a,s,c,u,l,h,d=[],p={x:0,y:0,z:0};this.initFromArray=function(e){this.points=[];for(var t=0;t<e.length;t++)this.points[t]={x:e[t][0],y:e[t][1],z:e[t][2]}},this.getPoint=function(e){return i=(this.points.length-1)*e,r=Math.floor(i),o=i-r,d[0]=0===r?r:r-1,d[1]=r,d[2]=r>this.points.length-2?this.points.length-1:r+1,d[3]=r>this.points.length-3?this.points.length-1:r+2,c=this.points[d[0]],u=this.points[d[1]],l=this.points[d[2]],h=this.points[d[3]],a=o*o,s=o*a,p.x=t(c.x,u.x,l.x,h.x,o,a,s),p.y=t(c.y,u.y,l.y,h.y,o,a,s),p.z=t(c.z,u.z,l.z,h.z,o,a,s),p},this.getControlPointsArray=function(){var e,t,i=this.points.length,r=[];for(e=0;i>e;e++)t=this.points[e],r[e]=[t.x,t.y,t.z];return r},this.getLength=function(e){var t,i,r,o,a=0,s=0,c=0,u=new n.Vector3,l=new n.Vector3,h=[],d=0;for(h[0]=0,e||(e=100),r=this.points.length*e,u.copy(this.points[0]),t=1;r>t;t++)i=t/r,o=this.getPoint(i),l.copy(o),d+=l.distanceTo(u),u.copy(o),a=(this.points.length-1)*i,s=Math.floor(a),s!==c&&(h[s]=d,c=s);return h[h.length]=d,{chunks:h,total:d}},this.reparametrizeByArcLength=function(e){var t,i,r,o,a,s,c,u,l=[],h=new n.Vector3,d=this.getLength();for(l.push(h.copy(this.points[0]).clone()),t=1;t<this.points.length;t++){for(s=d.chunks[t]-d.chunks[t-1],c=Math.ceil(e*s/d.total),o=(t-1)/(this.points.length-1),a=t/(this.points.length-1),i=1;c-1>i;i++)r=o+i*(1/c)*(a-o),u=this.getPoint(r),l.push(h.copy(u).clone());l.push(h.copy(this.points[t]).clone())}this.points=l}},n.Triangle=function(e,t,i){this.a=void 0!==e?e:new n.Vector3,this.b=void 0!==t?t:new n.Vector3,this.c=void 0!==i?i:new n.Vector3},n.Triangle.normal=function(){var e=new n.Vector3;return function(t,i,r,o){var a=o||new n.Vector3;a.subVectors(r,i),e.subVectors(t,i),a.cross(e);var s=a.lengthSq();return s>0?a.multiplyScalar(1/Math.sqrt(s)):a.set(0,0,0)}}(),n.Triangle.barycoordFromPoint=function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Vector3;return function(r,o,a,s,c){e.subVectors(s,o),t.subVectors(a,o),i.subVectors(r,o);var u=e.dot(e),l=e.dot(t),h=e.dot(i),d=t.dot(t),p=t.dot(i),f=u*d-l*l,m=c||new n.Vector3;if(0===f)return m.set(-2,-1,-1);var g=1/f,v=(d*h-l*p)*g,y=(u*p-l*h)*g;return m.set(1-v-y,y,v)}}(),n.Triangle.containsPoint=function(){var e=new n.Vector3;return function(t,i,r,o){var a=n.Triangle.barycoordFromPoint(t,i,r,o,e);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}(),n.Triangle.prototype={constructor:n.Triangle,set:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new n.Vector3,t=new n.Vector3;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){var t=e||new n.Vector3;return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return n.Triangle.normal(this.a,this.b,this.c,e)},plane:function(e){var t=e||new n.Plane;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return n.Triangle.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return n.Triangle.containsPoint(e,this.a,this.b,this.c)},closestPointToPoint:function(){var e,t,i,r;return function(o,a){void 0===e&&(e=new n.Plane,t=[new n.Line3,new n.Line3,new n.Line3],i=new n.Vector3,r=new n.Vector3);var s=a||new n.Vector3,c=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(o,i),this.containsPoint(i)===!0)s.copy(i);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var u=0;u<t.length;u++){t[u].closestPointToPoint(i,!0,r);var l=i.distanceToSquared(r);c>l&&(c=l,s.copy(r))}}return s}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},n.Interpolant=function(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i},n.Interpolant.prototype={constructor:n.Interpolant,evaluate:function(e){var t=this.parameterPositions,i=this._cachedIndex,r=t[i],n=t[i-1];e:{t:{var o;i:{r:if(!(r>e)){for(var a=i+2;;){if(void 0===r){if(n>e)break r;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,n)}if(i===a)break;if(n=r,r=t[++i],r>e)break t}o=t.length;break i}{if(e>=n)break e;var s=t[1];s>e&&(i=2,n=s);for(var a=i-2;;){if(void 0===n)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===a)break;if(r=n,n=t[--i-1],e>=n)break t}o=i,i=0}}for(;o>i;){var c=i+o>>>1;e<t[c]?o=c:i=c+1}if(r=t[i],n=t[i-1],void 0===n)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,n,e)}this._cachedIndex=i,this.intervalChanged_(i,n,r)}return this.interpolate_(i,n,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=e*r,o=0;o!==r;++o)t[o]=i[n+o];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}},Object.assign(n.Interpolant.prototype,{beforeStart_:n.Interpolant.prototype.copySampleValue_,afterEnd_:n.Interpolant.prototype.copySampleValue_}),n.CubicInterpolant=function(e,t,i,r){n.Interpolant.call(this,e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0},n.CubicInterpolant.prototype=Object.assign(Object.create(n.Interpolant.prototype),{constructor:n.CubicInterpolant,DefaultSettings_:{endingStart:n.ZeroCurvatureEnding,endingEnd:n.ZeroCurvatureEnding},intervalChanged_:function(e,t,i){var r=this.parameterPositions,o=e-2,a=e+1,s=r[o],c=r[a];if(void 0===s)switch(this.getSettings_().endingStart){case n.ZeroSlopeEnding:o=e,s=2*t-i;break;case n.WrapAroundEnding:o=r.length-2,s=t+r[o]-r[o+1];break;default:o=e,s=i}if(void 0===c)switch(this.getSettings_().endingEnd){case n.ZeroSlopeEnding:a=e,c=2*i-t;break;case n.WrapAroundEnding:a=1,c=i+r[1]-r[0];break;default:a=e-1,c=t}var u=.5*(i-t),l=this.valueSize;this._weightPrev=u/(t-s),this._weightNext=u/(c-i),this._offsetPrev=o*l,this._offsetNext=a*l},interpolate_:function(e,t,i,r){for(var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,u=this._offsetPrev,l=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(i-t)/(r-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,M=d*m-d*f,A=0;A!==a;++A)n[A]=g*o[u+A]+v*o[c+A]+y*o[s+A]+M*o[l+A];return n}}),n.DiscreteInterpolant=function(e,t,i,r){n.Interpolant.call(this,e,t,i,r)},n.DiscreteInterpolant.prototype=Object.assign(Object.create(n.Interpolant.prototype),{constructor:n.DiscreteInterpolant,interpolate_:function(e){return this.copySampleValue_(e-1)}}),n.LinearInterpolant=function(e,t,i,r){n.Interpolant.call(this,e,t,i,r)},n.LinearInterpolant.prototype=Object.assign(Object.create(n.Interpolant.prototype),{constructor:n.LinearInterpolant,interpolate_:function(e,t,i,r){for(var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,u=(i-t)/(r-t),l=1-u,h=0;h!==a;++h)n[h]=o[c+h]*l+o[s+h]*u;return n}}),n.QuaternionLinearInterpolant=function(e,t,i,r){n.Interpolant.call(this,e,t,i,r)},n.QuaternionLinearInterpolant.prototype=Object.assign(Object.create(n.Interpolant.prototype),{constructor:n.QuaternionLinearInterpolant,interpolate_:function(e,t,i,r){for(var o=this.resultBuffer,a=this.sampleValues,s=this.valueSize,c=e*s,u=(i-t)/(r-t),l=c+s;c!==l;c+=4)n.Quaternion.slerpFlat(o,0,a,c-s,a,c,u);return o}}),n.Clock=function(e){this.autoStart=void 0!==e?e:!0,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1},n.Clock.prototype={constructor:n.Clock,start:function(){this.startTime=(performance||Date).now(),this.oldTime=this.startTime,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running&&this.start(),this.running){var t=(performance||Date).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}},n.EventDispatcher=function(){},n.EventDispatcher.prototype={constructor:n.EventDispatcher,apply:function(e){e.addEventListener=n.EventDispatcher.prototype.addEventListener,e.hasEventListener=n.EventDispatcher.prototype.hasEventListener,e.removeEventListener=n.EventDispatcher.prototype.removeEventListener,e.dispatchEvent=n.EventDispatcher.prototype.dispatchEvent},addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)?!0:!1},removeEventListener:function(e,t){if(void 0!==this._listeners){var i=this._listeners,r=i[e];if(void 0!==r){var n=r.indexOf(t);-1!==n&&r.splice(n,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners,i=t[e.type];if(void 0!==i){e.target=this;for(var r=[],n=i.length,o=0;n>o;o++)r[o]=i[o];for(var o=0;n>o;o++)r[o].call(this,e)}}}},n.Layers=function(){this.mask=1},n.Layers.prototype={constructor:n.Layers,set:function(e){this.mask=1<<e},enable:function(e){this.mask|=1<<e},toggle:function(e){this.mask^=1<<e},disable:function(e){this.mask&=~(1<<e)},test:function(e){return 0!==(this.mask&e.mask)}},function(e){function t(e,t){return e.distance-t.distance}function i(e,t,r,n){if(e.visible!==!1&&(e.raycast(t,r),n===!0))for(var o=e.children,a=0,s=o.length;s>a;a++)i(o[a],t,r,!0)}e.Raycaster=function(t,i,r,n){this.ray=new e.Ray(t,i),this.near=r||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})},e.Raycaster.prototype={constructor:e.Raycaster,linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(t,i){i instanceof e.PerspectiveCamera?(this.ray.origin.setFromMatrixPosition(i.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(i).sub(this.ray.origin).normalize()):i instanceof e.OrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(i),this.ray.direction.set(0,0,-1).transformDirection(i.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,r){var n=[];return i(e,this,n,r),n.sort(t),n},intersectObjects:function(e,r){var n=[];if(Array.isArray(e)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(var o=0,a=e.length;a>o;o++)i(e[o],this,n,r);return n.sort(t),n}}}(n),n.Object3D=function(){function e(){o.setFromEuler(r,!1)}function t(){r.setFromQuaternion(o,void 0,!1)}Object.defineProperty(this,"id",{value:n.Object3DIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=n.Object3D.DefaultUp.clone();var i=new n.Vector3,r=new n.Euler,o=new n.Quaternion,a=new n.Vector3(1,1,1);r.onChange(e),o.onChange(t),Object.defineProperties(this,{position:{enumerable:!0,value:i},rotation:{enumerable:!0,value:r},quaternion:{enumerable:!0,value:o},scale:{enumerable:!0,value:a},modelViewMatrix:{value:new n.Matrix4},normalMatrix:{value:new n.Matrix3}}),this.rotationAutoUpdate=!0,this.matrix=new n.Matrix4,this.matrixWorld=new n.Matrix4,this.matrixAutoUpdate=n.Object3D.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new n.Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},n.Object3D.DefaultUp=new n.Vector3(0,1,0),n.Object3D.DefaultMatrixAutoUpdate=!0,n.Object3D.prototype={constructor:n.Object3D,applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(){var e=new n.Quaternion;return function(t,i){return e.setFromAxisAngle(t,i),this.quaternion.multiply(e),this}}(),rotateX:function(){var e=new n.Vector3(1,0,0);return function(t){return this.rotateOnAxis(e,t); }}(),rotateY:function(){var e=new n.Vector3(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new n.Vector3(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new n.Vector3;return function(t,i){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(i)),this}}(),translateX:function(){var e=new n.Vector3(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new n.Vector3(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new n.Vector3(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new n.Matrix4;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new n.Matrix4;return function(t){e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e instanceof n.Object3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1)for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);var i=this.children.indexOf(e);-1!==i&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(i,1))},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var i=0,r=this.children.length;r>i;i++){var n=this.children[i],o=n.getObjectByProperty(e,t);if(void 0!==o)return o}return void 0},getWorldPosition:function(e){var t=e||new n.Vector3;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var e=new n.Vector3,t=new n.Vector3;return function(i){var r=i||new n.Quaternion;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,r,t),r}}(),getWorldRotation:function(){var e=new n.Quaternion;return function(t){var i=t||new n.Euler;return this.getWorldQuaternion(e),i.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new n.Vector3,t=new n.Quaternion;return function(i){var r=i||new n.Vector3;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,r),r}}(),getWorldDirection:function(){var e=new n.Quaternion;return function(t){var i=t||new n.Vector3;return this.getWorldQuaternion(e),i.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,i=0,r=t.length;r>i;i++)t[i].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var t=this.children,i=0,r=t.length;r>i;i++)t[i].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate===!0&&this.updateMatrix(),(this.matrixWorldNeedsUpdate===!0||e===!0)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=0,i=this.children.length;i>t;t++)this.children[t].updateMatrixWorld(e)},toJSON:function(e){function t(e){var t=[];for(var i in e){var r=e[i];delete r.metadata,t.push(r)}return t}var i=void 0===e||""===e,r={};i&&(e={geometries:{},materials:{},textures:{},images:{}},r.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var n={};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),this.castShadow===!0&&(n.castShadow=!0),this.receiveShadow===!0&&(n.receiveShadow=!0),this.visible===!1&&(n.visible=!1),n.matrix=this.matrix.toArray(),void 0!==this.geometry&&(void 0===e.geometries[this.geometry.uuid]&&(e.geometries[this.geometry.uuid]=this.geometry.toJSON(e)),n.geometry=this.geometry.uuid),void 0!==this.material&&(void 0===e.materials[this.material.uuid]&&(e.materials[this.material.uuid]=this.material.toJSON(e)),n.material=this.material.uuid),this.children.length>0){n.children=[];for(var o=0;o<this.children.length;o++)n.children.push(this.children[o].toJSON(e).object)}if(i){var a=t(e.geometries),s=t(e.materials),c=t(e.textures),u=t(e.images);a.length>0&&(r.geometries=a),s.length>0&&(r.materials=s),c.length>0&&(r.textures=c),u.length>0&&(r.images=u)}return r.object=n,r},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.rotationAutoUpdate=e.rotationAutoUpdate,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(var i=0;i<e.children.length;i++){var r=e.children[i];this.add(r.clone())}return this}},n.EventDispatcher.prototype.apply(n.Object3D.prototype),n.Object3DIdCount=0,n.Face3=function(e,t,i,r,o,a){this.a=e,this.b=t,this.c=i,this.normal=r instanceof n.Vector3?r:new n.Vector3,this.vertexNormals=Array.isArray(r)?r:[],this.color=o instanceof n.Color?o:new n.Color,this.vertexColors=Array.isArray(o)?o:[],this.materialIndex=void 0!==a?a:0},n.Face3.prototype={constructor:n.Face3,clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,i=e.vertexNormals.length;i>t;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(var t=0,i=e.vertexColors.length;i>t;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}},n.BufferAttribute=function(e,t,i){this.uuid=n.Math.generateUUID(),this.array=e,this.itemSize=t,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0,this.normalized=i===!0},n.BufferAttribute.prototype={constructor:n.BufferAttribute,get count(){return this.array.length/this.itemSize},set needsUpdate(e){e===!0&&this.version++},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.dynamic=e.dynamic,this},copyAt:function(e,t,i){e*=this.itemSize,i*=t.itemSize;for(var r=0,n=this.itemSize;n>r;r++)this.array[e+r]=t.array[i+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,i=0,r=0,o=e.length;o>r;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new n.Color),t[i++]=a.r,t[i++]=a.g,t[i++]=a.b}return this},copyIndicesArray:function(e){for(var t=this.array,i=0,r=0,n=e.length;n>r;r++){var o=e[r];t[i++]=o.a,t[i++]=o.b,t[i++]=o.c}return this},copyVector2sArray:function(e){for(var t=this.array,i=0,r=0,o=e.length;o>r;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),a=new n.Vector2),t[i++]=a.x,t[i++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,i=0,r=0,o=e.length;o>r;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new n.Vector3),t[i++]=a.x,t[i++]=a.y,t[i++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,i=0,r=0,o=e.length;o>r;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new n.Vector4),t[i++]=a.x,t[i++]=a.y,t[i++]=a.z,t[i++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this},setXYZ:function(e,t,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this},setXYZW:function(e,t,i,r,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=n,this},clone:function(){return(new this.constructor).copy(this)}},n.Int8Attribute=function(e,t){return new n.BufferAttribute(new Int8Array(e),t)},n.Uint8Attribute=function(e,t){return new n.BufferAttribute(new Uint8Array(e),t)},n.Uint8ClampedAttribute=function(e,t){return new n.BufferAttribute(new Uint8ClampedArray(e),t)},n.Int16Attribute=function(e,t){return new n.BufferAttribute(new Int16Array(e),t)},n.Uint16Attribute=function(e,t){return new n.BufferAttribute(new Uint16Array(e),t)},n.Int32Attribute=function(e,t){return new n.BufferAttribute(new Int32Array(e),t)},n.Uint32Attribute=function(e,t){return new n.BufferAttribute(new Uint32Array(e),t)},n.Float32Attribute=function(e,t){return new n.BufferAttribute(new Float32Array(e),t)},n.Float64Attribute=function(e,t){return new n.BufferAttribute(new Float64Array(e),t)},n.DynamicBufferAttribute=function(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new n.BufferAttribute(e,t).setDynamic(!0)},n.InstancedBufferAttribute=function(e,t,i){n.BufferAttribute.call(this,e,t),this.meshPerAttribute=i||1},n.InstancedBufferAttribute.prototype=Object.create(n.BufferAttribute.prototype),n.InstancedBufferAttribute.prototype.constructor=n.InstancedBufferAttribute,n.InstancedBufferAttribute.prototype.copy=function(e){return n.BufferAttribute.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},n.InterleavedBuffer=function(e,t){this.uuid=n.Math.generateUUID(),this.array=e,this.stride=t,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0},n.InterleavedBuffer.prototype={constructor:n.InterleavedBuffer,get length(){return this.array.length},get count(){return this.array.length/this.stride},set needsUpdate(e){e===!0&&this.version++},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,i){e*=this.stride,i*=t.stride;for(var r=0,n=this.stride;n>r;r++)this.array[e+r]=t.array[i+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)}},n.InstancedInterleavedBuffer=function(e,t,i){n.InterleavedBuffer.call(this,e,t),this.meshPerAttribute=i||1},n.InstancedInterleavedBuffer.prototype=Object.create(n.InterleavedBuffer.prototype),n.InstancedInterleavedBuffer.prototype.constructor=n.InstancedInterleavedBuffer,n.InstancedInterleavedBuffer.prototype.copy=function(e){return n.InterleavedBuffer.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},n.InterleavedBufferAttribute=function(e,t,i){this.uuid=n.Math.generateUUID(),this.data=e,this.itemSize=t,this.offset=i},n.InterleavedBufferAttribute.prototype={constructor:n.InterleavedBufferAttribute,get length(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length},get count(){return this.data.count},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this},setXYZ:function(e,t,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this},setXYZW:function(e,t,i,r,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=n,this}},n.Geometry=function(){Object.defineProperty(this,"id",{value:n.GeometryIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.elementsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1},n.Geometry.prototype={constructor:n.Geometry,applyMatrix:function(e){for(var t=(new n.Matrix3).getNormalMatrix(e),i=0,r=this.vertices.length;r>i;i++){var o=this.vertices[i];o.applyMatrix4(e)}for(var i=0,r=this.faces.length;r>i;i++){var a=this.faces[i];a.normal.applyMatrix3(t).normalize();for(var s=0,c=a.vertexNormals.length;c>s;s++)a.vertexNormals[s].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e;return function(t,i,r){return void 0===e&&(e=new n.Matrix4),e.makeTranslation(t,i,r),this.applyMatrix(e),this}}(),scale:function(){var e;return function(t,i,r){return void 0===e&&(e=new n.Matrix4),e.makeScale(t,i,r),this.applyMatrix(e),this}}(),lookAt:function(){var e;return function(t){void 0===e&&(e=new n.Object3D),e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),fromBufferGeometry:function(e){function t(e,t,r,o){var a=void 0!==s?[h[e].clone(),h[t].clone(),h[r].clone()]:[],f=void 0!==c?[i.colors[e].clone(),i.colors[t].clone(),i.colors[r].clone()]:[],m=new n.Face3(e,t,r,a,f,o);i.faces.push(m),void 0!==u&&i.faceVertexUvs[0].push([d[e].clone(),d[t].clone(),d[r].clone()]),void 0!==l&&i.faceVertexUvs[1].push([p[e].clone(),p[t].clone(),p[r].clone()])}var i=this,r=null!==e.index?e.index.array:void 0,o=e.attributes,a=o.position.array,s=void 0!==o.normal?o.normal.array:void 0,c=void 0!==o.color?o.color.array:void 0,u=void 0!==o.uv?o.uv.array:void 0,l=void 0!==o.uv2?o.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var h=[],d=[],p=[],f=0,m=0;f<a.length;f+=3,m+=2)i.vertices.push(new n.Vector3(a[f],a[f+1],a[f+2])),void 0!==s&&h.push(new n.Vector3(s[f],s[f+1],s[f+2])),void 0!==c&&i.colors.push(new n.Color(c[f],c[f+1],c[f+2])),void 0!==u&&d.push(new n.Vector2(u[m],u[m+1])),void 0!==l&&p.push(new n.Vector2(l[m],l[m+1]));if(void 0!==r){var g=e.groups;if(g.length>0)for(var f=0;f<g.length;f++)for(var v=g[f],y=v.start,M=v.count,m=y,A=y+M;A>m;m+=3)t(r[m],r[m+1],r[m+2],v.materialIndex);else for(var f=0;f<r.length;f+=3)t(r[f],r[f+1],r[f+2])}else for(var f=0;f<a.length/3;f+=3)t(f,f+1,f+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.center().negate();return this.translate(e.x,e.y,e.z),e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,i=0===t?1:1/t,r=new n.Matrix4;return r.set(i,0,0,-i*e.x,0,i,0,-i*e.y,0,0,i,-i*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new n.Vector3,t=new n.Vector3,i=0,r=this.faces.length;r>i;i++){var o=this.faces[i],a=this.vertices[o.a],s=this.vertices[o.b],c=this.vertices[o.c];e.subVectors(c,s),t.subVectors(a,s),e.cross(t),e.normalize(),o.normal.copy(e)}},computeVertexNormals:function(e){void 0===e&&(e=!0);var t,i,r,o,a,s;for(s=new Array(this.vertices.length),t=0,i=this.vertices.length;i>t;t++)s[t]=new n.Vector3;if(e){var c,u,l,h=new n.Vector3,d=new n.Vector3;for(r=0,o=this.faces.length;o>r;r++)a=this.faces[r],c=this.vertices[a.a],u=this.vertices[a.b],l=this.vertices[a.c],h.subVectors(l,u),d.subVectors(c,u),h.cross(d),s[a.a].add(h),s[a.b].add(h),s[a.c].add(h)}else for(r=0,o=this.faces.length;o>r;r++)a=this.faces[r],s[a.a].add(a.normal),s[a.b].add(a.normal),s[a.c].add(a.normal);for(t=0,i=this.vertices.length;i>t;t++)s[t].normalize();for(r=0,o=this.faces.length;o>r;r++){a=this.faces[r];var p=a.vertexNormals;3===p.length?(p[0].copy(s[a.a]),p[1].copy(s[a.b]),p[2].copy(s[a.c])):(p[0]=s[a.a].clone(),p[1]=s[a.b].clone(),p[2]=s[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,i,r,o;for(i=0,r=this.faces.length;r>i;i++)for(o=this.faces[i],o.__originalFaceNormal?o.__originalFaceNormal.copy(o.normal):o.__originalFaceNormal=o.normal.clone(),o.__originalVertexNormals||(o.__originalVertexNormals=[]),e=0,t=o.vertexNormals.length;t>e;e++)o.__originalVertexNormals[e]?o.__originalVertexNormals[e].copy(o.vertexNormals[e]):o.__originalVertexNormals[e]=o.vertexNormals[e].clone();var a=new n.Geometry;for(a.faces=this.faces,e=0,t=this.morphTargets.length;t>e;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var s,c,u=this.morphNormals[e].faceNormals,l=this.morphNormals[e].vertexNormals;for(i=0,r=this.faces.length;r>i;i++)s=new n.Vector3,c={a:new n.Vector3,b:new n.Vector3,c:new n.Vector3},u.push(s),l.push(c)}var h=this.morphNormals[e];a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals();var s,c;for(i=0,r=this.faces.length;r>i;i++)o=this.faces[i],s=h.faceNormals[i],c=h.vertexNormals[i],s.copy(o.normal),c.a.copy(o.vertexNormals[0]),c.b.copy(o.vertexNormals[1]),c.c.copy(o.vertexNormals[2])}for(i=0,r=this.faces.length;r>i;i++)o=this.faces[i],o.normal=o.__originalFaceNormal,o.vertexNormals=o.__originalVertexNormals},computeTangents:function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){for(var e=0,t=this.vertices,i=0,r=t.length;r>i;i++)i>0&&(e+=t[i].distanceTo(t[i-1])),this.lineDistances[i]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new n.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,i){if(e instanceof n.Geometry==!1)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);var r,o=this.vertices.length,a=this.vertices,s=e.vertices,c=this.faces,u=e.faces,l=this.faceVertexUvs[0],h=e.faceVertexUvs[0];void 0===i&&(i=0),void 0!==t&&(r=(new n.Matrix3).getNormalMatrix(t));for(var d=0,p=s.length;p>d;d++){var f=s[d],m=f.clone();void 0!==t&&m.applyMatrix4(t),a.push(m)}for(d=0,p=u.length;p>d;d++){var g,v,y,M=u[d],A=M.vertexNormals,x=M.vertexColors;g=new n.Face3(M.a+o,M.b+o,M.c+o),g.normal.copy(M.normal),void 0!==r&&g.normal.applyMatrix3(r).normalize();for(var w=0,E=A.length;E>w;w++)v=A[w].clone(),void 0!==r&&v.applyMatrix3(r).normalize(),g.vertexNormals.push(v);g.color.copy(M.color);for(var w=0,E=x.length;E>w;w++)y=x[w],g.vertexColors.push(y.clone());g.materialIndex=M.materialIndex+i,c.push(g)}for(d=0,p=h.length;p>d;d++){var b=h[d],T=[];if(void 0!==b){for(var w=0,E=b.length;E>w;w++)T.push(b[w].clone());l.push(T)}}},mergeMesh:function(e){return e instanceof n.Mesh==!1?void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e):(e.matrixAutoUpdate&&e.updateMatrix(),void this.merge(e.geometry,e.matrix))},mergeVertices:function(){var e,t,i,r,n,o,a,s,c={},u=[],l=[],h=4,d=Math.pow(10,h);for(i=0,r=this.vertices.length;r>i;i++)e=this.vertices[i],t=Math.round(e.x*d)+"_"+Math.round(e.y*d)+"_"+Math.round(e.z*d),void 0===c[t]?(c[t]=i,u.push(this.vertices[i]),l[i]=u.length-1):l[i]=l[c[t]];var p=[];for(i=0,r=this.faces.length;r>i;i++){n=this.faces[i],n.a=l[n.a],n.b=l[n.b],n.c=l[n.c],o=[n.a,n.b,n.c];for(var f=-1,m=0;3>m;m++)if(o[m]===o[(m+1)%3]){f=m,p.push(i);break}}for(i=p.length-1;i>=0;i--){var g=p[i];for(this.faces.splice(g,1),a=0,s=this.faceVertexUvs.length;s>a;a++)this.faceVertexUvs[a].splice(g,1)}var v=this.vertices.length-u.length;return this.vertices=u,v},sortFacesByMaterialIndex:function(){function e(e,t){return e.materialIndex-t.materialIndex}for(var t=this.faces,i=t.length,r=0;i>r;r++)t[r]._id=r;t.sort(e);var n,o,a=this.faceVertexUvs[0],s=this.faceVertexUvs[1];a&&a.length===i&&(n=[]),s&&s.length===i&&(o=[]);for(var r=0;i>r;r++){var c=t[r]._id;n&&n.push(a[c]),o&&o.push(s[c])}n&&(this.faceVertexUvs[0]=n),o&&(this.faceVertexUvs[1]=o)},toJSON:function(){function e(e,t,i){return i?e|1<<t:e&~(1<<t)}function t(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==d[t]?d[t]:(d[t]=h.length/3,h.push(e.x,e.y,e.z),d[t])}function i(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==f[t]?f[t]:(f[t]=p.length,p.push(e.getHex()),f[t])}function r(e){var t=e.x.toString()+e.y.toString();return void 0!==g[t]?g[t]:(g[t]=m.length/2,m.push(e.x,e.y),g[t])}var n={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),void 0!==this.parameters){var o=this.parameters;for(var a in o)void 0!==o[a]&&(n[a]=o[a]);return n}for(var s=[],c=0;c<this.vertices.length;c++){var u=this.vertices[c];s.push(u.x,u.y,u.z)}for(var l=[],h=[],d={},p=[],f={},m=[],g={},c=0;c<this.faces.length;c++){var v=this.faces[c],y=!0,M=!1,A=void 0!==this.faceVertexUvs[0][c],x=v.normal.length()>0,w=v.vertexNormals.length>0,E=1!==v.color.r||1!==v.color.g||1!==v.color.b,b=v.vertexColors.length>0,T=0;if(T=e(T,0,0),T=e(T,1,y),T=e(T,2,M),T=e(T,3,A),T=e(T,4,x),T=e(T,5,w),T=e(T,6,E),T=e(T,7,b),l.push(T),l.push(v.a,v.b,v.c),l.push(v.materialIndex),A){var L=this.faceVertexUvs[0][c];l.push(r(L[0]),r(L[1]),r(L[2]))}if(x&&l.push(t(v.normal)),w){var D=v.vertexNormals;l.push(t(D[0]),t(D[1]),t(D[2]))}if(E&&l.push(i(v.color)),b){var N=v.vertexColors;l.push(i(N[0]),i(N[1]),i(N[2]))}}return n.data={},n.data.vertices=s,n.data.normals=h,p.length>0&&(n.data.colors=p),m.length>0&&(n.data.uvs=[m]),n.data.faces=l,n},clone:function(){return(new n.Geometry).copy(this)},copy:function(e){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]];for(var t=e.vertices,i=0,r=t.length;r>i;i++)this.vertices.push(t[i].clone());for(var n=e.faces,i=0,r=n.length;r>i;i++)this.faces.push(n[i].clone());for(var i=0,r=e.faceVertexUvs.length;r>i;i++){var o=e.faceVertexUvs[i];void 0===this.faceVertexUvs[i]&&(this.faceVertexUvs[i]=[]);for(var a=0,s=o.length;s>a;a++){for(var c=o[a],u=[],l=0,h=c.length;h>l;l++){var d=c[l];u.push(d.clone())}this.faceVertexUvs[i].push(u)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},n.EventDispatcher.prototype.apply(n.Geometry.prototype),n.GeometryIdCount=0,n.DirectGeometry=function(){Object.defineProperty(this,"id",{value:n.GeometryIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.type="DirectGeometry",this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1},n.DirectGeometry.prototype={constructor:n.DirectGeometry,computeBoundingBox:n.Geometry.prototype.computeBoundingBox,computeBoundingSphere:n.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},computeGroups:function(e){for(var t,i,r=[],n=e.faces,o=0;o<n.length;o++){var a=n[o];a.materialIndex!==i&&(i=a.materialIndex,void 0!==t&&(t.count=3*o-t.start,r.push(t)),t={start:3*o,materialIndex:i})}void 0!==t&&(t.count=3*o-t.start,r.push(t)),this.groups=r},fromGeometry:function(e){var t,i=e.faces,r=e.vertices,o=e.faceVertexUvs,a=o[0]&&o[0].length>0,s=o[1]&&o[1].length>0,c=e.morphTargets,u=c.length;if(u>0){t=[];for(var l=0;u>l;l++)t[l]=[];this.morphTargets.position=t}var h,d=e.morphNormals,p=d.length;if(p>0){h=[];for(var l=0;p>l;l++)h[l]=[];this.morphTargets.normal=h}for(var f=e.skinIndices,m=e.skinWeights,g=f.length===r.length,v=m.length===r.length,l=0;l<i.length;l++){var y=i[l];this.vertices.push(r[y.a],r[y.b],r[y.c]);var M=y.vertexNormals;if(3===M.length)this.normals.push(M[0],M[1],M[2]);else{var A=y.normal;this.normals.push(A,A,A)}var x=y.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{var w=y.color;this.colors.push(w,w,w)}if(a===!0){var E=o[0][l];void 0!==E?this.uvs.push(E[0],E[1],E[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new n.Vector2,new n.Vector2,new n.Vector2))}if(s===!0){var E=o[1][l];void 0!==E?this.uvs2.push(E[0],E[1],E[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new n.Vector2,new n.Vector2,new n.Vector2))}for(var b=0;u>b;b++){var T=c[b].vertices;t[b].push(T[y.a],T[y.b],T[y.c])}for(var b=0;p>b;b++){var L=d[b].vertexNormals[l];h[b].push(L.a,L.b,L.c)}g&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),v&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),n.BufferGeometry=function(){Object.defineProperty(this,"id",{value:n.GeometryIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}},n.BufferGeometry.prototype={constructor:n.BufferGeometry,getIndex:function(){return this.index},setIndex:function(e){this.index=e},addAttribute:function(e,t){return t instanceof n.BufferAttribute==!1&&t instanceof n.InterleavedBufferAttribute==!1?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(e,new n.BufferAttribute(arguments[1],arguments[2]))):"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(t)):(this.attributes[e]=t,this)},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,i){this.groups.push({start:e,count:t,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToVector3Array(t.array),t.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var r=(new n.Matrix3).getNormalMatrix(e);r.applyToVector3Array(i.array),i.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e;return function(t){return void 0===e&&(e=new n.Matrix4),e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e;return function(t,i,r){return void 0===e&&(e=new n.Matrix4),e.makeTranslation(t,i,r),this.applyMatrix(e),this}}(),scale:function(){var e;return function(t,i,r){return void 0===e&&(e=new n.Matrix4),e.makeScale(t,i,r),this.applyMatrix(e),this}}(),lookAt:function(){var e;return function(t){void 0===e&&(e=new n.Object3D),e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.center().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e instanceof n.Points||e instanceof n.Line){var i=new n.Float32Attribute(3*t.vertices.length,3),r=new n.Float32Attribute(3*t.colors.length,3);if(this.addAttribute("position",i.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var o=new n.Float32Attribute(t.lineDistances.length,1);this.addAttribute("lineDistance",o.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e instanceof n.Mesh&&t instanceof n.Geometry&&this.fromGeometry(t);return this},updateFromObject:function(e){var t=e.geometry;if(e instanceof n.Mesh){var i=t.__directGeometry;if(void 0===i)return this.fromGeometry(t);i.verticesNeedUpdate=t.verticesNeedUpdate,i.normalsNeedUpdate=t.normalsNeedUpdate,i.colorsNeedUpdate=t.colorsNeedUpdate,i.uvsNeedUpdate=t.uvsNeedUpdate,i.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=i}if(t.verticesNeedUpdate===!0){var r=this.attributes.position;void 0!==r&&(r.copyVector3sArray(t.vertices),r.needsUpdate=!0),t.verticesNeedUpdate=!1}if(t.normalsNeedUpdate===!0){var r=this.attributes.normal;void 0!==r&&(r.copyVector3sArray(t.normals),r.needsUpdate=!0),t.normalsNeedUpdate=!1}if(t.colorsNeedUpdate===!0){var r=this.attributes.color;void 0!==r&&(r.copyColorsArray(t.colors),r.needsUpdate=!0),t.colorsNeedUpdate=!1}if(t.uvsNeedUpdate){var r=this.attributes.uv;void 0!==r&&(r.copyVector2sArray(t.uvs),r.needsUpdate=!0),t.uvsNeedUpdate=!1}if(t.lineDistancesNeedUpdate){var r=this.attributes.lineDistance;void 0!==r&&(r.copyArray(t.lineDistances),r.needsUpdate=!0),t.lineDistancesNeedUpdate=!1}return t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new n.DirectGeometry).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var i=new Float32Array(3*e.normals.length);this.addAttribute("normal",new n.BufferAttribute(i,3).copyVector3sArray(e.normals)); }if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.addAttribute("color",new n.BufferAttribute(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var o=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var s=e.vertices.length>65535?Uint32Array:Uint16Array,c=new s(3*e.indices.length);this.setIndex(new n.BufferAttribute(c,1).copyIndicesArray(e.indices))}this.groups=e.groups;for(var u in e.morphTargets){for(var l=[],h=e.morphTargets[u],d=0,p=h.length;p>d;d++){var f=h[d],m=new n.Float32Attribute(3*f.length,3);l.push(m.copyVector3sArray(f))}this.morphAttributes[u]=l}if(e.skinIndices.length>0){var g=new n.Float32Attribute(4*e.skinIndices.length,4);this.addAttribute("skinIndex",g.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var v=new n.Float32Attribute(4*e.skinWeights.length,4);this.addAttribute("skinWeight",v.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new n.Box3);var e=this.attributes.position.array;void 0!==e?this.boundingBox.setFromArray(e):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var e=new n.Box3,t=new n.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new n.Sphere);var i=this.attributes.position.array;if(i){var r=this.boundingSphere.center;e.setFromArray(i),e.center(r);for(var o=0,a=0,s=i.length;s>a;a+=3)t.fromArray(i,a),o=Math.max(o,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes,i=this.groups;if(t.position){var r=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new n.BufferAttribute(new Float32Array(r.length),3));else for(var o=t.normal.array,a=0,s=o.length;s>a;a++)o[a]=0;var c,u,l,h=t.normal.array,d=new n.Vector3,p=new n.Vector3,f=new n.Vector3,m=new n.Vector3,g=new n.Vector3;if(e){var v=e.array;0===i.length&&this.addGroup(0,v.length);for(var y=0,M=i.length;M>y;++y)for(var A=i[y],x=A.start,w=A.count,a=x,s=x+w;s>a;a+=3)c=3*v[a+0],u=3*v[a+1],l=3*v[a+2],d.fromArray(r,c),p.fromArray(r,u),f.fromArray(r,l),m.subVectors(f,p),g.subVectors(d,p),m.cross(g),h[c]+=m.x,h[c+1]+=m.y,h[c+2]+=m.z,h[u]+=m.x,h[u+1]+=m.y,h[u+2]+=m.z,h[l]+=m.x,h[l+1]+=m.y,h[l+2]+=m.z}else for(var a=0,s=r.length;s>a;a+=9)d.fromArray(r,a),p.fromArray(r,a+3),f.fromArray(r,a+6),m.subVectors(f,p),g.subVectors(d,p),m.cross(g),h[a]=m.x,h[a+1]=m.y,h[a+2]=m.z,h[a+3]=m.x,h[a+4]=m.y,h[a+5]=m.z,h[a+6]=m.x,h[a+7]=m.y,h[a+8]=m.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e instanceof n.BufferGeometry==!1)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0);var i=this.attributes;for(var r in i)if(void 0!==e.attributes[r])for(var o=i[r],a=o.array,s=e.attributes[r],c=s.array,u=s.itemSize,l=0,h=u*t;l<c.length;l++,h++)a[h]=c[l];return this},normalizeNormals:function(){for(var e,t,i,r,n=this.attributes.normal.array,o=0,a=n.length;a>o;o+=3)e=n[o],t=n[o+1],i=n[o+2],r=1/Math.sqrt(e*e+t*t+i*i),n[o]*=r,n[o+1]*=r,n[o+2]*=r},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new n.BufferGeometry,t=this.index.array,i=this.attributes;for(var r in i){for(var o=i[r],a=o.array,s=o.itemSize,c=new a.constructor(t.length*s),u=0,l=0,h=0,d=t.length;d>h;h++){u=t[h]*s;for(var p=0;s>p;p++)c[l++]=a[u++]}e.addAttribute(r,new n.BufferAttribute(c,s))}return e},toJSON:function(){var e={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};var r=this.index;if(null!==r){var n=Array.prototype.slice.call(r.array);e.data.index={type:r.array.constructor.name,array:n}}var o=this.attributes;for(var i in o){var a=o[i],n=Array.prototype.slice.call(a.array);e.data.attributes[i]={itemSize:a.itemSize,type:a.array.constructor.name,array:n,normalized:a.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new n.BufferGeometry).copy(this)},copy:function(e){var t=e.index;null!==t&&this.setIndex(t.clone());var i=e.attributes;for(var r in i){var n=i[r];this.addAttribute(r,n.clone())}for(var o=e.groups,a=0,s=o.length;s>a;a++){var c=o[a];this.addGroup(c.start,c.count,c.materialIndex)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),n.BufferGeometry.MaxIndex=65535,n.InstancedBufferGeometry=function(){n.BufferGeometry.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0},n.InstancedBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.InstancedBufferGeometry.prototype.constructor=n.InstancedBufferGeometry,n.InstancedBufferGeometry.prototype.addGroup=function(e,t,i){this.groups.push({start:e,count:t,instances:i})},n.InstancedBufferGeometry.prototype.copy=function(e){var t=e.index;null!==t&&this.setIndex(t.clone());var i=e.attributes;for(var r in i){var n=i[r];this.addAttribute(r,n.clone())}for(var o=e.groups,a=0,s=o.length;s>a;a++){var c=o[a];this.addGroup(c.start,c.count,c.instances)}return this},n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),n.Uniform=function(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e,this.dynamic=!1},n.Uniform.prototype={constructor:n.Uniform,onUpdate:function(e){return this.dynamic=!0,this.onUpdateCallback=e,this}},n.AnimationClip=function(e,t,i){this.name=e||n.Math.generateUUID(),this.tracks=i,this.duration=void 0!==t?t:-1,this.duration<0&&this.resetDuration(),this.trim(),this.optimize()},n.AnimationClip.prototype={constructor:n.AnimationClip,resetDuration:function(){for(var e=this.tracks,t=0,i=0,r=e.length;i!==r;++i){var n=this.tracks[i];t=Math.max(t,n.times[n.times.length-1])}this.duration=t},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}},Object.assign(n.AnimationClip,{parse:function(e){for(var t=[],i=e.tracks,r=1/(e.fps||1),o=0,a=i.length;o!==a;++o)t.push(n.KeyframeTrack.parse(i[o]).scale(r));return new n.AnimationClip(e.name,e.duration,t)},toJSON:function(e){for(var t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t},o=0,a=i.length;o!==a;++o)t.push(n.KeyframeTrack.toJSON(i[o]));return r},CreateFromMorphTargetSequence:function(e,t,i,r){for(var o=t.length,a=[],s=0;o>s;s++){var c=[],u=[];c.push((s+o-1)%o,s,(s+1)%o),u.push(0,1,0);var l=n.AnimationUtils.getKeyframeOrder(c);c=n.AnimationUtils.sortedArray(c,1,l),u=n.AnimationUtils.sortedArray(u,1,l),r||0!==c[0]||(c.push(o),u.push(u[0])),a.push(new n.NumberKeyframeTrack(".morphTargetInfluences["+t[s].name+"]",c,u).scale(1/i))}return new n.AnimationClip(e,-1,a)},findByName:function(e,t){for(var i=0;i<e.length;i++)if(e[i].name===t)return e[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,i){for(var r={},o=/^([\w-]*?)([\d]+)$/,a=0,s=e.length;s>a;a++){var c=e[a],u=c.name.match(o);if(u&&u.length>1){var l=u[1],h=r[l];h||(r[l]=h=[]),h.push(c)}}var d=[];for(var l in r)d.push(n.AnimationClip.CreateFromMorphTargetSequence(l,r[l],t,i));return d},parseAnimation:function(e,t){if(!e)return console.error(" no animation in JSONLoader data"),null;for(var i=function(e,t,i,r,o){if(0!==i.length){var a=[],s=[];n.AnimationUtils.flattenJSON(i,a,s,r),0!==a.length&&o.push(new e(t,a,s))}},r=[],o=e.name||"default",a=e.length||-1,s=e.fps||30,c=e.hierarchy||[],u=0;u<c.length;u++){var l=c[u].keys;if(l&&0!=l.length)if(l[0].morphTargets){for(var h={},d=0;d<l.length;d++)if(l[d].morphTargets)for(var p=0;p<l[d].morphTargets.length;p++)h[l[d].morphTargets[p]]=-1;for(var f in h){for(var m=[],g=[],p=0;p!==l[d].morphTargets.length;++p){var v=l[d];m.push(v.time),g.push(v.morphTarget===f?1:0)}r.push(new n.NumberKeyframeTrack(".morphTargetInfluence["+f+"]",m,g))}a=h.length*(s||1)}else{var y=".bones["+t[u].name+"]";i(n.VectorKeyframeTrack,y+".position",l,"pos",r),i(n.QuaternionKeyframeTrack,y+".quaternion",l,"rot",r),i(n.VectorKeyframeTrack,y+".scale",l,"scl",r)}}if(0===r.length)return null;var M=new n.AnimationClip(o,a,r);return M}}),n.AnimationMixer=function(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1},n.AnimationMixer.prototype={constructor:n.AnimationMixer,clipAction:function(e,t){var i,r=t||this._root,o=r.uuid,a="string"==typeof e?e:e.name,s=e!==a?e:null,c=this._actionsByClip[a];if(void 0!==c){var u=c.actionByRoot[o];if(void 0!==u)return u;if(i=c.knownActions[0],s=i._clip,e!==a&&e!==s)throw new Error("Different clips with the same name detected!")}if(null===s)return null;var l=new n.AnimationMixer._Action(this,s,t);return this._bindAction(l,i),this._addInactiveAction(l,a,o),l},existingAction:function(e,t){var i=t||this._root,r=i.uuid,n="string"==typeof e?e:e.name,o=this._actionsByClip[n];return void 0!==o?o.actionByRoot[r]||null:null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,i=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var n=0;n!==t;++n)e[n].reset();for(var n=0;n!==r;++n)i[n].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,i=this._nActiveActions,r=this.time+=e,n=Math.sign(e),o=this._accuIndex^=1,a=0;a!==i;++a){var s=t[a];s.enabled&&s._update(r,e,n,o)}for(var c=this._bindings,u=this._nActiveBindings,a=0;a!==u;++a)c[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,i=e.name,r=this._actionsByClip,n=r[i];if(void 0!==n){for(var o=n.knownActions,a=0,s=o.length;a!==s;++a){var c=o[a];this._deactivateAction(c);var u=c._cacheIndex,l=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,l._cacheIndex=u,t[u]=l,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}},uncacheRoot:function(e){var t=e.uuid,i=this._actionsByClip;for(var r in i){var n=i[r].actionByRoot,o=n[t];void 0!==o&&(this._deactivateAction(o),this._removeInactiveAction(o))}var a=this._bindingsByRootAndName,s=a[t];if(void 0!==s)for(var c in s){var u=s[c];u.restoreOriginalState(),this._removeInactiveBinding(u)}},uncacheAction:function(e,t){var i=this.existingAction(e,t);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}},n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),n.AnimationMixer._Action=function(e,t,i){this._mixer=e,this._clip=t,this._localRoot=i||null;for(var r=t.tracks,o=r.length,a=new Array(o),s={endingStart:n.ZeroCurvatureEnding,endingEnd:n.ZeroCurvatureEnding},c=0;c!==o;++c){var u=r[c].createInterpolant(null);a[c]=u,u.settings=s}this._interpolantSettings=s,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=n.LoopRepeat,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0},n.AnimationMixer._Action.prototype={constructor:n.AnimationMixer._Action,play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){this._startTime;return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,i){this._mixer;if(e.fadeOut(t),this.fadeIn(t),i){var r=this._clip.duration,n=e._clip.duration,o=n/r,a=r/n;e.warp(1,o,t),this.warp(a,1,t)}return this},crossFadeTo:function(e,t,i){return e.crossFadeFrom(this,t,i)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._currentTimeScale,0,e)},warp:function(e,t,i){var r=this._mixer,n=r.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=n,s[1]=n+i,c[0]=e/a,c[1]=t/a,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,i,r){var n=this._startTime;if(null!==n){var o=(e-n)*i;if(0>o||0===i)return;this._startTime=null,t=i*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,u=this._propertyBindings,l=0,h=c.length;l!==h;++l)c[l].evaluate(a),u[l].accumulate(r,s)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var i=this._weightInterpolant;if(null!==i){var r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i){var r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.pause=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e;if(0===e)return t;var i=this._clip.duration,r=this.loop,o=this._loopCount,a=!1;switch(r){case n.LoopOnce:if(-1===o&&(this.loopCount=0,this._setEndings(!0,!0,!1)),t>=i)t=i;else{if(!(0>t))break;t=0}this.clampWhenFinished?this.pause=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:0>e?-1:1});break;case n.LoopPingPong:a=!0;case n.LoopRepeat:if(-1===o&&(e>0?(o=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=i||0>t){var s=Math.floor(t/i);t-=i*s,o+=Math.abs(s);var c=this.repetitions-o;if(0>c){this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});break}if(0===c){var u=0>e;this._setEndings(u,!u,a)}else this._setEndings(!1,!1,a);this._loopCount=o,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:s})}if(r===n.LoopPingPong&&1===(1&o))return this.time=t,i-t}return this.time=t,t},_setEndings:function(e,t,i){var r=this._interpolantSettings;i?(r.endingStart=n.ZeroSlopeEnding,r.endingEnd=n.ZeroSlopeEnding):(r.endingStart=e?this.zeroSlopeAtStart?n.ZeroSlopeEnding:n.ZeroCurvatureEnding:n.WrapAroundEnding,r.endingEnd=t?this.zeroSlopeAtEnd?n.ZeroSlopeEnding:n.ZeroCurvatureEnding:n.WrapAroundEnding)},_scheduleFading:function(e,t,i){var r=this._mixer,n=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=n,s[0]=t,a[1]=n+e,s[1]=i,this}},Object.assign(n.AnimationMixer.prototype,{_bindAction:function(e,t){var i=e._localRoot||this._root,r=e._clip.tracks,o=r.length,a=e._propertyBindings,s=e._interpolants,c=i.uuid,u=this._bindingsByRootAndName,l=u[c];void 0===l&&(l={},u[c]=l);for(var h=0;h!==o;++h){var d=r[h],p=d.name,f=l[p];if(void 0!==f)a[h]=f;else{if(f=a[h],void 0!==f){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,c,p));continue}var m=t&&t._propertyBindings[h].binding.parsedPath;f=new n.PropertyMixer(n.PropertyBinding.create(i,p,m),d.ValueTypeName,d.getValueSize()),++f.referenceCount,this._addInactiveBinding(f,c,p),a[h]=f}s[h].resultBuffer=f.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,i=e._clip.name,r=this._actionsByClip[i];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,i,t)}for(var n=e._propertyBindings,o=0,a=n.length;o!==a;++o){var s=n[o];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,i=0,r=t.length;i!==r;++i){var n=t[i];0===--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,i){var r=this._actions,n=this._actionsByClip,o=n[t];if(void 0===o)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,n[t]=o;else{var a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e},_removeInactiveAction:function(e){var t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;var n=e._clip.name,o=this._actionsByClip,a=o[n],s=a.knownActions,c=s[s.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,s[u]=c,s.pop(),e._byClipCacheIndex=null;var l=a.actionByRoot,h=(t._localRoot||this._root).uuid;delete l[h],0===s.length&&delete o[n],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,i=0,r=t.length;i!==r;++i){var n=t[i];0===--n.referenceCount&&this._removeInactiveBinding(n)}},_lendAction:function(e){var t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_takeBackAction:function(e){var t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_addInactiveBinding:function(e,t,i){var r=this._bindingsByRootAndName,n=r[t],o=this._bindings;void 0===n&&(n={},r[t]=n),n[i]=e,e._cacheIndex=o.length,o.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,i=e.binding,r=i.rootNode.uuid,n=i.path,o=this._bindingsByRootAndName,a=o[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete a[n];e:{for(var u in a)break e;delete o[r]}},_lendBinding:function(e){var t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_takeBackBinding:function(e){var t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,i=e[t];return void 0===i&&(i=new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=t,e[t]=i),i},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,n=t[r];e.__cacheIndex=r,t[r]=e,n.__cacheIndex=i,t[i]=n},_controlInterpolantsResultBuffer:new Float32Array(1)}),n.AnimationObjectGroup=function(){this.uuid=n.Math.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,i=arguments.length;t!==i;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}},n.AnimationObjectGroup.prototype={constructor:n.AnimationObjectGroup,add:function(){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,r=this._indicesByUUID,o=this._paths,a=this._parsedPaths,s=this._bindings,c=s.length,u=0,l=arguments.length;u!==l;++u){var h=arguments[u],d=h.uuid,p=r[d];if(void 0===p){p=t++,r[d]=p,e.push(h);for(var f=0,m=c;f!==m;++f)s[f].push(new n.PropertyBinding(h,o[f],a[f]))}else if(i>p){var g=e[p],v=--i,y=e[v];r[y.uuid]=p,e[p]=y,r[d]=v,e[v]=h;for(var f=0,m=c;f!==m;++f){var M=s[f],A=M[v],x=M[p];M[p]=A,void 0===x&&(x=new n.PropertyBinding(h,o[f],a[f])),M[v]=x}}else e[p]!==g&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=i},remove:function(){for(var e=this._objects,t=(e.length,this.nCachedObjects_),i=this._indicesByUUID,r=this._bindings,n=r.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],c=s.uuid,u=i[c];if(void 0!==u&&u>=t){var l=t++,h=e[l];i[h.uuid]=u,e[u]=h,i[c]=l,e[l]=s;for(var d=0,p=n;d!==p;++d){var f=r[d],m=f[l],g=f[u];f[u]=m,f[l]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,r=this._indicesByUUID,n=this._bindings,o=n.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a],u=c.uuid,l=r[u];if(void 0!==l)if(delete r[u],i>l){var h=--i,d=e[h],p=--t,f=e[p];r[d.uuid]=l,e[l]=d,r[f.uuid]=h,e[h]=f,e.pop();for(var m=0,g=o;m!==g;++m){var v=n[m],y=v[h],M=v[p];v[l]=y,v[h]=M,v.pop()}}else{var p=--t,f=e[p];r[f.uuid]=l,e[l]=f,e.pop();for(var m=0,g=o;m!==g;++m){var v=n[m];v[l]=v[p],v.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){var i=this._bindingsIndicesByPath,r=i[e],o=this._bindings;if(void 0!==r)return o[r];var a=this._paths,s=this._parsedPaths,c=this._objects,u=c.length,l=this.nCachedObjects_,h=new Array(u);r=o.length,i[e]=r,a.push(e),s.push(t),o.push(h);for(var d=l,p=c.length;d!==p;++d){var f=c[d];h[d]=new n.PropertyBinding(f,e,t)}return h},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,i=t[e];if(void 0!==i){var r=this._paths,n=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a],c=e[a];t[c]=i,o[i]=s,o.pop(),n[i]=n[a],n.pop(),r[i]=r[a],r.pop()}}},n.AnimationUtils={arraySlice:function(e,t,i){return n.AnimationUtils.isTypedArray(e)?new e.constructor(e.subarray(t,i)):e.slice(t,i)},convertArray:function(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){function t(t,i){return e[t]-e[i]}for(var i=e.length,r=new Array(i),n=0;n!==i;++n)r[n]=n;return r.sort(t),r},sortedArray:function(e,t,i){for(var r=e.length,n=new e.constructor(r),o=0,a=0;a!==r;++o)for(var s=i[o]*t,c=0;c!==t;++c)n[a++]=e[s+c];return n},flattenJSON:function(e,t,i,r){for(var n=1,o=e[0];void 0!==o&&void 0===o[r];)o=e[n++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a)){do a=o[r],void 0!==a&&(t.push(o.time),i.push.apply(i,a)),o=e[n++];while(void 0!==o)}else if(void 0!==a.toArray){do a=o[r],void 0!==a&&(t.push(o.time),a.toArray(i,i.length)),o=e[n++];while(void 0!==o)}else do a=o[r],void 0!==a&&(t.push(o.time),i.push(a)),o=e[n++];while(void 0!==o)}}},n.KeyframeTrack=function(e,t,i,r){if(void 0===e)throw new Error("track name is undefined");if(void 0===t||0===t.length)throw new Error("no keyframes in track named "+e);this.name=e,this.times=n.AnimationUtils.convertArray(t,this.TimeBufferType),this.values=n.AnimationUtils.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()},n.KeyframeTrack.prototype={constructor:n.KeyframeTrack,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:n.InterpolateLinear,InterpolantFactoryMethodDiscrete:function(e){return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t=void 0;switch(e){case n.InterpolateDiscrete:t=this.InterpolantFactoryMethodDiscrete;break;case n.InterpolateLinear:t=this.InterpolantFactoryMethodLinear;break;case n.InterpolateSmooth:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return void console.warn(i)}this.createInterpolant=t},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return n.InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return n.InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return n.InterpolateSmooth}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,i=0,r=t.length;i!==r;++i)t[i]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,i=0,r=t.length;i!==r;++i)t[i]*=e;return this},trim:function(e,t){for(var i=this.times,r=i.length,o=0,a=r-1;o!==r&&i[o]<e;)++o;for(;-1!==a&&i[a]>t;)--a;if(++a,0!==o||a!==r){o>=a&&(a=Math.max(a,1),o=a-1);var s=this.getValueSize();this.times=n.AnimationUtils.arraySlice(i,o,a),this.values=n.AnimationUtils.arraySlice(this.values,o*s,a*s)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("invalid value size in track",this),e=!1);var i=this.times,r=this.values,o=i.length;0===o&&(console.error("track is empty",this),e=!1);for(var a=null,s=0;s!==o;s++){var c=i[s];if("number"==typeof c&&isNaN(c)){console.error("time is not a valid number",this,s,c),e=!1;break}if(null!==a&&a>c){console.error("out of order keys",this,s,c,a),e=!1;break}a=c}if(void 0!==r&&n.AnimationUtils.isTypedArray(r))for(var s=0,u=r.length;s!==u;++s){var l=r[s];if(isNaN(l)){console.error("value is not a valid number",this,s,l),e=!1;break}}return e},optimize:function(){for(var e=this.times,t=this.values,i=this.getValueSize(),r=1,o=1,a=e.length-1;a>=o;++o){var s=!1,c=e[o],u=e[o+1];if(c!==u&&(1!==o||c!==c[0]))for(var l=o*i,h=l-i,d=l+i,p=0;p!==i;++p){var f=t[l+p];if(f!==t[h+p]||f!==t[d+p]){s=!0;break}}if(s){if(o!==r){e[r]=e[o];for(var m=o*i,g=r*i,p=0;p!==i;++p)t[g+p]=t[m+p]}++r}}return r!==e.length&&(this.times=n.AnimationUtils.arraySlice(e,0,r),this.values=n.AnimationUtils.arraySlice(t,0,r*i)),this}},Object.assign(n.KeyframeTrack,{parse:function(e){if(void 0===e.type)throw new Error("track type undefined, can not parse");var t=n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);if(void 0===e.times){console.warn("legacy JSON format detected, converting");var i=[],r=[];n.AnimationUtils.flattenJSON(e.keys,i,r,"value"),e.times=i,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)},toJSON:function(e){var t,i=e.constructor;if(void 0!==i.toJSON)t=i.toJSON(e);else{t={name:e.name,times:n.AnimationUtils.convertArray(e.times,Array),values:n.AnimationUtils.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t},_getTrackTypeForValueTypeName:function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return n.NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return n.VectorKeyframeTrack;case"color":return n.ColorKeyframeTrack;case"quaternion":return n.QuaternionKeyframeTrack;case"bool":case"boolean":return n.BooleanKeyframeTrack;case"string":return n.StringKeyframeTrack}throw new Error("Unsupported typeName: "+e)}}),n.PropertyBinding=function(e,t,i){this.path=t,this.parsedPath=i||n.PropertyBinding.parseTrackName(t),this.node=n.PropertyBinding.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e},n.PropertyBinding.prototype={constructor:n.PropertyBinding,getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,i=t.objectName,r=t.propertyName,o=t.propertyIndex;if(e||(e=n.PropertyBinding.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error(" trying to update node for track: "+this.path+" but it wasn't found.");if(i){var a=t.objectIndex;switch(i){case"materials":if(!e.material)return void console.error(" can not bind to material as node does not have a material",this);if(!e.material.materials)return void console.error(" can not bind to material.materials as node.material does not have a materials array",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error(" can not bind to bones as node does not have a skeleton",this);e=e.skeleton.bones;for(var s=0;s<e.length;s++)if(e[s].name===a){a=s;break}break;default:if(void 0===e[i])return void console.error(" can not bind to objectName of node, undefined",this);e=e[i]}if(void 0!==a){if(void 0===e[a])return void console.error(" trying to bind to objectIndex of objectName, but is undefined:",this,e);e=e[a]}}var c=e[r];if(!c){var u=t.nodeName;return void console.error(" trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}var l=this.Versioning.None;void 0!==e.needsUpdate?(l=this.Versioning.NeedsUpdate,this.targetObject=e):void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=e);var h=this.BindingType.Direct;if(void 0!==o){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry",this);if(!e.geometry.morphTargets)return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);for(var s=0;s<this.node.geometry.morphTargets.length;s++)if(e.geometry.morphTargets[s].name===o){o=s;break}}h=this.BindingType.ArrayElement, this.resolvedProperty=c,this.propertyIndex=o}else void 0!==c.fromArray&&void 0!==c.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=c):void 0!==c.length?(h=this.BindingType.EntireArray,this.resolvedProperty=c):this.propertyName=r;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][l]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},Object.assign(n.PropertyBinding.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},_getValue_unbound:n.PropertyBinding.prototype.getValue,_setValue_unbound:n.PropertyBinding.prototype.setValue,BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)e[t++]=i[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.node[this.propertyName]=e[t]},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++]},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]]}),n.PropertyBinding.Composite=function(e,t,i){var r=i||n.PropertyBinding.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)},n.PropertyBinding.Composite.prototype={constructor:n.PropertyBinding.Composite,getValue:function(e,t){this.bind();var i=this._targetGroup.nCachedObjects_,r=this._bindings[i];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var i=this._bindings,r=this._targetGroup.nCachedObjects_,n=i.length;r!==n;++r)i[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},n.PropertyBinding.create=function(e,t,i){return e instanceof n.AnimationObjectGroup?new n.PropertyBinding.Composite(e,t,i):new n.PropertyBinding(e,t,i)},n.PropertyBinding.parseTrackName=function(e){var t=/^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,i=t.exec(e);if(!i)throw new Error("cannot parse trackName at all: "+e);i.index===t.lastIndex&&t.lastIndex++;var r={nodeName:i[3],objectName:i[5],objectIndex:i[7],propertyName:i[9],propertyIndex:i[11]};if(null===r.propertyName||0===r.propertyName.length)throw new Error("can not parse propertyName from trackName: "+e);return r},n.PropertyBinding.findNode=function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var i=function(e){for(var i=0;i<e.bones.length;i++){var r=e.bones[i];if(r.name===t)return r}return null},r=i(e.skeleton);if(r)return r}if(e.children){var n=function(e){for(var i=0;i<e.length;i++){var r=e[i];if(r.name===t||r.uuid===t)return r;var o=n(r.children);if(o)return o}return null},o=n(e.children);if(o)return o}return null},n.PropertyMixer=function(e,t,i){this.binding=e,this.valueSize=i;var r,n=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":n=Array,r=this._select;break;default:r=this._lerp}this.buffer=new n(4*i),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0},n.PropertyMixer.prototype={constructor:n.PropertyMixer,accumulate:function(e,t){var i=this.buffer,r=this.valueSize,n=e*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)i[n+a]=i[a];o=t}else{o+=t;var s=t/o;this._mixBufferRegion(i,n,0,s,r)}this.cumulativeWeight=o},apply:function(e){var t=this.valueSize,i=this.buffer,r=e*t+t,n=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,1>n){var a=3*t;this._mixBufferRegion(i,r,a,1-n,t)}for(var s=t,c=t+t;s!==c;++s)if(i[s]!==i[s+t]){o.setValue(i,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,i=this.valueSize,r=3*i;e.getValue(t,r);for(var n=i,o=r;n!==o;++n)t[n]=t[r+n%i];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,i,r,n){if(r>=.5)for(var o=0;o!==n;++o)e[t+o]=e[i+o]},_slerp:function(e,t,i,r){n.Quaternion.slerpFlat(e,t,e,t,e,i,r)},_lerp:function(e,t,i,r,n){for(var o=1-r,a=0;a!==n;++a){var s=t+a;e[s]=e[s]*o+e[i+a]*r}}},n.BooleanKeyframeTrack=function(e,t,i){n.KeyframeTrack.call(this,e,t,i)},n.BooleanKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.BooleanKeyframeTrack,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:n.InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),n.ColorKeyframeTrack=function(e,t,i,r){n.KeyframeTrack.call(this,e,t,i,r)},n.ColorKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.ColorKeyframeTrack,ValueTypeName:"color"}),n.NumberKeyframeTrack=function(e,t,i,r){n.KeyframeTrack.call(this,e,t,i,r)},n.NumberKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.NumberKeyframeTrack,ValueTypeName:"number"}),n.QuaternionKeyframeTrack=function(e,t,i,r){n.KeyframeTrack.call(this,e,t,i,r)},n.QuaternionKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.QuaternionKeyframeTrack,ValueTypeName:"quaternion",DefaultInterpolation:n.InterpolateLinear,InterpolantFactoryMethodLinear:function(e){return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),n.StringKeyframeTrack=function(e,t,i,r){n.KeyframeTrack.call(this,e,t,i,r)},n.StringKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.StringKeyframeTrack,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:n.InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),n.VectorKeyframeTrack=function(e,t,i,r){n.KeyframeTrack.call(this,e,t,i,r)},n.VectorKeyframeTrack.prototype=Object.assign(Object.create(n.KeyframeTrack.prototype),{constructor:n.VectorKeyframeTrack,ValueTypeName:"vector"}),n.Audio=function(e){n.Object3D.call(this),this.type="Audio",this.context=e.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filter=null},n.Audio.prototype=Object.create(n.Object3D.prototype),n.Audio.prototype.constructor=n.Audio,n.Audio.prototype.getOutput=function(){return this.gain},n.Audio.prototype.setNodeSource=function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},n.Audio.prototype.setBuffer=function(e){var t=this;return t.source.buffer=e,t.sourceType="buffer",t.autoplay&&t.play(),this},n.Audio.prototype.play=function(){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");var e=this.context.createBufferSource();e.buffer=this.source.buffer,e.loop=this.source.loop,e.onended=this.source.onended,e.start(0,this.startTime),e.playbackRate.value=this.playbackRate,this.isPlaying=!0,this.source=e,this.connect()},n.Audio.prototype.pause=function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),void(this.startTime=this.context.currentTime))},n.Audio.prototype.stop=function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),void(this.startTime=0))},n.Audio.prototype.connect=function(){null!==this.filter?(this.source.connect(this.filter),this.filter.connect(this.getOutput())):this.source.connect(this.getOutput())},n.Audio.prototype.disconnect=function(){null!==this.filter?(this.source.disconnect(this.filter),this.filter.disconnect(this.getOutput())):this.source.disconnect(this.getOutput())},n.Audio.prototype.getFilter=function(){return this.filter},n.Audio.prototype.setFilter=function(e){void 0===e&&(e=null),this.isPlaying===!0?(this.disconnect(),this.filter=e,this.connect()):this.filter=e},n.Audio.prototype.setPlaybackRate=function(e){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=e,void(this.isPlaying===!0&&(this.source.playbackRate.value=this.playbackRate)))},n.Audio.prototype.getPlaybackRate=function(){return this.playbackRate},n.Audio.prototype.onEnded=function(){this.isPlaying=!1},n.Audio.prototype.setLoop=function(e){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):void(this.source.loop=e)},n.Audio.prototype.getLoop=function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.source.loop},n.Audio.prototype.setVolume=function(e){this.gain.gain.value=e},n.Audio.prototype.getVolume=function(){return this.gain.gain.value},n.AudioAnalyser=function(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)},n.AudioAnalyser.prototype={constructor:n.AudioAnalyser,getData:function(){return this.analyser.getByteFrequencyData(this.data),this.data}},Object.defineProperty(n,"AudioContext",{get:function(){var e;return function(){return void 0===e&&(e=new(window.AudioContext||window.webkitAudioContext)),e}}()}),n.PositionalAudio=function(e){n.Audio.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)},n.PositionalAudio.prototype=Object.create(n.Audio.prototype),n.PositionalAudio.prototype.constructor=n.PositionalAudio,n.PositionalAudio.prototype.getOutput=function(){return this.panner},n.PositionalAudio.prototype.setRefDistance=function(e){this.panner.refDistance=e},n.PositionalAudio.prototype.getRefDistance=function(){return this.panner.refDistance},n.PositionalAudio.prototype.setRolloffFactor=function(e){this.panner.rolloffFactor=e},n.PositionalAudio.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor},n.PositionalAudio.prototype.setDistanceModel=function(e){this.panner.distanceModel=e},n.PositionalAudio.prototype.getDistanceModel=function(){return this.panner.distanceModel},n.PositionalAudio.prototype.setMaxDistance=function(e){this.panner.maxDistance=e},n.PositionalAudio.prototype.getMaxDistance=function(){return this.panner.maxDistance},n.PositionalAudio.prototype.updateMatrixWorld=function(){var e=new n.Vector3;return function(t){n.Object3D.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}(),n.AudioListener=function(){n.Object3D.call(this),this.type="AudioListener",this.context=n.AudioContext,this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null},n.AudioListener.prototype=Object.create(n.Object3D.prototype),n.AudioListener.prototype.constructor=n.AudioListener,n.AudioListener.prototype.getInput=function(){return this.gain},n.AudioListener.prototype.removeFilter=function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},n.AudioListener.prototype.setFilter=function(e){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},n.AudioListener.prototype.getFilter=function(){return this.filter},n.AudioListener.prototype.setMasterVolume=function(e){this.gain.gain.value=e},n.AudioListener.prototype.getMasterVolume=function(){return this.gain.gain.value},n.AudioListener.prototype.updateMatrixWorld=function(){var e=new n.Vector3,t=new n.Quaternion,i=new n.Vector3,r=new n.Vector3;return function(o){n.Object3D.prototype.updateMatrixWorld.call(this,o);var a=this.context.listener,s=this.up;this.matrixWorld.decompose(e,t,i),r.set(0,0,-1).applyQuaternion(t),a.setPosition(e.x,e.y,e.z),a.setOrientation(r.x,r.y,r.z,s.x,s.y,s.z)}}(),n.Camera=function(){n.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new n.Matrix4,this.projectionMatrix=new n.Matrix4},n.Camera.prototype=Object.create(n.Object3D.prototype),n.Camera.prototype.constructor=n.Camera,n.Camera.prototype.getWorldDirection=function(){var e=new n.Quaternion;return function(t){var i=t||new n.Vector3;return this.getWorldQuaternion(e),i.set(0,0,-1).applyQuaternion(e)}}(),n.Camera.prototype.lookAt=function(){var e=new n.Matrix4;return function(t){e.lookAt(this.position,t,this.up),this.quaternion.setFromRotationMatrix(e)}}(),n.Camera.prototype.clone=function(){return(new this.constructor).copy(this)},n.Camera.prototype.copy=function(e){return n.Object3D.prototype.copy.call(this,e),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},n.CubeCamera=function(e,t,i){n.Object3D.call(this),this.type="CubeCamera";var r=90,o=1,a=new n.PerspectiveCamera(r,o,e,t);a.up.set(0,-1,0),a.lookAt(new n.Vector3(1,0,0)),this.add(a);var s=new n.PerspectiveCamera(r,o,e,t);s.up.set(0,-1,0),s.lookAt(new n.Vector3(-1,0,0)),this.add(s);var c=new n.PerspectiveCamera(r,o,e,t);c.up.set(0,0,1),c.lookAt(new n.Vector3(0,1,0)),this.add(c);var u=new n.PerspectiveCamera(r,o,e,t);u.up.set(0,0,-1),u.lookAt(new n.Vector3(0,-1,0)),this.add(u);var l=new n.PerspectiveCamera(r,o,e,t);l.up.set(0,-1,0),l.lookAt(new n.Vector3(0,0,1)),this.add(l);var h=new n.PerspectiveCamera(r,o,e,t);h.up.set(0,-1,0),h.lookAt(new n.Vector3(0,0,-1)),this.add(h);var d={format:n.RGBFormat,magFilter:n.LinearFilter,minFilter:n.LinearFilter};this.renderTarget=new n.WebGLRenderTargetCube(i,i,d),this.updateCubeMap=function(e,t){null===this.parent&&this.updateMatrixWorld();var i=this.renderTarget,r=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,i.activeCubeFace=0,e.render(t,a,i),i.activeCubeFace=1,e.render(t,s,i),i.activeCubeFace=2,e.render(t,c,i),i.activeCubeFace=3,e.render(t,u,i),i.activeCubeFace=4,e.render(t,l,i),i.texture.generateMipmaps=r,i.activeCubeFace=5,e.render(t,h,i),e.setRenderTarget(null)}},n.CubeCamera.prototype=Object.create(n.Object3D.prototype),n.CubeCamera.prototype.constructor=n.CubeCamera,n.OrthographicCamera=function(e,t,i,r,o,a){n.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=void 0!==o?o:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()},n.OrthographicCamera.prototype=Object.create(n.Camera.prototype),n.OrthographicCamera.prototype.constructor=n.OrthographicCamera,n.OrthographicCamera.prototype.updateProjectionMatrix=function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(i-e,i+e,r+t,r-t,this.near,this.far)},n.OrthographicCamera.prototype.copy=function(e){return n.Camera.prototype.copy.call(this,e),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this},n.OrthographicCamera.prototype.toJSON=function(e){var t=n.Object3D.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,t},n.PerspectiveCamera=function(e,t,i,r){n.Camera.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()},n.PerspectiveCamera.prototype=Object.create(n.Camera.prototype),n.PerspectiveCamera.prototype.constructor=n.PerspectiveCamera,n.PerspectiveCamera.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},n.PerspectiveCamera.prototype.setFocalLength=function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*n.Math.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},n.PerspectiveCamera.prototype.getFocalLength=function(){var e=Math.tan(.5*n.Math.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},n.PerspectiveCamera.prototype.getEffectiveFOV=function(){return 2*n.Math.RAD2DEG*Math.atan(Math.tan(.5*n.Math.DEG2RAD*this.fov)/this.zoom)},n.PerspectiveCamera.prototype.getFilmWidth=function(){return this.filmGauge*Math.min(this.aspect,1)},n.PerspectiveCamera.prototype.getFilmHeight=function(){return this.filmGauge/Math.max(this.aspect,1)},n.PerspectiveCamera.prototype.setViewOffset=function(e,t,i,r,n,o){this.aspect=e/t,this.view={fullWidth:e,fullHeight:t,offsetX:i,offsetY:r,width:n,height:o},this.updateProjectionMatrix()},n.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var e=this.near,t=e*Math.tan(.5*n.Math.DEG2RAD*this.fov)/this.zoom,i=2*t,r=this.aspect*i,o=-.5*r,a=this.view;if(null!==a){var s=a.fullWidth,c=a.fullHeight;o+=a.offsetX*r/s,t-=a.offsetY*i/c,r*=a.width/s,i*=a.height/c}var u=this.filmOffset;0!==u&&(o+=e*u/this.getFilmWidth()),this.projectionMatrix.makeFrustum(o,o+r,t-i,t,e,this.far)},n.PerspectiveCamera.prototype.copy=function(e){return n.Camera.prototype.copy.call(this,e),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},n.PerspectiveCamera.prototype.toJSON=function(e){var t=n.Object3D.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t},n.StereoCamera=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new n.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new n.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1},n.StereoCamera.prototype={constructor:n.StereoCamera,update:function(){var e,t,i,r,o,a=new n.Matrix4,s=new n.Matrix4;return function(c){var u=e!==c.focus||t!==c.fov||i!==c.aspect*this.aspect||r!==c.near||o!==c.far;if(u){e=c.focus,t=c.fov,i=c.aspect*this.aspect,r=c.near,o=c.far;var l,h,d=c.projectionMatrix.clone(),p=.032,f=p*r/e,m=r*Math.tan(n.Math.DEG2RAD*t*.5);s.elements[12]=-p,a.elements[12]=p,l=-m*i+f,h=m*i+f,d.elements[0]=2*r/(h-l),d.elements[8]=(h+l)/(h-l),this.cameraL.projectionMatrix.copy(d),l=-m*i-f,h=m*i-f,d.elements[0]=2*r/(h-l),d.elements[8]=(h+l)/(h-l),this.cameraR.projectionMatrix.copy(d)}this.cameraL.matrixWorld.copy(c.matrixWorld).multiply(s),this.cameraR.matrixWorld.copy(c.matrixWorld).multiply(a)}}()},n.Light=function(e,t){n.Object3D.call(this),this.type="Light",this.color=new n.Color(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0},n.Light.prototype=Object.create(n.Object3D.prototype),n.Light.prototype.constructor=n.Light,n.Light.prototype.copy=function(e){return n.Object3D.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},n.Light.prototype.toJSON=function(e){var t=n.Object3D.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),t},n.LightShadow=function(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new n.Vector2(512,512),this.map=null,this.matrix=new n.Matrix4},n.LightShadow.prototype={constructor:n.LightShadow,copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)}},n.AmbientLight=function(e,t){n.Light.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0},n.AmbientLight.prototype=Object.create(n.Light.prototype),n.AmbientLight.prototype.constructor=n.AmbientLight,n.DirectionalLight=function(e,t){n.Light.call(this,e,t),this.type="DirectionalLight",this.position.set(0,1,0),this.updateMatrix(),this.target=new n.Object3D,this.shadow=new n.DirectionalLightShadow},n.DirectionalLight.prototype=Object.create(n.Light.prototype),n.DirectionalLight.prototype.constructor=n.DirectionalLight,n.DirectionalLight.prototype.copy=function(e){return n.Light.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this},n.DirectionalLightShadow=function(){n.LightShadow.call(this,new n.OrthographicCamera(-5,5,5,-5,.5,500))},n.DirectionalLightShadow.prototype=Object.create(n.LightShadow.prototype),n.DirectionalLightShadow.prototype.constructor=n.DirectionalLightShadow,n.HemisphereLight=function(e,t,i){n.Light.call(this,e,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.set(0,1,0),this.updateMatrix(),this.groundColor=new n.Color(t)},n.HemisphereLight.prototype=Object.create(n.Light.prototype),n.HemisphereLight.prototype.constructor=n.HemisphereLight,n.HemisphereLight.prototype.copy=function(e){return n.Light.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this},n.PointLight=function(e,t,i,r){n.Light.call(this,e,t),this.type="PointLight",this.distance=void 0!==i?i:0,this.decay=void 0!==r?r:1,this.shadow=new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))},n.PointLight.prototype=Object.create(n.Light.prototype),n.PointLight.prototype.constructor=n.PointLight,Object.defineProperty(n.PointLight.prototype,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),n.PointLight.prototype.copy=function(e){return n.Light.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this},n.SpotLight=function(e,t,i,r,o,a){n.Light.call(this,e,t),this.type="SpotLight",this.position.set(0,1,0),this.updateMatrix(),this.target=new n.Object3D,this.distance=void 0!==i?i:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==o?o:0,this.decay=void 0!==a?a:1,this.shadow=new n.SpotLightShadow},n.SpotLight.prototype=Object.create(n.Light.prototype),n.SpotLight.prototype.constructor=n.SpotLight,Object.defineProperty(n.SpotLight.prototype,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),n.SpotLight.prototype.copy=function(e){return n.Light.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this},n.SpotLightShadow=function(){n.LightShadow.call(this,new n.PerspectiveCamera(50,1,.5,500))},n.SpotLightShadow.prototype=Object.create(n.LightShadow.prototype),n.SpotLightShadow.prototype.constructor=n.SpotLightShadow,n.SpotLightShadow.prototype.update=function(e){var t=2*n.Math.RAD2DEG*e.angle,i=this.mapSize.width/this.mapSize.height,r=e.distance||500,o=this.camera;(t!==o.fov||i!==o.aspect||r!==o.far)&&(o.fov=t,o.aspect=i,o.far=r,o.updateProjectionMatrix())},n.AudioLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.AudioLoader.prototype={constructor:n.AudioLoader,load:function(e,t,i,r){var o=new n.XHRLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,function(e){var i=n.AudioContext;i.decodeAudioData(e,function(e){t(e)})},i,r)}},n.Cache={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){return this.enabled!==!1?this.files[e]:void 0},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},n.Loader=function(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},n.Loader.prototype={constructor:n.Loader,crossOrigin:void 0,extractUrlBase:function(e){var t=e.split("/");return 1===t.length?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(e,t,i){for(var r=[],n=0;n<e.length;++n)r[n]=this.createMaterial(e[n],t,i);return r},createMaterial:function(){var e,t,i;return function(r,o,a){function s(e,i,r,s,u){var l,h=o+e,d=n.Loader.Handlers.get(h);null!==d?l=d.load(h):(t.setCrossOrigin(a),l=t.load(h)),void 0!==i&&(l.repeat.fromArray(i),1!==i[0]&&(l.wrapS=n.RepeatWrapping),1!==i[1]&&(l.wrapT=n.RepeatWrapping)),void 0!==r&&l.offset.fromArray(r),void 0!==s&&("repeat"===s[0]&&(l.wrapS=n.RepeatWrapping),"mirror"===s[0]&&(l.wrapS=n.MirroredRepeatWrapping),"repeat"===s[1]&&(l.wrapT=n.RepeatWrapping),"mirror"===s[1]&&(l.wrapT=n.MirroredRepeatWrapping)),void 0!==u&&(l.anisotropy=u);var p=n.Math.generateUUID();return c[p]=l,p}void 0===e&&(e=new n.Color),void 0===t&&(t=new n.TextureLoader),void 0===i&&(i=new n.MaterialLoader);var c={},u={uuid:n.Math.generateUUID(),type:"MeshLambertMaterial"};for(var l in r){var h=r[l];switch(l){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":u.name=h;break;case"blending":u.blending=n[h];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",l,"is no longer supported.");break;case"colorDiffuse":u.color=e.fromArray(h).getHex();break;case"colorSpecular":u.specular=e.fromArray(h).getHex();break;case"colorEmissive":u.emissive=e.fromArray(h).getHex();break;case"specularCoef":u.shininess=h;break;case"shading":"basic"===h.toLowerCase()&&(u.type="MeshBasicMaterial"),"phong"===h.toLowerCase()&&(u.type="MeshPhongMaterial");break;case"mapDiffuse":u.map=s(h,r.mapDiffuseRepeat,r.mapDiffuseOffset,r.mapDiffuseWrap,r.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapLight":u.lightMap=s(h,r.mapLightRepeat,r.mapLightOffset,r.mapLightWrap,r.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":u.aoMap=s(h,r.mapAORepeat,r.mapAOOffset,r.mapAOWrap,r.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":u.bumpMap=s(h,r.mapBumpRepeat,r.mapBumpOffset,r.mapBumpWrap,r.mapBumpAnisotropy);break;case"mapBumpScale":u.bumpScale=h;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":u.normalMap=s(h,r.mapNormalRepeat,r.mapNormalOffset,r.mapNormalWrap,r.mapNormalAnisotropy);break;case"mapNormalFactor":u.normalScale=[h,h];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":u.specularMap=s(h,r.mapSpecularRepeat,r.mapSpecularOffset,r.mapSpecularWrap,r.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapAlpha":u.alphaMap=s(h,r.mapAlphaRepeat,r.mapAlphaOffset,r.mapAlphaWrap,r.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":u.side=n.BackSide;break;case"doubleSided":u.side=n.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),u.opacity=h;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":u[l]=h;break;case"vertexColors":h===!0&&(u.vertexColors=n.VertexColors),"face"===h&&(u.vertexColors=n.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",l,h)}}return"MeshBasicMaterial"===u.type&&delete u.emissive,"MeshPhongMaterial"!==u.type&&delete u.specular,u.opacity<1&&(u.transparent=!0),i.setTextures(c),i.parse(u)}}()},n.Loader.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,i=0,r=t.length;r>i;i+=2){var n=t[i],o=t[i+1];if(n.test(e))return o}return null}},n.XHRLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.XHRLoader.prototype={constructor:n.XHRLoader,load:function(e,t,i,r){void 0!==this.path&&(e=this.path+e);var o=this,a=n.Cache.get(e);if(void 0!==a)return t&&setTimeout(function(){t(a)},0),a;var s=new XMLHttpRequest;return s.overrideMimeType("text/plain"),s.open("GET",e,!0),s.addEventListener("load",function(i){var a=i.target.response;n.Cache.add(e,a),200===this.status?(t&&t(a),o.manager.itemEnd(e)):0===this.status?(console.warn("THREE.XHRLoader: HTTP Status 0 received."),t&&t(a),o.manager.itemEnd(e)):(r&&r(i),o.manager.itemError(e))},!1),void 0!==i&&s.addEventListener("progress",function(e){i(e)},!1),s.addEventListener("error",function(t){r&&r(t),o.manager.itemError(e)},!1),void 0!==this.responseType&&(s.responseType=this.responseType),void 0!==this.withCredentials&&(s.withCredentials=this.withCredentials),s.send(null),o.manager.itemStart(e),s},setPath:function(e){this.path=e},setResponseType:function(e){this.responseType=e},setWithCredentials:function(e){this.withCredentials=e}},n.FontLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.FontLoader.prototype={constructor:n.FontLoader,load:function(e,t,i,r){var o=new n.XHRLoader(this.manager);o.load(e,function(e){t(new n.Font(JSON.parse(e.substring(65,e.length-2))))},i,r)}},n.ImageLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.ImageLoader.prototype={constructor:n.ImageLoader,load:function(e,t,i,r){void 0!==this.path&&(e=this.path+e);var o=this,a=n.Cache.get(e);if(void 0!==a)return o.manager.itemStart(e),t?setTimeout(function(){t(a),o.manager.itemEnd(e)},0):o.manager.itemEnd(e),a;var s=document.createElement("img");return s.addEventListener("load",function(){n.Cache.add(e,this),t&&t(this),o.manager.itemEnd(e)},!1),void 0!==i&&s.addEventListener("progress",function(e){i(e)},!1),s.addEventListener("error",function(t){r&&r(t),o.manager.itemError(e)},!1),void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),o.manager.itemStart(e),s.src=e,s},setCrossOrigin:function(e){this.crossOrigin=e},setPath:function(e){this.path=e}},n.JSONLoader=function(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:n.DefaultLoadingManager,this.withCredentials=!1},n.JSONLoader.prototype={constructor:n.JSONLoader,get statusDomElement(){return void 0===this._statusDomElement&&(this._statusDomElement=document.createElement("div")),console.warn("THREE.JSONLoader: .statusDomElement has been removed."), this._statusDomElement},load:function(e,t,i,r){var o=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:n.Loader.prototype.extractUrlBase(e),s=new n.XHRLoader(this.manager);s.setWithCredentials(this.withCredentials),s.load(e,function(i){var r=JSON.parse(i),n=r.metadata;if(void 0!==n){var s=n.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.")}}var c=o.parse(r,a);t(c.geometry,c.materials)},i,r)},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){function i(t){function i(e,t){return e&1<<t}var r,o,a,c,u,l,h,d,p,f,m,g,v,y,M,A,x,w,E,b,T,L,D,N,S,C,I,j=e.faces,_=e.vertices,O=e.normals,z=e.colors,k=0;if(void 0!==e.uvs){for(r=0;r<e.uvs.length;r++)e.uvs[r].length&&k++;for(r=0;k>r;r++)s.faceVertexUvs[r]=[]}for(c=0,u=_.length;u>c;)w=new n.Vector3,w.x=_[c++]*t,w.y=_[c++]*t,w.z=_[c++]*t,s.vertices.push(w);for(c=0,u=j.length;u>c;)if(f=j[c++],m=i(f,0),g=i(f,1),v=i(f,3),y=i(f,4),M=i(f,5),A=i(f,6),x=i(f,7),m){if(b=new n.Face3,b.a=j[c],b.b=j[c+1],b.c=j[c+3],T=new n.Face3,T.a=j[c+1],T.b=j[c+2],T.c=j[c+3],c+=4,g&&(p=j[c++],b.materialIndex=p,T.materialIndex=p),a=s.faces.length,v)for(r=0;k>r;r++)for(N=e.uvs[r],s.faceVertexUvs[r][a]=[],s.faceVertexUvs[r][a+1]=[],o=0;4>o;o++)d=j[c++],C=N[2*d],I=N[2*d+1],S=new n.Vector2(C,I),2!==o&&s.faceVertexUvs[r][a].push(S),0!==o&&s.faceVertexUvs[r][a+1].push(S);if(y&&(h=3*j[c++],b.normal.set(O[h++],O[h++],O[h]),T.normal.copy(b.normal)),M)for(r=0;4>r;r++)h=3*j[c++],D=new n.Vector3(O[h++],O[h++],O[h]),2!==r&&b.vertexNormals.push(D),0!==r&&T.vertexNormals.push(D);if(A&&(l=j[c++],L=z[l],b.color.setHex(L),T.color.setHex(L)),x)for(r=0;4>r;r++)l=j[c++],L=z[l],2!==r&&b.vertexColors.push(new n.Color(L)),0!==r&&T.vertexColors.push(new n.Color(L));s.faces.push(b),s.faces.push(T)}else{if(E=new n.Face3,E.a=j[c++],E.b=j[c++],E.c=j[c++],g&&(p=j[c++],E.materialIndex=p),a=s.faces.length,v)for(r=0;k>r;r++)for(N=e.uvs[r],s.faceVertexUvs[r][a]=[],o=0;3>o;o++)d=j[c++],C=N[2*d],I=N[2*d+1],S=new n.Vector2(C,I),s.faceVertexUvs[r][a].push(S);if(y&&(h=3*j[c++],E.normal.set(O[h++],O[h++],O[h])),M)for(r=0;3>r;r++)h=3*j[c++],D=new n.Vector3(O[h++],O[h++],O[h]),E.vertexNormals.push(D);if(A&&(l=j[c++],E.color.setHex(z[l])),x)for(r=0;3>r;r++)l=j[c++],E.vertexColors.push(new n.Color(z[l]));s.faces.push(E)}}function r(){var t=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var i=0,r=e.skinWeights.length;r>i;i+=t){var o=e.skinWeights[i],a=t>1?e.skinWeights[i+1]:0,c=t>2?e.skinWeights[i+2]:0,u=t>3?e.skinWeights[i+3]:0;s.skinWeights.push(new n.Vector4(o,a,c,u))}if(e.skinIndices)for(var i=0,r=e.skinIndices.length;r>i;i+=t){var l=e.skinIndices[i],h=t>1?e.skinIndices[i+1]:0,d=t>2?e.skinIndices[i+2]:0,p=t>3?e.skinIndices[i+3]:0;s.skinIndices.push(new n.Vector4(l,h,d,p))}s.bones=e.bones,s.bones&&s.bones.length>0&&(s.skinWeights.length!==s.skinIndices.length||s.skinIndices.length!==s.vertices.length)&&console.warn("When skinning, number of vertices ("+s.vertices.length+"), skinIndices ("+s.skinIndices.length+"), and skinWeights ("+s.skinWeights.length+") should match.")}function o(t){if(void 0!==e.morphTargets)for(var i=0,r=e.morphTargets.length;r>i;i++){s.morphTargets[i]={},s.morphTargets[i].name=e.morphTargets[i].name,s.morphTargets[i].vertices=[];for(var o=s.morphTargets[i].vertices,a=e.morphTargets[i].vertices,c=0,u=a.length;u>c;c+=3){var l=new n.Vector3;l.x=a[c]*t,l.y=a[c+1]*t,l.z=a[c+2]*t,o.push(l)}}if(void 0!==e.morphColors&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var h=s.faces,d=e.morphColors[0].colors,i=0,r=h.length;r>i;i++)h[i].color.fromArray(d,3*i)}}function a(){var t=[],i=[];void 0!==e.animation&&i.push(e.animation),void 0!==e.animations&&(e.animations.length?i=i.concat(e.animations):i.push(e.animations));for(var r=0;r<i.length;r++){var o=n.AnimationClip.parseAnimation(i[r],s.bones);o&&t.push(o)}if(s.morphTargets){var a=n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets,10);t=t.concat(a)}t.length>0&&(s.animations=t)}var s=new n.Geometry,c=void 0!==e.scale?1/e.scale:1;if(i(c),r(),o(c),a(),s.computeFaceNormals(),s.computeBoundingSphere(),void 0===e.materials||0===e.materials.length)return{geometry:s};var u=n.Loader.prototype.initMaterials(e.materials,t,this.crossOrigin);return{geometry:s,materials:u}}},n.LoadingManager=function(e,t,i){var r=this,n=!1,o=0,a=0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){a++,n===!1&&void 0!==r.onStart&&r.onStart(e,o,a),n=!0},this.itemEnd=function(e){o++,void 0!==r.onProgress&&r.onProgress(e,o,a),o===a&&(n=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)}},n.DefaultLoadingManager=new n.LoadingManager,n.BufferGeometryLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.BufferGeometryLoader.prototype={constructor:n.BufferGeometryLoader,load:function(e,t,i,r){var o=this,a=new n.XHRLoader(o.manager);a.load(e,function(e){t(o.parse(JSON.parse(e)))},i,r)},parse:function(e){var t=new n.BufferGeometry,i=e.data.index,r={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};if(void 0!==i){var o=new r[i.type](i.array);t.setIndex(new n.BufferAttribute(o,1))}var a=e.data.attributes;for(var s in a){var c=a[s],o=new r[c.type](c.array);t.addAttribute(s,new n.BufferAttribute(o,c.itemSize,c.normalized))}var u=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==u)for(var l=0,h=u.length;l!==h;++l){var d=u[l];t.addGroup(d.start,d.count,d.materialIndex)}var p=e.data.boundingSphere;if(void 0!==p){var f=new n.Vector3;void 0!==p.center&&f.fromArray(p.center),t.boundingSphere=new n.Sphere(f,p.radius)}return t}},n.MaterialLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager,this.textures={}},n.MaterialLoader.prototype={constructor:n.MaterialLoader,load:function(e,t,i,r){var o=this,a=new n.XHRLoader(o.manager);a.load(e,function(e){t(o.parse(JSON.parse(e)))},i,r)},setTextures:function(e){this.textures=e},getTexture:function(e){var t=this.textures;return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]},parse:function(e){var t=new n[e.type];if(void 0!==e.uuid&&(t.uuid=e.uuid),void 0!==e.name&&(t.name=e.name),void 0!==e.color&&t.color.setHex(e.color),void 0!==e.roughness&&(t.roughness=e.roughness),void 0!==e.metalness&&(t.metalness=e.metalness),void 0!==e.emissive&&t.emissive.setHex(e.emissive),void 0!==e.specular&&t.specular.setHex(e.specular),void 0!==e.shininess&&(t.shininess=e.shininess),void 0!==e.uniforms&&(t.uniforms=e.uniforms),void 0!==e.vertexShader&&(t.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(t.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(t.vertexColors=e.vertexColors),void 0!==e.shading&&(t.shading=e.shading),void 0!==e.blending&&(t.blending=e.blending),void 0!==e.side&&(t.side=e.side),void 0!==e.opacity&&(t.opacity=e.opacity),void 0!==e.transparent&&(t.transparent=e.transparent),void 0!==e.alphaTest&&(t.alphaTest=e.alphaTest),void 0!==e.depthTest&&(t.depthTest=e.depthTest),void 0!==e.depthWrite&&(t.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(t.colorWrite=e.colorWrite),void 0!==e.wireframe&&(t.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(t.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.size&&(t.size=e.size),void 0!==e.sizeAttenuation&&(t.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(t.map=this.getTexture(e.map)),void 0!==e.alphaMap&&(t.alphaMap=this.getTexture(e.alphaMap),t.transparent=!0),void 0!==e.bumpMap&&(t.bumpMap=this.getTexture(e.bumpMap)),void 0!==e.bumpScale&&(t.bumpScale=e.bumpScale),void 0!==e.normalMap&&(t.normalMap=this.getTexture(e.normalMap)),void 0!==e.normalScale){var i=e.normalScale;Array.isArray(i)===!1&&(i=[i,i]),t.normalScale=(new n.Vector2).fromArray(i)}if(void 0!==e.displacementMap&&(t.displacementMap=this.getTexture(e.displacementMap)),void 0!==e.displacementScale&&(t.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(t.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(t.roughnessMap=this.getTexture(e.roughnessMap)),void 0!==e.metalnessMap&&(t.metalnessMap=this.getTexture(e.metalnessMap)),void 0!==e.emissiveMap&&(t.emissiveMap=this.getTexture(e.emissiveMap)),void 0!==e.emissiveIntensity&&(t.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(t.specularMap=this.getTexture(e.specularMap)),void 0!==e.envMap&&(t.envMap=this.getTexture(e.envMap),t.combine=n.MultiplyOperation),e.reflectivity&&(t.reflectivity=e.reflectivity),void 0!==e.lightMap&&(t.lightMap=this.getTexture(e.lightMap)),void 0!==e.lightMapIntensity&&(t.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(t.aoMap=this.getTexture(e.aoMap)),void 0!==e.aoMapIntensity&&(t.aoMapIntensity=e.aoMapIntensity),void 0!==e.materials)for(var r=0,o=e.materials.length;o>r;r++)t.materials.push(this.parse(e.materials[r]));return t}},n.ObjectLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager,this.texturePath=""},n.ObjectLoader.prototype={constructor:n.ObjectLoader,load:function(e,t,i,r){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var o=this,a=new n.XHRLoader(o.manager);a.load(e,function(e){o.parse(JSON.parse(e),t)},i,r)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var i=this.parseGeometries(e.geometries),r=this.parseImages(e.images,function(){void 0!==t&&t(a)}),n=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,n),a=this.parseObject(e.object,i,o);return e.animations&&(a.animations=this.parseAnimations(e.animations)),(void 0===e.images||0===e.images.length)&&void 0!==t&&t(a),a},parseGeometries:function(e){var t={};if(void 0!==e)for(var i=new n.JSONLoader,r=new n.BufferGeometryLoader,o=0,a=e.length;a>o;o++){var s,c=e[o];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new n[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new n[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new n[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new n[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new n[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":s=new n.DodecahedronGeometry(c.radius,c.detail);break;case"IcosahedronGeometry":s=new n.IcosahedronGeometry(c.radius,c.detail);break;case"OctahedronGeometry":s=new n.OctahedronGeometry(c.radius,c.detail);break;case"TetrahedronGeometry":s=new n.TetrahedronGeometry(c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new n[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new n[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new n[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new n[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"BufferGeometry":s=r.parse(c);break;case"Geometry":s=i.parse(c.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),t[c.uuid]=s}return t},parseMaterials:function(e,t){var i={};if(void 0!==e){var r=new n.MaterialLoader;r.setTextures(t);for(var o=0,a=e.length;a>o;o++){var s=r.parse(e[o]);i[s.uuid]=s}}return i},parseAnimations:function(e){for(var t=[],i=0;i<e.length;i++){var r=n.AnimationClip.parse(e[i]);t.push(r)}return t},parseImages:function(e,t){function i(e){return r.manager.itemStart(e),s.load(e,function(){r.manager.itemEnd(e)})}var r=this,o={};if(void 0!==e&&e.length>0){var a=new n.LoadingManager(t),s=new n.ImageLoader(a);s.setCrossOrigin(this.crossOrigin);for(var c=0,u=e.length;u>c;c++){var l=e[c],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:r.texturePath+l.url;o[l.uuid]=i(h)}}return o},parseTextures:function(e,t){function i(e){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),n[e])}var r={};if(void 0!==e)for(var o=0,a=e.length;a>o;o++){var s=e[o];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);var c=new n.Texture(t[s.image]);c.needsUpdate=!0,c.uuid=s.uuid,void 0!==s.name&&(c.name=s.name),void 0!==s.mapping&&(c.mapping=i(s.mapping)),void 0!==s.offset&&(c.offset=new n.Vector2(s.offset[0],s.offset[1])),void 0!==s.repeat&&(c.repeat=new n.Vector2(s.repeat[0],s.repeat[1])),void 0!==s.minFilter&&(c.minFilter=i(s.minFilter)),void 0!==s.magFilter&&(c.magFilter=i(s.magFilter)),void 0!==s.anisotropy&&(c.anisotropy=s.anisotropy),Array.isArray(s.wrap)&&(c.wrapS=i(s.wrap[0]),c.wrapT=i(s.wrap[1])),r[s.uuid]=c}return r},parseObject:function(){var e=new n.Matrix4;return function(t,i,r){function o(e){return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),i[e]}function a(e){return void 0===e?void 0:(void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),r[e])}var s;switch(t.type){case"Scene":s=new n.Scene;break;case"PerspectiveCamera":s=new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(s.focus=t.focus),void 0!==t.zoom&&(s.zoom=t.zoom),void 0!==t.filmGauge&&(s.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(s.filmOffset=t.filmOffset),void 0!==t.view&&(s.view=Object.assign({},t.view));break;case"OrthographicCamera":s=new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":s=new n.AmbientLight(t.color,t.intensity);break;case"DirectionalLight":s=new n.DirectionalLight(t.color,t.intensity);break;case"PointLight":s=new n.PointLight(t.color,t.intensity,t.distance,t.decay);break;case"SpotLight":s=new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":s=new n.HemisphereLight(t.color,t.groundColor,t.intensity);break;case"Mesh":var c=o(t.geometry),u=a(t.material);s=c.bones&&c.bones.length>0?new n.SkinnedMesh(c,u):new n.Mesh(c,u);break;case"LOD":s=new n.LOD;break;case"Line":s=new n.Line(o(t.geometry),a(t.material),t.mode);break;case"PointCloud":case"Points":s=new n.Points(o(t.geometry),a(t.material));break;case"Sprite":s=new n.Sprite(a(t.material));break;case"Group":s=new n.Group;break;default:s=new n.Object3D}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(e.fromArray(t.matrix),e.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.children)for(var l in t.children)s.add(this.parseObject(t.children[l],i,r));if("LOD"===t.type)for(var h=t.levels,d=0;d<h.length;d++){var p=h[d],l=s.getObjectByProperty("uuid",p.object);void 0!==l&&s.addLevel(l,p.distance)}return s}}()},n.TextureLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.TextureLoader.prototype={constructor:n.TextureLoader,load:function(e,t,i,r){var o=new n.Texture,a=new n.ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(e){o.image=e,o.needsUpdate=!0,void 0!==t&&t(o)},i,r),o},setCrossOrigin:function(e){this.crossOrigin=e},setPath:function(e){this.path=e}},n.CubeTextureLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager},n.CubeTextureLoader.prototype={constructor:n.CubeTextureLoader,load:function(e,t,i,r){function o(i){s.load(e[i],function(e){a.images[i]=e,c++,6===c&&(a.needsUpdate=!0,t&&t(a))},void 0,r)}var a=new n.CubeTexture,s=new n.ImageLoader(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);for(var c=0,u=0;u<e.length;++u)o(u);return a},setCrossOrigin:function(e){this.crossOrigin=e},setPath:function(e){this.path=e}},n.DataTextureLoader=n.BinaryTextureLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager,this._parser=null},n.BinaryTextureLoader.prototype={constructor:n.BinaryTextureLoader,load:function(e,t,i,r){var o=this,a=new n.DataTexture,s=new n.XHRLoader(this.manager);return s.setResponseType("arraybuffer"),s.load(e,function(e){var i=o._parser(e);i&&(void 0!==i.image?a.image=i.image:void 0!==i.data&&(a.image.width=i.width,a.image.height=i.height,a.image.data=i.data),a.wrapS=void 0!==i.wrapS?i.wrapS:n.ClampToEdgeWrapping,a.wrapT=void 0!==i.wrapT?i.wrapT:n.ClampToEdgeWrapping,a.magFilter=void 0!==i.magFilter?i.magFilter:n.LinearFilter,a.minFilter=void 0!==i.minFilter?i.minFilter:n.LinearMipMapLinearFilter,a.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(a.format=i.format),void 0!==i.type&&(a.type=i.type),void 0!==i.mipmaps&&(a.mipmaps=i.mipmaps),1===i.mipmapCount&&(a.minFilter=n.LinearFilter),a.needsUpdate=!0,t&&t(a,i))},i,r),a}},n.CompressedTextureLoader=function(e){this.manager=void 0!==e?e:n.DefaultLoadingManager,this._parser=null},n.CompressedTextureLoader.prototype={constructor:n.CompressedTextureLoader,load:function(e,t,i,r){function o(o){u.load(e[o],function(e){var i=a._parser(e,!0);s[o]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},l+=1,6===l&&(1===i.mipmapCount&&(c.minFilter=n.LinearFilter),c.format=i.format,c.needsUpdate=!0,t&&t(c))},i,r)}var a=this,s=[],c=new n.CompressedTexture;c.image=s;var u=new n.XHRLoader(this.manager);if(u.setPath(this.path),u.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,h=0,d=e.length;d>h;++h)o(h);else u.load(e,function(e){var i=a._parser(e,!0);if(i.isCubemap)for(var r=i.mipmaps.length/i.mipmapCount,o=0;r>o;o++){s[o]={mipmaps:[]};for(var u=0;u<i.mipmapCount;u++)s[o].mipmaps.push(i.mipmaps[o*i.mipmapCount+u]),s[o].format=i.format,s[o].width=i.width,s[o].height=i.height}else c.image.width=i.width,c.image.height=i.height,c.mipmaps=i.mipmaps;1===i.mipmapCount&&(c.minFilter=n.LinearFilter),c.format=i.format,c.needsUpdate=!0,t&&t(c)},i,r);return c},setPath:function(e){this.path=e}},n.Material=function(){Object.defineProperty(this,"id",{value:n.MaterialIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.type="Material",this.side=n.FrontSide,this.opacity=1,this.transparent=!1,this.blending=n.NormalBlending,this.blendSrc=n.SrcAlphaFactor,this.blendDst=n.OneMinusSrcAlphaFactor,this.blendEquation=n.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=n.LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0},n.Material.prototype={constructor:n.Material,get needsUpdate(){return this._needsUpdate},set needsUpdate(e){e===!0&&this.update(),this._needsUpdate=e},setValues:function(e){if(void 0!==e)for(var t in e){var i=e[t];if(void 0!==i){var r=this[t];void 0!==r?r instanceof n.Color?r.set(i):r instanceof n.Vector3&&i instanceof n.Vector3?r.copy(i):this[t]="overdraw"===t?Number(i):i:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){function t(e){var t=[];for(var i in e){var r=e[i];delete r.metadata,t.push(r)}return t}var i=void 0===e;i&&(e={textures:{},images:{}});var r={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color instanceof n.Color&&(r.color=this.color.getHex()),.5!==this.roughness&&(r.roughness=this.roughness),.5!==this.metalness&&(r.metalness=this.metalness),this.emissive instanceof n.Color&&(r.emissive=this.emissive.getHex()),this.specular instanceof n.Color&&(r.specular=this.specular.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),this.map instanceof n.Texture&&(r.map=this.map.toJSON(e).uuid),this.alphaMap instanceof n.Texture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap instanceof n.Texture&&(r.lightMap=this.lightMap.toJSON(e).uuid),this.bumpMap instanceof n.Texture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap instanceof n.Texture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalScale=this.normalScale.toArray()),this.displacementMap instanceof n.Texture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap instanceof n.Texture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap instanceof n.Texture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap instanceof n.Texture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap instanceof n.Texture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.envMap instanceof n.Texture&&(r.envMap=this.envMap.toJSON(e).uuid,r.reflectivity=this.reflectivity),void 0!==this.size&&(r.size=this.size),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),void 0!==this.vertexColors&&this.vertexColors!==n.NoColors&&(r.vertexColors=this.vertexColors),void 0!==this.shading&&this.shading!==n.SmoothShading&&(r.shading=this.shading),void 0!==this.blending&&this.blending!==n.NormalBlending&&(r.blending=this.blending),void 0!==this.side&&this.side!==n.FrontSide&&(r.side=this.side),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),i){var o=t(e.textures),a=t(e.images);o.length>0&&(r.textures=o),a.length>0&&(r.images=a)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.side=e.side,this.opacity=e.opacity,this.transparent=e.transparent,this.blending=e.blending,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.clipShadows=e.clipShadows;var t=e.clippingPlanes,i=null;if(null!==t){var r=t.length;i=new Array(r);for(var n=0;n!==r;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},n.EventDispatcher.prototype.apply(n.Material.prototype),n.MaterialIdCount=0,n.LineBasicMaterial=function(e){n.Material.call(this),this.type="LineBasicMaterial",this.color=new n.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.blending=n.NormalBlending,this.vertexColors=n.NoColors,this.fog=!0,this.setValues(e)},n.LineBasicMaterial.prototype=Object.create(n.Material.prototype),n.LineBasicMaterial.prototype.constructor=n.LineBasicMaterial,n.LineBasicMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.vertexColors=e.vertexColors,this.fog=e.fog,this},n.LineDashedMaterial=function(e){n.Material.call(this),this.type="LineDashedMaterial",this.color=new n.Color(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.blending=n.NormalBlending,this.vertexColors=n.NoColors,this.fog=!0,this.setValues(e)},n.LineDashedMaterial.prototype=Object.create(n.Material.prototype),n.LineDashedMaterial.prototype.constructor=n.LineDashedMaterial,n.LineDashedMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this.vertexColors=e.vertexColors,this.fog=e.fog,this},n.MeshBasicMaterial=function(e){n.Material.call(this),this.type="MeshBasicMaterial",this.color=new n.Color(16777215),this.map=null,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=n.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=n.SmoothShading,this.blending=n.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=n.NoColors,this.skinning=!1,this.morphTargets=!1,this.setValues(e)},n.MeshBasicMaterial.prototype=Object.create(n.Material.prototype),n.MeshBasicMaterial.prototype.constructor=n.MeshBasicMaterial,n.MeshBasicMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.fog=e.fog,this.shading=e.shading,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},n.MeshDepthMaterial=function(e){n.Material.call(this),this.type="MeshDepthMaterial",this.depthPacking=n.BasicDepthPacking,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)},n.MeshDepthMaterial.prototype=Object.create(n.Material.prototype),n.MeshDepthMaterial.prototype.constructor=n.MeshDepthMaterial,n.MeshDepthMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},n.MeshLambertMaterial=function(e){n.Material.call(this),this.type="MeshLambertMaterial",this.color=new n.Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new n.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=n.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.blending=n.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=n.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},n.MeshLambertMaterial.prototype=Object.create(n.Material.prototype),n.MeshLambertMaterial.prototype.constructor=n.MeshLambertMaterial,n.MeshLambertMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.fog=e.fog,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},n.MeshNormalMaterial=function(e){n.Material.call(this,e),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(e)},n.MeshNormalMaterial.prototype=Object.create(n.Material.prototype),n.MeshNormalMaterial.prototype.constructor=n.MeshNormalMaterial,n.MeshNormalMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},n.MeshPhongMaterial=function(e){n.Material.call(this),this.type="MeshPhongMaterial",this.color=new n.Color(16777215),this.specular=new n.Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new n.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new n.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=n.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=n.SmoothShading,this.blending=n.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=n.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},n.MeshPhongMaterial.prototype=Object.create(n.Material.prototype),n.MeshPhongMaterial.prototype.constructor=n.MeshPhongMaterial,n.MeshPhongMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.fog=e.fog,this.shading=e.shading,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},n.MeshStandardMaterial=function(e){n.Material.call(this),this.defines={ STANDARD:""},this.type="MeshStandardMaterial",this.color=new n.Color(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new n.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new n.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.fog=!0,this.shading=n.SmoothShading,this.blending=n.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=n.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},n.MeshStandardMaterial.prototype=Object.create(n.Material.prototype),n.MeshStandardMaterial.prototype.constructor=n.MeshStandardMaterial,n.MeshStandardMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.fog=e.fog,this.shading=e.shading,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},n.MeshPhysicalMaterial=function(e){n.MeshStandardMaterial.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.setValues(e)},n.MeshPhysicalMaterial.prototype=Object.create(n.MeshStandardMaterial.prototype),n.MeshPhysicalMaterial.prototype.constructor=n.MeshPhysicalMaterial,n.MeshPhysicalMaterial.prototype.copy=function(e){return n.MeshStandardMaterial.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this},n.MultiMaterial=function(e){this.uuid=n.Math.generateUUID(),this.type="MultiMaterial",this.materials=e instanceof Array?e:[],this.visible=!0},n.MultiMaterial.prototype={constructor:n.MultiMaterial,toJSON:function(e){for(var t={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},i=this.materials,r=0,n=i.length;n>r;r++){var o=i[r].toJSON(e);delete o.metadata,t.materials.push(o)}return t.visible=this.visible,t},clone:function(){for(var e=new this.constructor,t=0;t<this.materials.length;t++)e.materials.push(this.materials[t].clone());return e.visible=this.visible,e}},n.PointsMaterial=function(e){n.Material.call(this),this.type="PointsMaterial",this.color=new n.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.blending=n.NormalBlending,this.vertexColors=n.NoColors,this.fog=!0,this.setValues(e)},n.PointsMaterial.prototype=Object.create(n.Material.prototype),n.PointsMaterial.prototype.constructor=n.PointsMaterial,n.PointsMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.vertexColors=e.vertexColors,this.fog=e.fog,this},n.ShaderMaterial=function(e){n.Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.shading=n.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.vertexColors=n.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))},n.ShaderMaterial.prototype=Object.create(n.Material.prototype),n.ShaderMaterial.prototype.constructor=n.ShaderMaterial,n.ShaderMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=n.UniformsUtils.clone(e.uniforms),this.defines=e.defines,this.shading=e.shading,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},n.ShaderMaterial.prototype.toJSON=function(e){var t=n.Material.prototype.toJSON.call(this,e);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},n.RawShaderMaterial=function(e){n.ShaderMaterial.call(this,e),this.type="RawShaderMaterial"},n.RawShaderMaterial.prototype=Object.create(n.ShaderMaterial.prototype),n.RawShaderMaterial.prototype.constructor=n.RawShaderMaterial,n.SpriteMaterial=function(e){n.Material.call(this),this.type="SpriteMaterial",this.color=new n.Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.setValues(e)},n.SpriteMaterial.prototype=Object.create(n.Material.prototype),n.SpriteMaterial.prototype.constructor=n.SpriteMaterial,n.SpriteMaterial.prototype.copy=function(e){return n.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this.fog=e.fog,this},n.Texture=function(e,t,i,r,o,a,s,c,u,l){Object.defineProperty(this,"id",{value:n.TextureIdCount++}),this.uuid=n.Math.generateUUID(),this.name="",this.sourceFile="",this.image=void 0!==e?e:n.Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:n.Texture.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:n.ClampToEdgeWrapping,this.wrapT=void 0!==r?r:n.ClampToEdgeWrapping,this.magFilter=void 0!==o?o:n.LinearFilter,this.minFilter=void 0!==a?a:n.LinearMipMapLinearFilter,this.anisotropy=void 0!==u?u:1,this.format=void 0!==s?s:n.RGBAFormat,this.type=void 0!==c?c:n.UnsignedByteType,this.offset=new n.Vector2(0,0),this.repeat=new n.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:n.LinearEncoding,this.version=0,this.onUpdate=null},n.Texture.DEFAULT_IMAGE=void 0,n.Texture.DEFAULT_MAPPING=n.UVMapping,n.Texture.prototype={constructor:n.Texture,set needsUpdate(e){e===!0&&this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){function t(e){var t;return void 0!==e.toDataURL?t=e:(t=document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0,e.width,e.height)),t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}if(void 0!==e.textures[this.uuid])return e.textures[this.uuid];var i={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=n.Math.generateUUID()),void 0===e.images[r.uuid]&&(e.images[r.uuid]={uuid:r.uuid,url:t(r)}),i.image=r.uuid}return e.textures[this.uuid]=i,i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping===n.UVMapping){if(e.multiply(this.repeat),e.add(this.offset),e.x<0||e.x>1)switch(this.wrapS){case n.RepeatWrapping:e.x=e.x-Math.floor(e.x);break;case n.ClampToEdgeWrapping:e.x=e.x<0?0:1;break;case n.MirroredRepeatWrapping:e.x=1===Math.abs(Math.floor(e.x)%2)?Math.ceil(e.x)-e.x:e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case n.RepeatWrapping:e.y=e.y-Math.floor(e.y);break;case n.ClampToEdgeWrapping:e.y=e.y<0?0:1;break;case n.MirroredRepeatWrapping:e.y=1===Math.abs(Math.floor(e.y)%2)?Math.ceil(e.y)-e.y:e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}},n.EventDispatcher.prototype.apply(n.Texture.prototype),n.TextureIdCount=0,n.DepthTexture=function(e,t,i,r,o,a,s,c,u){n.Texture.call(this,null,r,o,a,s,c,n.DepthFormat,i,u),this.image={width:e,height:t},this.type=void 0!==i?i:n.UnsignedShortType,this.magFilter=void 0!==s?s:n.NearestFilter,this.minFilter=void 0!==c?c:n.NearestFilter,this.flipY=!1,this.generateMipmaps=!1},n.DepthTexture.prototype=Object.create(n.Texture.prototype),n.DepthTexture.prototype.constructor=n.DepthTexture,n.CanvasTexture=function(e,t,i,r,o,a,s,c,u){n.Texture.call(this,e,t,i,r,o,a,s,c,u),this.needsUpdate=!0},n.CanvasTexture.prototype=Object.create(n.Texture.prototype),n.CanvasTexture.prototype.constructor=n.CanvasTexture,n.CubeTexture=function(e,t,i,r,o,a,s,c,u,l){e=void 0!==e?e:[],t=void 0!==t?t:n.CubeReflectionMapping,n.Texture.call(this,e,t,i,r,o,a,s,c,u,l),this.flipY=!1},n.CubeTexture.prototype=Object.create(n.Texture.prototype),n.CubeTexture.prototype.constructor=n.CubeTexture,Object.defineProperty(n.CubeTexture.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),n.CompressedTexture=function(e,t,i,r,o,a,s,c,u,l,h,d){n.Texture.call(this,null,a,s,c,u,l,r,o,h,d),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1},n.CompressedTexture.prototype=Object.create(n.Texture.prototype),n.CompressedTexture.prototype.constructor=n.CompressedTexture,n.DataTexture=function(e,t,i,r,o,a,s,c,u,l,h,d){n.Texture.call(this,null,a,s,c,u,l,r,o,h,d),this.image={data:e,width:t,height:i},this.magFilter=void 0!==u?u:n.NearestFilter,this.minFilter=void 0!==l?l:n.NearestFilter,this.flipY=!1,this.generateMipmaps=!1},n.DataTexture.prototype=Object.create(n.Texture.prototype),n.DataTexture.prototype.constructor=n.DataTexture,n.VideoTexture=function(e,t,i,r,o,a,s,c,u){function l(){requestAnimationFrame(l),e.readyState>=e.HAVE_CURRENT_DATA&&(h.needsUpdate=!0)}n.Texture.call(this,e,t,i,r,o,a,s,c,u),this.generateMipmaps=!1;var h=this;l()},n.VideoTexture.prototype=Object.create(n.Texture.prototype),n.VideoTexture.prototype.constructor=n.VideoTexture,n.Group=function(){n.Object3D.call(this),this.type="Group"},n.Group.prototype=Object.create(n.Object3D.prototype),n.Group.prototype.constructor=n.Group,n.Points=function(e,t){n.Object3D.call(this),this.type="Points",this.geometry=void 0!==e?e:new n.Geometry,this.material=void 0!==t?t:new n.PointsMaterial({color:16777215*Math.random()})},n.Points.prototype=Object.create(n.Object3D.prototype),n.Points.prototype.constructor=n.Points,n.Points.prototype.raycast=function(){var e=new n.Matrix4,t=new n.Ray,i=new n.Sphere;return function(r,o){function a(e,i){var n=t.distanceSqToPoint(e);if(d>n){var a=t.closestPointToPoint(e);a.applyMatrix4(u);var c=r.ray.origin.distanceTo(a);if(c<r.near||c>r.far)return;o.push({distance:c,distanceToRay:Math.sqrt(n),point:a.clone(),index:i,face:null,object:s})}}var s=this,c=this.geometry,u=this.matrixWorld,l=r.params.Points.threshold;if(null===c.boundingSphere&&c.computeBoundingSphere(),i.copy(c.boundingSphere),i.applyMatrix4(u),r.ray.intersectsSphere(i)!==!1){e.getInverse(u),t.copy(r.ray).applyMatrix4(e);var h=l/((this.scale.x+this.scale.y+this.scale.z)/3),d=h*h,p=new n.Vector3;if(c instanceof n.BufferGeometry){var f=c.index,m=c.attributes,g=m.position.array;if(null!==f)for(var v=f.array,y=0,M=v.length;M>y;y++){var A=v[y];p.fromArray(g,3*A),a(p,A)}else for(var y=0,x=g.length/3;x>y;y++)p.fromArray(g,3*y),a(p,y)}else for(var w=c.vertices,y=0,x=w.length;x>y;y++)a(w[y],y)}}}(),n.Points.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},n.Line=function(e,t,i){return 1===i?(console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new n.LineSegments(e,t)):(n.Object3D.call(this),this.type="Line",this.geometry=void 0!==e?e:new n.Geometry,void(this.material=void 0!==t?t:new n.LineBasicMaterial({color:16777215*Math.random()})))},n.Line.prototype=Object.create(n.Object3D.prototype),n.Line.prototype.constructor=n.Line,n.Line.prototype.raycast=function(){var e=new n.Matrix4,t=new n.Ray,i=new n.Sphere;return function(r,o){var a=r.linePrecision,s=a*a,c=this.geometry,u=this.matrixWorld;if(null===c.boundingSphere&&c.computeBoundingSphere(),i.copy(c.boundingSphere),i.applyMatrix4(u),r.ray.intersectsSphere(i)!==!1){e.getInverse(u),t.copy(r.ray).applyMatrix4(e);var l=new n.Vector3,h=new n.Vector3,d=new n.Vector3,p=new n.Vector3,f=this instanceof n.LineSegments?2:1;if(c instanceof n.BufferGeometry){var m=c.index,g=c.attributes,v=g.position.array;if(null!==m)for(var y=m.array,M=0,A=y.length-1;A>M;M+=f){var x=y[M],w=y[M+1];l.fromArray(v,3*x),h.fromArray(v,3*w);var E=t.distanceSqToSegment(l,h,p,d);if(!(E>s)){p.applyMatrix4(this.matrixWorld);var b=r.ray.origin.distanceTo(p);b<r.near||b>r.far||o.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else for(var M=0,A=v.length/3-1;A>M;M+=f){l.fromArray(v,3*M),h.fromArray(v,3*M+3);var E=t.distanceSqToSegment(l,h,p,d);if(!(E>s)){p.applyMatrix4(this.matrixWorld);var b=r.ray.origin.distanceTo(p);b<r.near||b>r.far||o.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}else if(c instanceof n.Geometry)for(var T=c.vertices,L=T.length,M=0;L-1>M;M+=f){var E=t.distanceSqToSegment(T[M],T[M+1],p,d);if(!(E>s)){p.applyMatrix4(this.matrixWorld);var b=r.ray.origin.distanceTo(p);b<r.near||b>r.far||o.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}}}(),n.Line.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},n.LineStrip=0,n.LinePieces=1,n.LineSegments=function(e,t){n.Line.call(this,e,t),this.type="LineSegments"},n.LineSegments.prototype=Object.create(n.Line.prototype),n.LineSegments.prototype.constructor=n.LineSegments,n.Mesh=function(e,t){n.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new n.Geometry,this.material=void 0!==t?t:new n.MeshBasicMaterial({color:16777215*Math.random()}),this.drawMode=n.TrianglesDrawMode,this.updateMorphTargets()},n.Mesh.prototype=Object.create(n.Object3D.prototype),n.Mesh.prototype.constructor=n.Mesh,n.Mesh.prototype.setDrawMode=function(e){this.drawMode=e},n.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,t=this.geometry.morphTargets.length;t>e;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=e}},n.Mesh.prototype.getMorphTargetIndexByName=function(e){return void 0!==this.morphTargetDictionary[e]?this.morphTargetDictionary[e]:(console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+e+" does not exist. Returning 0."),0)},n.Mesh.prototype.raycast=function(){function e(e,t,i,r,o,a,s){return n.Triangle.barycoordFromPoint(e,t,i,r,g),o.multiplyScalar(g.x),a.multiplyScalar(g.y),s.multiplyScalar(g.z),o.add(a).add(s),o.clone()}function t(e,t,i,r,o,a,s){var c,u=e.material;if(c=u.side===n.BackSide?i.intersectTriangle(a,o,r,!0,s):i.intersectTriangle(r,o,a,u.side!==n.DoubleSide,s),null===c)return null;y.copy(s),y.applyMatrix4(e.matrixWorld);var l=t.ray.origin.distanceTo(y);return l<t.near||l>t.far?null:{distance:l,point:y.clone(),object:e}}function i(i,r,o,a,l,h,d,g){s.fromArray(a,3*h),c.fromArray(a,3*d),u.fromArray(a,3*g);var y=t(i,r,o,s,c,u,v);return y&&(l&&(p.fromArray(l,2*h),f.fromArray(l,2*d),m.fromArray(l,2*g),y.uv=e(v,s,c,u,p,f,m)),y.face=new n.Face3(h,d,g,n.Triangle.normal(s,c,u)),y.faceIndex=h),y}var r=new n.Matrix4,o=new n.Ray,a=new n.Sphere,s=new n.Vector3,c=new n.Vector3,u=new n.Vector3,l=new n.Vector3,h=new n.Vector3,d=new n.Vector3,p=new n.Vector2,f=new n.Vector2,m=new n.Vector2,g=new n.Vector3,v=new n.Vector3,y=new n.Vector3;return function(g,y){var M=this.geometry,A=this.material,x=this.matrixWorld;if(void 0!==A&&(null===M.boundingSphere&&M.computeBoundingSphere(),a.copy(M.boundingSphere),a.applyMatrix4(x),g.ray.intersectsSphere(a)!==!1&&(r.getInverse(x),o.copy(g.ray).applyMatrix4(r),null===M.boundingBox||o.intersectsBox(M.boundingBox)!==!1))){var w,E;if(M instanceof n.BufferGeometry){var b,T,L,D=M.index,N=M.attributes,S=N.position.array;if(void 0!==N.uv&&(w=N.uv.array),null!==D)for(var C=D.array,I=0,j=C.length;j>I;I+=3)b=C[I],T=C[I+1],L=C[I+2],E=i(this,g,o,S,w,b,T,L),E&&(E.faceIndex=Math.floor(I/3),y.push(E));else for(var I=0,j=S.length;j>I;I+=9)b=I/3,T=b+1,L=b+2,E=i(this,g,o,S,w,b,T,L),E&&(E.index=b,y.push(E))}else if(M instanceof n.Geometry){var _,O,z,k=A instanceof n.MultiMaterial,R=k===!0?A.materials:null,B=M.vertices,U=M.faces,P=M.faceVertexUvs[0];P.length>0&&(w=P);for(var F=0,G=U.length;G>F;F++){var V=U[F],Q=k===!0?R[V.materialIndex]:A;if(void 0!==Q){if(_=B[V.a],O=B[V.b],z=B[V.c],Q.morphTargets===!0){var Y=M.morphTargets,H=this.morphTargetInfluences;s.set(0,0,0),c.set(0,0,0),u.set(0,0,0);for(var W=0,X=Y.length;X>W;W++){var q=H[W];if(0!==q){var Z=Y[W].vertices;s.addScaledVector(l.subVectors(Z[V.a],_),q),c.addScaledVector(h.subVectors(Z[V.b],O),q),u.addScaledVector(d.subVectors(Z[V.c],z),q)}}s.add(_),c.add(O),u.add(z),_=s,O=c,z=u}if(E=t(this,g,o,_,O,z,v)){if(w){var K=w[F];p.copy(K[0]),f.copy(K[1]),m.copy(K[2]),E.uv=e(v,_,O,z,p,f,m)}E.face=V,E.faceIndex=F,y.push(E)}}}}}}}(),n.Mesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},n.Bone=function(e){n.Object3D.call(this),this.type="Bone",this.skin=e},n.Bone.prototype=Object.create(n.Object3D.prototype),n.Bone.prototype.constructor=n.Bone,n.Bone.prototype.copy=function(e){return n.Object3D.prototype.copy.call(this,e),this.skin=e.skin,this},n.Skeleton=function(e,t,i){if(this.useVertexTexture=void 0!==i?i:!0,this.identityMatrix=new n.Matrix4,e=e||[],this.bones=e.slice(0),this.useVertexTexture){var r=Math.sqrt(4*this.bones.length);r=n.Math.nextPowerOfTwo(Math.ceil(r)),r=Math.max(r,4),this.boneTextureWidth=r,this.boneTextureHeight=r,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var o=0,a=this.bones.length;a>o;o++)this.boneInverses.push(new n.Matrix4)}},n.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var e=0,t=this.bones.length;t>e;e++){var i=new n.Matrix4;this.bones[e]&&i.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(i)}},n.Skeleton.prototype.pose=function(){for(var e,t=0,i=this.bones.length;i>t;t++)e=this.bones[t],e&&e.matrixWorld.getInverse(this.boneInverses[t]);for(var t=0,i=this.bones.length;i>t;t++)e=this.bones[t],e&&(e.parent?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},n.Skeleton.prototype.update=function(){var e=new n.Matrix4;return function(){for(var t=0,i=this.bones.length;i>t;t++){var r=this.bones[t]?this.bones[t].matrixWorld:this.identityMatrix;e.multiplyMatrices(r,this.boneInverses[t]),e.toArray(this.boneMatrices,16*t)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),n.Skeleton.prototype.clone=function(){return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)},n.SkinnedMesh=function(e,t,i){n.Mesh.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new n.Matrix4,this.bindMatrixInverse=new n.Matrix4;var r=[];if(this.geometry&&void 0!==this.geometry.bones){for(var o,a,s=0,c=this.geometry.bones.length;c>s;++s)a=this.geometry.bones[s],o=new n.Bone(this),r.push(o),o.name=a.name,o.position.fromArray(a.pos),o.quaternion.fromArray(a.rotq),void 0!==a.scl&&o.scale.fromArray(a.scl);for(var s=0,c=this.geometry.bones.length;c>s;++s)a=this.geometry.bones[s],-1!==a.parent&&null!==a.parent&&void 0!==r[a.parent]?r[a.parent].add(r[s]):this.add(r[s])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new n.Skeleton(r,void 0,i),this.matrixWorld)},n.SkinnedMesh.prototype=Object.create(n.Mesh.prototype),n.SkinnedMesh.prototype.constructor=n.SkinnedMesh,n.SkinnedMesh.prototype.bind=function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},n.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},n.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof n.Geometry)for(var e=0;e<this.geometry.skinWeights.length;e++){var t=this.geometry.skinWeights[e],i=1/t.lengthManhattan();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0)}else if(this.geometry instanceof n.BufferGeometry)for(var r=new n.Vector4,o=this.geometry.attributes.skinWeight,e=0;e<o.count;e++){r.x=o.getX(e),r.y=o.getY(e),r.z=o.getZ(e),r.w=o.getW(e);var i=1/r.lengthManhattan();i!==1/0?r.multiplyScalar(i):r.set(1,0,0,0),o.setXYZW(e,r.x,r.y,r.z,r.w)}},n.SkinnedMesh.prototype.updateMatrixWorld=function(){n.Mesh.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)},n.SkinnedMesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)},n.LOD=function(){n.Object3D.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})},n.LOD.prototype=Object.create(n.Object3D.prototype),n.LOD.prototype.constructor=n.LOD,n.LOD.prototype.addLevel=function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var i=this.levels,r=0;r<i.length&&!(t<i[r].distance);r++);i.splice(r,0,{distance:t,object:e}),this.add(e)},n.LOD.prototype.getObjectForDistance=function(e){for(var t=this.levels,i=1,r=t.length;r>i&&!(e<t[i].distance);i++);return t[i-1].object},n.LOD.prototype.raycast=function(){var e=new n.Vector3;return function(t,i){e.setFromMatrixPosition(this.matrixWorld);var r=t.ray.origin.distanceTo(e);this.getObjectForDistance(r).raycast(t,i)}}(),n.LOD.prototype.update=function(){var e=new n.Vector3,t=new n.Vector3;return function(i){var r=this.levels;if(r.length>1){e.setFromMatrixPosition(i.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var n=e.distanceTo(t);r[0].object.visible=!0;for(var o=1,a=r.length;a>o&&n>=r[o].distance;o++)r[o-1].object.visible=!1,r[o].object.visible=!0;for(;a>o;o++)r[o].object.visible=!1}}}(),n.LOD.prototype.copy=function(e){n.Object3D.prototype.copy.call(this,e,!1);for(var t=e.levels,i=0,r=t.length;r>i;i++){var o=t[i];this.addLevel(o.object.clone(),o.distance)}return this},n.LOD.prototype.toJSON=function(e){var t=n.Object3D.prototype.toJSON.call(this,e);t.object.levels=[];for(var i=this.levels,r=0,o=i.length;o>r;r++){var a=i[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t},n.Sprite=function(){var e=new Uint16Array([0,1,2,0,2,3]),t=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),i=new Float32Array([0,0,1,0,1,1,0,1]),r=new n.BufferGeometry;return r.setIndex(new n.BufferAttribute(e,1)),r.addAttribute("position",new n.BufferAttribute(t,3)),r.addAttribute("uv",new n.BufferAttribute(i,2)),function(e){n.Object3D.call(this),this.type="Sprite",this.geometry=r,this.material=void 0!==e?e:new n.SpriteMaterial}}(),n.Sprite.prototype=Object.create(n.Object3D.prototype),n.Sprite.prototype.constructor=n.Sprite,n.Sprite.prototype.raycast=function(){var e=new n.Vector3;return function(t,i){e.setFromMatrixPosition(this.matrixWorld);var r=t.ray.distanceSqToPoint(e),n=this.scale.x*this.scale.y/4;r>n||i.push({distance:Math.sqrt(r),point:this.position,face:null,object:this})}}(),n.Sprite.prototype.clone=function(){return new this.constructor(this.material).copy(this)},n.Particle=n.Sprite,n.LensFlare=function(e,t,i,r,o){n.Object3D.call(this),this.lensFlares=[],this.positionScreen=new n.Vector3,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,i,r,o)},n.LensFlare.prototype=Object.create(n.Object3D.prototype),n.LensFlare.prototype.constructor=n.LensFlare,n.LensFlare.prototype.add=function(e,t,i,r,o,a){void 0===t&&(t=-1),void 0===i&&(i=0),void 0===a&&(a=1),void 0===o&&(o=new n.Color(16777215)),void 0===r&&(r=n.NormalBlending),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:e,size:t,distance:i,x:0,y:0,z:0,scale:1,rotation:0,opacity:a,color:o,blending:r})},n.LensFlare.prototype.updateLensFlares=function(){var e,t,i=this.lensFlares.length,r=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(e=0;i>e;e++)t=this.lensFlares[e],t.x=this.positionScreen.x+r*t.distance,t.y=this.positionScreen.y+n*t.distance,t.wantedRotation=t.x*Math.PI*.25,t.rotation+=.25*(t.wantedRotation-t.rotation)},n.LensFlare.prototype.copy=function(e){n.Object3D.prototype.copy.call(this,e),this.positionScreen.copy(e.positionScreen),this.customUpdateCallback=e.customUpdateCallback;for(var t=0,i=e.lensFlares.length;i>t;t++)this.lensFlares.push(e.lensFlares[t]);return this},n.Scene=function(){n.Object3D.call(this),this.type="Scene",this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0},n.Scene.prototype=Object.create(n.Object3D.prototype),n.Scene.prototype.constructor=n.Scene,n.Scene.prototype.copy=function(e,t){return n.Object3D.prototype.copy.call(this,e,t),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},n.Fog=function(e,t,i){this.name="",this.color=new n.Color(e),this.near=void 0!==t?t:1,this.far=void 0!==i?i:1e3},n.Fog.prototype.clone=function(){return new n.Fog(this.color.getHex(),this.near,this.far)},n.FogExp2=function(e,t){this.name="",this.color=new n.Color(e),this.density=void 0!==t?t:25e-5},n.FogExp2.prototype.clone=function(){return new n.FogExp2(this.color.getHex(),this.density)},n.ShaderChunk={},n.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",n.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n uniform sampler2D alphaMap;\n#endif\n",n.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n if ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",n.ShaderChunk.aomap_fragment="#ifdef USE_AOMAP\n float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_ENVMAP ) && defined( PHYSICAL )\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n #endif\n#endif\n",n.ShaderChunk.aomap_pars_fragment="#ifdef USE_AOMAP\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n#endif",n.ShaderChunk.begin_vertex="\nvec3 transformed = vec3( position );\n",n.ShaderChunk.beginnormal_vertex="\nvec3 objectNormal = vec3( normal );\n",n.ShaderChunk.bsdfs="bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n return any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n if( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n float maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n return distanceFalloff * maxDistanceCutoffFactor;\n#else\n return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n }\n return 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n return RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n float fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n return ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n float gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n return 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n float a2 = pow2( alpha );\n float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n return 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n float a2 = pow2( alpha );\n float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n return RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n float alpha = pow2( roughness );\n vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n float dotNH = saturate( dot( geometry.normal, halfDir ) );\n float dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n vec3 F = F_Schlick( specularColor, dotLH );\n float G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n float D = D_GGX( alpha, dotNH );\n return F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n vec4 r = roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n return specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n return 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n vec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n float dotNH = saturate( dot( geometry.normal, halfDir ) );\n float dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n vec3 F = F_Schlick( specularColor, dotLH );\n float G = G_BlinnPhong_Implicit( );\n float D = D_BlinnPhong( shininess, dotNH );\n return F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n return ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n return sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n", n.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n vec2 dHdxy_fwd() {\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n return vec2( dBx, dBy );\n }\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n vec3 vSigmaX = dFdx( surf_pos );\n vec3 vSigmaY = dFdy( surf_pos );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n float fDet = dot( vSigmaX, R1 );\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n }\n#endif\n",n.ShaderChunk.clipping_planes_fragment="#if NUM_CLIPPING_PLANES > 0\n for ( int i = 0; i < NUM_CLIPPING_PLANES; ++ i ) {\n vec4 plane = clippingPlanes[ i ];\n if ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n }\n#endif\n",n.ShaderChunk.clipping_planes_pars_fragment="#if NUM_CLIPPING_PLANES > 0\n #if ! defined( PHYSICAL ) && ! defined( PHONG )\n varying vec3 vViewPosition;\n #endif\n uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",n.ShaderChunk.clipping_planes_pars_vertex="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n varying vec3 vViewPosition;\n#endif\n",n.ShaderChunk.clipping_planes_vertex="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n vViewPosition = - mvPosition.xyz;\n#endif\n",n.ShaderChunk.color_fragment="#ifdef USE_COLOR\n diffuseColor.rgb *= vColor;\n#endif",n.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n varying vec3 vColor;\n#endif\n",n.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n varying vec3 vColor;\n#endif",n.ShaderChunk.color_vertex="#ifdef USE_COLOR\n vColor.xyz = color.xyz;\n#endif",n.ShaderChunk.common="#define PI 3.14159265359\n#define PI2 6.28318530718\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n return fract(sin(sn) * c);\n}\nstruct IncidentLight {\n vec3 color;\n vec3 direction;\n bool visible;\n};\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\nstruct GeometricContext {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n float distance = dot( planeNormal, point - pointOnPlane );\n return - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",n.ShaderChunk.cube_uv_reflection_fragment="#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nfloat cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nfloat cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nfloat cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nfloat cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",n.ShaderChunk.defaultnormal_vertex="#ifdef FLIP_SIDED\n objectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",n.ShaderChunk.displacementmap_vertex="#ifdef USE_DISPLACEMENTMAP\n transformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",n.ShaderChunk.displacementmap_pars_vertex="#ifdef USE_DISPLACEMENTMAP\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n#endif\n",n.ShaderChunk.emissivemap_fragment="#ifdef USE_EMISSIVEMAP\n vec4 emissiveColor = texture2D( emissiveMap, vUv );\n emissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n totalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",n.ShaderChunk.emissivemap_pars_fragment="#ifdef USE_EMISSIVEMAP\n uniform sampler2D emissiveMap;\n#endif\n",n.ShaderChunk.encodings_pars_fragment="\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",n.ShaderChunk.encodings_fragment=" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",n.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( cameraToVertex, worldNormal );\n #else\n vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #else\n vec3 reflectVec = vReflect;\n #endif\n #ifdef DOUBLE_SIDED\n float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #else\n float flipNormal = 1.0;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV;\n sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n vec4 envColor = texture2D( envMap, sampleUV );\n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n #endif\n envColor = envMapTexelToLinear( envColor );\n #ifdef ENVMAP_BLENDING_MULTIPLY\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_MIX )\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n #elif defined( ENVMAP_BLENDING_ADD )\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n #endif\n#endif\n",n.ShaderChunk.envmap_pars_fragment="#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n uniform float reflectivity;\n uniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n #if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n varying vec3 vWorldPosition;\n #endif\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n uniform float flipEnvMap;\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n uniform float refractionRatio;\n #else\n varying vec3 vReflect;\n #endif\n#endif\n",n.ShaderChunk.envmap_pars_vertex="#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n varying vec3 vWorldPosition;\n #else\n varying vec3 vReflect;\n uniform float refractionRatio;\n #endif\n#endif\n",n.ShaderChunk.envmap_vertex="#ifdef USE_ENVMAP\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n vWorldPosition = worldPosition.xyz;\n #else\n vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n #ifdef ENVMAP_MODE_REFLECTION\n vReflect = reflect( cameraToVertex, worldNormal );\n #else\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n #endif\n #endif\n#endif\n",n.ShaderChunk.fog_fragment="#ifdef USE_FOG\n #ifdef USE_LOGDEPTHBUF_EXT\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n #else\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n #endif\n #ifdef FOG_EXP2\n float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n #else\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n #endif\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",n.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n uniform vec3 fogColor;\n #ifdef FOG_EXP2\n uniform float fogDensity;\n #else\n uniform float fogNear;\n uniform float fogFar;\n #endif\n#endif",n.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n reflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",n.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n#endif",n.ShaderChunk.lights_lambert_vertex="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n vLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n getPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n getSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n#endif\n#if NUM_DIR_LIGHTS > 0\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n dotNL = dot( geometry.normal, directLight.direction );\n directLightColor_Diffuse = PI * directLight.color;\n vLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n #ifdef DOUBLE_SIDED\n vLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n #endif\n }\n#endif\n#if NUM_HEMI_LIGHTS > 0\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n vLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n #ifdef DOUBLE_SIDED\n vLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n #endif\n }\n#endif\n",n.ShaderChunk.lights_pars="uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n vec3 irradiance = ambientLightColor;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n return irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n struct DirectionalLight {\n vec3 direction;\n vec3 color;\n int shadow;\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n directLight.color = directionalLight.color;\n directLight.direction = directionalLight.direction;\n directLight.visible = true;\n }\n#endif\n#if NUM_POINT_LIGHTS > 0\n struct PointLight {\n vec3 position;\n vec3 color;\n float distance;\n float decay;\n int shadow;\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = pointLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n if ( testLightInRange( lightDistance, pointLight.distance ) ) {\n directLight.color = pointLight.color;\n directLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n directLight.visible = true;\n } else {\n directLight.color = vec3( 0.0 );\n directLight.visible = false;\n }\n }\n#endif\n#if NUM_SPOT_LIGHTS > 0\n struct SpotLight {\n vec3 position;\n vec3 direction;\n vec3 color;\n float distance;\n float decay;\n float coneCos;\n float penumbraCos;\n int shadow;\n float shadowBias;\n float shadowRadius;\n vec2 shadowMapSize;\n };\n uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n vec3 lVector = spotLight.position - geometry.position;\n directLight.direction = normalize( lVector );\n float lightDistance = length( lVector );\n float angleCos = dot( directLight.direction, spotLight.direction );\n if ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n float spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n directLight.color = spotLight.color;\n directLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n directLight.visible = true;\n } else {\n directLight.color = vec3( 0.0 );\n directLight.visible = false;\n }\n }\n#endif\n#if NUM_HEMI_LIGHTS > 0\n struct HemisphereLight {\n vec3 direction;\n vec3 skyColor;\n vec3 groundColor;\n };\n uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n float dotNL = dot( geometry.normal, hemiLight.direction );\n float hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n return irradiance;\n }\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n vec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n #ifdef DOUBLE_SIDED\n float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #else\n float flipNormal = 1.0;\n #endif\n vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n #ifdef ENVMAP_TYPE_CUBE\n vec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n #else\n vec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n vec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n #else\n vec4 envMapColor = vec4( 0.0 );\n #endif\n return PI * envMapColor.rgb * envMapIntensity;\n }\n float getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n float maxMIPLevelScalar = float( maxMIPLevel );\n float desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n }\n vec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n #ifdef ENVMAP_MODE_REFLECTION\n vec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n #else\n vec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n #endif\n #ifdef DOUBLE_SIDED\n float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #else\n float flipNormal = 1.0;\n #endif\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n float specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n #ifdef ENVMAP_TYPE_CUBE\n vec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n #else\n vec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_CUBE_UV )\n vec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n vec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV;\n sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n #else\n vec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n #ifdef TEXTURE_LOD_EXT\n vec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n #else\n vec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n #endif\n envMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n #endif\n return envMapColor.rgb * envMapIntensity;\n }\n#endif\n",n.ShaderChunk.lights_phong_fragment="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",n.ShaderChunk.lights_phong_pars_fragment="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n vec3 diffuseColor;\n vec3 specularColor;\n float specularShininess;\n float specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct RE_Direct_BlinnPhong\n#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material ) (0)\n",n.ShaderChunk.lights_physical_fragment="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n#else\n material.specularColor = mix( vec3( 0.16 * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#endif\n",n.ShaderChunk.lights_physical_pars_fragment="struct PhysicalMaterial {\n vec3 diffuseColor;\n float specularRoughness;\n vec3 specularColor;\n #ifndef STANDARD\n #endif\n};\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n reflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",n.ShaderChunk.lights_template="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n PointLight pointLight;\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n getPointDirectLightIrradiance( pointLight, geometry, directLight );\n #ifdef USE_SHADOWMAP\n directLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n SpotLight spotLight;\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n getSpotDirectLightIrradiance( spotLight, geometry, directLight );\n #ifdef USE_SHADOWMAP\n directLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n DirectionalLight directionalLight;\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n getDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n #ifdef USE_SHADOWMAP\n directLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n RE_Direct( directLight, geometry, material, reflectedLight );\n }\n#endif\n#if defined( RE_IndirectDiffuse )\n vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n #ifdef USE_LIGHTMAP\n vec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n lightMapIrradiance *= PI;\n #endif\n irradiance += lightMapIrradiance;\n #endif\n #if ( NUM_HEMI_LIGHTS > 0 )\n for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n }\n #endif\n #if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n irradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n #endif\n RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n vec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n RE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",n.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif", n.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n uniform float logDepthBufFC;\n #ifdef USE_LOGDEPTHBUF_EXT\n varying float vFragDepth;\n #endif\n#endif\n",n.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n #ifdef USE_LOGDEPTHBUF_EXT\n varying float vFragDepth;\n #endif\n uniform float logDepthBufFC;\n#endif",n.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n #ifdef USE_LOGDEPTHBUF_EXT\n vFragDepth = 1.0 + gl_Position.w;\n #else\n gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n #endif\n#endif\n",n.ShaderChunk.map_fragment="#ifdef USE_MAP\n vec4 texelColor = texture2D( map, vUv );\n texelColor = mapTexelToLinear( texelColor );\n diffuseColor *= texelColor;\n#endif\n",n.ShaderChunk.map_pars_fragment="#ifdef USE_MAP\n uniform sampler2D map;\n#endif\n",n.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n vec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n diffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",n.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n uniform vec4 offsetRepeat;\n uniform sampler2D map;\n#endif\n",n.ShaderChunk.metalnessmap_fragment="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n vec4 texelMetalness = texture2D( metalnessMap, vUv );\n metalnessFactor *= texelMetalness.r;\n#endif\n",n.ShaderChunk.metalnessmap_pars_fragment="#ifdef USE_METALNESSMAP\n uniform sampler2D metalnessMap;\n#endif",n.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",n.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n #ifndef USE_MORPHNORMALS\n uniform float morphTargetInfluences[ 8 ];\n #else\n uniform float morphTargetInfluences[ 4 ];\n #endif\n#endif",n.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n transformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n transformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n transformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n transformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n #ifndef USE_MORPHNORMALS\n transformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n transformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n transformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n transformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n #endif\n#endif\n",n.ShaderChunk.normal_fragment="#ifdef FLAT_SHADED\n vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n vec3 normal = normalize( cross( fdx, fdy ) );\n#else\n vec3 normal = normalize( vNormal );\n #ifdef DOUBLE_SIDED\n normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n #endif\n#endif\n#ifdef USE_NORMALMAP\n normal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",n.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n vec3 S = normalize( q0 * st1.t - q1 * st0.t );\n vec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n vec3 N = normalize( surf_norm );\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy = normalScale * mapN.xy;\n mat3 tsn = mat3( S, T, N );\n return normalize( tsn * mapN );\n }\n#endif\n",n.ShaderChunk.packing="vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 1.0 - 2.0 * rgb.xyz;\n}\nvec4 packDepthToRGBA( const in float value ) {\n const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n vec4 res = mod( value * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n res -= res.xxyz * bit_mask;\n return res;\n}\nfloat unpackRGBAToDepth( const in vec4 rgba ) {\n const vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n return dot( rgba, bitSh );\n}\nfloat viewZToOrthoDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat OrthoDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",n.ShaderChunk.premultiplied_alpha_fragment="#ifdef PREMULTIPLIED_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",n.ShaderChunk.project_vertex="#ifdef USE_SKINNING\n vec4 mvPosition = modelViewMatrix * skinned;\n#else\n vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",n.ShaderChunk.roughnessmap_fragment="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n vec4 texelRoughness = texture2D( roughnessMap, vUv );\n roughnessFactor *= texelRoughness.r;\n#endif\n",n.ShaderChunk.roughnessmap_pars_fragment="#ifdef USE_ROUGHNESSMAP\n uniform sampler2D roughnessMap;\n#endif",n.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n #endif\n #if NUM_SPOT_LIGHTS > 0\n uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n #endif\n #if NUM_POINT_LIGHTS > 0\n uniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n #endif\n float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n }\n float texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n const vec2 offset = vec2( 0.0, 1.0 );\n vec2 texelSize = vec2( 1.0 ) / size;\n vec2 centroidUV = floor( uv * size + 0.5 ) / size;\n float lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n float lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n float rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n float rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n vec2 f = fract( uv * size + 0.5 );\n float a = mix( lb, lt, f.y );\n float b = mix( rb, rt, f.y );\n float c = mix( a, b, f.x );\n return c;\n }\n float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n bool frustumTest = all( frustumTestVec );\n if ( frustumTest ) {\n #if defined( SHADOWMAP_TYPE_PCF )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n return (\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 9.0 );\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n float dx0 = - texelSize.x * shadowRadius;\n float dy0 = - texelSize.y * shadowRadius;\n float dx1 = + texelSize.x * shadowRadius;\n float dy1 = + texelSize.y * shadowRadius;\n return (\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n texture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n ) * ( 1.0 / 9.0 );\n #else\n return texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n #endif\n }\n return 1.0;\n }\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n vec3 absV = abs( v );\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n vec2 planar = v.xy;\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n if ( absV.z >= almostOne ) {\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n } else if ( absV.x >= almostOne ) {\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n } else if ( absV.y >= almostOne ) {\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n }\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n }\n float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n vec3 lightToPosition = shadowCoord.xyz;\n vec3 bd3D = normalize( lightToPosition );\n float dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n return (\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n ) * ( 1.0 / 9.0 );\n #else\n return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n #endif\n }\n#endif\n",n.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n #endif\n #if NUM_SPOT_LIGHTS > 0\n uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n #endif\n #if NUM_POINT_LIGHTS > 0\n uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n varying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n #endif\n#endif\n",n.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n }\n #endif\n #if NUM_SPOT_LIGHTS > 0\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n }\n #endif\n #if NUM_POINT_LIGHTS > 0\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n }\n #endif\n#endif\n",n.ShaderChunk.shadowmask_pars_fragment="float getShadowMask() {\n float shadow = 1.0;\n #ifdef USE_SHADOWMAP\n #if NUM_DIR_LIGHTS > 0\n DirectionalLight directionalLight;\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n directionalLight = directionalLights[ i ];\n shadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n }\n #endif\n #if NUM_SPOT_LIGHTS > 0\n SpotLight spotLight;\n for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n spotLight = spotLights[ i ];\n shadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n }\n #endif\n #if NUM_POINT_LIGHTS > 0\n PointLight pointLight;\n for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n pointLight = pointLights[ i ];\n shadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n }\n #endif\n #endif\n return shadow;\n}\n",n.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",n.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n #ifdef BONE_TEXTURE\n uniform sampler2D boneTexture;\n uniform int boneTextureWidth;\n uniform int boneTextureHeight;\n mat4 getBoneMatrix( const in float i ) {\n float j = i * 4.0;\n float x = mod( j, float( boneTextureWidth ) );\n float y = floor( j / float( boneTextureWidth ) );\n float dx = 1.0 / float( boneTextureWidth );\n float dy = 1.0 / float( boneTextureHeight );\n y = dy * ( y + 0.5 );\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n mat4 bone = mat4( v1, v2, v3, v4 );\n return bone;\n }\n #else\n uniform mat4 boneMatrices[ MAX_BONES ];\n mat4 getBoneMatrix( const in float i ) {\n mat4 bone = boneMatrices[ int(i) ];\n return bone;\n }\n #endif\n#endif\n",n.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n skinned = bindMatrixInverse * skinned;\n#endif\n",n.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",n.ShaderChunk.specularmap_fragment="float specularStrength;\n#ifdef USE_SPECULARMAP\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n#else\n specularStrength = 1.0;\n#endif",n.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n uniform sampler2D specularMap;\n#endif",n.ShaderChunk.tonemapping_fragment="#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",n.ShaderChunk.tonemapping_pars_fragment="#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",n.ShaderChunk.uv2_pars_fragment="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n varying vec2 vUv2;\n#endif",n.ShaderChunk.uv2_pars_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n attribute vec2 uv2;\n varying vec2 vUv2;\n#endif",n.ShaderChunk.uv2_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n vUv2 = uv2;\n#endif",n.ShaderChunk.uv_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n varying vec2 vUv;\n#endif",n.ShaderChunk.uv_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n varying vec2 vUv;\n uniform vec4 offsetRepeat;\n#endif\n",n.ShaderChunk.uv_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",n.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n #ifdef USE_SKINNING\n vec4 worldPosition = modelMatrix * skinned;\n #else\n vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n #endif\n#endif\n",n.UniformsUtils={merge:function(e){for(var t={},i=0;i<e.length;i++){var r=this.clone(e[i]);for(var n in r)t[n]=r[n]}return t},clone:function(e){var t={};for(var i in e){t[i]={};for(var r in e[i]){var o=e[i][r];t[i][r]=o instanceof n.Color||o instanceof n.Vector2||o instanceof n.Vector3||o instanceof n.Vector4||o instanceof n.Matrix3||o instanceof n.Matrix4||o instanceof n.Texture?o.clone():Array.isArray(o)?o.slice():o}}return t}},n.UniformsLib={common:{diffuse:{type:"c",value:new n.Color(15658734)},opacity:{type:"1f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new n.Vector4(0,0,1,1)},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"1f",value:-1},reflectivity:{type:"1f",value:1},refractionRatio:{type:"1f",value:.98}},aomap:{aoMap:{type:"t",value:null},aoMapIntensity:{type:"1f",value:1}},lightmap:{lightMap:{type:"t",value:null},lightMapIntensity:{type:"1f",value:1}},emissivemap:{emissiveMap:{type:"t",value:null}},bumpmap:{bumpMap:{type:"t",value:null},bumpScale:{type:"1f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new n.Vector2(1,1)}},displacementmap:{displacementMap:{type:"t",value:null},displacementScale:{type:"1f",value:1},displacementBias:{type:"1f",value:0}},roughnessmap:{roughnessMap:{type:"t",value:null}},metalnessmap:{metalnessMap:{type:"t",value:null}},fog:{fogDensity:{type:"1f",value:25e-5},fogNear:{type:"1f",value:1},fogFar:{type:"1f",value:2e3},fogColor:{type:"c",value:new n.Color(16777215)}},lights:{ambientLightColor:{type:"3fv",value:[]},directionalLights:{type:"sa",value:[],properties:{direction:{type:"v3"},color:{type:"c"},shadow:{type:"1i"},shadowBias:{type:"1f"},shadowRadius:{type:"1f"},shadowMapSize:{type:"v2"}}},directionalShadowMap:{type:"tv",value:[]},directionalShadowMatrix:{type:"m4v",value:[]},spotLights:{type:"sa",value:[],properties:{color:{type:"c"},position:{type:"v3"},direction:{type:"v3"},distance:{type:"1f"},coneCos:{type:"1f"},penumbraCos:{type:"1f"},decay:{type:"1f"},shadow:{type:"1i"},shadowBias:{type:"1f"},shadowRadius:{type:"1f"},shadowMapSize:{type:"v2"}}},spotShadowMap:{type:"tv",value:[]},spotShadowMatrix:{type:"m4v",value:[]},pointLights:{type:"sa",value:[],properties:{color:{type:"c"},position:{type:"v3"},decay:{type:"1f"},distance:{type:"1f"},shadow:{type:"1i"},shadowBias:{type:"1f"},shadowRadius:{type:"1f"},shadowMapSize:{type:"v2"}}},pointShadowMap:{type:"tv",value:[]},pointShadowMatrix:{type:"m4v",value:[]},hemisphereLights:{type:"sa",value:[],properties:{direction:{type:"v3"},skyColor:{type:"c"},groundColor:{type:"c"}}}},points:{diffuse:{type:"c",value:new n.Color(15658734)},opacity:{type:"1f",value:1},size:{type:"1f",value:1},scale:{type:"1f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new n.Vector4(0,0,1,1)}}},n.ShaderChunk.cube_frag="uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n #include <logdepthbuf_fragment>\n}\n",n.ShaderChunk.cube_vert="varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vWorldPosition = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n}\n",n.ShaderChunk.depth_frag="#if DEPTH_PACKING == 3200\n uniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( 1.0 );\n #if DEPTH_PACKING == 3200\n diffuseColor.a = opacity;\n #endif\n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <logdepthbuf_fragment>\n #if DEPTH_PACKING == 3200\n gl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n #elif DEPTH_PACKING == 3201\n gl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n #endif\n}\n",n.ShaderChunk.depth_vert="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <skinbase_vertex>\n #include <begin_vertex>\n #include <displacementmap_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n}\n",n.ShaderChunk.distanceRGBA_frag="uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n #include <clipping_planes_fragment>\n gl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",n.ShaderChunk.distanceRGBA_vert="varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <skinbase_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n vWorldPosition = worldPosition;\n}\n",n.ShaderChunk.equirect_frag="uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec3 direction = normalize( vWorldPosition );\n vec2 sampleUV;\n sampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n gl_FragColor = texture2D( tEquirect, sampleUV );\n #include <logdepthbuf_fragment>\n}\n",n.ShaderChunk.equirect_vert="varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vWorldPosition = transformDirection( position, modelMatrix );\n #include <begin_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n}\n",n.ShaderChunk.linedashed_frag="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n if ( mod( vLineDistance, totalSize ) > dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <color_fragment>\n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.linedashed_vert="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <color_vertex>\n vLineDistance = scale * lineDistance;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n}\n",n.ShaderChunk.meshbasic_frag="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n ReflectedLight reflectedLight;\n reflectedLight.directDiffuse = vec3( 0.0 );\n reflectedLight.directSpecular = vec3( 0.0 );\n reflectedLight.indirectDiffuse = diffuseColor.rgb;\n reflectedLight.indirectSpecular = vec3( 0.0 );\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.indirectDiffuse;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.meshbasic_vert="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <skinbase_vertex>\n #ifdef USE_ENVMAP\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #endif\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n #include <envmap_vertex>\n}\n",n.ShaderChunk.meshlambert_frag="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <emissivemap_fragment>\n reflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n #include <lightmap_fragment>\n reflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n #ifdef DOUBLE_SIDED\n reflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n #else\n reflectedLight.directDiffuse = vLightFront;\n #endif\n reflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.meshlambert_vert="#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n varying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <lights_lambert_vertex>\n #include <shadowmap_vertex>\n}\n", n.ShaderChunk.meshphong_frag="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment>\n #include <emissivemap_fragment>\n #include <lights_phong_fragment>\n #include <lights_template>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n #include <envmap_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.meshphong_vert="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n#endif\n #include <begin_vertex>\n #include <displacementmap_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n}\n",n.ShaderChunk.meshphysical_frag="#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec4 diffuseColor = vec4( diffuse, opacity );\n ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <roughnessmap_fragment>\n #include <metalnessmap_fragment>\n #include <normal_fragment>\n #include <emissivemap_fragment>\n #include <lights_physical_fragment>\n #include <lights_template>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.meshphysical_vert="#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n varying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <uv_vertex>\n #include <uv2_vertex>\n #include <color_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n#endif\n #include <begin_vertex>\n #include <displacementmap_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n}\n",n.ShaderChunk.normal_frag="uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <packing>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n gl_FragColor = vec4( packNormalToRGB( vNormal ), opacity );\n #include <logdepthbuf_fragment>\n}\n",n.ShaderChunk.normal_vert="varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vNormal = normalize( normalMatrix * normal );\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n}\n",n.ShaderChunk.points_frag="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n #include <clipping_planes_fragment>\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n #include <logdepthbuf_fragment>\n #include <map_particle_fragment>\n #include <color_fragment>\n #include <alphatest_fragment>\n outgoingLight = diffuseColor.rgb;\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n #include <premultiplied_alpha_fragment>\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n}\n",n.ShaderChunk.points_vert="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n #include <color_vertex>\n #include <begin_vertex>\n #include <project_vertex>\n #ifdef USE_SIZEATTENUATION\n gl_PointSize = size * ( scale / - mvPosition.z );\n #else\n gl_PointSize = size;\n #endif\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n #include <worldpos_vertex>\n #include <shadowmap_vertex>\n}\n",n.ShaderLib={basic:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.aomap,n.UniformsLib.fog]),vertexShader:n.ShaderChunk.meshbasic_vert,fragmentShader:n.ShaderChunk.meshbasic_frag},lambert:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.aomap,n.UniformsLib.lightmap,n.UniformsLib.emissivemap,n.UniformsLib.fog,n.UniformsLib.lights,{emissive:{type:"c",value:new n.Color(0)}}]),vertexShader:n.ShaderChunk.meshlambert_vert,fragmentShader:n.ShaderChunk.meshlambert_frag},phong:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.aomap,n.UniformsLib.lightmap,n.UniformsLib.emissivemap,n.UniformsLib.bumpmap,n.UniformsLib.normalmap,n.UniformsLib.displacementmap,n.UniformsLib.fog,n.UniformsLib.lights,{emissive:{type:"c",value:new n.Color(0)},specular:{type:"c",value:new n.Color(1118481)},shininess:{type:"1f",value:30}}]),vertexShader:n.ShaderChunk.meshphong_vert,fragmentShader:n.ShaderChunk.meshphong_frag},standard:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.aomap,n.UniformsLib.lightmap,n.UniformsLib.emissivemap,n.UniformsLib.bumpmap,n.UniformsLib.normalmap,n.UniformsLib.displacementmap,n.UniformsLib.roughnessmap,n.UniformsLib.metalnessmap,n.UniformsLib.fog,n.UniformsLib.lights,{emissive:{type:"c",value:new n.Color(0)},roughness:{type:"1f",value:.5},metalness:{type:"1f",value:0},envMapIntensity:{type:"1f",value:1}}]),vertexShader:n.ShaderChunk.meshphysical_vert,fragmentShader:n.ShaderChunk.meshphysical_frag},points:{uniforms:n.UniformsUtils.merge([n.UniformsLib.points,n.UniformsLib.fog]),vertexShader:n.ShaderChunk.points_vert,fragmentShader:n.ShaderChunk.points_frag},dashed:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.fog,{scale:{type:"1f",value:1},dashSize:{type:"1f",value:1},totalSize:{type:"1f",value:2}}]),vertexShader:n.ShaderChunk.linedashed_vert,fragmentShader:n.ShaderChunk.linedashed_frag},depth:{uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.displacementmap]),vertexShader:n.ShaderChunk.depth_vert,fragmentShader:n.ShaderChunk.depth_frag},normal:{uniforms:{opacity:{type:"1f",value:1}},vertexShader:n.ShaderChunk.normal_vert,fragmentShader:n.ShaderChunk.normal_frag},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"1f",value:-1}},vertexShader:n.ShaderChunk.cube_vert,fragmentShader:n.ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"1f",value:-1}},vertexShader:n.ShaderChunk.equirect_vert,fragmentShader:n.ShaderChunk.equirect_frag},distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new n.Vector3}},vertexShader:n.ShaderChunk.distanceRGBA_vert,fragmentShader:n.ShaderChunk.distanceRGBA_frag}},n.ShaderLib.physical={uniforms:n.UniformsUtils.merge([n.ShaderLib.standard.uniforms,{}]),vertexShader:n.ShaderChunk.meshphysical_vert,fragmentShader:n.ShaderChunk.meshphysical_frag},n.WebGLRenderer=function(e){function t(){return null===be?Re:1}function i(e,t,i,r){de===!0&&(e*=r,t*=r,i*=r),ut.clearColor(e,t,i,r)}function r(){ut.init(),ut.scissor(Se.copy(Be).multiplyScalar(Re)),ut.viewport(Ie.copy(Pe).multiplyScalar(Re)),i(_e.r,_e.g,_e.b,Oe)}function o(){Ee=null,Ne=null,De="",Le=-1,ut.reset()}function a(e){e.preventDefault(),o(),r(),lt.clear()}function s(e){var t=e.target;t.removeEventListener("dispose",s),l(t),tt.textures--}function c(e){var t=e.target;t.removeEventListener("dispose",c),h(t),tt.textures--}function u(e){var t=e.target;t.removeEventListener("dispose",u),d(t)}function l(e){var t=lt.get(e);if(e.image&&t.__image__webglTextureCube)rt.deleteTexture(t.__image__webglTextureCube);else{if(void 0===t.__webglInit)return;rt.deleteTexture(t.__webglTexture)}lt["delete"](e)}function h(e){var t=lt.get(e),i=lt.get(e.texture);if(e){if(void 0!==i.__webglTexture&&rt.deleteTexture(i.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e instanceof n.WebGLRenderTargetCube)for(var r=0;6>r;r++)rt.deleteFramebuffer(t.__webglFramebuffer[r]),t.__webglDepthbuffer&&rt.deleteRenderbuffer(t.__webglDepthbuffer[r]);else rt.deleteFramebuffer(t.__webglFramebuffer),t.__webglDepthbuffer&&rt.deleteRenderbuffer(t.__webglDepthbuffer);lt["delete"](e.texture),lt["delete"](e)}}function d(e){p(e),lt["delete"](e)}function p(e){var t=lt.get(e).program;e.program=void 0,void 0!==t&&dt.releaseProgram(t)}function f(e,t,i,r){var o;if(i instanceof n.InstancedBufferGeometry&&(o=st.get("ANGLE_instanced_arrays"),null===o))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===r&&(r=0),ut.initAttributes();var a=i.attributes,s=t.getAttributes(),c=e.defaultAttributeValues;for(var u in s){var l=s[u];if(l>=0){var h=a[u];if(void 0!==h){var d=rt.FLOAT,p=h.array,f=h.normalized;p instanceof Float32Array?d=rt.FLOAT:p instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):p instanceof Uint16Array?d=rt.UNSIGNED_SHORT:p instanceof Int16Array?d=rt.SHORT:p instanceof Uint32Array?d=rt.UNSIGNED_INT:p instanceof Int32Array?d=rt.INT:p instanceof Int8Array?d=rt.BYTE:p instanceof Uint8Array&&(d=rt.UNSIGNED_BYTE);var m=h.itemSize,g=ht.getAttributeBuffer(h);if(h instanceof n.InterleavedBufferAttribute){var v=h.data,y=v.stride,M=h.offset;v instanceof n.InstancedInterleavedBuffer?(ut.enableAttributeAndDivisor(l,v.meshPerAttribute,o),void 0===i.maxInstancedCount&&(i.maxInstancedCount=v.meshPerAttribute*v.count)):ut.enableAttribute(l),rt.bindBuffer(rt.ARRAY_BUFFER,g),rt.vertexAttribPointer(l,m,d,f,y*v.array.BYTES_PER_ELEMENT,(r*y+M)*v.array.BYTES_PER_ELEMENT)}else h instanceof n.InstancedBufferAttribute?(ut.enableAttributeAndDivisor(l,h.meshPerAttribute,o),void 0===i.maxInstancedCount&&(i.maxInstancedCount=h.meshPerAttribute*h.count)):ut.enableAttribute(l),rt.bindBuffer(rt.ARRAY_BUFFER,g),rt.vertexAttribPointer(l,m,d,f,0,r*m*h.array.BYTES_PER_ELEMENT)}else if(void 0!==c){var A=c[u];if(void 0!==A)switch(A.length){case 2:rt.vertexAttrib2fv(l,A);break;case 3:rt.vertexAttrib3fv(l,A);break;case 4:rt.vertexAttrib4fv(l,A);break;default:rt.vertexAttrib1fv(l,A)}}}}ut.disableUnusedAttributes()}function m(e,t){return Math.abs(t[0])-Math.abs(e[0])}function g(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function v(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function y(e,t,i,r,n){var o,a;i.transparent?(o=ve,a=++ye):(o=me,a=++ge);var s=o[a];void 0!==s?(s.id=e.id,s.object=e,s.geometry=t,s.material=i,s.z=$e.z,s.group=n):(s={id:e.id,object:e,geometry:t,material:i,z:$e.z,group:n},o.push(s))}function M(e){var t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere();var i=Ze.copy(t.boundingSphere).applyMatrix4(e.matrixWorld);if(!Fe.intersectsSphere(i))return!1;if(0===Ye)return!0;var r=we.clippingPlanes,n=i.center,o=-i.radius,a=0;do if(r[a].distanceToPoint(n)<o)return!1;while(++a!==Ye);return!0}function A(e,t){if(e.visible!==!1){if(e.layers.test(t.layers))if(e instanceof n.Light)fe.push(e);else if(e instanceof n.Sprite)(e.frustumCulled===!1||M(e)===!0)&&Ae.push(e);else if(e instanceof n.LensFlare)xe.push(e);else if(e instanceof n.ImmediateRenderObject)we.sortObjects===!0&&($e.setFromMatrixPosition(e.matrixWorld),$e.applyProjection(Je)),y(e,null,e.material,$e.z,null);else if((e instanceof n.Mesh||e instanceof n.Line||e instanceof n.Points)&&(e instanceof n.SkinnedMesh&&e.skeleton.update(),e.frustumCulled===!1||M(e)===!0)){var i=e.material;if(i.visible===!0){we.sortObjects===!0&&($e.setFromMatrixPosition(e.matrixWorld),$e.applyProjection(Je));var r=ht.update(e);if(i instanceof n.MultiMaterial)for(var o=r.groups,a=i.materials,s=0,c=o.length;c>s;s++){var u=o[s],l=a[u.materialIndex];l.visible===!0&&y(e,r,l,$e.z,u)}else y(e,r,i,$e.z,null)}}for(var h=e.children,s=0,c=h.length;c>s;s++)A(h[s],t)}}function x(e,t,i,r){for(var o=0,a=e.length;a>o;o++){var s=e[o],c=s.object,u=s.geometry,l=void 0===r?s.material:r,h=s.group;if(c.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,c.matrixWorld),c.normalMatrix.getNormalMatrix(c.modelViewMatrix),c instanceof n.ImmediateRenderObject){E(l);var d=T(t,i,l,c);De="",c.render(function(e){we.renderBufferImmediate(e,d,l)})}else we.renderBufferDirect(t,i,u,l,c,h)}}function w(e,t,i){var r=lt.get(e),o=dt.getParameters(e,et,t,Ye,i),a=dt.getProgramCode(e,o),s=r.program,c=!0;if(void 0===s)e.addEventListener("dispose",u);else if(s.code!==a)p(e);else{if(void 0!==o.shaderID)return;c=!1}if(c){if(o.shaderID){var l=n.ShaderLib[o.shaderID];r.__webglShader={name:e.type,uniforms:n.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}else r.__webglShader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.__webglShader=r.__webglShader,s=dt.acquireProgram(e,o,a),r.program=s,e.program=s}var h=s.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var d=0;d<we.maxMorphTargets;d++)h["morphTarget"+d]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(var d=0;d<we.maxMorphNormals;d++)h["morphNormal"+d]>=0&&e.numSupportedMorphNormals++}var f=r.__webglShader.uniforms;(e instanceof n.ShaderMaterial||e instanceof n.RawShaderMaterial)&&e.clipping!==!0||(r.numClippingPlanes=Ye,f.clippingPlanes=He),(e instanceof n.MeshPhongMaterial||e instanceof n.MeshLambertMaterial||e instanceof n.MeshStandardMaterial||e.lights)&&(r.lightsHash=et.hash,f.ambientLightColor.value=et.ambient,f.directionalLights.value=et.directional,f.spotLights.value=et.spot,f.pointLights.value=et.point,f.hemisphereLights.value=et.hemi,f.directionalShadowMap.value=et.directionalShadowMap,f.directionalShadowMatrix.value=et.directionalShadowMatrix,f.spotShadowMap.value=et.spotShadowMap,f.spotShadowMatrix.value=et.spotShadowMatrix,f.pointShadowMap.value=et.pointShadowMap,f.pointShadowMatrix.value=et.pointShadowMatrix);var m=r.program.getUniforms(),g=n.WebGLUniforms.seqWithValue(m.seq,f);r.uniformsList=g,r.dynamicUniforms=n.WebGLUniforms.splitDynamic(g,f)}function E(e){b(e),e.transparent===!0?ut.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha):ut.setBlending(n.NoBlending),ut.setDepthFunc(e.depthFunc),ut.setDepthTest(e.depthTest),ut.setDepthWrite(e.depthWrite),ut.setColorWrite(e.colorWrite),ut.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function b(e){e.side!==n.DoubleSide?ut.enable(rt.CULL_FACE):ut.disable(rt.CULL_FACE),ut.setFlipSided(e.side===n.BackSide)}function T(e,t,i,r){je=0;var o=lt.get(i);if(Ge){if(Ve||e!==Ne){var a=e===Ne&&i.id===Le;F(i.clippingPlanes,i.clipShadows,e,o,a)}void 0!==o.numClippingPlanes&&o.numClippingPlanes!==Ye&&(i.needsUpdate=!0)}void 0===o.program&&(i.needsUpdate=!0),void 0!==o.lightsHash&&o.lightsHash!==et.hash&&(i.needsUpdate=!0),i.needsUpdate&&(w(i,t,r),i.needsUpdate=!1);var s=!1,c=!1,u=!1,l=o.program,h=l.getUniforms(),d=o.__webglShader.uniforms;if(l.id!==Ee&&(rt.useProgram(l.program),Ee=l.id,s=!0,c=!0,u=!0),i.id!==Le&&(Le=i.id,c=!0),s||e!==Ne){if(h.set(rt,e,"projectionMatrix"),ct.logarithmicDepthBuffer&&h.setValue(rt,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),e!==Ne&&(Ne=e,c=!0,u=!0),i instanceof n.ShaderMaterial||i instanceof n.MeshPhongMaterial||i instanceof n.MeshStandardMaterial||i.envMap){var p=h.map.cameraPosition;void 0!==p&&p.setValue(rt,$e.setFromMatrixPosition(e.matrixWorld))}(i instanceof n.MeshPhongMaterial||i instanceof n.MeshLambertMaterial||i instanceof n.MeshBasicMaterial||i instanceof n.MeshStandardMaterial||i instanceof n.ShaderMaterial||i.skinning)&&h.setValue(rt,"viewMatrix",e.matrixWorldInverse),h.set(rt,we,"toneMappingExposure"),h.set(rt,we,"toneMappingWhitePoint")}if(i.skinning){h.setOptional(rt,r,"bindMatrix"),h.setOptional(rt,r,"bindMatrixInverse");var f=r.skeleton;f&&(ct.floatVertexTextures&&f.useVertexTexture?(h.set(rt,f,"boneTexture"),h.set(rt,f,"boneTextureWidth"),h.set(rt,f,"boneTextureHeight")):h.setOptional(rt,f,"boneMatrices"))}c&&((i instanceof n.MeshPhongMaterial||i instanceof n.MeshLambertMaterial||i instanceof n.MeshStandardMaterial||i.lights)&&z(d,u),t&&i.fog&&C(d,t),(i instanceof n.MeshBasicMaterial||i instanceof n.MeshLambertMaterial||i instanceof n.MeshPhongMaterial||i instanceof n.MeshStandardMaterial||i instanceof n.MeshDepthMaterial)&&L(d,i),i instanceof n.LineBasicMaterial?D(d,i):i instanceof n.LineDashedMaterial?(D(d,i),N(d,i)):i instanceof n.PointsMaterial?S(d,i):i instanceof n.MeshLambertMaterial?I(d,i):i instanceof n.MeshPhongMaterial?j(d,i):i instanceof n.MeshPhysicalMaterial?O(d,i):i instanceof n.MeshStandardMaterial?_(d,i):i instanceof n.MeshDepthMaterial?i.displacementMap&&(d.displacementMap.value=i.displacementMap,d.displacementScale.value=i.displacementScale,d.displacementBias.value=i.displacementBias):i instanceof n.MeshNormalMaterial&&(d.opacity.value=i.opacity),n.WebGLUniforms.upload(rt,o.uniformsList,d,we)),h.set(rt,r,"modelViewMatrix"),h.set(rt,r,"normalMatrix"),h.setValue(rt,"modelMatrix",r.matrixWorld);var m=o.dynamicUniforms;return null!==m&&(n.WebGLUniforms.evalDynamic(m,d,r,e),n.WebGLUniforms.upload(rt,m,d,we)),l}function L(e,t){e.opacity.value=t.opacity,e.diffuse.value=t.color,t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),e.map.value=t.map,e.specularMap.value=t.specularMap,e.alphaMap.value=t.alphaMap,t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity);var i;if(t.map?i=t.map:t.specularMap?i=t.specularMap:t.displacementMap?i=t.displacementMap:t.normalMap?i=t.normalMap:t.bumpMap?i=t.bumpMap:t.roughnessMap?i=t.roughnessMap:t.metalnessMap?i=t.metalnessMap:t.alphaMap?i=t.alphaMap:t.emissiveMap&&(i=t.emissiveMap),void 0!==i){i instanceof n.WebGLRenderTarget&&(i=i.texture);var r=i.offset,o=i.repeat;e.offsetRepeat.value.set(r.x,r.y,o.x,o.y)}e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap instanceof n.WebGLRenderTargetCube?1:-1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio}function D(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}function N(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function S(e,t){if(e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*Re,e.scale.value=.5*ae.clientHeight,e.map.value=t.map,null!==t.map){var i=t.map.offset,r=t.map.repeat;e.offsetRepeat.value.set(i.x,i.y,r.x,r.y)}}function C(e,t){e.fogColor.value=t.color,t instanceof n.Fog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t instanceof n.FogExp2&&(e.fogDensity.value=t.density)}function I(e,t){t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}function j(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function _(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function O(e,t){_(e,t)}function z(e,t){e.ambientLightColor.needsUpdate=t,e.directionalLights.needsUpdate=t,e.pointLights.needsUpdate=t,e.spotLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}function k(e){for(var t=0,i=0,r=e.length;r>i;i++){var n=e[i];n.castShadow&&(et.shadows[t++]=n)}et.shadows.length=t}function R(e,t){var i,r,o,a,s,c,u=0,l=0,h=0,d=t.matrixWorldInverse,p=0,f=0,m=0,g=0;for(i=0,r=e.length;r>i;i++)if(o=e[i],a=o.color,s=o.intensity,c=o.distance,o instanceof n.AmbientLight)u+=a.r*s,l+=a.g*s,h+=a.b*s;else if(o instanceof n.DirectionalLight){var v=pt.get(o);v.color.copy(o.color).multiplyScalar(o.intensity),v.direction.setFromMatrixPosition(o.matrixWorld),$e.setFromMatrixPosition(o.target.matrixWorld),v.direction.sub($e),v.direction.transformDirection(d),v.shadow=o.castShadow,o.castShadow&&(v.shadowBias=o.shadow.bias,v.shadowRadius=o.shadow.radius,v.shadowMapSize=o.shadow.mapSize),et.directionalShadowMap[p]=o.shadow.map,et.directionalShadowMatrix[p]=o.shadow.matrix,et.directional[p++]=v}else if(o instanceof n.SpotLight){var v=pt.get(o);v.position.setFromMatrixPosition(o.matrixWorld),v.position.applyMatrix4(d),v.color.copy(a).multiplyScalar(s),v.distance=c,v.direction.setFromMatrixPosition(o.matrixWorld),$e.setFromMatrixPosition(o.target.matrixWorld),v.direction.sub($e),v.direction.transformDirection(d),v.coneCos=Math.cos(o.angle),v.penumbraCos=Math.cos(o.angle*(1-o.penumbra)),v.decay=0===o.distance?0:o.decay,v.shadow=o.castShadow,o.castShadow&&(v.shadowBias=o.shadow.bias,v.shadowRadius=o.shadow.radius,v.shadowMapSize=o.shadow.mapSize),et.spotShadowMap[m]=o.shadow.map,et.spotShadowMatrix[m]=o.shadow.matrix,et.spot[m++]=v}else if(o instanceof n.PointLight){var v=pt.get(o);v.position.setFromMatrixPosition(o.matrixWorld),v.position.applyMatrix4(d),v.color.copy(o.color).multiplyScalar(o.intensity),v.distance=o.distance,v.decay=0===o.distance?0:o.decay,v.shadow=o.castShadow,o.castShadow&&(v.shadowBias=o.shadow.bias,v.shadowRadius=o.shadow.radius,v.shadowMapSize=o.shadow.mapSize),et.pointShadowMap[f]=o.shadow.map,void 0===et.pointShadowMatrix[f]&&(et.pointShadowMatrix[f]=new n.Matrix4),$e.setFromMatrixPosition(o.matrixWorld).negate(),et.pointShadowMatrix[f].identity().setPosition($e),et.point[f++]=v}else if(o instanceof n.HemisphereLight){var v=pt.get(o);v.direction.setFromMatrixPosition(o.matrixWorld),v.direction.transformDirection(d),v.direction.normalize(),v.skyColor.copy(o.color).multiplyScalar(s),v.groundColor.copy(o.groundColor).multiplyScalar(s),et.hemi[g++]=v}et.ambient[0]=u,et.ambient[1]=l,et.ambient[2]=h,et.directional.length=p,et.spot.length=m,et.point.length=f,et.hemi.length=g,et.hash=p+","+f+","+m+","+g+","+et.shadows.length}function B(e,t){Ge=0!==we.clippingPlanes.length||we.localClippingEnabled||0!==Xe||Ve,Ve=we.localClippingEnabled,We=U(e,t,0),Xe=null!==e?e.length:0}function U(e,t,i,r){var n=null!==e?e.length:0,o=null;if(0!==n){if(o=He.value,r!==!0||null===o){var a=i+4*n,s=t.matrixWorldInverse,c=qe.getNormalMatrix(s);(null===o||o.length<a)&&(o=new Float32Array(a));for(var u=0,l=i;u!==n;++u,l+=4){var h=Ke.copy(e[u]).applyMatrix4(s,c);h.normal.toArray(o,l),o[l+3]=h.constant}}He.value=o,He.needsUpdate=!0}return Ye=n,o}function P(){He.value!==We&&(He.value=We,He.needsUpdate=Xe>0),Ye=Xe}function F(e,t,i,r,n){if(!Ve||null===e||0===e.length||Qe&&!t)Qe?U(null):P();else{var o=Qe?0:Xe,a=4*o,s=r.clippingState||null;He.value=s,s=U(e,i,a,n);for(var c=0;c!==a;++c)s[c]=We[c];r.clippingState=s,Ye+=o}}function G(){var e=je;return e>=ct.maxTextures&&console.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+ct.maxTextures),je+=1,e}function V(e,t,i){var r;if(i?(rt.texParameteri(e,rt.TEXTURE_WRAP_S,oe(t.wrapS)),rt.texParameteri(e,rt.TEXTURE_WRAP_T,oe(t.wrapT)),rt.texParameteri(e,rt.TEXTURE_MAG_FILTER,oe(t.magFilter)),rt.texParameteri(e,rt.TEXTURE_MIN_FILTER,oe(t.minFilter))):(rt.texParameteri(e,rt.TEXTURE_WRAP_S,rt.CLAMP_TO_EDGE),rt.texParameteri(e,rt.TEXTURE_WRAP_T,rt.CLAMP_TO_EDGE),(t.wrapS!==n.ClampToEdgeWrapping||t.wrapT!==n.ClampToEdgeWrapping)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",t),rt.texParameteri(e,rt.TEXTURE_MAG_FILTER,ne(t.magFilter)),rt.texParameteri(e,rt.TEXTURE_MIN_FILTER,ne(t.minFilter)),t.minFilter!==n.NearestFilter&&t.minFilter!==n.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",t)),r=st.get("EXT_texture_filter_anisotropic")){if(t.type===n.FloatType&&null===st.get("OES_texture_float_linear"))return;if(t.type===n.HalfFloatType&&null===st.get("OES_texture_half_float_linear"))return;(t.anisotropy>1||lt.get(t).__currentAnisotropy)&&(rt.texParameterf(e,r.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,we.getMaxAnisotropy())),lt.get(t).__currentAnisotropy=t.anisotropy)}}function Q(e,t,i){void 0===e.__webglInit&&(e.__webglInit=!0,t.addEventListener("dispose",s),e.__webglTexture=rt.createTexture(),tt.textures++),ut.activeTexture(rt.TEXTURE0+i),ut.bindTexture(rt.TEXTURE_2D,e.__webglTexture),rt.pixelStorei(rt.UNPACK_FLIP_Y_WEBGL,t.flipY),rt.pixelStorei(rt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),rt.pixelStorei(rt.UNPACK_ALIGNMENT,t.unpackAlignment);var r=H(t.image,ct.maxTextureSize);X(t)&&W(r)===!1&&(r=q(r));var o=W(r),a=oe(t.format),c=oe(t.type);V(rt.TEXTURE_2D,t,o);var u,l=t.mipmaps;if(t instanceof n.DepthTexture){var h=rt.DEPTH_COMPONENT;if(t.type===n.FloatType){if(!at)throw new Error("Float Depth Texture only supported in WebGL2.0");h=rt.DEPTH_COMPONENT32F}else at&&(h=rt.DEPTH_COMPONENT16);ut.texImage2D(rt.TEXTURE_2D,0,h,r.width,r.height,0,a,c,null)}else if(t instanceof n.DataTexture)if(l.length>0&&o){for(var d=0,p=l.length;p>d;d++)u=l[d],ut.texImage2D(rt.TEXTURE_2D,d,a,u.width,u.height,0,a,c,u.data);t.generateMipmaps=!1}else ut.texImage2D(rt.TEXTURE_2D,0,a,r.width,r.height,0,a,c,r.data);else if(t instanceof n.CompressedTexture)for(var d=0,p=l.length;p>d;d++)u=l[d],t.format!==n.RGBAFormat&&t.format!==n.RGBFormat?ut.getCompressedTextureFormats().indexOf(a)>-1?ut.compressedTexImage2D(rt.TEXTURE_2D,d,a,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ut.texImage2D(rt.TEXTURE_2D,d,a,u.width,u.height,0,a,c,u.data);else if(l.length>0&&o){for(var d=0,p=l.length;p>d;d++)u=l[d],ut.texImage2D(rt.TEXTURE_2D,d,a,a,c,u);t.generateMipmaps=!1}else ut.texImage2D(rt.TEXTURE_2D,0,a,a,c,r);t.generateMipmaps&&o&&rt.generateMipmap(rt.TEXTURE_2D),e.__version=t.version,t.onUpdate&&t.onUpdate(t)}function Y(e,t){e instanceof n.WebGLRenderTarget&&(e=e.texture);var i=lt.get(e);if(e.version>0&&i.__version!==e.version){var r=e.image;return void 0===r?void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e):r.complete===!1?void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",e):void Q(i,e,t)}ut.activeTexture(rt.TEXTURE0+t),ut.bindTexture(rt.TEXTURE_2D,i.__webglTexture)}function H(e,t){if(e.width>t||e.height>t){var i=t/Math.max(e.width,e.height),r=document.createElement("canvas");r.width=Math.floor(e.width*i),r.height=Math.floor(e.height*i);var n=r.getContext("2d");return n.drawImage(e,0,0,e.width,e.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+r.width+"x"+r.height,e),r}return e}function W(e){return n.Math.isPowerOfTwo(e.width)&&n.Math.isPowerOfTwo(e.height)}function X(e){return e.wrapS!==n.ClampToEdgeWrapping||e.wrapT!==n.ClampToEdgeWrapping?!0:e.minFilter!==n.NearestFilter&&e.minFilter!==n.LinearFilter?!0:!1; }function q(e){if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement){var t=document.createElement("canvas");t.width=n.Math.nearestPowerOfTwo(e.width),t.height=n.Math.nearestPowerOfTwo(e.height);var i=t.getContext("2d");return i.drawImage(e,0,0,t.width,t.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+t.width+"x"+t.height,e),t}return e}function Z(e,t){var i=lt.get(e);if(6===e.image.length)if(e.version>0&&i.__version!==e.version){i.__image__webglTextureCube||(e.addEventListener("dispose",s),i.__image__webglTextureCube=rt.createTexture(),tt.textures++),ut.activeTexture(rt.TEXTURE0+t),ut.bindTexture(rt.TEXTURE_CUBE_MAP,i.__image__webglTextureCube),rt.pixelStorei(rt.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var r=e instanceof n.CompressedTexture,o=e.image[0]instanceof n.DataTexture,a=[],c=0;6>c;c++)a[c]=!we.autoScaleCubemaps||r||o?o?e.image[c].image:e.image[c]:H(e.image[c],ct.maxCubemapSize);var u=a[0],l=W(u),h=oe(e.format),d=oe(e.type);V(rt.TEXTURE_CUBE_MAP,e,l);for(var c=0;6>c;c++)if(r)for(var p,f=a[c].mipmaps,m=0,g=f.length;g>m;m++)p=f[m],e.format!==n.RGBAFormat&&e.format!==n.RGBFormat?ut.getCompressedTextureFormats().indexOf(h)>-1?ut.compressedTexImage2D(rt.TEXTURE_CUBE_MAP_POSITIVE_X+c,m,h,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):ut.texImage2D(rt.TEXTURE_CUBE_MAP_POSITIVE_X+c,m,h,p.width,p.height,0,h,d,p.data);else o?ut.texImage2D(rt.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,h,a[c].width,a[c].height,0,h,d,a[c].data):ut.texImage2D(rt.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,h,h,d,a[c]);e.generateMipmaps&&l&&rt.generateMipmap(rt.TEXTURE_CUBE_MAP),i.__version=e.version,e.onUpdate&&e.onUpdate(e)}else ut.activeTexture(rt.TEXTURE0+t),ut.bindTexture(rt.TEXTURE_CUBE_MAP,i.__image__webglTextureCube)}function K(e,t){ut.activeTexture(rt.TEXTURE0+t),ut.bindTexture(rt.TEXTURE_CUBE_MAP,lt.get(e).__webglTexture)}function J(e,t,i,r){var n=oe(t.texture.format),o=oe(t.texture.type);ut.texImage2D(r,0,n,t.width,t.height,0,n,o,null),rt.bindFramebuffer(rt.FRAMEBUFFER,e),rt.framebufferTexture2D(rt.FRAMEBUFFER,i,r,lt.get(t.texture).__webglTexture,0),rt.bindFramebuffer(rt.FRAMEBUFFER,null)}function $(e,t){rt.bindRenderbuffer(rt.RENDERBUFFER,e),t.depthBuffer&&!t.stencilBuffer?(rt.renderbufferStorage(rt.RENDERBUFFER,rt.DEPTH_COMPONENT16,t.width,t.height),rt.framebufferRenderbuffer(rt.FRAMEBUFFER,rt.DEPTH_ATTACHMENT,rt.RENDERBUFFER,e)):t.depthBuffer&&t.stencilBuffer?(rt.renderbufferStorage(rt.RENDERBUFFER,rt.DEPTH_STENCIL,t.width,t.height),rt.framebufferRenderbuffer(rt.FRAMEBUFFER,rt.DEPTH_STENCIL_ATTACHMENT,rt.RENDERBUFFER,e)):rt.renderbufferStorage(rt.RENDERBUFFER,rt.RGBA4,t.width,t.height),rt.bindRenderbuffer(rt.RENDERBUFFER,null)}function ee(e,t){var i=t instanceof n.WebGLRenderTargetCube;if(i)throw new Error("Depth Texture with cube render targets is not supported!");if(rt.bindFramebuffer(rt.FRAMEBUFFER,e),!(t.depthTexture instanceof n.DepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");lt.get(t.depthTexture).__webglTexture&&t.depthTexture.image.width===t.width&&t.depthTexture.image.height===t.height||(t.depthTexture.image.width=t.width,t.depthTexture.image.height=t.height,t.depthTexture.needsUpdate=!0),we.setTexture(t.depthTexture,0);var r=lt.get(t.depthTexture).__webglTexture;rt.framebufferTexture2D(rt.FRAMEBUFFER,rt.DEPTH_ATTACHMENT,rt.TEXTURE_2D,r,0)}function te(e){var t=lt.get(e),i=e instanceof n.WebGLRenderTargetCube;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");ee(t.__webglFramebuffer,e)}else if(i){t.__webglDepthbuffer=[];for(var r=0;6>r;r++)rt.bindFramebuffer(rt.FRAMEBUFFER,t.__webglFramebuffer[r]),t.__webglDepthbuffer[r]=rt.createRenderbuffer(),$(t.__webglDepthbuffer[r],e)}else rt.bindFramebuffer(rt.FRAMEBUFFER,t.__webglFramebuffer),t.__webglDepthbuffer=rt.createRenderbuffer(),$(t.__webglDepthbuffer,e);rt.bindFramebuffer(rt.FRAMEBUFFER,null)}function ie(e){var t=lt.get(e),i=lt.get(e.texture);e.addEventListener("dispose",c),i.__webglTexture=rt.createTexture(),tt.textures++;var r=e instanceof n.WebGLRenderTargetCube,o=n.Math.isPowerOfTwo(e.width)&&n.Math.isPowerOfTwo(e.height);if(r){t.__webglFramebuffer=[];for(var a=0;6>a;a++)t.__webglFramebuffer[a]=rt.createFramebuffer()}else t.__webglFramebuffer=rt.createFramebuffer();if(r){ut.bindTexture(rt.TEXTURE_CUBE_MAP,i.__webglTexture),V(rt.TEXTURE_CUBE_MAP,e.texture,o);for(var a=0;6>a;a++)J(t.__webglFramebuffer[a],e,rt.COLOR_ATTACHMENT0,rt.TEXTURE_CUBE_MAP_POSITIVE_X+a);e.texture.generateMipmaps&&o&&rt.generateMipmap(rt.TEXTURE_CUBE_MAP),ut.bindTexture(rt.TEXTURE_CUBE_MAP,null)}else ut.bindTexture(rt.TEXTURE_2D,i.__webglTexture),V(rt.TEXTURE_2D,e.texture,o),J(t.__webglFramebuffer,e,rt.COLOR_ATTACHMENT0,rt.TEXTURE_2D),e.texture.generateMipmaps&&o&&rt.generateMipmap(rt.TEXTURE_2D),ut.bindTexture(rt.TEXTURE_2D,null);e.depthBuffer&&te(e)}function re(e){var t=e instanceof n.WebGLRenderTargetCube?rt.TEXTURE_CUBE_MAP:rt.TEXTURE_2D,i=lt.get(e.texture).__webglTexture;ut.bindTexture(t,i),rt.generateMipmap(t),ut.bindTexture(t,null)}function ne(e){return e===n.NearestFilter||e===n.NearestMipMapNearestFilter||e===n.NearestMipMapLinearFilter?rt.NEAREST:rt.LINEAR}function oe(e){var t;if(e===n.RepeatWrapping)return rt.REPEAT;if(e===n.ClampToEdgeWrapping)return rt.CLAMP_TO_EDGE;if(e===n.MirroredRepeatWrapping)return rt.MIRRORED_REPEAT;if(e===n.NearestFilter)return rt.NEAREST;if(e===n.NearestMipMapNearestFilter)return rt.NEAREST_MIPMAP_NEAREST;if(e===n.NearestMipMapLinearFilter)return rt.NEAREST_MIPMAP_LINEAR;if(e===n.LinearFilter)return rt.LINEAR;if(e===n.LinearMipMapNearestFilter)return rt.LINEAR_MIPMAP_NEAREST;if(e===n.LinearMipMapLinearFilter)return rt.LINEAR_MIPMAP_LINEAR;if(e===n.UnsignedByteType)return rt.UNSIGNED_BYTE;if(e===n.UnsignedShort4444Type)return rt.UNSIGNED_SHORT_4_4_4_4;if(e===n.UnsignedShort5551Type)return rt.UNSIGNED_SHORT_5_5_5_1;if(e===n.UnsignedShort565Type)return rt.UNSIGNED_SHORT_5_6_5;if(e===n.ByteType)return rt.BYTE;if(e===n.ShortType)return rt.SHORT;if(e===n.UnsignedShortType)return rt.UNSIGNED_SHORT;if(e===n.IntType)return rt.INT;if(e===n.UnsignedIntType)return rt.UNSIGNED_INT;if(e===n.FloatType)return rt.FLOAT;if(t=st.get("OES_texture_half_float"),null!==t&&e===n.HalfFloatType)return t.HALF_FLOAT_OES;if(e===n.AlphaFormat)return rt.ALPHA;if(e===n.RGBFormat)return rt.RGB;if(e===n.RGBAFormat)return rt.RGBA;if(e===n.LuminanceFormat)return rt.LUMINANCE;if(e===n.LuminanceAlphaFormat)return rt.LUMINANCE_ALPHA;if(e===n.DepthFormat)return rt.DEPTH_COMPONENT;if(e===n.AddEquation)return rt.FUNC_ADD;if(e===n.SubtractEquation)return rt.FUNC_SUBTRACT;if(e===n.ReverseSubtractEquation)return rt.FUNC_REVERSE_SUBTRACT;if(e===n.ZeroFactor)return rt.ZERO;if(e===n.OneFactor)return rt.ONE;if(e===n.SrcColorFactor)return rt.SRC_COLOR;if(e===n.OneMinusSrcColorFactor)return rt.ONE_MINUS_SRC_COLOR;if(e===n.SrcAlphaFactor)return rt.SRC_ALPHA;if(e===n.OneMinusSrcAlphaFactor)return rt.ONE_MINUS_SRC_ALPHA;if(e===n.DstAlphaFactor)return rt.DST_ALPHA;if(e===n.OneMinusDstAlphaFactor)return rt.ONE_MINUS_DST_ALPHA;if(e===n.DstColorFactor)return rt.DST_COLOR;if(e===n.OneMinusDstColorFactor)return rt.ONE_MINUS_DST_COLOR;if(e===n.SrcAlphaSaturateFactor)return rt.SRC_ALPHA_SATURATE;if(t=st.get("WEBGL_compressed_texture_s3tc"),null!==t){if(e===n.RGB_S3TC_DXT1_Format)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===n.RGBA_S3TC_DXT1_Format)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===n.RGBA_S3TC_DXT3_Format)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===n.RGBA_S3TC_DXT5_Format)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t=st.get("WEBGL_compressed_texture_pvrtc"),null!==t){if(e===n.RGB_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===n.RGB_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===n.RGBA_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===n.RGBA_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t=st.get("WEBGL_compressed_texture_etc1"),null!==t&&e===n.RGB_ETC1_Format)return t.COMPRESSED_RGB_ETC1_WEBGL;if(t=st.get("EXT_blend_minmax"),null!==t){if(e===n.MinEquation)return t.MIN_EXT;if(e===n.MaxEquation)return t.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",n.REVISION),e=e||{};var ae=void 0!==e.canvas?e.canvas:document.createElement("canvas"),se=void 0!==e.context?e.context:null,ce=void 0!==e.alpha?e.alpha:!1,ue=void 0!==e.depth?e.depth:!0,le=void 0!==e.stencil?e.stencil:!0,he=void 0!==e.antialias?e.antialias:!1,de=void 0!==e.premultipliedAlpha?e.premultipliedAlpha:!0,pe=void 0!==e.preserveDrawingBuffer?e.preserveDrawingBuffer:!1,fe=[],me=[],ge=-1,ve=[],ye=-1,Me=new Float32Array(8),Ae=[],xe=[];this.domElement=ae,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=n.LinearToneMapping,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0;var we=this,Ee=null,be=null,Te=null,Le=-1,De="",Ne=null,Se=new n.Vector4,Ce=null,Ie=new n.Vector4,je=0,_e=new n.Color(0),Oe=0,ze=ae.width,ke=ae.height,Re=1,Be=new n.Vector4(0,0,ze,ke),Ue=!1,Pe=new n.Vector4(0,0,ze,ke),Fe=new n.Frustum,Ge=!1,Ve=!1,Qe=!1,Ye=0,He={type:"4fv",value:null,needsUpdate:!1},We=null,Xe=0,qe=new n.Matrix3,Ze=new n.Sphere,Ke=new n.Plane,Je=new n.Matrix4,$e=new n.Vector3,et={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},tt={geometries:0,textures:0},it={calls:0,vertices:0,faces:0,points:0};this.info={render:it,memory:tt,programs:null};var rt;try{var nt={alpha:ce,depth:ue,stencil:le,antialias:he,premultipliedAlpha:de,preserveDrawingBuffer:pe};if(rt=se||ae.getContext("webgl",nt)||ae.getContext("experimental-webgl",nt),null===rt)throw null!==ae.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";void 0===rt.getShaderPrecisionFormat&&(rt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),ae.addEventListener("webglcontextlost",a,!1)}catch(ot){console.error("THREE.WebGLRenderer: "+ot)}var at="undefined"!=typeof WebGL2RenderingContext&&rt instanceof WebGL2RenderingContext,st=new n.WebGLExtensions(rt);st.get("WEBGL_depth_texture"),st.get("OES_texture_float"),st.get("OES_texture_float_linear"),st.get("OES_texture_half_float"),st.get("OES_texture_half_float_linear"),st.get("OES_standard_derivatives"),st.get("ANGLE_instanced_arrays"),st.get("OES_element_index_uint")&&(n.BufferGeometry.MaxIndex=4294967296);var ct=new n.WebGLCapabilities(rt,st,e),ut=new n.WebGLState(rt,st,oe),lt=new n.WebGLProperties,ht=new n.WebGLObjects(rt,lt,this.info),dt=new n.WebGLPrograms(this,ct),pt=new n.WebGLLights;this.info.programs=dt.programs;var ft=new n.WebGLBufferRenderer(rt,st,it),mt=new n.WebGLIndexedBufferRenderer(rt,st,it);r(),this.context=rt,this.capabilities=ct,this.extensions=st,this.properties=lt,this.state=ut;var gt=new n.WebGLShadowMap(this,et,ht);this.shadowMap=gt;var vt=new n.SpritePlugin(this,Ae),yt=new n.LensFlarePlugin(this,xe);this.getContext=function(){return rt},this.getContextAttributes=function(){return rt.getContextAttributes()},this.forceContextLoss=function(){st.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){var e;return function(){if(void 0!==e)return e;var t=st.get("EXT_texture_filter_anisotropic");return e=null!==t?rt.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}(),this.getPrecision=function(){return ct.precision},this.getPixelRatio=function(){return Re},this.setPixelRatio=function(e){void 0!==e&&(Re=e,this.setSize(Pe.z,Pe.w,!1))},this.getSize=function(){return{width:ze,height:ke}},this.setSize=function(e,t,i){ze=e,ke=t,ae.width=e*Re,ae.height=t*Re,i!==!1&&(ae.style.width=e+"px",ae.style.height=t+"px"),this.setViewport(0,0,e,t)},this.setViewport=function(e,t,i,r){ut.viewport(Pe.set(e,t,i,r))},this.setScissor=function(e,t,i,r){ut.scissor(Be.set(e,t,i,r))},this.setScissorTest=function(e){ut.setScissorTest(Ue=e)},this.getClearColor=function(){return _e},this.setClearColor=function(e,t){_e.set(e),Oe=void 0!==t?t:1,i(_e.r,_e.g,_e.b,Oe)},this.getClearAlpha=function(){return Oe},this.setClearAlpha=function(e){Oe=e,i(_e.r,_e.g,_e.b,Oe)},this.clear=function(e,t,i){var r=0;(void 0===e||e)&&(r|=rt.COLOR_BUFFER_BIT),(void 0===t||t)&&(r|=rt.DEPTH_BUFFER_BIT),(void 0===i||i)&&(r|=rt.STENCIL_BUFFER_BIT),rt.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(e,t,i,r){this.setRenderTarget(e),this.clear(t,i,r)},this.resetGLState=o,this.dispose=function(){ae.removeEventListener("webglcontextlost",a,!1)},this.renderBufferImmediate=function(e,t,i){ut.initAttributes();var r=lt.get(e);e.hasPositions&&!r.position&&(r.position=rt.createBuffer()),e.hasNormals&&!r.normal&&(r.normal=rt.createBuffer()),e.hasUvs&&!r.uv&&(r.uv=rt.createBuffer()),e.hasColors&&!r.color&&(r.color=rt.createBuffer());var o=t.getAttributes();if(e.hasPositions&&(rt.bindBuffer(rt.ARRAY_BUFFER,r.position),rt.bufferData(rt.ARRAY_BUFFER,e.positionArray,rt.DYNAMIC_DRAW),ut.enableAttribute(o.position),rt.vertexAttribPointer(o.position,3,rt.FLOAT,!1,0,0)),e.hasNormals){if(rt.bindBuffer(rt.ARRAY_BUFFER,r.normal),"MeshPhongMaterial"!==i.type&&"MeshStandardMaterial"!==i.type&&"MeshPhysicalMaterial"!==i.type&&i.shading===n.FlatShading)for(var a=0,s=3*e.count;s>a;a+=9){var c=e.normalArray,u=(c[a+0]+c[a+3]+c[a+6])/3,l=(c[a+1]+c[a+4]+c[a+7])/3,h=(c[a+2]+c[a+5]+c[a+8])/3;c[a+0]=u,c[a+1]=l,c[a+2]=h,c[a+3]=u,c[a+4]=l,c[a+5]=h,c[a+6]=u,c[a+7]=l,c[a+8]=h}rt.bufferData(rt.ARRAY_BUFFER,e.normalArray,rt.DYNAMIC_DRAW),ut.enableAttribute(o.normal),rt.vertexAttribPointer(o.normal,3,rt.FLOAT,!1,0,0)}e.hasUvs&&i.map&&(rt.bindBuffer(rt.ARRAY_BUFFER,r.uv),rt.bufferData(rt.ARRAY_BUFFER,e.uvArray,rt.DYNAMIC_DRAW),ut.enableAttribute(o.uv),rt.vertexAttribPointer(o.uv,2,rt.FLOAT,!1,0,0)),e.hasColors&&i.vertexColors!==n.NoColors&&(rt.bindBuffer(rt.ARRAY_BUFFER,r.color),rt.bufferData(rt.ARRAY_BUFFER,e.colorArray,rt.DYNAMIC_DRAW),ut.enableAttribute(o.color),rt.vertexAttribPointer(o.color,3,rt.FLOAT,!1,0,0)),ut.disableUnusedAttributes(),rt.drawArrays(rt.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,i,r,o,a,s){E(o);var c=T(e,i,o,a),u=!1,l=r.id+"_"+c.id+"_"+o.wireframe;l!==De&&(De=l,u=!0);var h=a.morphTargetInfluences;if(void 0!==h){for(var d=[],p=0,g=h.length;g>p;p++){var v=h[p];d.push([v,p])}d.sort(m),d.length>8&&(d.length=8);for(var y=r.morphAttributes,p=0,g=d.length;g>p;p++){var v=d[p];if(Me[p]=v[0],0!==v[0]){var M=v[1];o.morphTargets===!0&&y.position&&r.addAttribute("morphTarget"+p,y.position[M]),o.morphNormals===!0&&y.normal&&r.addAttribute("morphNormal"+p,y.normal[M])}else o.morphTargets===!0&&r.removeAttribute("morphTarget"+p),o.morphNormals===!0&&r.removeAttribute("morphNormal"+p)}c.getUniforms().setValue(rt,"morphTargetInfluences",Me),u=!0}var M=r.index,A=r.attributes.position;o.wireframe===!0&&(M=ht.getWireframeAttribute(r));var x;null!==M?(x=mt,x.setIndex(M)):x=ft,u&&(f(o,c,r),null!==M&&rt.bindBuffer(rt.ELEMENT_ARRAY_BUFFER,ht.getAttributeBuffer(M)));var w=0,b=1/0;null!==M?b=M.count:void 0!==A&&(b=A.count);var L=r.drawRange.start,D=r.drawRange.count,N=null!==s?s.start:0,S=null!==s?s.count:1/0,C=Math.max(w,L,N),I=Math.min(w+b,L+D,N+S)-1,j=Math.max(0,I-C+1);if(a instanceof n.Mesh)if(o.wireframe===!0)ut.setLineWidth(o.wireframeLinewidth*t()),x.setMode(rt.LINES);else switch(a.drawMode){case n.TrianglesDrawMode:x.setMode(rt.TRIANGLES);break;case n.TriangleStripDrawMode:x.setMode(rt.TRIANGLE_STRIP);break;case n.TriangleFanDrawMode:x.setMode(rt.TRIANGLE_FAN)}else if(a instanceof n.Line){var _=o.linewidth;void 0===_&&(_=1),ut.setLineWidth(_*t()),x.setMode(a instanceof n.LineSegments?rt.LINES:rt.LINE_STRIP)}else a instanceof n.Points&&x.setMode(rt.POINTS);r instanceof n.InstancedBufferGeometry?r.maxInstancedCount>0&&x.renderInstances(r,C,j):x.render(C,j)},this.render=function(e,t,i,r){if(t instanceof n.Camera==!1)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");var o=e.fog;if(De="",Le=-1,Ne=null,e.autoUpdate===!0&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld),Je.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Fe.setFromMatrix(Je),fe.length=0,ge=-1,ye=-1,Ae.length=0,xe.length=0,B(this.clippingPlanes,t),A(e,t),me.length=ge+1,ve.length=ye+1,we.sortObjects===!0&&(me.sort(g),ve.sort(v)),Ge&&(Qe=!0,U(null)),k(fe),gt.render(e,t),R(fe,t),Ge&&(Qe=!1,P()),it.calls=0,it.vertices=0,it.faces=0,it.points=0,void 0===i&&(i=null),this.setRenderTarget(i),(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),e.overrideMaterial){var a=e.overrideMaterial;x(me,t,o,a),x(ve,t,o,a)}else ut.setBlending(n.NoBlending),x(me,t,o),x(ve,t,o);if(vt.render(e,t),yt.render(e,t,Ie),i){var s=i.texture;s.generateMipmaps&&W(i)&&s.minFilter!==n.NearestFilter&&s.minFilter!==n.LinearFilter&&re(i)}ut.setDepthTest(!0),ut.setDepthWrite(!0),ut.setColorWrite(!0)},this.setFaceCulling=function(e,t){e===n.CullFaceNone?ut.disable(rt.CULL_FACE):(rt.frontFace(t===n.FrontFaceDirectionCW?rt.CW:rt.CCW),rt.cullFace(e===n.CullFaceBack?rt.BACK:e===n.CullFaceFront?rt.FRONT:rt.FRONT_AND_BACK),ut.enable(rt.CULL_FACE))};var Mt=!1;this.setTexture=function(e,t){Mt||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),Mt=!0),Y(e,t)},this.allocTextureUnit=G,this.setTexture2D=Y,this.setTextureCube=function(e,t){e instanceof n.CubeTexture||Array.isArray(e.image)&&6===e.image.length?Z(e,t):K(e.texture,t)},this.getCurrentRenderTarget=function(){return be},this.setRenderTarget=function(e){be=e,e&&void 0===lt.get(e).__webglFramebuffer&&ie(e);var t,i=e instanceof n.WebGLRenderTargetCube;if(e){var r=lt.get(e);t=i?r.__webglFramebuffer[e.activeCubeFace]:r.__webglFramebuffer,Se.copy(e.scissor),Ce=e.scissorTest,Ie.copy(e.viewport)}else t=null,Se.copy(Be).multiplyScalar(Re),Ce=Ue,Ie.copy(Pe).multiplyScalar(Re);if(Te!==t&&(rt.bindFramebuffer(rt.FRAMEBUFFER,t),Te=t),ut.scissor(Se),ut.setScissorTest(Ce),ut.viewport(Ie),i){var o=lt.get(e.texture);rt.framebufferTexture2D(rt.FRAMEBUFFER,rt.COLOR_ATTACHMENT0,rt.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,o.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,i,r,o,a){if(e instanceof n.WebGLRenderTarget==!1)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var s=lt.get(e).__webglFramebuffer;if(s){var c=!1;s!==Te&&(rt.bindFramebuffer(rt.FRAMEBUFFER,s),c=!0);try{var u=e.texture;if(u.format!==n.RGBAFormat&&oe(u.format)!==rt.getParameter(rt.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(u.type===n.UnsignedByteType||oe(u.type)===rt.getParameter(rt.IMPLEMENTATION_COLOR_READ_TYPE)||u.type===n.FloatType&&st.get("WEBGL_color_buffer_float")||u.type===n.HalfFloatType&&st.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");rt.checkFramebufferStatus(rt.FRAMEBUFFER)===rt.FRAMEBUFFER_COMPLETE?t>0&&t<=e.width-r&&i>0&&i<=e.height-o&&rt.readPixels(t,i,r,o,oe(u.format),oe(u.type),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&rt.bindFramebuffer(rt.FRAMEBUFFER,Te)}}}},n.WebGLRenderTarget=function(e,t,i){this.uuid=n.Math.generateUUID(),this.width=e,this.height=t,this.scissor=new n.Vector4(0,0,e,t),this.scissorTest=!1,this.viewport=new n.Vector4(0,0,e,t),i=i||{},void 0===i.minFilter&&(i.minFilter=n.LinearFilter),this.texture=new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.depthBuffer=void 0!==i.depthBuffer?i.depthBuffer:!0,this.stencilBuffer=void 0!==i.stencilBuffer?i.stencilBuffer:!0,this.depthTexture=null},n.WebGLRenderTarget.prototype={constructor:n.WebGLRenderTarget,setSize:function(e,t){(this.width!==e||this.height!==t)&&(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),n.WebGLRenderTargetCube=function(e,t,i){n.WebGLRenderTarget.call(this,e,t,i),this.activeCubeFace=0,this.activeMipMapLevel=0},n.WebGLRenderTargetCube.prototype=Object.create(n.WebGLRenderTarget.prototype),n.WebGLRenderTargetCube.prototype.constructor=n.WebGLRenderTargetCube,n.WebGLBufferRenderer=function(e,t,i){function r(e){s=e}function o(t,r){e.drawArrays(s,t,r),i.calls++,i.vertices+=r,s===e.TRIANGLES&&(i.faces+=r/3)}function a(r){var o=t.get("ANGLE_instanced_arrays");if(null===o)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var a=r.attributes.position,c=0;a instanceof n.InterleavedBufferAttribute?(c=a.data.count,o.drawArraysInstancedANGLE(s,0,c,r.maxInstancedCount)):(c=a.count,o.drawArraysInstancedANGLE(s,0,c,r.maxInstancedCount)),i.calls++,i.vertices+=c*r.maxInstancedCount,s===e.TRIANGLES&&(i.faces+=r.maxInstancedCount*c/3)}var s;this.setMode=r,this.render=o,this.renderInstances=a},n.WebGLIndexedBufferRenderer=function(e,t,i){function r(e){s=e}function n(i){i.array instanceof Uint32Array&&t.get("OES_element_index_uint")?(c=e.UNSIGNED_INT,u=4):(c=e.UNSIGNED_SHORT,u=2)}function o(t,r){e.drawElements(s,r,c,t*u),i.calls++,i.vertices+=r,s===e.TRIANGLES&&(i.faces+=r/3)}function a(r,n,o){var a=t.get("ANGLE_instanced_arrays");return null===a?void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(a.drawElementsInstancedANGLE(s,o,c,n*u,r.maxInstancedCount),i.calls++,i.vertices+=o*r.maxInstancedCount,void(s===e.TRIANGLES&&(i.faces+=r.maxInstancedCount*o/3)))}var s,c,u;this.setMode=r,this.setIndex=n,this.render=o,this.renderInstances=a},n.WebGLExtensions=function(e){var t={};this.get=function(i){if(void 0!==t[i])return t[i];var r;switch(i){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=e.getExtension("WEBGL_compressed_texture_etc1");break;default:r=e.getExtension(i)}return null===r&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),t[i]=r,r}},n.WebGLCapabilities=function(e,t,i){function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}this.getMaxPrecision=r,this.precision=void 0!==i.precision?i.precision:"highp",this.logarithmicDepthBuffer=void 0!==i.logarithmicDepthBuffer?i.logarithmicDepthBuffer:!1,this.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxVertexTextures=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxCubemapSize=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),this.maxAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxVertexUniforms=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),this.maxVaryings=e.getParameter(e.MAX_VARYING_VECTORS),this.maxFragmentUniforms=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),this.vertexTextures=this.maxVertexTextures>0,this.floatFragmentTextures=!!t.get("OES_texture_float"),this.floatVertexTextures=this.vertexTextures&&this.floatFragmentTextures;var n=r(this.precision);n!==this.precision&&(console.warn("THREE.WebGLRenderer:",this.precision,"not supported, using",n,"instead."),this.precision=n),this.logarithmicDepthBuffer&&(this.logarithmicDepthBuffer=!!t.get("EXT_frag_depth"))},n.WebGLGeometries=function(e,t,i){function r(e){var t=e.geometry;if(void 0!==l[t.id])return l[t.id];t.addEventListener("dispose",o);var r;return t instanceof n.BufferGeometry?r=t:t instanceof n.Geometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new n.BufferGeometry).setFromObject(e)),r=t._bufferGeometry),l[t.id]=r,i.memory.geometries++,r}function o(e){var r=e.target,n=l[r.id];null!==n.index&&s(n.index),c(n.attributes),r.removeEventListener("dispose",o),delete l[r.id];var a=t.get(r);a.wireframe&&s(a.wireframe),t["delete"](r);var u=t.get(n);u.wireframe&&s(u.wireframe),t["delete"](n),i.memory.geometries--}function a(e){return e instanceof n.InterleavedBufferAttribute?t.get(e.data).__webglBuffer:t.get(e).__webglBuffer}function s(t){var i=a(t);void 0!==i&&(e.deleteBuffer(i),u(t))}function c(e){for(var t in e)s(e[t])}function u(e){t["delete"](e instanceof n.InterleavedBufferAttribute?e.data:e)}var l={};this.get=r},n.WebGLLights=function(){var e={};this.get=function(t){if(void 0!==e[t.id])return e[t.id];var i;switch(t.type){case"DirectionalLight":i={direction:new n.Vector3,color:new n.Color,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new n.Vector2};break;case"SpotLight":i={position:new n.Vector3,direction:new n.Vector3,color:new n.Color,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new n.Vector2};break;case"PointLight":i={position:new n.Vector3,color:new n.Color,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new n.Vector2};break;case"HemisphereLight":i={direction:new n.Vector3,skyColor:new n.Color,groundColor:new n.Color}}return e[t.id]=i,i}},n.WebGLObjects=function(e,t,i){function r(t){var i=h.get(t);t.geometry instanceof n.Geometry&&i.updateFromObject(t);var r=i.index,a=i.attributes;null!==r&&o(r,e.ELEMENT_ARRAY_BUFFER);for(var s in a)o(a[s],e.ARRAY_BUFFER);var c=i.morphAttributes;for(var s in c)for(var u=c[s],l=0,d=u.length;d>l;l++)o(u[l],e.ARRAY_BUFFER);return i}function o(e,i){var r=e instanceof n.InterleavedBufferAttribute?e.data:e,o=t.get(r);void 0===o.__webglBuffer?a(o,r,i):o.version!==r.version&&s(o,r,i)}function a(t,i,r){t.__webglBuffer=e.createBuffer(),e.bindBuffer(r,t.__webglBuffer);var n=i.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW;e.bufferData(r,i.array,n),t.version=i.version}function s(t,i,r){e.bindBuffer(r,t.__webglBuffer),i.dynamic===!1||-1===i.updateRange.count?e.bufferSubData(r,0,i.array):0===i.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(r,i.updateRange.offset*i.array.BYTES_PER_ELEMENT,i.array.subarray(i.updateRange.offset,i.updateRange.offset+i.updateRange.count)),i.updateRange.count=0),t.version=i.version}function c(e){return e instanceof n.InterleavedBufferAttribute?t.get(e.data).__webglBuffer:t.get(e).__webglBuffer}function u(i){var r=t.get(i);if(void 0!==r.wireframe)return r.wireframe;var a=[],s=i.index,c=i.attributes,u=c.position;if(null!==s)for(var h={},d=s.array,p=0,f=d.length;f>p;p+=3){var m=d[p+0],g=d[p+1],v=d[p+2];l(h,m,g)&&a.push(m,g),l(h,g,v)&&a.push(g,v),l(h,v,m)&&a.push(v,m)}else for(var d=c.position.array,p=0,f=d.length/3-1;f>p;p+=3){var m=p+0,g=p+1,v=p+2;a.push(m,g,g,v,v,m)}var y=u.count>65535?Uint32Array:Uint16Array,M=new n.BufferAttribute(new y(a),1);return o(M,e.ELEMENT_ARRAY_BUFFER),r.wireframe=M,M}function l(e,t,i){if(t>i){var r=t;t=i,i=r}var n=e[t];return void 0===n?(e[t]=[i],!0):-1===n.indexOf(i)?(n.push(i),!0):!1}var h=new n.WebGLGeometries(e,t,i);this.getAttributeBuffer=c,this.getWireframeAttribute=u,this.update=r},n.WebGLProgram=function(){function e(e){switch(e){case n.LinearEncoding:return["Linear","( value )"];case n.sRGBEncoding:return["sRGB","( value )"];case n.RGBEEncoding:return["RGBE","( value )"];case n.RGBM7Encoding:return["RGBM","( value, 7.0 )"];case n.RGBM16Encoding:return["RGBM","( value, 16.0 )"];case n.RGBDEncoding:return["RGBD","( value, 256.0 )"];case n.GammaEncoding:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function t(t,i){var r=e(i);return"vec4 "+t+"( vec4 value ) { return "+r[0]+"ToLinear"+r[1]+"; }"}function i(t,i){var r=e(i);return"vec4 "+t+"( vec4 value ) { return LinearTo"+r[0]+r[1]+"; }"}function r(e,t){var i;switch(t){case n.LinearToneMapping:i="Linear";break;case n.ReinhardToneMapping:i="Reinhard";break;case n.Uncharted2ToneMapping:i="Uncharted2";break;case n.CineonToneMapping:i="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function o(e,t,i){e=e||{};var r=[e.derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return r.filter(c).join("\n")}function a(e){var t=[];for(var i in e){var r=e[i];r!==!1&&t.push("#define "+i+" "+r)}return t.join("\n")}function s(e,t){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=0;r>n;n++){var o=e.getActiveAttrib(t,n),a=o.name;i[a]=e.getAttribLocation(t,a)}return i}function c(e){return""!==e}function u(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function l(e){function t(e,t){var i=n.ShaderChunk[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return l(i)}var i=/#include +<([\w\d.]+)>/g;return e.replace(i,t)}function h(e){function t(e,t,i,r){for(var n="",o=parseInt(t);o<parseInt(i);o++)n+=r.replace(/\[ i \]/g,"[ "+o+" ]");return n}var i=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return e.replace(i,t)}var d=0;return function(e,p,f,m){var g=e.context,v=f.extensions,y=f.defines,M=f.__webglShader.vertexShader,A=f.__webglShader.fragmentShader,x="SHADOWMAP_TYPE_BASIC";m.shadowMapType===n.PCFShadowMap?x="SHADOWMAP_TYPE_PCF":m.shadowMapType===n.PCFSoftShadowMap&&(x="SHADOWMAP_TYPE_PCF_SOFT");var w="ENVMAP_TYPE_CUBE",E="ENVMAP_MODE_REFLECTION",b="ENVMAP_BLENDING_MULTIPLY";if(m.envMap){switch(f.envMap.mapping){case n.CubeReflectionMapping:case n.CubeRefractionMapping: w="ENVMAP_TYPE_CUBE";break;case n.CubeUVReflectionMapping:case n.CubeUVRefractionMapping:w="ENVMAP_TYPE_CUBE_UV";break;case n.EquirectangularReflectionMapping:case n.EquirectangularRefractionMapping:w="ENVMAP_TYPE_EQUIREC";break;case n.SphericalReflectionMapping:w="ENVMAP_TYPE_SPHERE"}switch(f.envMap.mapping){case n.CubeRefractionMapping:case n.EquirectangularRefractionMapping:E="ENVMAP_MODE_REFRACTION"}switch(f.combine){case n.MultiplyOperation:b="ENVMAP_BLENDING_MULTIPLY";break;case n.MixOperation:b="ENVMAP_BLENDING_MIX";break;case n.AddOperation:b="ENVMAP_BLENDING_ADD"}}var T,L,D=e.gammaFactor>0?e.gammaFactor:1,N=o(v,m,e.extensions),S=a(y),C=g.createProgram();f instanceof n.RawShaderMaterial?(T="",L=""):(T=["precision "+m.precision+" float;","precision "+m.precision+" int;","#define SHADER_NAME "+f.__webglShader.name,S,m.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+D,"#define MAX_BONES "+m.maxBones,m.map?"#define USE_MAP":"",m.envMap?"#define USE_ENVMAP":"",m.envMap?"#define "+E:"",m.lightMap?"#define USE_LIGHTMAP":"",m.aoMap?"#define USE_AOMAP":"",m.emissiveMap?"#define USE_EMISSIVEMAP":"",m.bumpMap?"#define USE_BUMPMAP":"",m.normalMap?"#define USE_NORMALMAP":"",m.displacementMap&&m.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",m.specularMap?"#define USE_SPECULARMAP":"",m.roughnessMap?"#define USE_ROUGHNESSMAP":"",m.metalnessMap?"#define USE_METALNESSMAP":"",m.alphaMap?"#define USE_ALPHAMAP":"",m.vertexColors?"#define USE_COLOR":"",m.flatShading?"#define FLAT_SHADED":"",m.skinning?"#define USE_SKINNING":"",m.useVertexTexture?"#define BONE_TEXTURE":"",m.morphTargets?"#define USE_MORPHTARGETS":"",m.morphNormals&&m.flatShading===!1?"#define USE_MORPHNORMALS":"",m.doubleSided?"#define DOUBLE_SIDED":"",m.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+m.numClippingPlanes,m.shadowMapEnabled?"#define USE_SHADOWMAP":"",m.shadowMapEnabled?"#define "+x:"",m.sizeAttenuation?"#define USE_SIZEATTENUATION":"",m.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",m.logarithmicDepthBuffer&&e.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif","\n"].filter(c).join("\n"),L=[N,"precision "+m.precision+" float;","precision "+m.precision+" int;","#define SHADER_NAME "+f.__webglShader.name,S,m.alphaTest?"#define ALPHATEST "+m.alphaTest:"","#define GAMMA_FACTOR "+D,m.useFog&&m.fog?"#define USE_FOG":"",m.useFog&&m.fogExp?"#define FOG_EXP2":"",m.map?"#define USE_MAP":"",m.envMap?"#define USE_ENVMAP":"",m.envMap?"#define "+w:"",m.envMap?"#define "+E:"",m.envMap?"#define "+b:"",m.lightMap?"#define USE_LIGHTMAP":"",m.aoMap?"#define USE_AOMAP":"",m.emissiveMap?"#define USE_EMISSIVEMAP":"",m.bumpMap?"#define USE_BUMPMAP":"",m.normalMap?"#define USE_NORMALMAP":"",m.specularMap?"#define USE_SPECULARMAP":"",m.roughnessMap?"#define USE_ROUGHNESSMAP":"",m.metalnessMap?"#define USE_METALNESSMAP":"",m.alphaMap?"#define USE_ALPHAMAP":"",m.vertexColors?"#define USE_COLOR":"",m.flatShading?"#define FLAT_SHADED":"",m.doubleSided?"#define DOUBLE_SIDED":"",m.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+m.numClippingPlanes,m.shadowMapEnabled?"#define USE_SHADOWMAP":"",m.shadowMapEnabled?"#define "+x:"",m.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",m.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",m.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",m.logarithmicDepthBuffer&&e.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",m.envMap&&e.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",m.toneMapping!==n.NoToneMapping?"#define TONE_MAPPING":"",m.toneMapping!==n.NoToneMapping?n.ShaderChunk.tonemapping_pars_fragment:"",m.toneMapping!==n.NoToneMapping?r("toneMapping",m.toneMapping):"",m.outputEncoding||m.mapEncoding||m.envMapEncoding||m.emissiveMapEncoding?n.ShaderChunk.encodings_pars_fragment:"",m.mapEncoding?t("mapTexelToLinear",m.mapEncoding):"",m.envMapEncoding?t("envMapTexelToLinear",m.envMapEncoding):"",m.emissiveMapEncoding?t("emissiveMapTexelToLinear",m.emissiveMapEncoding):"",m.outputEncoding?i("linearToOutputTexel",m.outputEncoding):"",m.depthPacking?"#define DEPTH_PACKING "+f.depthPacking:"","\n"].filter(c).join("\n")),M=l(M,m),M=u(M,m),A=l(A,m),A=u(A,m),f instanceof n.ShaderMaterial==!1&&(M=h(M),A=h(A));var I=T+M,j=L+A,_=n.WebGLShader(g,g.VERTEX_SHADER,I),O=n.WebGLShader(g,g.FRAGMENT_SHADER,j);g.attachShader(C,_),g.attachShader(C,O),void 0!==f.index0AttributeName?g.bindAttribLocation(C,0,f.index0AttributeName):m.morphTargets===!0&&g.bindAttribLocation(C,0,"position"),g.linkProgram(C);var z=g.getProgramInfoLog(C),k=g.getShaderInfoLog(_),R=g.getShaderInfoLog(O),B=!0,U=!0;g.getProgramParameter(C,g.LINK_STATUS)===!1?(B=!1,console.error("THREE.WebGLProgram: shader error: ",g.getError(),"gl.VALIDATE_STATUS",g.getProgramParameter(C,g.VALIDATE_STATUS),"gl.getProgramInfoLog",z,k,R)):""!==z?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",z):(""===k||""===R)&&(U=!1),U&&(this.diagnostics={runnable:B,material:f,programLog:z,vertexShader:{log:k,prefix:T},fragmentShader:{log:R,prefix:L}}),g.deleteShader(_),g.deleteShader(O);var P;this.getUniforms=function(){return void 0===P&&(P=new n.WebGLUniforms(g,C,e)),P};var F;return this.getAttributes=function(){return void 0===F&&(F=s(g,C)),F},this.destroy=function(){g.deleteProgram(C),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=d++,this.code=p,this.usedTimes=1,this.program=C,this.vertexShader=_,this.fragmentShader=O,this}}(),n.WebGLPrograms=function(e,t){function i(e){if(t.floatVertexTextures&&e&&e.skeleton&&e.skeleton.useVertexTexture)return 1024;var i=t.maxVertexUniforms,r=Math.floor((i-20)/4),o=r;return void 0!==e&&e instanceof n.SkinnedMesh&&(o=Math.min(e.skeleton.bones.length,o),o<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+o+" (try OpenGL instead of ANGLE)")),o}function r(e,t){var i;return e?e instanceof n.Texture?i=e.encoding:e instanceof n.WebGLRenderTarget&&(i=e.texture.encoding):i=n.LinearEncoding,i===n.LinearEncoding&&t&&(i=n.GammaEncoding),i}var o=[],a={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},s=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","depthPacking"];this.getParameters=function(o,s,c,u,l){var h=a[o.type],d=i(l),p=e.getPrecision();null!==o.precision&&(p=t.getMaxPrecision(o.precision),p!==o.precision&&console.warn("THREE.WebGLProgram.getParameters:",o.precision,"not supported, using",p,"instead."));var f={shaderID:h,precision:p,supportsVertexTextures:t.vertexTextures,outputEncoding:r(e.getCurrentRenderTarget(),e.gammaOutput),map:!!o.map,mapEncoding:r(o.map,e.gammaInput),envMap:!!o.envMap,envMapMode:o.envMap&&o.envMap.mapping,envMapEncoding:r(o.envMap,e.gammaInput),envMapCubeUV:!!o.envMap&&(o.envMap.mapping===n.CubeUVReflectionMapping||o.envMap.mapping===n.CubeUVRefractionMapping),lightMap:!!o.lightMap,aoMap:!!o.aoMap,emissiveMap:!!o.emissiveMap,emissiveMapEncoding:r(o.emissiveMap,e.gammaInput),bumpMap:!!o.bumpMap,normalMap:!!o.normalMap,displacementMap:!!o.displacementMap,roughnessMap:!!o.roughnessMap,metalnessMap:!!o.metalnessMap,specularMap:!!o.specularMap,alphaMap:!!o.alphaMap,combine:o.combine,vertexColors:o.vertexColors,fog:c,useFog:o.fog,fogExp:c instanceof n.FogExp2,flatShading:o.shading===n.FlatShading,sizeAttenuation:o.sizeAttenuation,logarithmicDepthBuffer:t.logarithmicDepthBuffer,skinning:o.skinning,maxBones:d,useVertexTexture:t.floatVertexTextures&&l&&l.skeleton&&l.skeleton.useVertexTexture,morphTargets:o.morphTargets,morphNormals:o.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numHemiLights:s.hemi.length,numClippingPlanes:u,shadowMapEnabled:e.shadowMap.enabled&&l.receiveShadow&&s.shadows.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:o.premultipliedAlpha,alphaTest:o.alphaTest,doubleSided:o.side===n.DoubleSide,flipSided:o.side===n.BackSide,depthPacking:void 0!==o.depthPacking?o.depthPacking:!1};return f},this.getProgramCode=function(e,t){var i=[];if(t.shaderID?i.push(t.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)i.push(r),i.push(e.defines[r]);for(var n=0;n<s.length;n++)i.push(t[s[n]]);return i.join()},this.acquireProgram=function(t,i,r){for(var a,s=0,c=o.length;c>s;s++){var u=o[s];if(u.code===r){a=u,++a.usedTimes;break}}return void 0===a&&(a=new n.WebGLProgram(e,r,t,i),o.push(a)),a},this.releaseProgram=function(e){if(0===--e.usedTimes){var t=o.indexOf(e);o[t]=o[o.length-1],o.pop(),e.destroy()}},this.programs=o},n.WebGLProperties=function(){var e={};this.get=function(t){var i=t.uuid,r=e[i];return void 0===r&&(r={},e[i]=r),r},this["delete"]=function(t){delete e[t.uuid]},this.clear=function(){e={}}},n.WebGLShader=function(){function e(e){for(var t=e.split("\n"),i=0;i<t.length;i++)t[i]=i+1+": "+t[i];return t.join("\n")}return function(t,i,r){var n=t.createShader(i);return t.shaderSource(n,r),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",i===t.VERTEX_SHADER?"vertex":"fragment",t.getShaderInfoLog(n),e(r)),n}}(),n.WebGLShadowMap=function(e,t,i){function r(t,i,r,o){var a=t.geometry,s=null,c=y,u=t.customDepthMaterial;if(r&&(c=M,u=t.customDistanceMaterial),u)s=u;else{var l=void 0!==a.morphTargets&&a.morphTargets.length>0&&i.morphTargets,h=t instanceof n.SkinnedMesh&&i.skinning,d=0;l&&(d|=m),h&&(d|=g),s=c[d]}if(e.localClippingEnabled&&i.clipShadows===!0&&0!==i.clippingPlanes.length){var p=s.uuid,f=i.uuid,v=A[p];void 0===v&&(v={},A[p]=v);var x=v[f];void 0===x&&(x=s.clone(),v[f]=x),s=x}return s.visible=i.visible,s.wireframe=i.wireframe,s.side=i.side,s.clipShadows=i.clipShadows,s.clippingPlanes=i.clippingPlanes,s.wireframeLinewidth=i.wireframeLinewidth,s.linewidth=i.linewidth,r&&void 0!==s.uniforms.lightPos&&s.uniforms.lightPos.value.copy(o),s}function o(e,t,i){if(e.visible!==!1){if(e.layers.test(t.layers)&&(e instanceof n.Mesh||e instanceof n.Line||e instanceof n.Points)&&e.castShadow&&(e.frustumCulled===!1||c.intersectsObject(e)===!0)){var r=e.material;r.visible===!0&&(e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),f.push(e))}for(var a=e.children,s=0,u=a.length;u>s;s++)o(a[s],t,i)}}var a=e.context,s=e.state,c=new n.Frustum,u=new n.Matrix4,l=t.shadows,h=new n.Vector2,d=new n.Vector3,p=new n.Vector3,f=[],m=1,g=2,v=(m|g)+1,y=new Array(v),M=new Array(v),A={},x=[new n.Vector3(1,0,0),new n.Vector3(-1,0,0),new n.Vector3(0,0,1),new n.Vector3(0,0,-1),new n.Vector3(0,1,0),new n.Vector3(0,-1,0)],w=[new n.Vector3(0,1,0),new n.Vector3(0,1,0),new n.Vector3(0,1,0),new n.Vector3(0,1,0),new n.Vector3(0,0,1),new n.Vector3(0,0,-1)],E=[new n.Vector4,new n.Vector4,new n.Vector4,new n.Vector4,new n.Vector4,new n.Vector4],b=new n.MeshDepthMaterial;b.depthPacking=n.RGBADepthPacking,b.clipping=!0;for(var T=n.ShaderLib.distanceRGBA,L=n.UniformsUtils.clone(T.uniforms),D=0;D!==v;++D){var N=0!==(D&m),S=0!==(D&g),C=b.clone();C.morphTargets=N,C.skinning=S,y[D]=C;var I=new n.ShaderMaterial({defines:{USE_SHADOWMAP:""},uniforms:L,vertexShader:T.vertexShader,fragmentShader:T.fragmentShader,morphTargets:N,skinning:S,clipping:!0});M[D]=I}var j=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=n.PCFShadowMap,this.cullFace=n.CullFaceFront,this.render=function(t,m){if(j.enabled!==!1&&(j.autoUpdate!==!1||j.needsUpdate!==!1)&&0!==l.length){s.clearColor(1,1,1,1),s.disable(a.BLEND),s.enable(a.CULL_FACE),a.frontFace(a.CCW),a.cullFace(j.cullFace===n.CullFaceFront?a.FRONT:a.BACK),s.setDepthTest(!0),s.setScissorTest(!1);for(var g,v,y=0,M=l.length;M>y;y++){var A=l[y],b=A.shadow,T=b.camera;if(h.copy(b.mapSize),A instanceof n.PointLight){g=6,v=!0;var L=h.x,D=h.y;E[0].set(2*L,D,L,D),E[1].set(0,D,L,D),E[2].set(3*L,D,L,D),E[3].set(L,D,L,D),E[4].set(3*L,0,L,D),E[5].set(L,0,L,D),h.x*=4,h.y*=2}else g=1,v=!1;if(null===b.map){var N={minFilter:n.NearestFilter,magFilter:n.NearestFilter,format:n.RGBAFormat};b.map=new n.WebGLRenderTarget(h.x,h.y,N),T.updateProjectionMatrix()}b instanceof n.SpotLightShadow&&b.update(A);var S=b.map,C=b.matrix;p.setFromMatrixPosition(A.matrixWorld),T.position.copy(p),e.setRenderTarget(S),e.clear();for(var I=0;g>I;I++){if(v){d.copy(T.position),d.add(x[I]),T.up.copy(w[I]),T.lookAt(d);var _=E[I];s.viewport(_)}else d.setFromMatrixPosition(A.target.matrixWorld),T.lookAt(d);T.updateMatrixWorld(),T.matrixWorldInverse.getInverse(T.matrixWorld),C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(T.projectionMatrix),C.multiply(T.matrixWorldInverse),u.multiplyMatrices(T.projectionMatrix,T.matrixWorldInverse),c.setFromMatrix(u),f.length=0,o(t,m,T);for(var O=0,z=f.length;z>O;O++){var k=f[O],R=i.update(k),B=k.material;if(B instanceof n.MultiMaterial)for(var U=R.groups,P=B.materials,F=0,G=U.length;G>F;F++){var V=U[F],Q=P[V.materialIndex];if(Q.visible===!0){var Y=r(k,Q,v,p);e.renderBufferDirect(T,null,R,Y,k,V)}}else{var Y=r(k,B,v,p);e.renderBufferDirect(T,null,R,Y,k,null)}}}}var H=e.getClearColor(),W=e.getClearAlpha();e.setClearColor(H,W),s.enable(a.BLEND),j.cullFace===n.CullFaceFront&&a.cullFace(a.BACK),j.needsUpdate=!1}}},n.WebGLState=function(e,t,i){var r=this,o=new n.Vector4,a=e.getParameter(e.MAX_VERTEX_ATTRIBS),s=new Uint8Array(a),c=new Uint8Array(a),u=new Uint8Array(a),l={},h=null,d=null,p=null,f=null,m=null,g=null,v=null,y=null,M=!1,A=null,x=null,w=null,E=null,b=null,T=null,L=null,D=null,N=null,S=null,C=null,I=null,j=null,_=null,O=null,z=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),k=void 0,R={},B=new n.Vector4,U=null,P=null,F=new n.Vector4,G=new n.Vector4;this.init=function(){this.clearColor(0,0,0,1),this.clearDepth(1),this.clearStencil(0),this.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.frontFace(e.CCW),e.cullFace(e.BACK),this.enable(e.CULL_FACE),this.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA)},this.initAttributes=function(){for(var e=0,t=s.length;t>e;e++)s[e]=0},this.enableAttribute=function(i){if(s[i]=1,0===c[i]&&(e.enableVertexAttribArray(i),c[i]=1),0!==u[i]){var r=t.get("ANGLE_instanced_arrays");r.vertexAttribDivisorANGLE(i,0),u[i]=0}},this.enableAttributeAndDivisor=function(t,i,r){s[t]=1,0===c[t]&&(e.enableVertexAttribArray(t),c[t]=1),u[t]!==i&&(r.vertexAttribDivisorANGLE(t,i),u[t]=i)},this.disableUnusedAttributes=function(){for(var t=0,i=c.length;i>t;t++)c[t]!==s[t]&&(e.disableVertexAttribArray(t),c[t]=0)},this.enable=function(t){l[t]!==!0&&(e.enable(t),l[t]=!0)},this.disable=function(t){l[t]!==!1&&(e.disable(t),l[t]=!1)},this.getCompressedTextureFormats=function(){if(null===h&&(h=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")))for(var i=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),r=0;r<i.length;r++)h.push(i[r]);return h},this.setBlending=function(t,r,o,a,s,c,u,l){t===n.NoBlending?this.disable(e.BLEND):this.enable(e.BLEND),(t!==d||l!==M)&&(t===n.AdditiveBlending?l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)):t===n.SubtractiveBlending?l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR)):t===n.MultiplyBlending?l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.SRC_COLOR,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR)):l?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)),d=t,M=l),t===n.CustomBlending?(s=s||r,c=c||o,u=u||a,(r!==p||s!==g)&&(e.blendEquationSeparate(i(r),i(s)),p=r,g=s),(o!==f||a!==m||c!==v||u!==y)&&(e.blendFuncSeparate(i(o),i(a),i(c),i(u)),f=o,m=a,v=c,y=u)):(p=null,f=null,m=null,g=null,v=null,y=null)},this.setDepthFunc=function(t){if(A!==t){if(t)switch(t){case n.NeverDepth:e.depthFunc(e.NEVER);break;case n.AlwaysDepth:e.depthFunc(e.ALWAYS);break;case n.LessDepth:e.depthFunc(e.LESS);break;case n.LessEqualDepth:e.depthFunc(e.LEQUAL);break;case n.EqualDepth:e.depthFunc(e.EQUAL);break;case n.GreaterEqualDepth:e.depthFunc(e.GEQUAL);break;case n.GreaterDepth:e.depthFunc(e.GREATER);break;case n.NotEqualDepth:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);A=t}},this.setDepthTest=function(t){t?this.enable(e.DEPTH_TEST):this.disable(e.DEPTH_TEST)},this.setDepthWrite=function(t){x!==t&&(e.depthMask(t),x=t)},this.setColorWrite=function(t){w!==t&&(e.colorMask(t,t,t,t),w=t)},this.setStencilFunc=function(t,i,r){(b!==t||T!==i||L!==r)&&(e.stencilFunc(t,i,r),b=t,T=i,L=r)},this.setStencilOp=function(t,i,r){(D!==t||N!==i||S!==r)&&(e.stencilOp(t,i,r),D=t,N=i,S=r)},this.setStencilTest=function(t){t?this.enable(e.STENCIL_TEST):this.disable(e.STENCIL_TEST)},this.setStencilWrite=function(t){E!==t&&(e.stencilMask(t),E=t)},this.setFlipSided=function(t){C!==t&&(e.frontFace(t?e.CW:e.CCW),C=t)},this.setLineWidth=function(t){t!==I&&(e.lineWidth(t),I=t)},this.setPolygonOffset=function(t,i,r){t?this.enable(e.POLYGON_OFFSET_FILL):this.disable(e.POLYGON_OFFSET_FILL),!t||j===i&&_===r||(e.polygonOffset(i,r),j=i,_=r)},this.getScissorTest=function(){return O},this.setScissorTest=function(t){O=t,t?this.enable(e.SCISSOR_TEST):this.disable(e.SCISSOR_TEST)},this.activeTexture=function(t){void 0===t&&(t=e.TEXTURE0+z-1),k!==t&&(e.activeTexture(t),k=t)},this.bindTexture=function(t,i){void 0===k&&r.activeTexture();var n=R[k];void 0===n&&(n={type:void 0,texture:void 0},R[k]=n),(n.type!==t||n.texture!==i)&&(e.bindTexture(t,i),n.type=t,n.texture=i)},this.compressedTexImage2D=function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error(t)}},this.texImage2D=function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error(t)}},this.clearColor=function(t,i,r,n){o.set(t,i,r,n),B.equals(o)===!1&&(e.clearColor(t,i,r,n),B.copy(o))},this.clearDepth=function(t){U!==t&&(e.clearDepth(t),U=t)},this.clearStencil=function(t){P!==t&&(e.clearStencil(t),P=t)},this.scissor=function(t){F.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),F.copy(t))},this.viewport=function(t){G.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),G.copy(t))},this.reset=function(){for(var t=0;t<c.length;t++)1===c[t]&&(e.disableVertexAttribArray(t),c[t]=0);l={},h=null,k=void 0,R={},d=null,w=null,x=null,E=null,C=null}},n.WebGLUniforms=function(){var e=function(){this.seq=[],this.map={}},t=[],i=[],r=function(e,i,r){var n=e[0];if(0>=n||n>0)return e;var o=i*r,a=t[o];if(void 0===a&&(a=new Float32Array(o),t[o]=a),0!==i){n.toArray(a,0);for(var s=1,c=0;s!==i;++s)c+=r,e[s].toArray(a,c)}return a},n=function(e,t){var r=i[t];void 0===r&&(r=new Int32Array(t),i[t]=r);for(var n=0;n!==t;++n)r[n]=e.allocTextureUnit();return r},o=function(e,t){e.uniform1f(this.addr,t)},a=function(e,t){e.uniform1i(this.addr,t)},s=function(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)},c=function(e,t){void 0!==t.x?e.uniform3f(this.addr,t.x,t.y,t.z):void 0!==t.r?e.uniform3f(this.addr,t.r,t.g,t.b):e.uniform3fv(this.addr,t)},u=function(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)},l=function(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)},h=function(e,t){e.uniformMatrix3fv(this.addr,!1,t.elements||t)},d=function(e,t){e.uniformMatrix4fv(this.addr,!1,t.elements||t)},p=function(e,t,i){var r=i.allocTextureUnit();e.uniform1i(this.addr,r),t&&i.setTexture2D(t,r)},f=function(e,t,i){var r=i.allocTextureUnit();e.uniform1i(this.addr,r),t&&i.setTextureCube(t,r)},m=function(e,t){e.uniform2iv(this.addr,t)},g=function(e,t){e.uniform3iv(this.addr,t)},v=function(e,t){e.uniform4iv(this.addr,t)},y=function(e){switch(e){case 5126:return o;case 35664:return s;case 35665:return c;case 35666:return u;case 35674:return l;case 35675:return h;case 35676:return d;case 35678:return p;case 35680:return f;case 5124:case 35670:return a;case 35667:case 35671:return m;case 35668:case 35672:return g;case 35669:case 35673:return v}},M=function(e,t){e.uniform1fv(this.addr,t)},A=function(e,t){e.uniform1iv(this.addr,t)},x=function(e,t){e.uniform2fv(this.addr,r(t,this.size,2))},w=function(e,t){e.uniform3fv(this.addr,r(t,this.size,3))},E=function(e,t){e.uniform4fv(this.addr,r(t,this.size,4))},b=function(e,t){e.uniformMatrix2fv(this.addr,!1,r(t,this.size,4))},T=function(e,t){e.uniformMatrix3fv(this.addr,!1,r(t,this.size,9))},L=function(e,t){e.uniformMatrix4fv(this.addr,!1,r(t,this.size,16))},D=function(e,t,i){var r=t.length,o=n(i,r);e.uniform1iv(this.addr,o);for(var a=0;a!==r;++a){var s=t[a];s&&i.setTexture2D(s,o[a])}},N=function(e,t,i){var r=t.length,o=n(i,r);e.uniform1iv(this.addr,o);for(var a=0;a!==r;++a){var s=t[a];s&&i.setTextureCube(s,o[a])}},S=function(e){switch(e){case 5126:return M;case 35664:return x;case 35665:return w;case 35666:return E;case 35674:return b;case 35675:return T;case 35676:return L;case 35678:return D;case 35680:return N;case 5124:case 35670:return A;case 35667:case 35671:return m;case 35668:case 35672:return g;case 35669:case 35673:return v}},C=function(e,t,i){this.id=e,this.addr=i,this.setValue=y(t.type)},I=function(e,t,i){this.id=e,this.addr=i,this.size=t.size,this.setValue=S(t.type)},j=function(t){this.id=t,e.call(this)};j.prototype.setValue=function(e,t){for(var i=this.seq,r=0,n=i.length;r!==n;++r){var o=i[r];o.setValue(e,t[o.id])}};var _=/([\w\d_]+)(\])?(\[|\.)?/g,O=function(e,t){e.seq.push(t),e.map[t.id]=t},z=function(e,t,i){var r=e.name,n=r.length;for(_.lastIndex=0;;){var o=_.exec(r),a=_.lastIndex,s=o[1],c="]"===o[2],u=o[3];if(c&&(s=0|s),void 0===u||"["===u&&a+2===n){O(i,void 0===u?new C(s,e,t):new I(s,e,t));break}var l=i.map,h=l[s];void 0===h&&(h=new j(s),O(i,h)),i=h}},k=function(t,i,r){e.call(this),this.renderer=r;for(var n=t.getProgramParameter(i,t.ACTIVE_UNIFORMS),o=0;o!==n;++o){var a=t.getActiveUniform(i,o),s=a.name,c=t.getUniformLocation(i,s);z(a,c,this)}};return k.prototype.setValue=function(e,t,i){var r=this.map[t];void 0!==r&&r.setValue(e,i,this.renderer)},k.prototype.set=function(e,t,i){var r=this.map[i];void 0!==r&&r.setValue(e,t[i],this.renderer)},k.prototype.setOptional=function(e,t,i){var r=t[i];void 0!==r&&this.setValue(e,i,r)},k.upload=function(e,t,i,r){for(var n=0,o=t.length;n!==o;++n){var a=t[n],s=i[a.id];s.needsUpdate!==!1&&a.setValue(e,s.value,r)}},k.seqWithValue=function(e,t){for(var i=[],r=0,n=e.length;r!==n;++r){var o=e[r];o.id in t&&i.push(o)}return i},k.splitDynamic=function(e,t){for(var i=null,r=e.length,n=0,o=0;o!==r;++o){var a=e[o],s=t[a.id];s&&s.dynamic===!0?(null===i&&(i=[]),i.push(a)):(o>n&&(e[n]=a),++n)}return r>n&&(e.length=n),i},k.evalDynamic=function(e,t,i,r){for(var n=0,o=e.length;n!==o;++n){var a=t[e[n].id],s=a.onUpdateCallback;void 0!==s&&s.call(a,i,r)}},k}(),n.LensFlarePlugin=function(e,t){function i(){var e=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),t=new Uint16Array([0,1,2,0,2,3]);o=p.createBuffer(),a=p.createBuffer(),p.bindBuffer(p.ARRAY_BUFFER,o),p.bufferData(p.ARRAY_BUFFER,e,p.STATIC_DRAW),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,a),p.bufferData(p.ELEMENT_ARRAY_BUFFER,t,p.STATIC_DRAW),h=p.createTexture(),d=p.createTexture(),f.bindTexture(p.TEXTURE_2D,h),p.texImage2D(p.TEXTURE_2D,0,p.RGB,16,16,0,p.RGB,p.UNSIGNED_BYTE,null),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),f.bindTexture(p.TEXTURE_2D,d),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,16,16,0,p.RGBA,p.UNSIGNED_BYTE,null),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),s={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},c=r(s),u={vertex:p.getAttribLocation(c,"position"),uv:p.getAttribLocation(c,"uv")},l={renderType:p.getUniformLocation(c,"renderType"),map:p.getUniformLocation(c,"map"),occlusionMap:p.getUniformLocation(c,"occlusionMap"),opacity:p.getUniformLocation(c,"opacity"),color:p.getUniformLocation(c,"color"),scale:p.getUniformLocation(c,"scale"),rotation:p.getUniformLocation(c,"rotation"),screenPosition:p.getUniformLocation(c,"screenPosition")}}function r(t){var i=p.createProgram(),r=p.createShader(p.FRAGMENT_SHADER),n=p.createShader(p.VERTEX_SHADER),o="precision "+e.getPrecision()+" float;\n";return p.shaderSource(r,o+t.fragmentShader),p.shaderSource(n,o+t.vertexShader),p.compileShader(r),p.compileShader(n),p.attachShader(i,r),p.attachShader(i,n),p.linkProgram(i),i}var o,a,s,c,u,l,h,d,p=e.context,f=e.state;this.render=function(r,s,m){if(0!==t.length){var g=new n.Vector3,v=m.w/m.z,y=.5*m.z,M=.5*m.w,A=16/m.w,x=new n.Vector2(A*v,A),w=new n.Vector3(1,1,0),E=new n.Vector2(1,1),b=new n.Box2;b.min.set(0,0),b.max.set(m.z-16,m.w-16),void 0===c&&i(),p.useProgram(c),f.initAttributes(),f.enableAttribute(u.vertex),f.enableAttribute(u.uv),f.disableUnusedAttributes(),p.uniform1i(l.occlusionMap,0),p.uniform1i(l.map,1),p.bindBuffer(p.ARRAY_BUFFER,o),p.vertexAttribPointer(u.vertex,2,p.FLOAT,!1,16,0),p.vertexAttribPointer(u.uv,2,p.FLOAT,!1,16,8),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,a),f.disable(p.CULL_FACE),f.setDepthWrite(!1);for(var T=0,L=t.length;L>T;T++){A=16/m.w,x.set(A*v,A);var D=t[T];if(g.set(D.matrixWorld.elements[12],D.matrixWorld.elements[13],D.matrixWorld.elements[14]),g.applyMatrix4(s.matrixWorldInverse),g.applyProjection(s.projectionMatrix),w.copy(g),E.x=m.x+w.x*y+y-8,E.y=m.y+w.y*M+M-8,b.containsPoint(E)===!0){f.activeTexture(p.TEXTURE0),f.bindTexture(p.TEXTURE_2D,null),f.activeTexture(p.TEXTURE1),f.bindTexture(p.TEXTURE_2D,h),p.copyTexImage2D(p.TEXTURE_2D,0,p.RGB,E.x,E.y,16,16,0),p.uniform1i(l.renderType,0),p.uniform2f(l.scale,x.x,x.y),p.uniform3f(l.screenPosition,w.x,w.y,w.z),f.disable(p.BLEND),f.enable(p.DEPTH_TEST),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0),f.activeTexture(p.TEXTURE0),f.bindTexture(p.TEXTURE_2D,d),p.copyTexImage2D(p.TEXTURE_2D,0,p.RGBA,E.x,E.y,16,16,0),p.uniform1i(l.renderType,1),f.disable(p.DEPTH_TEST),f.activeTexture(p.TEXTURE1),f.bindTexture(p.TEXTURE_2D,h),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0),D.positionScreen.copy(w),D.customUpdateCallback?D.customUpdateCallback(D):D.updateLensFlares(),p.uniform1i(l.renderType,2),f.enable(p.BLEND);for(var N=0,S=D.lensFlares.length;S>N;N++){var C=D.lensFlares[N];C.opacity>.001&&C.scale>.001&&(w.x=C.x,w.y=C.y,w.z=C.z,A=C.size*C.scale/m.w,x.x=A*v,x.y=A,p.uniform3f(l.screenPosition,w.x,w.y,w.z),p.uniform2f(l.scale,x.x,x.y),p.uniform1f(l.rotation,C.rotation),p.uniform1f(l.opacity,C.opacity),p.uniform3f(l.color,C.color.r,C.color.g,C.color.b),f.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),e.setTexture2D(C.texture,1),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0))}}}f.enable(p.CULL_FACE),f.enable(p.DEPTH_TEST),f.setDepthWrite(!0),e.resetGLState()}}},n.SpritePlugin=function(e,t){function i(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),t=new Uint16Array([0,1,2,0,2,3]);a=d.createBuffer(),s=d.createBuffer(),d.bindBuffer(d.ARRAY_BUFFER,a),d.bufferData(d.ARRAY_BUFFER,e,d.STATIC_DRAW),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,s),d.bufferData(d.ELEMENT_ARRAY_BUFFER,t,d.STATIC_DRAW),c=r(),u={position:d.getAttribLocation(c,"position"),uv:d.getAttribLocation(c,"uv")},l={uvOffset:d.getUniformLocation(c,"uvOffset"),uvScale:d.getUniformLocation(c,"uvScale"),rotation:d.getUniformLocation(c,"rotation"),scale:d.getUniformLocation(c,"scale"),color:d.getUniformLocation(c,"color"),map:d.getUniformLocation(c,"map"),opacity:d.getUniformLocation(c,"opacity"),modelViewMatrix:d.getUniformLocation(c,"modelViewMatrix"),projectionMatrix:d.getUniformLocation(c,"projectionMatrix"), fogType:d.getUniformLocation(c,"fogType"),fogDensity:d.getUniformLocation(c,"fogDensity"),fogNear:d.getUniformLocation(c,"fogNear"),fogFar:d.getUniformLocation(c,"fogFar"),fogColor:d.getUniformLocation(c,"fogColor"),alphaTest:d.getUniformLocation(c,"alphaTest")};var i=document.createElement("canvas");i.width=8,i.height=8;var o=i.getContext("2d");o.fillStyle="white",o.fillRect(0,0,8,8),h=new n.Texture(i),h.needsUpdate=!0}function r(){var t=d.createProgram(),i=d.createShader(d.VERTEX_SHADER),r=d.createShader(d.FRAGMENT_SHADER);return d.shaderSource(i,["precision "+e.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),d.shaderSource(r,["precision "+e.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),d.compileShader(i),d.compileShader(r),d.attachShader(t,i),d.attachShader(t,r),d.linkProgram(t),t}function o(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}var a,s,c,u,l,h,d=e.context,p=e.state,f=new n.Vector3,m=new n.Quaternion,g=new n.Vector3;this.render=function(r,v){if(0!==t.length){void 0===c&&i(),d.useProgram(c),p.initAttributes(),p.enableAttribute(u.position),p.enableAttribute(u.uv),p.disableUnusedAttributes(),p.disable(d.CULL_FACE),p.enable(d.BLEND),d.bindBuffer(d.ARRAY_BUFFER,a),d.vertexAttribPointer(u.position,2,d.FLOAT,!1,16,0),d.vertexAttribPointer(u.uv,2,d.FLOAT,!1,16,8),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,s),d.uniformMatrix4fv(l.projectionMatrix,!1,v.projectionMatrix.elements),p.activeTexture(d.TEXTURE0),d.uniform1i(l.map,0);var y=0,M=0,A=r.fog;A?(d.uniform3f(l.fogColor,A.color.r,A.color.g,A.color.b),A instanceof n.Fog?(d.uniform1f(l.fogNear,A.near),d.uniform1f(l.fogFar,A.far),d.uniform1i(l.fogType,1),y=1,M=1):A instanceof n.FogExp2&&(d.uniform1f(l.fogDensity,A.density),d.uniform1i(l.fogType,2),y=2,M=2)):(d.uniform1i(l.fogType,0),y=0,M=0);for(var x=0,w=t.length;w>x;x++){var E=t[x];E.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,E.matrixWorld),E.z=-E.modelViewMatrix.elements[14]}t.sort(o);for(var b=[],x=0,w=t.length;w>x;x++){var E=t[x],T=E.material;d.uniform1f(l.alphaTest,T.alphaTest),d.uniformMatrix4fv(l.modelViewMatrix,!1,E.modelViewMatrix.elements),E.matrixWorld.decompose(f,m,g),b[0]=g.x,b[1]=g.y;var L=0;r.fog&&T.fog&&(L=M),y!==L&&(d.uniform1i(l.fogType,L),y=L),null!==T.map?(d.uniform2f(l.uvOffset,T.map.offset.x,T.map.offset.y),d.uniform2f(l.uvScale,T.map.repeat.x,T.map.repeat.y)):(d.uniform2f(l.uvOffset,0,0),d.uniform2f(l.uvScale,1,1)),d.uniform1f(l.opacity,T.opacity),d.uniform3f(l.color,T.color.r,T.color.g,T.color.b),d.uniform1f(l.rotation,T.rotation),d.uniform2fv(l.scale,b),p.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst),p.setDepthTest(T.depthTest),p.setDepthWrite(T.depthWrite),T.map?e.setTexture2D(T.map,0):e.setTexture2D(h,0),d.drawElements(d.TRIANGLES,6,d.UNSIGNED_SHORT,0)}p.enable(d.CULL_FACE),e.resetGLState()}}},Object.defineProperties(n.Box2.prototype,{empty:{value:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()}},isIntersectionBox:{value:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)}}}),Object.defineProperties(n.Box3.prototype,{empty:{value:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()}},isIntersectionBox:{value:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)}},isIntersectionSphere:{value:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}}),Object.defineProperties(n.Matrix3.prototype,{multiplyVector3:{value:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)}},multiplyVector3Array:{value:function(e){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)}}}),Object.defineProperties(n.Matrix4.prototype,{extractPosition:{value:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)}},setRotationFromQuaternion:{value:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)}},multiplyVector3:{value:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),e.applyProjection(this)}},multiplyVector4:{value:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)}},multiplyVector3Array:{value:function(e){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)}},rotateAxis:{value:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)}},crossVector:{value:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)}},translate:{value:function(){console.error("THREE.Matrix4: .translate() has been removed.")}},rotateX:{value:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")}},rotateY:{value:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")}},rotateZ:{value:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")}},rotateByAxis:{value:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")}}}),Object.defineProperties(n.Plane.prototype,{isIntersectionLine:{value:function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)}}}),Object.defineProperties(n.Quaternion.prototype,{multiplyVector3:{value:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)}}}),Object.defineProperties(n.Ray.prototype,{isIntersectionBox:{value:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)}},isIntersectionPlane:{value:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)}},isIntersectionSphere:{value:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}}),Object.defineProperties(n.Vector3.prototype,{setEulerFromRotationMatrix:{value:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")}},setEulerFromQuaternion:{value:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")}},getPositionFromMatrix:{value:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)}},getScaleFromMatrix:{value:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)}},getColumnFromMatrix:{value:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)}}}),n.Face4=function(e,t,i,r,o,a,s){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new n.Face3(e,t,i,o,a,s)},n.Vertex=function(e,t,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new n.Vector3(e,t,i)},Object.defineProperties(n.Object3D.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},getChildByName:{value:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)}},renderDepth:{set:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")}},translate:{value:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(n,{PointCloud:{value:function(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new n.Points(e,t)}},ParticleSystem:{value:function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new n.Points(e,t)}}}),Object.defineProperties(n.Light.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(n.BufferAttribute.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length}}}),Object.defineProperties(n.BufferGeometry.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}},addIndex:{value:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)}},addDrawCall:{value:function(e,t,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)}},clearDrawCalls:{value:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()}},computeTangents:{value:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")}},computeOffsets:{value:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}}),Object.defineProperties(n.Material.prototype,{wrapAround:{get:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new n.Color}}}),Object.defineProperties(n,{PointCloudMaterial:{value:function(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new n.PointsMaterial(e)}},ParticleBasicMaterial:{value:function(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new n.PointsMaterial(e)}},ParticleSystemMaterial:{value:function(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new n.PointsMaterial(e)}}}),Object.defineProperties(n.MeshPhongMaterial.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(n.ShaderMaterial.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.defineProperties(n.WebGLRenderer.prototype,{supportsFloatTextures:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")}},supportsHalfFloatTextures:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")}},supportsStandardDerivatives:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")}},supportsCompressedTextureS3TC:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")}},supportsCompressedTexturePVRTC:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")}},supportsBlendMinMax:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")}},supportsVertexTextures:{value:function(){return this.capabilities.vertexTextures}},supportsInstancedArrays:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")}},enableScissorTest:{value:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)}},initMaterial:{value:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")}},addPrePlugin:{value:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")}},addPostPlugin:{value:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")}},updateShadowMap:{value:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=e}}}),Object.defineProperties(n.WebGLRenderTarget.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(n.Audio.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader.");var t=this,i=new n.AudioLoader;return i.load(e,function(e){t.setBuffer(e)}),this}}}),n.GeometryUtils={merge:function(e,t,i){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var r;t instanceof n.Mesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,i)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}},n.ImageUtils={crossOrigin:void 0,loadTexture:function(e,t,i,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var o=new n.TextureLoader;o.setCrossOrigin(this.crossOrigin);var a=o.load(e,i,void 0,r);return t&&(a.mapping=t),a},loadTextureCube:function(e,t,i,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var o=new n.CubeTextureLoader;o.setCrossOrigin(this.crossOrigin);var a=o.load(e,i,void 0,r);return t&&(a.mapping=t),a},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}},n.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(e,t){console.warn("THREE.Projector: .projectVector() is now vector.project()."),e.project(t)},this.unprojectVector=function(e,t){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),e.unproject(t)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},n.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},n.MeshFaceMaterial=n.MultiMaterial,Object.defineProperties(n.LOD.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),n.CurveUtils={tangentQuadraticBezier:function(e,t,i,r){return 2*(1-e)*(i-t)+2*e*(r-i)},tangentCubicBezier:function(e,t,i,r,n){return-3*t*(1-e)*(1-e)+3*i*(1-e)*(1-e)-6*e*i*(1-e)+6*e*r*(1-e)-3*e*e*r+3*e*e*n},tangentSpline:function(e){var t=6*e*e-6*e,i=3*e*e-4*e+1,r=-6*e*e+6*e,n=3*e*e-2*e;return t+i+r+n},interpolate:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,c=n*s;return(2*t-2*i+o+a)*c+(-3*t+3*i-2*o-a)*s+o*n+t}},n.SceneUtils={createMultiMaterialObject:function(e,t){for(var i=new n.Group,r=0,o=t.length;o>r;r++)i.add(new n.Mesh(e,t[r]));return i},detach:function(e,t,i){e.applyMatrix(t.matrixWorld),t.remove(e),i.add(e)},attach:function(e,t,i){var r=new n.Matrix4;r.getInverse(i.matrixWorld),e.applyMatrix(r),t.remove(e),i.add(e)}},n.ShapeUtils={area:function(e){for(var t=e.length,i=0,r=t-1,n=0;t>n;r=n++)i+=e[r].x*e[n].y-e[n].x*e[r].y;return.5*i},triangulate:function(){function e(e,t,i,r,n,o){var a,s,c,u,l,h,d,p,f;if(s=e[o[t]].x,c=e[o[t]].y,u=e[o[i]].x,l=e[o[i]].y,h=e[o[r]].x,d=e[o[r]].y,Number.EPSILON>(u-s)*(d-c)-(l-c)*(h-s))return!1;var m,g,v,y,M,A,x,w,E,b,T,L,D,N,S;for(m=h-u,g=d-l,v=s-h,y=c-d,M=u-s,A=l-c,a=0;n>a;a++)if(p=e[o[a]].x,f=e[o[a]].y,!(p===s&&f===c||p===u&&f===l||p===h&&f===d)&&(x=p-s,w=f-c,E=p-u,b=f-l,T=p-h,L=f-d,S=m*b-g*E,D=M*w-A*x,N=v*L-y*T,S>=-Number.EPSILON&&N>=-Number.EPSILON&&D>=-Number.EPSILON))return!1;return!0}return function(t,i){var r=t.length;if(3>r)return null;var o,a,s,c=[],u=[],l=[];if(n.ShapeUtils.area(t)>0)for(a=0;r>a;a++)u[a]=a;else for(a=0;r>a;a++)u[a]=r-1-a;var h=r,d=2*h;for(a=h-1;h>2;){if(d--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i?l:c;if(o=a,o>=h&&(o=0),a=o+1,a>=h&&(a=0),s=a+1,s>=h&&(s=0),e(t,o,a,s,h,u)){var p,f,m,g,v;for(p=u[o],f=u[a],m=u[s],c.push([t[p],t[f],t[m]]),l.push([u[o],u[a],u[s]]),g=a,v=a+1;h>v;g++,v++)u[g]=u[v];h--,d=2*h}}return i?l:c}}(),triangulateShape:function(e,t){function i(e,t,i){return e.x!==t.x?e.x<t.x?e.x<=i.x&&i.x<=t.x:t.x<=i.x&&i.x<=e.x:e.y<t.y?e.y<=i.y&&i.y<=t.y:t.y<=i.y&&i.y<=e.y}function r(e,t,r,n,o){var a=t.x-e.x,s=t.y-e.y,c=n.x-r.x,u=n.y-r.y,l=e.x-r.x,h=e.y-r.y,d=s*c-a*u,p=s*l-a*h;if(Math.abs(d)>Number.EPSILON){var f;if(d>0){if(0>p||p>d)return[];if(f=u*l-c*h,0>f||f>d)return[]}else{if(p>0||d>p)return[];if(f=u*l-c*h,f>0||d>f)return[]}if(0===f)return!o||0!==p&&p!==d?[e]:[];if(f===d)return!o||0!==p&&p!==d?[t]:[];if(0===p)return[r];if(p===d)return[n];var m=f/d;return[{x:e.x+m*a,y:e.y+m*s}]}if(0!==p||u*l!==c*h)return[];var g=0===a&&0===s,v=0===c&&0===u;if(g&&v)return e.x!==r.x||e.y!==r.y?[]:[e];if(g)return i(r,n,e)?[e]:[];if(v)return i(e,t,r)?[r]:[];var y,M,A,x,w,E,b,T;return 0!==a?(e.x<t.x?(y=e,A=e.x,M=t,x=t.x):(y=t,A=t.x,M=e,x=e.x),r.x<n.x?(w=r,b=r.x,E=n,T=n.x):(w=n,b=n.x,E=r,T=r.x)):(e.y<t.y?(y=e,A=e.y,M=t,x=t.y):(y=t,A=t.y,M=e,x=e.y),r.y<n.y?(w=r,b=r.y,E=n,T=n.y):(w=n,b=n.y,E=r,T=r.y)),b>=A?b>x?[]:x===b?o?[]:[w]:T>=x?[w,M]:[w,E]:A>T?[]:A===T?o?[]:[y]:T>=x?[y,M]:[y,E]}function o(e,t,i,r){var n=t.x-e.x,o=t.y-e.y,a=i.x-e.x,s=i.y-e.y,c=r.x-e.x,u=r.y-e.y,l=n*s-o*a,h=n*u-o*c;if(Math.abs(l)>Number.EPSILON){var d=c*s-u*a;return l>0?h>=0&&d>=0:h>=0||d>=0}return h>0}function a(e,t){function i(e,t){var i=y.length-1,r=e-1;0>r&&(r=i);var n=e+1;n>i&&(n=0);var a=o(y[e],y[r],y[n],s[t]);if(!a)return!1;var c=s.length-1,u=t-1;0>u&&(u=c);var l=t+1;return l>c&&(l=0),a=o(s[t],s[u],s[l],y[e]),a?!0:!1}function n(e,t){var i,n,o;for(i=0;i<y.length;i++)if(n=i+1,n%=y.length,o=r(e,t,y[i],y[n],!0),o.length>0)return!0;return!1}function a(e,i){var n,o,a,s,c;for(n=0;n<M.length;n++)for(o=t[M[n]],a=0;a<o.length;a++)if(s=a+1,s%=o.length,c=r(e,i,o[a],o[s],!0),c.length>0)return!0;return!1}for(var s,c,u,l,h,d,p,f,m,g,v,y=e.concat(),M=[],A=[],x=0,w=t.length;w>x;x++)M.push(x);for(var E=0,b=2*M.length;M.length>0;){if(b--,0>b){console.log("Infinite Loop! Holes left:"+M.length+", Probably Hole outside Shape!");break}for(u=E;u<y.length;u++){l=y[u],c=-1;for(var x=0;x<M.length;x++)if(d=M[x],p=l.x+":"+l.y+":"+d,void 0===A[p]){s=t[d];for(var T=0;T<s.length;T++)if(h=s[T],i(u,T)&&!n(l,h)&&!a(l,h)){c=T,M.splice(x,1),f=y.slice(0,u+1),m=y.slice(u),g=s.slice(c),v=s.slice(0,c+1),y=f.concat(g).concat(v).concat(m),E=u;break}if(c>=0)break;A[p]=!0}if(c>=0)break}}return y}for(var s,c,u,l,h,d,p={},f=e.concat(),m=0,g=t.length;g>m;m++)Array.prototype.push.apply(f,t[m]);for(s=0,c=f.length;c>s;s++)h=f[s].x+":"+f[s].y,void 0!==p[h]&&console.warn("THREE.Shape: Duplicate point",h),p[h]=s;var v=a(e,t),y=n.ShapeUtils.triangulate(v,!1);for(s=0,c=y.length;c>s;s++)for(l=y[s],u=0;3>u;u++)h=l[u].x+":"+l[u].y,d=p[h],void 0!==d&&(l[u]=d);return y.concat()},isClockWise:function(e){return n.ShapeUtils.area(e)<0},b2:function(){function e(e,t){var i=1-e;return i*i*t}function t(e,t){return 2*(1-e)*e*t}function i(e,t){return e*e*t}return function(r,n,o,a){return e(r,n)+t(r,o)+i(r,a)}}(),b3:function(){function e(e,t){var i=1-e;return i*i*i*t}function t(e,t){var i=1-e;return 3*i*i*e*t}function i(e,t){var i=1-e;return 3*i*e*e*t}function r(e,t){return e*e*e*t}return function(n,o,a,s,c){return e(n,o)+t(n,a)+i(n,s)+r(n,c)}}()},n.Curve=function(){},n.Curve.prototype={constructor:n.Curve,getPoint:function(){return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},getPointAt:function(e){var t=this.getUtoTmapping(e);return this.getPoint(t)},getPoints:function(e){e||(e=5);var t,i=[];for(t=0;e>=t;t++)i.push(this.getPoint(t/e));return i},getSpacedPoints:function(e){e||(e=5);var t,i=[];for(t=0;e>=t;t++)i.push(this.getPointAt(t/e));return i},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(e||(e=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i,r=[],n=this.getPoint(0),o=0;for(r.push(0),i=1;e>=i;i++)t=this.getPoint(i/e),o+=t.distanceTo(n),r.push(o),n=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var i,r=this.getLengths(),n=0,o=r.length;i=t?t:e*r[o-1];for(var a,s=0,c=o-1;c>=s;)if(n=Math.floor(s+(c-s)/2),a=r[n]-i,0>a)s=n+1;else{if(!(a>0)){c=n;break}c=n-1}if(n=c,r[n]===i){var u=n/(o-1);return u}var l=r[n],h=r[n+1],d=h-l,p=(i-l)/d,u=(n+p)/(o-1);return u},getTangent:function(e){var t=1e-4,i=e-t,r=e+t;0>i&&(i=0),r>1&&(r=1);var n=this.getPoint(i),o=this.getPoint(r),a=o.clone().sub(n);return a.normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)}},n.Curve.create=function(e,t){return e.prototype=Object.create(n.Curve.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},n.CurvePath=function(){this.curves=[],this.autoClose=!1},n.CurvePath.prototype=Object.create(n.Curve.prototype),n.CurvePath.prototype.constructor=n.CurvePath,n.CurvePath.prototype.add=function(e){this.curves.push(e)},n.CurvePath.prototype.closePath=function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new n.LineCurve(t,e))},n.CurvePath.prototype.getPoint=function(e){for(var t=e*this.getLength(),i=this.getCurveLengths(),r=0;r<i.length;){if(i[r]>=t){var n=i[r]-t,o=this.curves[r],a=1-n/o.getLength();return o.getPointAt(a)}r++}return null},n.CurvePath.prototype.getLength=function(){var e=this.getCurveLengths();return e[e.length-1]},n.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,i=0,r=this.curves.length;r>i;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e},n.CurvePath.prototype.createPointsGeometry=function(e){var t=this.getPoints(e);return this.createGeometry(t)},n.CurvePath.prototype.createSpacedPointsGeometry=function(e){var t=this.getSpacedPoints(e);return this.createGeometry(t)},n.CurvePath.prototype.createGeometry=function(e){for(var t=new n.Geometry,i=0,r=e.length;r>i;i++){var o=e[i];t.vertices.push(new n.Vector3(o.x,o.y,o.z||0))}return t},n.Font=function(e){this.data=e},n.Font.prototype={constructor:n.Font,generateShapes:function(e,t,i){function r(e){for(var i=String(e).split(""),r=t/a.resolution,n=0,s=[],c=0;c<i.length;c++){var u=o(i[c],r,n);n+=u.offset,s.push(u.path)}return s}function o(e,t,r){var o=a.glyphs[e]||a.glyphs["?"];if(o){var s,c,u,l,h,d,p,f,m,g,v,y=new n.Path,M=[],A=n.ShapeUtils.b2,x=n.ShapeUtils.b3;if(o.o)for(var w=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),E=0,b=w.length;b>E;){var T=w[E++];switch(T){case"m":s=w[E++]*t+r,c=w[E++]*t,y.moveTo(s,c);break;case"l":s=w[E++]*t+r,c=w[E++]*t,y.lineTo(s,c);break;case"q":if(u=w[E++]*t+r,l=w[E++]*t,p=w[E++]*t+r,f=w[E++]*t,y.quadraticCurveTo(p,f,u,l),v=M[M.length-1]){h=v.x,d=v.y;for(var L=1;i>=L;L++){var D=L/i;A(D,h,p,u),A(D,d,f,l)}}break;case"b":if(u=w[E++]*t+r,l=w[E++]*t,p=w[E++]*t+r,f=w[E++]*t,m=w[E++]*t+r,g=w[E++]*t,y.bezierCurveTo(p,f,m,g,u,l),v=M[M.length-1]){h=v.x, d=v.y;for(var L=1;i>=L;L++){var D=L/i;x(D,h,p,m,u),x(D,d,f,g,l)}}}}return{offset:o.ha*t,path:y}}}void 0===t&&(t=100),void 0===i&&(i=4);for(var a=this.data,s=r(e),c=[],u=0,l=s.length;l>u;u++)Array.prototype.push.apply(c,s[u].toShapes());return c}},n.Path=function(e){n.CurvePath.call(this),this.actions=[],e&&this.fromPoints(e)},n.Path.prototype=Object.create(n.CurvePath.prototype),n.Path.prototype.constructor=n.Path,n.Path.prototype.fromPoints=function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,i=e.length;i>t;t++)this.lineTo(e[t].x,e[t].y)},n.Path.prototype.moveTo=function(e,t){this.actions.push({action:"moveTo",args:[e,t]})},n.Path.prototype.lineTo=function(e,t){var i=this.actions[this.actions.length-1].args,r=i[i.length-2],o=i[i.length-1],a=new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));this.curves.push(a),this.actions.push({action:"lineTo",args:[e,t]})},n.Path.prototype.quadraticCurveTo=function(e,t,i,r){var o=this.actions[this.actions.length-1].args,a=o[o.length-2],s=o[o.length-1],c=new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));this.curves.push(c),this.actions.push({action:"quadraticCurveTo",args:[e,t,i,r]})},n.Path.prototype.bezierCurveTo=function(e,t,i,r,o,a){var s=this.actions[this.actions.length-1].args,c=s[s.length-2],u=s[s.length-1],l=new n.CubicBezierCurve(new n.Vector2(c,u),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));this.curves.push(l),this.actions.push({action:"bezierCurveTo",args:[e,t,i,r,o,a]})},n.Path.prototype.splineThru=function(e){var t=Array.prototype.slice.call(arguments),i=this.actions[this.actions.length-1].args,r=i[i.length-2],o=i[i.length-1],a=[new n.Vector2(r,o)];Array.prototype.push.apply(a,e);var s=new n.SplineCurve(a);this.curves.push(s),this.actions.push({action:"splineThru",args:t})},n.Path.prototype.arc=function(e,t,i,r,n,o){var a=this.actions[this.actions.length-1].args,s=a[a.length-2],c=a[a.length-1];this.absarc(e+s,t+c,i,r,n,o)},n.Path.prototype.absarc=function(e,t,i,r,n,o){this.absellipse(e,t,i,i,r,n,o)},n.Path.prototype.ellipse=function(e,t,i,r,n,o,a,s){var c=this.actions[this.actions.length-1].args,u=c[c.length-2],l=c[c.length-1];this.absellipse(e+u,t+l,i,r,n,o,a,s)},n.Path.prototype.absellipse=function(e,t,i,r,o,a,s,c){var u=[e,t,i,r,o,a,s,c||0],l=new n.EllipseCurve(e,t,i,r,o,a,s,c);this.curves.push(l);var h=l.getPoint(1);u.push(h.x),u.push(h.y),this.actions.push({action:"ellipse",args:u})},n.Path.prototype.getSpacedPoints=function(e){e||(e=40);for(var t=[],i=0;e>i;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t},n.Path.prototype.getPoints=function(e){e=e||12;for(var t,i,r,o,a,s,c,u,l,h,d,p=n.ShapeUtils.b2,f=n.ShapeUtils.b3,m=[],g=0,v=this.actions.length;v>g;g++){var y=this.actions[g],M=y.action,A=y.args;switch(M){case"moveTo":m.push(new n.Vector2(A[0],A[1]));break;case"lineTo":m.push(new n.Vector2(A[0],A[1]));break;case"quadraticCurveTo":t=A[2],i=A[3],a=A[0],s=A[1],m.length>0?(l=m[m.length-1],c=l.x,u=l.y):(l=this.actions[g-1].args,c=l[l.length-2],u=l[l.length-1]);for(var x=1;e>=x;x++){var w=x/e;h=p(w,c,a,t),d=p(w,u,s,i),m.push(new n.Vector2(h,d))}break;case"bezierCurveTo":t=A[4],i=A[5],a=A[0],s=A[1],r=A[2],o=A[3],m.length>0?(l=m[m.length-1],c=l.x,u=l.y):(l=this.actions[g-1].args,c=l[l.length-2],u=l[l.length-1]);for(var x=1;e>=x;x++){var w=x/e;h=f(w,c,a,r,t),d=f(w,u,s,o,i),m.push(new n.Vector2(h,d))}break;case"splineThru":l=this.actions[g-1].args;var E=new n.Vector2(l[l.length-2],l[l.length-1]),b=[E],T=e*A[0].length;b=b.concat(A[0]);for(var L=new n.SplineCurve(b),x=1;T>=x;x++)m.push(L.getPointAt(x/T));break;case"arc":for(var D,N=A[0],S=A[1],C=A[2],I=A[3],j=A[4],_=!!A[5],O=j-I,z=2*e,x=1;z>=x;x++){var w=x/z;_||(w=1-w),D=I+w*O,h=N+C*Math.cos(D),d=S+C*Math.sin(D),m.push(new n.Vector2(h,d))}break;case"ellipse":var D,k,R,N=A[0],S=A[1],B=A[2],U=A[3],I=A[4],j=A[5],_=!!A[6],P=A[7],O=j-I,z=2*e;0!==P&&(k=Math.cos(P),R=Math.sin(P));for(var x=1;z>=x;x++){var w=x/z;if(_||(w=1-w),D=I+w*O,h=N+B*Math.cos(D),d=S+U*Math.sin(D),0!==P){var F=h,G=d;h=(F-N)*k-(G-S)*R+N,d=(F-N)*R+(G-S)*k+S}m.push(new n.Vector2(h,d))}}}var V=m[m.length-1];return Math.abs(V.x-m[0].x)<Number.EPSILON&&Math.abs(V.y-m[0].y)<Number.EPSILON&&m.splice(m.length-1,1),this.autoClose&&m.push(m[0]),m},n.Path.prototype.toShapes=function(e,t){function i(e){for(var t=[],i=new n.Path,r=0,o=e.length;o>r;r++){var a=e[r],s=a.args,c=a.action;"moveTo"===c&&0!==i.actions.length&&(t.push(i),i=new n.Path),i[c].apply(i,s)}return 0!==i.actions.length&&t.push(i),t}function r(e){for(var t=[],i=0,r=e.length;r>i;i++){var o=e[i],a=new n.Shape;a.actions=o.actions,a.curves=o.curves,t.push(a)}return t}function o(e,t){for(var i=t.length,r=!1,n=i-1,o=0;i>o;n=o++){var a=t[n],s=t[o],c=s.x-a.x,u=s.y-a.y;if(Math.abs(u)>Number.EPSILON){if(0>u&&(a=t[o],c=-c,s=t[n],u=-u),e.y<a.y||e.y>s.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var l=u*(e.x-a.x)-c*(e.y-a.y);if(0===l)return!0;if(0>l)continue;r=!r}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return r}var a=n.ShapeUtils.isClockWise,s=i(this.actions);if(0===s.length)return[];if(t===!0)return r(s);var c,u,l,h=[];if(1===s.length)return u=s[0],l=new n.Shape,l.actions=u.actions,l.curves=u.curves,h.push(l),h;var d=!a(s[0].getPoints());d=e?!d:d;var p,f=[],m=[],g=[],v=0;m[v]=void 0,g[v]=[];for(var y=0,M=s.length;M>y;y++)u=s[y],p=u.getPoints(),c=a(p),c=e?!c:c,c?(!d&&m[v]&&v++,m[v]={s:new n.Shape,p:p},m[v].s.actions=u.actions,m[v].s.curves=u.curves,d&&v++,g[v]=[]):g[v].push({h:u,p:p[0]});if(!m[0])return r(s);if(m.length>1){for(var A=!1,x=[],w=0,E=m.length;E>w;w++)f[w]=[];for(var w=0,E=m.length;E>w;w++)for(var b=g[w],T=0;T<b.length;T++){for(var L=b[T],D=!0,N=0;N<m.length;N++)o(L.p,m[N].p)&&(w!==N&&x.push({froms:w,tos:N,hole:T}),D?(D=!1,f[N].push(L)):A=!0);D&&f[w].push(L)}x.length>0&&(A||(g=f))}for(var S,y=0,C=m.length;C>y;y++){l=m[y].s,h.push(l),S=g[y];for(var I=0,j=S.length;j>I;I++)l.holes.push(S[I].h)}return h},n.Shape=function(){n.Path.apply(this,arguments),this.holes=[]},n.Shape.prototype=Object.create(n.Path.prototype),n.Shape.prototype.constructor=n.Shape,n.Shape.prototype.extrude=function(e){return new n.ExtrudeGeometry(this,e)},n.Shape.prototype.makeGeometry=function(e){return new n.ShapeGeometry(this,e)},n.Shape.prototype.getPointsHoles=function(e){for(var t=[],i=0,r=this.holes.length;r>i;i++)t[i]=this.holes[i].getPoints(e);return t},n.Shape.prototype.extractAllPoints=function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},n.Shape.prototype.extractPoints=function(e){return this.extractAllPoints(e)},n.LineCurve=function(e,t){this.v1=e,this.v2=t},n.LineCurve.prototype=Object.create(n.Curve.prototype),n.LineCurve.prototype.constructor=n.LineCurve,n.LineCurve.prototype.getPoint=function(e){var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(e).add(this.v1),t},n.LineCurve.prototype.getPointAt=function(e){return this.getPoint(e)},n.LineCurve.prototype.getTangent=function(){var e=this.v2.clone().sub(this.v1);return e.normalize()},n.QuadraticBezierCurve=function(e,t,i){this.v0=e,this.v1=t,this.v2=i},n.QuadraticBezierCurve.prototype=Object.create(n.Curve.prototype),n.QuadraticBezierCurve.prototype.constructor=n.QuadraticBezierCurve,n.QuadraticBezierCurve.prototype.getPoint=function(e){var t=n.ShapeUtils.b2;return new n.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y))},n.QuadraticBezierCurve.prototype.getTangent=function(e){var t=n.CurveUtils.tangentQuadraticBezier;return new n.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y)).normalize()},n.CubicBezierCurve=function(e,t,i,r){this.v0=e,this.v1=t,this.v2=i,this.v3=r},n.CubicBezierCurve.prototype=Object.create(n.Curve.prototype),n.CubicBezierCurve.prototype.constructor=n.CubicBezierCurve,n.CubicBezierCurve.prototype.getPoint=function(e){var t=n.ShapeUtils.b3;return new n.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y))},n.CubicBezierCurve.prototype.getTangent=function(e){var t=n.CurveUtils.tangentCubicBezier;return new n.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()},n.SplineCurve=function(e){this.points=void 0==e?[]:e},n.SplineCurve.prototype=Object.create(n.Curve.prototype),n.SplineCurve.prototype.constructor=n.SplineCurve,n.SplineCurve.prototype.getPoint=function(e){var t=this.points,i=(t.length-1)*e,r=Math.floor(i),o=i-r,a=t[0===r?r:r-1],s=t[r],c=t[r>t.length-2?t.length-1:r+1],u=t[r>t.length-3?t.length-1:r+2],l=n.CurveUtils.interpolate;return new n.Vector2(l(a.x,s.x,c.x,u.x,o),l(a.y,s.y,c.y,u.y,o))},n.EllipseCurve=function(e,t,i,r,n,o,a,s){this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=n,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0},n.EllipseCurve.prototype=Object.create(n.Curve.prototype),n.EllipseCurve.prototype.constructor=n.EllipseCurve,n.EllipseCurve.prototype.getPoint=function(e){var t=this.aEndAngle-this.aStartAngle;0>t&&(t+=2*Math.PI),t>2*Math.PI&&(t-=2*Math.PI);var i;i=this.aClockwise===!0?this.aEndAngle+(1-e)*(2*Math.PI-t):this.aStartAngle+e*t;var r=this.aX+this.xRadius*Math.cos(i),o=this.aY+this.yRadius*Math.sin(i);if(0!==this.aRotation){var a=Math.cos(this.aRotation),s=Math.sin(this.aRotation),c=r,u=o;r=(c-this.aX)*a-(u-this.aY)*s+this.aX,o=(c-this.aX)*s+(u-this.aY)*a+this.aY}return new n.Vector2(r,o)},n.ArcCurve=function(e,t,i,r,o,a){n.EllipseCurve.call(this,e,t,i,i,r,o,a)},n.ArcCurve.prototype=Object.create(n.EllipseCurve.prototype),n.ArcCurve.prototype.constructor=n.ArcCurve,n.LineCurve3=n.Curve.create(function(e,t){this.v1=e,this.v2=t},function(e){var t=new n.Vector3;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t}),n.QuadraticBezierCurve3=n.Curve.create(function(e,t,i){this.v0=e,this.v1=t,this.v2=i},function(e){var t=n.ShapeUtils.b2;return new n.Vector3(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y),t(e,this.v0.z,this.v1.z,this.v2.z))}),n.CubicBezierCurve3=n.Curve.create(function(e,t,i,r){this.v0=e,this.v1=t,this.v2=i,this.v3=r},function(e){var t=n.ShapeUtils.b3;return new n.Vector3(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),t(e,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),n.SplineCurve3=n.Curve.create(function(e){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),this.points=void 0==e?[]:e},function(e){var t=this.points,i=(t.length-1)*e,r=Math.floor(i),o=i-r,a=t[0==r?r:r-1],s=t[r],c=t[r>t.length-2?t.length-1:r+1],u=t[r>t.length-3?t.length-1:r+2],l=n.CurveUtils.interpolate;return new n.Vector3(l(a.x,s.x,c.x,u.x,o),l(a.y,s.y,c.y,u.y,o),l(a.z,s.z,c.z,u.z,o))}),n.CatmullRomCurve3=function(){function e(){}var t=new n.Vector3,i=new e,r=new e,o=new e;return e.prototype.init=function(e,t,i,r){this.c0=e,this.c1=i,this.c2=-3*e+3*t-2*i-r,this.c3=2*e-2*t+i+r},e.prototype.initNonuniformCatmullRom=function(e,t,i,r,n,o,a){var s=(t-e)/n-(i-e)/(n+o)+(i-t)/o,c=(i-t)/o-(r-t)/(o+a)+(r-i)/a;s*=o,c*=o,this.init(t,i,s,c)},e.prototype.initCatmullRom=function(e,t,i,r,n){this.init(t,i,n*(i-e),n*(r-t))},e.prototype.calc=function(e){var t=e*e,i=t*e;return this.c0+this.c1*e+this.c2*t+this.c3*i},n.Curve.create(function(e){this.points=e||[],this.closed=!1},function(e){var a,s,c,u,l=this.points;u=l.length,2>u&&console.log("duh, you need at least 2 points"),a=(u-(this.closed?0:1))*e,s=Math.floor(a),c=a-s,this.closed?s+=s>0?0:(Math.floor(Math.abs(s)/l.length)+1)*l.length:0===c&&s===u-1&&(s=u-2,c=1);var h,d,p,f;if(this.closed||s>0?h=l[(s-1)%u]:(t.subVectors(l[0],l[1]).add(l[0]),h=t),d=l[s%u],p=l[(s+1)%u],this.closed||u>s+2?f=l[(s+2)%u]:(t.subVectors(l[u-1],l[u-2]).add(l[u-1]),f=t),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var m="chordal"===this.type?.5:.25,g=Math.pow(h.distanceToSquared(d),m),v=Math.pow(d.distanceToSquared(p),m),y=Math.pow(p.distanceToSquared(f),m);1e-4>v&&(v=1),1e-4>g&&(g=v),1e-4>y&&(y=v),i.initNonuniformCatmullRom(h.x,d.x,p.x,f.x,g,v,y),r.initNonuniformCatmullRom(h.y,d.y,p.y,f.y,g,v,y),o.initNonuniformCatmullRom(h.z,d.z,p.z,f.z,g,v,y)}else if("catmullrom"===this.type){var M=void 0!==this.tension?this.tension:.5;i.initCatmullRom(h.x,d.x,p.x,f.x,M),r.initCatmullRom(h.y,d.y,p.y,f.y,M),o.initCatmullRom(h.z,d.z,p.z,f.z,M)}var A=new n.Vector3(i.calc(c),r.calc(c),o.calc(c));return A})}(),n.ClosedSplineCurve3=function(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),n.CatmullRomCurve3.call(this,e),this.type="catmullrom",this.closed=!0},n.ClosedSplineCurve3.prototype=Object.create(n.CatmullRomCurve3.prototype),n.BoxGeometry=function(e,t,i,r,o,a){n.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:o,depthSegments:a},this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),this.mergeVertices()},n.BoxGeometry.prototype=Object.create(n.Geometry.prototype),n.BoxGeometry.prototype.constructor=n.BoxGeometry,n.CubeGeometry=n.BoxGeometry,n.BoxBufferGeometry=function(e,t,i,r,o,a){function s(e,t,i){var r=0;return r+=e*t*2,r+=e*i*2,r+=i*t*2,4*r}function c(e,t,i,r,o,a,s,c,l,h,x){for(var w=a/l,E=s/h,b=a/2,T=s/2,L=c/2,D=l+1,N=h+1,S=0,C=0,I=new n.Vector3,j=0;N>j;j++)for(var _=j*E-T,O=0;D>O;O++){var z=O*w-b;I[e]=z*r,I[t]=_*o,I[i]=L,p[g]=I.x,p[g+1]=I.y,p[g+2]=I.z,I[e]=0,I[t]=0,I[i]=c>0?1:-1,f[g]=I.x,f[g+1]=I.y,f[g+2]=I.z,m[v]=O/l,m[v+1]=1-j/h,g+=3,v+=2,S+=1}for(j=0;h>j;j++)for(O=0;l>O;O++){var k=M+O+D*j,R=M+O+D*(j+1),B=M+(O+1)+D*(j+1),U=M+(O+1)+D*j;d[y]=k,d[y+1]=R,d[y+2]=U,d[y+3]=R,d[y+4]=B,d[y+5]=U,y+=6,C+=6}u.addGroup(A,C,x),A+=C,M+=S}n.BufferGeometry.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:o,depthSegments:a};var u=this;r=Math.floor(r)||1,o=Math.floor(o)||1,a=Math.floor(a)||1;var l=s(r,o,a),h=l/4*6,d=new(h>65535?Uint32Array:Uint16Array)(h),p=new Float32Array(3*l),f=new Float32Array(3*l),m=new Float32Array(2*l),g=0,v=0,y=0,M=0,A=0;c("z","y","x",-1,-1,i,t,e,a,o,0),c("z","y","x",1,-1,i,t,-e,a,o,1),c("x","z","y",1,1,e,i,t,r,a,2),c("x","z","y",1,-1,e,i,-t,r,a,3),c("x","y","z",1,-1,e,t,i,r,o,4),c("x","y","z",-1,-1,e,t,-i,r,o,5),this.setIndex(new n.BufferAttribute(d,1)),this.addAttribute("position",new n.BufferAttribute(p,3)),this.addAttribute("normal",new n.BufferAttribute(f,3)),this.addAttribute("uv",new n.BufferAttribute(m,2))},n.BoxBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.BoxBufferGeometry.prototype.constructor=n.BoxBufferGeometry,n.CircleGeometry=function(e,t,i,r){n.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))},n.CircleGeometry.prototype=Object.create(n.Geometry.prototype),n.CircleGeometry.prototype.constructor=n.CircleGeometry,n.CircleBufferGeometry=function(e,t,i,r){n.BufferGeometry.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},e=e||50,t=void 0!==t?Math.max(3,t):8,i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var o=t+2,a=new Float32Array(3*o),s=new Float32Array(3*o),c=new Float32Array(2*o);s[2]=1,c[0]=.5,c[1]=.5;for(var u=0,l=3,h=2;t>=u;u++,l+=3,h+=2){var d=i+u/t*r;a[l]=e*Math.cos(d),a[l+1]=e*Math.sin(d),s[l+2]=1,c[h]=(a[l]/e+1)/2,c[h+1]=(a[l+1]/e+1)/2}for(var p=[],l=1;t>=l;l++)p.push(l,l+1,0);this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),this.addAttribute("position",new n.BufferAttribute(a,3)),this.addAttribute("normal",new n.BufferAttribute(s,3)),this.addAttribute("uv",new n.BufferAttribute(c,2)),this.boundingSphere=new n.Sphere(new n.Vector3,e)},n.CircleBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.CircleBufferGeometry.prototype.constructor=n.CircleBufferGeometry,n.CylinderBufferGeometry=function(e,t,i,r,o,a,s,c){function u(){var e=(r+1)*(o+1);return a===!1&&(e+=2*(r+1)+2*r),e}function l(){var e=r*o*2*3;return a===!1&&(e+=2*r*3),e}function h(){var a,u,l=new n.Vector3,h=new n.Vector3,d=0,f=(t-e)/i;for(u=0;o>=u;u++){var m=[],T=u/o,L=T*(t-e)+e;for(a=0;r>=a;a++){var D=a/r;h.x=L*Math.sin(D*c+s),h.y=-T*i+E,h.z=L*Math.cos(D*c+s),v.setXYZ(A,h.x,h.y,h.z),l.copy(h),(0===e&&0===u||0===t&&u===o)&&(l.x=Math.sin(D*c+s),l.z=Math.cos(D*c+s)),l.setY(Math.sqrt(l.x*l.x+l.z*l.z)*f).normalize(),y.setXYZ(A,l.x,l.y,l.z),M.setXY(A,D,1-T),m.push(A),A++}w.push(m)}for(a=0;r>a;a++)for(u=0;o>u;u++){var N=w[u][a],S=w[u+1][a],C=w[u+1][a+1],I=w[u][a+1];g.setX(x,N),x++,g.setX(x,S),x++,g.setX(x,I),x++,g.setX(x,S),x++,g.setX(x,C),x++,g.setX(x,I),x++,d+=6}p.addGroup(b,d,0),b+=d}function d(i){var o,a,u,l=new n.Vector2,h=new n.Vector3,d=0,f=i===!0?e:t,m=i===!0?1:-1;for(a=A,o=1;r>=o;o++)v.setXYZ(A,0,E*m,0),y.setXYZ(A,0,m,0),i===!0?(l.x=o/r,l.y=0):(l.x=(o-1)/r,l.y=1),M.setXY(A,l.x,l.y),A++;for(u=A,o=0;r>=o;o++){var w=o/r;h.x=f*Math.sin(w*c+s),h.y=E*m,h.z=f*Math.cos(w*c+s),v.setXYZ(A,h.x,h.y,h.z),y.setXYZ(A,0,m,0),M.setXY(A,w,i===!0?1:0),A++}for(o=0;r>o;o++){var T=a+o,L=u+o;i===!0?(g.setX(x,L),x++,g.setX(x,L+1),x++,g.setX(x,T),x++):(g.setX(x,L+1),x++,g.setX(x,L),x++,g.setX(x,T),x++),d+=3}p.addGroup(b,d,i===!0?1:2),b+=d}n.BufferGeometry.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:c};var p=this;e=void 0!==e?e:20,t=void 0!==t?t:20,i=void 0!==i?i:100,r=Math.floor(r)||8,o=Math.floor(o)||1,a=void 0!==a?a:!1,s=void 0!==s?s:0,c=void 0!==c?c:2*Math.PI;var f=u(),m=l(),g=new n.BufferAttribute(new(m>65535?Uint32Array:Uint16Array)(m),1),v=new n.BufferAttribute(new Float32Array(3*f),3),y=new n.BufferAttribute(new Float32Array(3*f),3),M=new n.BufferAttribute(new Float32Array(2*f),2),A=0,x=0,w=[],E=i/2,b=0;h(),a===!1&&(e>0&&d(!0),t>0&&d(!1)),this.setIndex(g),this.addAttribute("position",v),this.addAttribute("normal",y),this.addAttribute("uv",M)},n.CylinderBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.CylinderBufferGeometry.prototype.constructor=n.CylinderBufferGeometry,n.CylinderGeometry=function(e,t,i,r,o,a,s,c){n.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:c},this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,c)),this.mergeVertices()},n.CylinderGeometry.prototype=Object.create(n.Geometry.prototype),n.CylinderGeometry.prototype.constructor=n.CylinderGeometry,n.EdgesGeometry=function(e,t){function i(e,t){return e-t}n.BufferGeometry.call(this),t=void 0!==t?t:1;var r,o=Math.cos(n.Math.DEG2RAD*t),a=[0,0],s={},c=["a","b","c"];e instanceof n.BufferGeometry?(r=new n.Geometry,r.fromBufferGeometry(e)):r=e.clone(),r.mergeVertices(),r.computeFaceNormals();for(var u=r.vertices,l=r.faces,h=0,d=l.length;d>h;h++)for(var p=l[h],f=0;3>f;f++){a[0]=p[c[f]],a[1]=p[c[(f+1)%3]],a.sort(i);var m=a.toString();void 0===s[m]?s[m]={vert1:a[0],vert2:a[1],face1:h,face2:void 0}:s[m].face2=h}var g=[];for(var m in s){var v=s[m];if(void 0===v.face2||l[v.face1].normal.dot(l[v.face2].normal)<=o){var y=u[v.vert1];g.push(y.x),g.push(y.y),g.push(y.z),y=u[v.vert2],g.push(y.x),g.push(y.y),g.push(y.z)}}this.addAttribute("position",new n.BufferAttribute(new Float32Array(g),3))},n.EdgesGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.EdgesGeometry.prototype.constructor=n.EdgesGeometry,n.ExtrudeGeometry=function(e,t){return"undefined"==typeof e?void(e=[]):(n.Geometry.call(this),this.type="ExtrudeGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),void this.computeFaceNormals())},n.ExtrudeGeometry.prototype=Object.create(n.Geometry.prototype),n.ExtrudeGeometry.prototype.constructor=n.ExtrudeGeometry,n.ExtrudeGeometry.prototype.addShapeList=function(e,t){for(var i=e.length,r=0;i>r;r++){var n=e[r];this.addShape(n,t)}},n.ExtrudeGeometry.prototype.addShape=function(e,t){function i(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}function r(e,t,i){var r,o,a=1,s=e.x-t.x,c=e.y-t.y,u=i.x-e.x,l=i.y-e.y,h=s*s+c*c,d=s*l-c*u;if(Math.abs(d)>Number.EPSILON){var p=Math.sqrt(h),f=Math.sqrt(u*u+l*l),m=t.x-c/p,g=t.y+s/p,v=i.x-l/f,y=i.y+u/f,M=((v-m)*l-(y-g)*u)/(s*l-c*u);r=m+s*M-e.x,o=g+c*M-e.y;var A=r*r+o*o;if(2>=A)return new n.Vector2(r,o);a=Math.sqrt(A/2)}else{var x=!1;s>Number.EPSILON?u>Number.EPSILON&&(x=!0):s<-Number.EPSILON?u<-Number.EPSILON&&(x=!0):Math.sign(c)===Math.sign(l)&&(x=!0),x?(r=-c,o=s,a=Math.sqrt(h)):(r=s,o=c,a=Math.sqrt(h/2))}return new n.Vector2(r/a,o/a)}function o(){if(A){var e=0,t=V*e;for(H=0;Q>H;H++)G=z[H],u(G[2]+t,G[1]+t,G[0]+t);for(e=w+2*M,t=V*e,H=0;Q>H;H++)G=z[H],u(G[0]+t,G[1]+t,G[2]+t)}else{for(H=0;Q>H;H++)G=z[H],u(G[2],G[1],G[0]);for(H=0;Q>H;H++)G=z[H],u(G[0]+V*w,G[1]+V*w,G[2]+V*w)}}function a(){var e=0;for(s(k,e),e+=k.length,D=0,N=_.length;N>D;D++)L=_[D],s(L,e),e+=L.length}function s(e,t){var i,r;for(H=e.length;--H>=0;){i=H,r=H-1,0>r&&(r=e.length-1);var n=0,o=w+2*M;for(n=0;o>n;n++){var a=V*n,s=V*(n+1),c=t+i+a,u=t+r+a,h=t+r+s,d=t+i+s;l(c,u,h,d,e,n,o,i,r)}}}function c(e,t,i){S.vertices.push(new n.Vector3(e,t,i))}function u(e,t,i){e+=C,t+=C,i+=C,S.faces.push(new n.Face3(e,t,i,null,null,0));var r=T.generateTopUV(S,e,t,i);S.faceVertexUvs[0].push(r)}function l(e,t,i,r){e+=C,t+=C,i+=C,r+=C,S.faces.push(new n.Face3(e,t,r,null,null,1)),S.faces.push(new n.Face3(t,i,r,null,null,1));var o=T.generateSideWallUV(S,e,t,i,r);S.faceVertexUvs[0].push([o[0],o[1],o[3]]),S.faceVertexUvs[0].push([o[1],o[2],o[3]])}var h,d,p,f,m,g=void 0!==t.amount?t.amount:100,v=void 0!==t.bevelThickness?t.bevelThickness:6,y=void 0!==t.bevelSize?t.bevelSize:v-2,M=void 0!==t.bevelSegments?t.bevelSegments:3,A=void 0!==t.bevelEnabled?t.bevelEnabled:!0,x=void 0!==t.curveSegments?t.curveSegments:12,w=void 0!==t.steps?t.steps:1,E=t.extrudePath,b=!1,T=void 0!==t.UVGenerator?t.UVGenerator:n.ExtrudeGeometry.WorldUVGenerator;E&&(h=E.getSpacedPoints(w),b=!0,A=!1,d=void 0!==t.frames?t.frames:new n.TubeGeometry.FrenetFrames(E,w,!1),p=new n.Vector3,f=new n.Vector3,m=new n.Vector3),A||(M=0,v=0,y=0);var L,D,N,S=this,C=this.vertices.length,I=e.extractPoints(x),j=I.shape,_=I.holes,O=!n.ShapeUtils.isClockWise(j);if(O){for(j=j.reverse(),D=0,N=_.length;N>D;D++)L=_[D],n.ShapeUtils.isClockWise(L)&&(_[D]=L.reverse());O=!1}var z=n.ShapeUtils.triangulateShape(j,_),k=j;for(D=0,N=_.length;N>D;D++)L=_[D],j=j.concat(L);for(var R,B,U,P,F,G,V=j.length,Q=z.length,Y=[],H=0,W=k.length,X=W-1,q=H+1;W>H;H++,X++,q++)X===W&&(X=0),q===W&&(q=0),Y[H]=r(k[H],k[X],k[q]);var Z,K=[],J=Y.concat();for(D=0,N=_.length;N>D;D++){for(L=_[D],Z=[],H=0,W=L.length,X=W-1,q=H+1;W>H;H++,X++,q++)X===W&&(X=0),q===W&&(q=0),Z[H]=r(L[H],L[X],L[q]);K.push(Z),J=J.concat(Z)}for(R=0;M>R;R++){for(U=R/M,P=v*(1-U),B=y*Math.sin(U*Math.PI/2),H=0,W=k.length;W>H;H++)F=i(k[H],Y[H],B),c(F.x,F.y,-P);for(D=0,N=_.length;N>D;D++)for(L=_[D],Z=K[D],H=0,W=L.length;W>H;H++)F=i(L[H],Z[H],B),c(F.x,F.y,-P)}for(B=y,H=0;V>H;H++)F=A?i(j[H],J[H],B):j[H],b?(f.copy(d.normals[0]).multiplyScalar(F.x),p.copy(d.binormals[0]).multiplyScalar(F.y),m.copy(h[0]).add(f).add(p),c(m.x,m.y,m.z)):c(F.x,F.y,0);var $;for($=1;w>=$;$++)for(H=0;V>H;H++)F=A?i(j[H],J[H],B):j[H],b?(f.copy(d.normals[$]).multiplyScalar(F.x),p.copy(d.binormals[$]).multiplyScalar(F.y),m.copy(h[$]).add(f).add(p),c(m.x,m.y,m.z)):c(F.x,F.y,g/w*$);for(R=M-1;R>=0;R--){for(U=R/M,P=v*(1-U),B=y*Math.sin(U*Math.PI/2),H=0,W=k.length;W>H;H++)F=i(k[H],Y[H],B),c(F.x,F.y,g+P);for(D=0,N=_.length;N>D;D++)for(L=_[D],Z=K[D],H=0,W=L.length;W>H;H++)F=i(L[H],Z[H],B),b?c(F.x,F.y+h[w-1].y,h[w-1].x+P):c(F.x,F.y,g+P)}o(),a()},n.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(e,t,i,r){var o=e.vertices,a=o[t],s=o[i],c=o[r];return[new n.Vector2(a.x,a.y),new n.Vector2(s.x,s.y),new n.Vector2(c.x,c.y)]},generateSideWallUV:function(e,t,i,r,o){var a=e.vertices,s=a[t],c=a[i],u=a[r],l=a[o];return Math.abs(s.y-c.y)<.01?[new n.Vector2(s.x,1-s.z),new n.Vector2(c.x,1-c.z),new n.Vector2(u.x,1-u.z),new n.Vector2(l.x,1-l.z)]:[new n.Vector2(s.y,1-s.z),new n.Vector2(c.y,1-c.z),new n.Vector2(u.y,1-u.z),new n.Vector2(l.y,1-l.z)]}},n.ShapeGeometry=function(e,t){n.Geometry.call(this),this.type="ShapeGeometry",Array.isArray(e)===!1&&(e=[e]),this.addShapeList(e,t),this.computeFaceNormals()},n.ShapeGeometry.prototype=Object.create(n.Geometry.prototype),n.ShapeGeometry.prototype.constructor=n.ShapeGeometry,n.ShapeGeometry.prototype.addShapeList=function(e,t){for(var i=0,r=e.length;r>i;i++)this.addShape(e[i],t);return this},n.ShapeGeometry.prototype.addShape=function(e,t){void 0===t&&(t={});var i,r,o,a=void 0!==t.curveSegments?t.curveSegments:12,s=t.material,c=void 0===t.UVGenerator?n.ExtrudeGeometry.WorldUVGenerator:t.UVGenerator,u=this.vertices.length,l=e.extractPoints(a),h=l.shape,d=l.holes,p=!n.ShapeUtils.isClockWise(h);if(p){for(h=h.reverse(),i=0,r=d.length;r>i;i++)o=d[i],n.ShapeUtils.isClockWise(o)&&(d[i]=o.reverse());p=!1}var f=n.ShapeUtils.triangulateShape(h,d);for(i=0,r=d.length;r>i;i++)o=d[i],h=h.concat(o);var m,g,v=h.length,y=f.length;for(i=0;v>i;i++)m=h[i],this.vertices.push(new n.Vector3(m.x,m.y,0));for(i=0;y>i;i++){g=f[i];var M=g[0]+u,A=g[1]+u,x=g[2]+u;this.faces.push(new n.Face3(M,A,x,null,null,s)),this.faceVertexUvs[0].push(c.generateTopUV(this,M,A,x))}},n.LatheBufferGeometry=function(e,t,i,r){n.BufferGeometry.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t)||12,i=i||0,r=r||2*Math.PI,r=n.Math.clamp(r,0,2*Math.PI);var o,a,s,c=(t+1)*e.length,u=t*e.length*2*3,l=new n.BufferAttribute(new(u>65535?Uint32Array:Uint16Array)(u),1),h=new n.BufferAttribute(new Float32Array(3*c),3),d=new n.BufferAttribute(new Float32Array(2*c),2),p=0,f=0,m=(1/(e.length-1),1/t),g=new n.Vector3,v=new n.Vector2;for(a=0;t>=a;a++){var y=i+a*m*r,M=Math.sin(y),A=Math.cos(y);for(s=0;s<=e.length-1;s++)g.x=e[s].x*M,g.y=e[s].y,g.z=e[s].x*A,h.setXYZ(p,g.x,g.y,g.z),v.x=a/t,v.y=s/(e.length-1),d.setXY(p,v.x,v.y),p++}for(a=0;t>a;a++)for(s=0;s<e.length-1;s++){o=s+a*e.length;var x=o,w=o+e.length,E=o+e.length+1,b=o+1;l.setX(f,x),f++,l.setX(f,w),f++,l.setX(f,b),f++,l.setX(f,w),f++,l.setX(f,E),f++,l.setX(f,b),f++}if(this.setIndex(l),this.addAttribute("position",h),this.addAttribute("uv",d),this.computeVertexNormals(),r===2*Math.PI){var T=this.attributes.normal.array,L=new n.Vector3,D=new n.Vector3,N=new n.Vector3;for(o=t*e.length*3,a=0,s=0;a<e.length;a++,s+=3)L.x=T[s+0],L.y=T[s+1],L.z=T[s+2],D.x=T[o+s+0],D.y=T[o+s+1],D.z=T[o+s+2],N.addVectors(L,D).normalize(),T[s+0]=T[o+s+0]=N.x,T[s+1]=T[o+s+1]=N.y,T[s+2]=T[o+s+2]=N.z}},n.LatheBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.LatheBufferGeometry.prototype.constructor=n.LatheBufferGeometry,n.LatheGeometry=function(e,t,i,r){n.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),this.mergeVertices()},n.LatheGeometry.prototype=Object.create(n.Geometry.prototype),n.LatheGeometry.prototype.constructor=n.LatheGeometry,n.PlaneGeometry=function(e,t,i,r){n.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r},this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))},n.PlaneGeometry.prototype=Object.create(n.Geometry.prototype),n.PlaneGeometry.prototype.constructor=n.PlaneGeometry,n.PlaneBufferGeometry=function(e,t,i,r){n.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};for(var o=e/2,a=t/2,s=Math.floor(i)||1,c=Math.floor(r)||1,u=s+1,l=c+1,h=e/s,d=t/c,p=new Float32Array(u*l*3),f=new Float32Array(u*l*3),m=new Float32Array(u*l*2),g=0,v=0,y=0;l>y;y++)for(var M=y*d-a,A=0;u>A;A++){var x=A*h-o;p[g]=x,p[g+1]=-M,f[g+2]=1,m[v]=A/s,m[v+1]=1-y/c,g+=3,v+=2}g=0;for(var w=new(p.length/3>65535?Uint32Array:Uint16Array)(s*c*6),y=0;c>y;y++)for(var A=0;s>A;A++){var E=A+u*y,b=A+u*(y+1),T=A+1+u*(y+1),L=A+1+u*y;w[g]=E,w[g+1]=b,w[g+2]=L,w[g+3]=b,w[g+4]=T,w[g+5]=L,g+=6}this.setIndex(new n.BufferAttribute(w,1)),this.addAttribute("position",new n.BufferAttribute(p,3)),this.addAttribute("normal",new n.BufferAttribute(f,3)),this.addAttribute("uv",new n.BufferAttribute(m,2))},n.PlaneBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.PlaneBufferGeometry.prototype.constructor=n.PlaneBufferGeometry,n.RingBufferGeometry=function(e,t,i,r,o,a){n.BufferGeometry.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:o,thetaLength:a},e=e||20,t=t||50,o=void 0!==o?o:0,a=void 0!==a?a:2*Math.PI,i=void 0!==i?Math.max(3,i):8,r=void 0!==r?Math.max(1,r):1;var s,c,u,l=(i+1)*(r+1),h=i*r*2*3,d=new n.BufferAttribute(new(h>65535?Uint32Array:Uint16Array)(h),1),p=new n.BufferAttribute(new Float32Array(3*l),3),f=new n.BufferAttribute(new Float32Array(3*l),3),m=new n.BufferAttribute(new Float32Array(2*l),2),g=0,v=0,y=e,M=(t-e)/r,A=new n.Vector3,x=new n.Vector2;for(c=0;r>=c;c++){for(u=0;i>=u;u++)s=o+u/i*a,A.x=y*Math.cos(s),A.y=y*Math.sin(s),p.setXYZ(g,A.x,A.y,A.z),f.setXYZ(g,0,0,1),x.x=(A.x/t+1)/2,x.y=(A.y/t+1)/2,m.setXY(g,x.x,x.y),g++;y+=M}for(c=0;r>c;c++){var w=c*(i+1);for(u=0;i>u;u++){s=u+w;var E=s,b=s+i+1,T=s+i+2,L=s+1;d.setX(v,E),v++,d.setX(v,b),v++,d.setX(v,T),v++,d.setX(v,E),v++,d.setX(v,T),v++,d.setX(v,L),v++}}this.setIndex(d),this.addAttribute("position",p),this.addAttribute("normal",f),this.addAttribute("uv",m)},n.RingBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.RingBufferGeometry.prototype.constructor=n.RingBufferGeometry,n.RingGeometry=function(e,t,i,r,o,a){n.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))},n.RingGeometry.prototype=Object.create(n.Geometry.prototype),n.RingGeometry.prototype.constructor=n.RingGeometry,n.SphereGeometry=function(e,t,i,r,o,a,s){n.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))},n.SphereGeometry.prototype=Object.create(n.Geometry.prototype),n.SphereGeometry.prototype.constructor=n.SphereGeometry,n.SphereBufferGeometry=function(e,t,i,r,o,a,s){n.BufferGeometry.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:o,thetaStart:a,thetaLength:s},e=e||50,t=Math.max(3,Math.floor(t)||8),i=Math.max(2,Math.floor(i)||6),r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,a=void 0!==a?a:0,s=void 0!==s?s:Math.PI;for(var c=a+s,u=(t+1)*(i+1),l=new n.BufferAttribute(new Float32Array(3*u),3),h=new n.BufferAttribute(new Float32Array(3*u),3),d=new n.BufferAttribute(new Float32Array(2*u),2),p=0,f=[],m=new n.Vector3,g=0;i>=g;g++){for(var v=[],y=g/i,M=0;t>=M;M++){var A=M/t,x=-e*Math.cos(r+A*o)*Math.sin(a+y*s),w=e*Math.cos(a+y*s),E=e*Math.sin(r+A*o)*Math.sin(a+y*s);m.set(x,w,E).normalize(),l.setXYZ(p,x,w,E),h.setXYZ(p,m.x,m.y,m.z),d.setXY(p,A,1-y),v.push(p),p++}f.push(v)}for(var b=[],g=0;i>g;g++)for(var M=0;t>M;M++){var T=f[g][M+1],L=f[g][M],D=f[g+1][M],N=f[g+1][M+1];(0!==g||a>0)&&b.push(T,L,N),(g!==i-1||c<Math.PI)&&b.push(L,D,N)}this.setIndex(new(l.count>65535?n.Uint32Attribute:n.Uint16Attribute)(b,1)),this.addAttribute("position",l),this.addAttribute("normal",h),this.addAttribute("uv",d),this.boundingSphere=new n.Sphere(new n.Vector3,e)},n.SphereBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.SphereBufferGeometry.prototype.constructor=n.SphereBufferGeometry,n.TextGeometry=function(e,t){t=t||{};var i=t.font;if(i instanceof n.Font==!1)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new n.Geometry;var r=i.generateShapes(e,t.size,t.curveSegments);t.amount=void 0!==t.height?t.height:50, void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),n.ExtrudeGeometry.call(this,r,t),this.type="TextGeometry"},n.TextGeometry.prototype=Object.create(n.ExtrudeGeometry.prototype),n.TextGeometry.prototype.constructor=n.TextGeometry,n.TorusBufferGeometry=function(e,t,i,r,o){n.BufferGeometry.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:o},e=e||100,t=t||40,i=Math.floor(i)||8,r=Math.floor(r)||6,o=o||2*Math.PI;var a,s,c=(i+1)*(r+1),u=i*r*2*3,l=new(u>65535?Uint32Array:Uint16Array)(u),h=new Float32Array(3*c),d=new Float32Array(3*c),p=new Float32Array(2*c),f=0,m=0,g=0,v=new n.Vector3,y=new n.Vector3,M=new n.Vector3;for(a=0;i>=a;a++)for(s=0;r>=s;s++){var A=s/r*o,x=a/i*Math.PI*2;y.x=(e+t*Math.cos(x))*Math.cos(A),y.y=(e+t*Math.cos(x))*Math.sin(A),y.z=t*Math.sin(x),h[f]=y.x,h[f+1]=y.y,h[f+2]=y.z,v.x=e*Math.cos(A),v.y=e*Math.sin(A),M.subVectors(y,v).normalize(),d[f]=M.x,d[f+1]=M.y,d[f+2]=M.z,p[m]=s/r,p[m+1]=a/i,f+=3,m+=2}for(a=1;i>=a;a++)for(s=1;r>=s;s++){var w=(r+1)*a+s-1,E=(r+1)*(a-1)+s-1,b=(r+1)*(a-1)+s,T=(r+1)*a+s;l[g]=w,l[g+1]=E,l[g+2]=T,l[g+3]=E,l[g+4]=b,l[g+5]=T,g+=6}this.setIndex(new n.BufferAttribute(l,1)),this.addAttribute("position",new n.BufferAttribute(h,3)),this.addAttribute("normal",new n.BufferAttribute(d,3)),this.addAttribute("uv",new n.BufferAttribute(p,2))},n.TorusBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.TorusBufferGeometry.prototype.constructor=n.TorusBufferGeometry,n.TorusGeometry=function(e,t,i,r,o){n.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:o},this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))},n.TorusGeometry.prototype=Object.create(n.Geometry.prototype),n.TorusGeometry.prototype.constructor=n.TorusGeometry,n.TorusKnotBufferGeometry=function(e,t,i,r,o,a){function s(e,t,i,r,n){var o=Math.cos(e),a=Math.sin(e),s=i/t*e,c=Math.cos(s);n.x=r*(2+c)*.5*o,n.y=r*(2+c)*a*.5,n.z=r*Math.sin(s)*.5}n.BufferGeometry.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:o,q:a},e=e||100,t=t||40,i=Math.floor(i)||64,r=Math.floor(r)||8,o=o||2,a=a||3;var c,u,l=(r+1)*(i+1),h=r*i*2*3,d=new n.BufferAttribute(new(h>65535?Uint32Array:Uint16Array)(h),1),p=new n.BufferAttribute(new Float32Array(3*l),3),f=new n.BufferAttribute(new Float32Array(3*l),3),m=new n.BufferAttribute(new Float32Array(2*l),2),g=0,v=0,y=new n.Vector3,M=new n.Vector3,A=new n.Vector2,x=new n.Vector3,w=new n.Vector3,E=new n.Vector3,b=new n.Vector3,T=new n.Vector3;for(c=0;i>=c;++c){var L=c/i*o*Math.PI*2;for(s(L,o,a,e,x),s(L+.01,o,a,e,w),b.subVectors(w,x),T.addVectors(w,x),E.crossVectors(b,T),T.crossVectors(E,b),E.normalize(),T.normalize(),u=0;r>=u;++u){var D=u/r*Math.PI*2,N=-t*Math.cos(D),S=t*Math.sin(D);y.x=x.x+(N*T.x+S*E.x),y.y=x.y+(N*T.y+S*E.y),y.z=x.z+(N*T.z+S*E.z),p.setXYZ(g,y.x,y.y,y.z),M.subVectors(y,x).normalize(),f.setXYZ(g,M.x,M.y,M.z),A.x=c/i,A.y=u/r,m.setXY(g,A.x,A.y),g++}}for(u=1;i>=u;u++)for(c=1;r>=c;c++){var C=(r+1)*(u-1)+(c-1),I=(r+1)*u+(c-1),j=(r+1)*u+c,_=(r+1)*(u-1)+c;d.setX(v,C),v++,d.setX(v,I),v++,d.setX(v,_),v++,d.setX(v,I),v++,d.setX(v,j),v++,d.setX(v,_),v++}this.setIndex(d),this.addAttribute("position",p),this.addAttribute("normal",f),this.addAttribute("uv",m)},n.TorusKnotBufferGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.TorusKnotBufferGeometry.prototype.constructor=n.TorusKnotBufferGeometry,n.TorusKnotGeometry=function(e,t,i,r,o,a,s){n.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:o,q:a},void 0!==s&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),this.mergeVertices()},n.TorusKnotGeometry.prototype=Object.create(n.Geometry.prototype),n.TorusKnotGeometry.prototype.constructor=n.TorusKnotGeometry,n.TubeGeometry=function(e,t,i,r,o,a){function s(e,t,i){return C.vertices.push(new n.Vector3(e,t,i))-1}n.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:e,segments:t,radius:i,radialSegments:r,closed:o,taper:a},t=t||64,i=i||1,r=r||8,o=o||!1,a=a||n.TubeGeometry.NoTaper;var c,u,l,h,d,p,f,m,g,v,y,M,A,x,w,E,b,T,L,D,N,S=[],C=this,I=t+1,j=new n.Vector3,_=new n.TubeGeometry.FrenetFrames(e,t,o),O=_.tangents,z=_.normals,k=_.binormals;for(this.tangents=O,this.normals=z,this.binormals=k,v=0;I>v;v++)for(S[v]=[],h=v/(I-1),g=e.getPointAt(h),c=O[v],u=z[v],l=k[v],p=i*a(h),y=0;r>y;y++)d=y/r*2*Math.PI,f=-p*Math.cos(d),m=p*Math.sin(d),j.copy(g),j.x+=f*u.x+m*l.x,j.y+=f*u.y+m*l.y,j.z+=f*u.z+m*l.z,S[v][y]=s(j.x,j.y,j.z);for(v=0;t>v;v++)for(y=0;r>y;y++)M=o?(v+1)%t:v+1,A=(y+1)%r,x=S[v][y],w=S[M][y],E=S[M][A],b=S[v][A],T=new n.Vector2(v/t,y/r),L=new n.Vector2((v+1)/t,y/r),D=new n.Vector2((v+1)/t,(y+1)/r),N=new n.Vector2(v/t,(y+1)/r),this.faces.push(new n.Face3(x,w,b)),this.faceVertexUvs[0].push([T,L,N]),this.faces.push(new n.Face3(w,E,b)),this.faceVertexUvs[0].push([L.clone(),D,N.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},n.TubeGeometry.prototype=Object.create(n.Geometry.prototype),n.TubeGeometry.prototype.constructor=n.TubeGeometry,n.TubeGeometry.NoTaper=function(){return 1},n.TubeGeometry.SinusoidalTaper=function(e){return Math.sin(Math.PI*e)},n.TubeGeometry.FrenetFrames=function(e,t,i){function r(){f[0]=new n.Vector3,m[0]=new n.Vector3,a=Number.MAX_VALUE,s=Math.abs(p[0].x),c=Math.abs(p[0].y),u=Math.abs(p[0].z),a>=s&&(a=s,d.set(1,0,0)),a>=c&&(a=c,d.set(0,1,0)),a>=u&&d.set(0,0,1),g.crossVectors(p[0],d).normalize(),f[0].crossVectors(p[0],g),m[0].crossVectors(p[0],f[0])}var o,a,s,c,u,l,h,d=new n.Vector3,p=[],f=[],m=[],g=new n.Vector3,v=new n.Matrix4,y=t+1;for(this.tangents=p,this.normals=f,this.binormals=m,l=0;y>l;l++)h=l/(y-1),p[l]=e.getTangentAt(h),p[l].normalize();for(r(),l=1;y>l;l++)f[l]=f[l-1].clone(),m[l]=m[l-1].clone(),g.crossVectors(p[l-1],p[l]),g.length()>Number.EPSILON&&(g.normalize(),o=Math.acos(n.Math.clamp(p[l-1].dot(p[l]),-1,1)),f[l].applyMatrix4(v.makeRotationAxis(g,o))),m[l].crossVectors(p[l],f[l]);if(i)for(o=Math.acos(n.Math.clamp(f[0].dot(f[y-1]),-1,1)),o/=y-1,p[0].dot(g.crossVectors(f[0],f[y-1]))>0&&(o=-o),l=1;y>l;l++)f[l].applyMatrix4(v.makeRotationAxis(p[l],o*l)),m[l].crossVectors(p[l],f[l])},n.PolyhedronGeometry=function(e,t,i,r){function o(e){var t=e.normalize().clone();t.index=h.vertices.push(t)-1;var i=c(e)/2/Math.PI+.5,r=u(e)/Math.PI+.5;return t.uv=new n.Vector2(i,1-r),t}function a(e,t,i,r){var o=new n.Face3(e.index,t.index,i.index,[e.clone(),t.clone(),i.clone()],void 0,r);h.faces.push(o),A.copy(e).add(t).add(i).divideScalar(3);var a=c(A);h.faceVertexUvs[0].push([l(e.uv,e,a),l(t.uv,t,a),l(i.uv,i,a)])}function s(e,t){for(var i=Math.pow(2,t),r=o(h.vertices[e.a]),n=o(h.vertices[e.b]),s=o(h.vertices[e.c]),c=[],u=e.materialIndex,l=0;i>=l;l++){c[l]=[];for(var d=o(r.clone().lerp(s,l/i)),p=o(n.clone().lerp(s,l/i)),f=i-l,m=0;f>=m;m++)c[l][m]=0===m&&l===i?d:o(d.clone().lerp(p,m/f))}for(var l=0;i>l;l++)for(var m=0;2*(i-l)-1>m;m++){var g=Math.floor(m/2);m%2===0?a(c[l][g+1],c[l+1][g],c[l][g],u):a(c[l][g+1],c[l+1][g+1],c[l+1][g],u)}}function c(e){return Math.atan2(e.z,-e.x)}function u(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}function l(e,t,i){return 0>i&&1===e.x&&(e=new n.Vector2(e.x-1,e.y)),0===t.x&&0===t.z&&(e=new n.Vector2(i/2/Math.PI+.5,e.y)),e.clone()}n.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r},i=i||1,r=r||0;for(var h=this,d=0,p=e.length;p>d;d+=3)o(new n.Vector3(e[d],e[d+1],e[d+2]));for(var f=this.vertices,m=[],d=0,g=0,p=t.length;p>d;d+=3,g++){var v=f[t[d]],y=f[t[d+1]],M=f[t[d+2]];m[g]=new n.Face3(v.index,y.index,M.index,[v.clone(),y.clone(),M.clone()],void 0,g)}for(var A=new n.Vector3,d=0,p=m.length;p>d;d++)s(m[d],r);for(var d=0,p=this.faceVertexUvs[0].length;p>d;d++){var x=this.faceVertexUvs[0][d],w=x[0].x,E=x[1].x,b=x[2].x,T=Math.max(w,E,b),L=Math.min(w,E,b);T>.9&&.1>L&&(.2>w&&(x[0].x+=1),.2>E&&(x[1].x+=1),.2>b&&(x[2].x+=1))}for(var d=0,p=this.vertices.length;p>d;d++)this.vertices[d].multiplyScalar(i);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new n.Sphere(new n.Vector3,i)},n.PolyhedronGeometry.prototype=Object.create(n.Geometry.prototype),n.PolyhedronGeometry.prototype.constructor=n.PolyhedronGeometry,n.DodecahedronGeometry=function(e,t){var i=(1+Math.sqrt(5))/2,r=1/i,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];n.PolyhedronGeometry.call(this,o,a,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}},n.DodecahedronGeometry.prototype=Object.create(n.PolyhedronGeometry.prototype),n.DodecahedronGeometry.prototype.constructor=n.DodecahedronGeometry,n.IcosahedronGeometry=function(e,t){var i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],o=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];n.PolyhedronGeometry.call(this,r,o,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}},n.IcosahedronGeometry.prototype=Object.create(n.PolyhedronGeometry.prototype),n.IcosahedronGeometry.prototype.constructor=n.IcosahedronGeometry,n.OctahedronGeometry=function(e,t){var i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];n.PolyhedronGeometry.call(this,i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}},n.OctahedronGeometry.prototype=Object.create(n.PolyhedronGeometry.prototype),n.OctahedronGeometry.prototype.constructor=n.OctahedronGeometry,n.TetrahedronGeometry=function(e,t){var i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];n.PolyhedronGeometry.call(this,i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}},n.TetrahedronGeometry.prototype=Object.create(n.PolyhedronGeometry.prototype),n.TetrahedronGeometry.prototype.constructor=n.TetrahedronGeometry,n.ParametricGeometry=function(e,t,i){n.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};var r,o,a,s,c,u=this.vertices,l=this.faces,h=this.faceVertexUvs[0],d=t+1;for(r=0;i>=r;r++)for(c=r/i,o=0;t>=o;o++)s=o/t,a=e(s,c),u.push(a);var p,f,m,g,v,y,M,A;for(r=0;i>r;r++)for(o=0;t>o;o++)p=r*d+o,f=r*d+o+1,m=(r+1)*d+o+1,g=(r+1)*d+o,v=new n.Vector2(o/t,r/i),y=new n.Vector2((o+1)/t,r/i),M=new n.Vector2((o+1)/t,(r+1)/i),A=new n.Vector2(o/t,(r+1)/i),l.push(new n.Face3(p,f,g)),h.push([v,y,A]),l.push(new n.Face3(f,m,g)),h.push([y.clone(),M,A.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},n.ParametricGeometry.prototype=Object.create(n.Geometry.prototype),n.ParametricGeometry.prototype.constructor=n.ParametricGeometry,n.WireframeGeometry=function(e){function t(e,t){return e-t}n.BufferGeometry.call(this);var i=[0,0],r={},o=["a","b","c"];if(e instanceof n.Geometry){for(var a=e.vertices,s=e.faces,c=0,u=new Uint32Array(6*s.length),l=0,h=s.length;h>l;l++)for(var d=s[l],p=0;3>p;p++){i[0]=d[o[p]],i[1]=d[o[(p+1)%3]],i.sort(t);var f=i.toString();void 0===r[f]&&(u[2*c]=i[0],u[2*c+1]=i[1],r[f]=!0,c++)}for(var m=new Float32Array(2*c*3),l=0,h=c;h>l;l++)for(var p=0;2>p;p++){var g=a[u[2*l+p]],v=6*l+3*p;m[v+0]=g.x,m[v+1]=g.y,m[v+2]=g.z}this.addAttribute("position",new n.BufferAttribute(m,3))}else if(e instanceof n.BufferGeometry)if(null!==e.index){var y=e.index.array,a=e.attributes.position,M=e.groups,c=0;0===M.length&&e.addGroup(0,y.length);for(var u=new Uint32Array(2*y.length),A=0,x=M.length;x>A;++A)for(var w=M[A],E=w.start,b=w.count,l=E,T=E+b;T>l;l+=3)for(var p=0;3>p;p++){i[0]=y[l+p],i[1]=y[l+(p+1)%3],i.sort(t);var f=i.toString();void 0===r[f]&&(u[2*c]=i[0],u[2*c+1]=i[1],r[f]=!0,c++)}for(var m=new Float32Array(2*c*3),l=0,h=c;h>l;l++)for(var p=0;2>p;p++){var v=6*l+3*p,L=u[2*l+p];m[v+0]=a.getX(L),m[v+1]=a.getY(L),m[v+2]=a.getZ(L)}this.addAttribute("position",new n.BufferAttribute(m,3))}else{for(var a=e.attributes.position.array,c=a.length/3,D=c/3,m=new Float32Array(2*c*3),l=0,h=D;h>l;l++)for(var p=0;3>p;p++){var v=18*l+6*p,N=9*l+3*p;m[v+0]=a[N],m[v+1]=a[N+1],m[v+2]=a[N+2];var L=9*l+3*((p+1)%3);m[v+3]=a[L],m[v+4]=a[L+1],m[v+5]=a[L+2]}this.addAttribute("position",new n.BufferAttribute(m,3))}},n.WireframeGeometry.prototype=Object.create(n.BufferGeometry.prototype),n.WireframeGeometry.prototype.constructor=n.WireframeGeometry,n.AxisHelper=function(e){e=e||1;var t=new Float32Array([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e]),i=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]),r=new n.BufferGeometry;r.addAttribute("position",new n.BufferAttribute(t,3)),r.addAttribute("color",new n.BufferAttribute(i,3));var o=new n.LineBasicMaterial({vertexColors:n.VertexColors});n.LineSegments.call(this,r,o)},n.AxisHelper.prototype=Object.create(n.LineSegments.prototype),n.AxisHelper.prototype.constructor=n.AxisHelper,n.ArrowHelper=function(){var e=new n.Geometry;e.vertices.push(new n.Vector3(0,0,0),new n.Vector3(0,1,0));var t=new n.CylinderGeometry(0,.5,1,5,1);return t.translate(0,-.5,0),function(i,r,o,a,s,c){n.Object3D.call(this),void 0===a&&(a=16776960),void 0===o&&(o=1),void 0===s&&(s=.2*o),void 0===c&&(c=.2*s),this.position.copy(r),this.line=new n.Line(e,new n.LineBasicMaterial({color:a})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new n.Mesh(t,new n.MeshBasicMaterial({color:a})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(i),this.setLength(o,s,c)}}(),n.ArrowHelper.prototype=Object.create(n.Object3D.prototype),n.ArrowHelper.prototype.constructor=n.ArrowHelper,n.ArrowHelper.prototype.setDirection=function(){var e,t=new n.Vector3;return function(i){i.y>.99999?this.quaternion.set(0,0,0,1):i.y<-.99999?this.quaternion.set(1,0,0,0):(t.set(i.z,0,-i.x).normalize(),e=Math.acos(i.y),this.quaternion.setFromAxisAngle(t,e))}}(),n.ArrowHelper.prototype.setLength=function(e,t,i){void 0===t&&(t=.2*e),void 0===i&&(i=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()},n.ArrowHelper.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},n.BoxHelper=function(e){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new n.BufferGeometry;r.setIndex(new n.BufferAttribute(t,1)),r.addAttribute("position",new n.BufferAttribute(i,3)),n.LineSegments.call(this,r,new n.LineBasicMaterial({color:16776960})),void 0!==e&&this.update(e)},n.BoxHelper.prototype=Object.create(n.LineSegments.prototype),n.BoxHelper.prototype.constructor=n.BoxHelper,n.BoxHelper.prototype.update=function(){var e=new n.Box3;return function(t){if(t instanceof n.Box3?e.copy(t):e.setFromObject(t),!e.isEmpty()){var i=e.min,r=e.max,o=this.geometry.attributes.position,a=o.array;a[0]=r.x,a[1]=r.y,a[2]=r.z,a[3]=i.x,a[4]=r.y,a[5]=r.z,a[6]=i.x,a[7]=i.y,a[8]=r.z,a[9]=r.x,a[10]=i.y,a[11]=r.z,a[12]=r.x,a[13]=r.y,a[14]=i.z,a[15]=i.x,a[16]=r.y,a[17]=i.z,a[18]=i.x,a[19]=i.y,a[20]=i.z,a[21]=r.x,a[22]=i.y,a[23]=i.z,o.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),n.BoundingBoxHelper=function(e,t){var i=void 0!==t?t:8947848;this.object=e,this.box=new n.Box3,n.Mesh.call(this,new n.BoxGeometry(1,1,1),new n.MeshBasicMaterial({color:i,wireframe:!0}))},n.BoundingBoxHelper.prototype=Object.create(n.Mesh.prototype),n.BoundingBoxHelper.prototype.constructor=n.BoundingBoxHelper,n.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},n.CameraHelper=function(e){function t(e,t,r){i(e,r),i(t,r)}function i(e,t){r.vertices.push(new n.Vector3),r.colors.push(new n.Color(t)),void 0===a[e]&&(a[e]=[]),a[e].push(r.vertices.length-1)}var r=new n.Geometry,o=new n.LineBasicMaterial({color:16777215,vertexColors:n.FaceColors}),a={},s=16755200,c=16711680,u=43775,l=16777215,h=3355443;t("n1","n2",s),t("n2","n4",s),t("n4","n3",s),t("n3","n1",s),t("f1","f2",s),t("f2","f4",s),t("f4","f3",s),t("f3","f1",s),t("n1","f1",s),t("n2","f2",s),t("n3","f3",s),t("n4","f4",s),t("p","n1",c),t("p","n2",c),t("p","n3",c),t("p","n4",c),t("u1","u2",u),t("u2","u3",u),t("u3","u1",u),t("c","t",l),t("p","c",h),t("cn1","cn2",h),t("cn3","cn4",h),t("cf1","cf2",h),t("cf3","cf4",h),n.LineSegments.call(this,r,o),this.camera=e,this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()},n.CameraHelper.prototype=Object.create(n.LineSegments.prototype),n.CameraHelper.prototype.constructor=n.CameraHelper,n.CameraHelper.prototype.update=function(){function e(e,n,a,s){r.set(n,a,s).unproject(o);var c=i[e];if(void 0!==c)for(var u=0,l=c.length;l>u;u++)t.vertices[c[u]].copy(r)}var t,i,r=new n.Vector3,o=new n.Camera;return function(){t=this.geometry,i=this.pointMap;var r=1,n=1;o.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-r,-n,-1),e("n2",r,-n,-1),e("n3",-r,n,-1),e("n4",r,n,-1),e("f1",-r,-n,1),e("f2",r,-n,1),e("f3",-r,n,1),e("f4",r,n,1),e("u1",.7*r,1.1*n,-1),e("u2",.7*-r,1.1*n,-1),e("u3",0,2*n,-1),e("cf1",-r,0,1),e("cf2",r,0,1),e("cf3",0,-n,1),e("cf4",0,n,1),e("cn1",-r,0,-1),e("cn2",r,0,-1),e("cn3",0,-n,-1),e("cn4",0,n,-1),t.verticesNeedUpdate=!0}}(),n.DirectionalLightHelper=function(e,t){n.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,t=t||1;var i=new n.Geometry;i.vertices.push(new n.Vector3(-t,t,0),new n.Vector3(t,t,0),new n.Vector3(t,-t,0),new n.Vector3(-t,-t,0),new n.Vector3(-t,t,0));var r=new n.LineBasicMaterial({fog:!1});r.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new n.Line(i,r),this.add(this.lightPlane),i=new n.Geometry,i.vertices.push(new n.Vector3,new n.Vector3),r=new n.LineBasicMaterial({fog:!1}),r.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new n.Line(i,r),this.add(this.targetLine),this.update()},n.DirectionalLightHelper.prototype=Object.create(n.Object3D.prototype),n.DirectionalLightHelper.prototype.constructor=n.DirectionalLightHelper,n.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},n.DirectionalLightHelper.prototype.update=function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Vector3;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(t,e),this.lightPlane.lookAt(i),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(i),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),n.EdgesHelper=function(e,t,i){var r=void 0!==t?t:16777215;n.LineSegments.call(this,new n.EdgesGeometry(e.geometry,i),new n.LineBasicMaterial({color:r})),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},n.EdgesHelper.prototype=Object.create(n.LineSegments.prototype),n.EdgesHelper.prototype.constructor=n.EdgesHelper,n.FaceNormalsHelper=function(e,t,i,r){this.object=e,this.size=void 0!==t?t:1;var o=void 0!==i?i:16776960,a=void 0!==r?r:1,s=0,c=this.object.geometry;c instanceof n.Geometry?s=c.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var u=new n.BufferGeometry,l=new n.Float32Attribute(2*s*3,3);u.addAttribute("position",l),n.LineSegments.call(this,u,new n.LineBasicMaterial({color:o,linewidth:a})),this.matrixAutoUpdate=!1,this.update()},n.FaceNormalsHelper.prototype=Object.create(n.LineSegments.prototype),n.FaceNormalsHelper.prototype.constructor=n.FaceNormalsHelper,n.FaceNormalsHelper.prototype.update=function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Matrix3;return function(){this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);for(var r=this.object.matrixWorld,n=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,c=0,u=0,l=s.length;l>u;u++){var h=s[u],d=h.normal;e.copy(a[h.a]).add(a[h.b]).add(a[h.c]).divideScalar(3).applyMatrix4(r),t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),n.setXYZ(c,e.x,e.y,e.z),c+=1,n.setXYZ(c,t.x,t.y,t.z),c+=1}return n.needsUpdate=!0,this}}(),n.GridHelper=function(e,t){var i=new n.Geometry,r=new n.LineBasicMaterial({vertexColors:n.VertexColors});this.color1=new n.Color(4473924),this.color2=new n.Color(8947848);for(var o=-e;e>=o;o+=t){i.vertices.push(new n.Vector3(-e,0,o),new n.Vector3(e,0,o),new n.Vector3(o,0,-e),new n.Vector3(o,0,e));var a=0===o?this.color1:this.color2;i.colors.push(a,a,a,a)}n.LineSegments.call(this,i,r)},n.GridHelper.prototype=Object.create(n.LineSegments.prototype),n.GridHelper.prototype.constructor=n.GridHelper,n.GridHelper.prototype.setColors=function(e,t){this.color1.set(e),this.color2.set(t),this.geometry.colorsNeedUpdate=!0},n.HemisphereLightHelper=function(e,t){n.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new n.Color,new n.Color];var i=new n.SphereGeometry(t,4,2);i.rotateX(-Math.PI/2);for(var r=0,o=8;o>r;r++)i.faces[r].color=this.colors[4>r?0:1];var a=new n.MeshBasicMaterial({vertexColors:n.FaceColors,wireframe:!0});this.lightSphere=new n.Mesh(i,a),this.add(this.lightSphere),this.update()},n.HemisphereLightHelper.prototype=Object.create(n.Object3D.prototype),n.HemisphereLightHelper.prototype.constructor=n.HemisphereLightHelper,n.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},n.HemisphereLightHelper.prototype.update=function(){var e=new n.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),n.PointLightHelper=function(e,t){this.light=e,this.light.updateMatrixWorld();var i=new n.SphereGeometry(t,4,2),r=new n.MeshBasicMaterial({wireframe:!0,fog:!1});r.color.copy(this.light.color).multiplyScalar(this.light.intensity),n.Mesh.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},n.PointLightHelper.prototype=Object.create(n.Mesh.prototype),n.PointLightHelper.prototype.constructor=n.PointLightHelper,n.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},n.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},n.SkeletonHelper=function(e){this.bones=this.getBoneList(e);for(var t=new n.Geometry,i=0;i<this.bones.length;i++){var r=this.bones[i];r.parent instanceof n.Bone&&(t.vertices.push(new n.Vector3),t.vertices.push(new n.Vector3),t.colors.push(new n.Color(0,0,1)),t.colors.push(new n.Color(0,1,0)))}t.dynamic=!0;var o=new n.LineBasicMaterial({vertexColors:n.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});n.LineSegments.call(this,t,o),this.root=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.update()},n.SkeletonHelper.prototype=Object.create(n.LineSegments.prototype),n.SkeletonHelper.prototype.constructor=n.SkeletonHelper,n.SkeletonHelper.prototype.getBoneList=function(e){var t=[];e instanceof n.Bone&&t.push(e);for(var i=0;i<e.children.length;i++)t.push.apply(t,this.getBoneList(e.children[i]));return t},n.SkeletonHelper.prototype.update=function(){for(var e=this.geometry,t=(new n.Matrix4).getInverse(this.root.matrixWorld),i=new n.Matrix4,r=0,o=0;o<this.bones.length;o++){var a=this.bones[o];a.parent instanceof n.Bone&&(i.multiplyMatrices(t,a.matrixWorld),e.vertices[r].setFromMatrixPosition(i),i.multiplyMatrices(t,a.parent.matrixWorld),e.vertices[r+1].setFromMatrixPosition(i),r+=2)}e.verticesNeedUpdate=!0,e.computeBoundingSphere()},n.SpotLightHelper=function(e){n.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;for(var t=new n.BufferGeometry,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,o=1,a=32;a>r;r++,o++){var s=r/a*Math.PI*2,c=o/a*Math.PI*2;i.push(Math.cos(s),Math.sin(s),1,Math.cos(c),Math.sin(c),1)}t.addAttribute("position",new n.Float32Attribute(i,3));var u=new n.LineBasicMaterial({fog:!1});this.cone=new n.LineSegments(t,u),this.add(this.cone),this.update()},n.SpotLightHelper.prototype=Object.create(n.Object3D.prototype),n.SpotLightHelper.prototype.constructor=n.SpotLightHelper,n.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},n.SpotLightHelper.prototype.update=function(){var e=new n.Vector3,t=new n.Vector3;return function(){var i=this.light.distance?this.light.distance:1e3,r=i*Math.tan(this.light.angle);this.cone.scale.set(r,r,i),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),n.VertexNormalsHelper=function(e,t,i,r){this.object=e,this.size=void 0!==t?t:1;var o=void 0!==i?i:16711680,a=void 0!==r?r:1,s=0,c=this.object.geometry;c instanceof n.Geometry?s=3*c.faces.length:c instanceof n.BufferGeometry&&(s=c.attributes.normal.count);var u=new n.BufferGeometry,l=new n.Float32Attribute(2*s*3,3);u.addAttribute("position",l),n.LineSegments.call(this,u,new n.LineBasicMaterial({color:o,linewidth:a})),this.matrixAutoUpdate=!1,this.update()},n.VertexNormalsHelper.prototype=Object.create(n.LineSegments.prototype),n.VertexNormalsHelper.prototype.constructor=n.VertexNormalsHelper,n.VertexNormalsHelper.prototype.update=function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Matrix3;return function(){var r=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var o=this.object.matrixWorld,a=this.geometry.attributes.position,s=this.object.geometry;if(s instanceof n.Geometry)for(var c=s.vertices,u=s.faces,l=0,h=0,d=u.length;d>h;h++)for(var p=u[h],f=0,m=p.vertexNormals.length;m>f;f++){var g=c[p[r[f]]],v=p.vertexNormals[f];e.copy(g).applyMatrix4(o),t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),a.setXYZ(l,e.x,e.y,e.z),l+=1,a.setXYZ(l,t.x,t.y,t.z),l+=1}else if(s instanceof n.BufferGeometry)for(var y=s.attributes.position,M=s.attributes.normal,l=0,f=0,m=y.count;m>f;f++)e.set(y.getX(f),y.getY(f),y.getZ(f)).applyMatrix4(o),t.set(M.getX(f),M.getY(f),M.getZ(f)),t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),a.setXYZ(l,e.x,e.y,e.z),l+=1,a.setXYZ(l,t.x,t.y,t.z),l+=1;return a.needsUpdate=!0,this}}(),n.WireframeHelper=function(e,t){var i=void 0!==t?t:16777215;n.LineSegments.call(this,new n.WireframeGeometry(e.geometry),new n.LineBasicMaterial({color:i})),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},n.WireframeHelper.prototype=Object.create(n.LineSegments.prototype),n.WireframeHelper.prototype.constructor=n.WireframeHelper,n.ImmediateRenderObject=function(e){n.Object3D.call(this),this.material=e,this.render=function(){}},n.ImmediateRenderObject.prototype=Object.create(n.Object3D.prototype),n.ImmediateRenderObject.prototype.constructor=n.ImmediateRenderObject,n.MorphBlendMesh=function(e,t){n.Mesh.call(this,e,t),this.animationsMap={},this.animationsList=[];var i=this.geometry.morphTargets.length,r="__default",o=0,a=i-1,s=i/1;this.createAnimation(r,o,a,s),this.setAnimationWeight(r,1)},n.MorphBlendMesh.prototype=Object.create(n.Mesh.prototype),n.MorphBlendMesh.prototype.constructor=n.MorphBlendMesh,n.MorphBlendMesh.prototype.createAnimation=function(e,t,i,r){var n={start:t,end:i,length:i-t+1,fps:r,duration:(i-t)/r,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[e]=n,this.animationsList.push(n)},n.MorphBlendMesh.prototype.autoCreateAnimations=function(e){for(var t,i=/([a-z]+)_?(\d+)/i,r={},n=this.geometry,o=0,a=n.morphTargets.length;a>o;o++){var s=n.morphTargets[o],c=s.name.match(i);if(c&&c.length>1){var u=c[1];r[u]||(r[u]={start:1/0,end:-(1/0)});var l=r[u];o<l.start&&(l.start=o),o>l.end&&(l.end=o),t||(t=u)}}for(var u in r){var l=r[u];this.createAnimation(u,l.start,l.end,e)}this.firstAnimation=t},n.MorphBlendMesh.prototype.setAnimationDirectionForward=function(e){var t=this.animationsMap[e];t&&(t.direction=1,t.directionBackwards=!1)},n.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(e){var t=this.animationsMap[e];t&&(t.direction=-1,t.directionBackwards=!0)},n.MorphBlendMesh.prototype.setAnimationFPS=function(e,t){var i=this.animationsMap[e];i&&(i.fps=t,i.duration=(i.end-i.start)/i.fps)},n.MorphBlendMesh.prototype.setAnimationDuration=function(e,t){var i=this.animationsMap[e];i&&(i.duration=t,i.fps=(i.end-i.start)/i.duration)},n.MorphBlendMesh.prototype.setAnimationWeight=function(e,t){var i=this.animationsMap[e];i&&(i.weight=t)},n.MorphBlendMesh.prototype.setAnimationTime=function(e,t){var i=this.animationsMap[e];i&&(i.time=t)},n.MorphBlendMesh.prototype.getAnimationTime=function(e){var t=0,i=this.animationsMap[e];return i&&(t=i.time),t},n.MorphBlendMesh.prototype.getAnimationDuration=function(e){var t=-1,i=this.animationsMap[e];return i&&(t=i.duration),t},n.MorphBlendMesh.prototype.playAnimation=function(e){var t=this.animationsMap[e];t?(t.time=0,t.active=!0):console.warn("THREE.MorphBlendMesh: animation["+e+"] undefined in .playAnimation()")},n.MorphBlendMesh.prototype.stopAnimation=function(e){var t=this.animationsMap[e];t&&(t.active=!1)},n.MorphBlendMesh.prototype.update=function(e){for(var t=0,i=this.animationsList.length;i>t;t++){var r=this.animationsList[t];if(r.active){var o=r.duration/r.length;r.time+=r.direction*e,r.mirroredLoop?(r.time>r.duration||r.time<0)&&(r.direction*=-1,r.time>r.duration&&(r.time=r.duration,r.directionBackwards=!0),r.time<0&&(r.time=0,r.directionBackwards=!1)):(r.time=r.time%r.duration,r.time<0&&(r.time+=r.duration));var a=r.start+n.Math.clamp(Math.floor(r.time/o),0,r.length-1),s=r.weight;a!==r.currentFrame&&(this.morphTargetInfluences[r.lastFrame]=0,this.morphTargetInfluences[r.currentFrame]=1*s,this.morphTargetInfluences[a]=0,r.lastFrame=r.currentFrame,r.currentFrame=a);var c=r.time%o/o;r.directionBackwards&&(c=1-c),r.currentFrame!==r.lastFrame?(this.morphTargetInfluences[r.currentFrame]=c*s,this.morphTargetInfluences[r.lastFrame]=(1-c)*s):this.morphTargetInfluences[r.currentFrame]=s}}},"undefined"!=typeof r?("undefined"!=typeof i&&i.exports&&(r=i.exports=n),r.THREE=n):this.THREE=n},{}],18:[function(e,i,r){!function(e){if("performance"in e==!1&&(e.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in e.performance==!1){var t=e.performance.timing&&e.performance.timing.navigationStart?performance.timing.navigationStart:Date.now();e.performance.now=function(){return Date.now()-t}}}(this);var n=n||function(){var e=[];return{REVISION:"14",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=void 0!==t?t:window.performance.now();i<e.length;)e[i].update(t)?i++:e.splice(i,1);return!0}}}();n.Tween=function(e){var t=e,i={},r={},o={},a=1e3,s=0,c=!1,u=!1,l=!1,h=0,d=null,p=n.Easing.Linear.None,f=n.Interpolation.Linear,m=[],g=null,v=!1,y=null,M=null,A=null; for(var x in e)i[x]=parseFloat(e[x],10);this.to=function(e,t){return void 0!==t&&(a=t),r=e,this},this.start=function(e){n.add(this),u=!0,v=!1,d=void 0!==e?e:window.performance.now(),d+=h;for(var a in r){if(r[a]instanceof Array){if(0===r[a].length)continue;r[a]=[t[a]].concat(r[a])}i[a]=t[a],i[a]instanceof Array==!1&&(i[a]*=1),o[a]=i[a]||0}return this},this.stop=function(){return u?(n.remove(this),u=!1,null!==A&&A.call(t),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=m.length;t>e;e++)m[e].stop()},this.delay=function(e){return h=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return c=e,this},this.easing=function(e){return p=e,this},this.interpolation=function(e){return f=e,this},this.chain=function(){return m=arguments,this},this.onStart=function(e){return g=e,this},this.onUpdate=function(e){return y=e,this},this.onComplete=function(e){return M=e,this},this.onStop=function(e){return A=e,this},this.update=function(e){var n;if(d>e)return!0;v===!1&&(null!==g&&g.call(t),v=!0);var u=(e-d)/a;u=u>1?1:u;var A=p(u);for(n in r){var x=i[n]||0,w=r[n];w instanceof Array?t[n]=f(w,A):("string"==typeof w&&(w=x+parseFloat(w,10)),"number"==typeof w&&(t[n]=x+(w-x)*A))}if(null!==y&&y.call(t,A),1==u){if(s>0){isFinite(s)&&s--;for(n in o){if("string"==typeof r[n]&&(o[n]=o[n]+parseFloat(r[n],10)),c){var E=o[n];o[n]=r[n],r[n]=E}i[n]=o[n]}return c&&(l=!l),d=e+h,!0}null!==M&&M.call(t);for(var b=0,T=m.length;T>b;b++)m[b].start(e);return!1}return!0}},n.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/r)))},Out:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin(2*(e-t)*Math.PI/r)+1)},InOut:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||1>i?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?-.5*i*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/r):i*Math.pow(2,-10*(e-=1))*Math.sin(2*(e-t)*Math.PI/r)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-n.Easing.Bounce.Out(1-e)},Out:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return.5>e?.5*n.Easing.Bounce.In(2*e):.5*n.Easing.Bounce.Out(2*e-1)+.5}}},n.Interpolation={Linear:function(e,t){var i=e.length-1,r=i*t,o=Math.floor(r),a=n.Interpolation.Utils.Linear;return 0>t?a(e[0],e[1],r):t>1?a(e[i],e[i-1],i-r):a(e[o],e[o+1>i?i:o+1],r-o)},Bezier:function(e,t){var i,r=0,o=e.length-1,a=Math.pow,s=n.Interpolation.Utils.Bernstein;for(i=0;o>=i;i++)r+=a(1-t,o-i)*a(t,i)*e[i]*s(o,i);return r},CatmullRom:function(e,t){var i=e.length-1,r=i*t,o=Math.floor(r),a=n.Interpolation.Utils.CatmullRom;return e[0]===e[i]?(0>t&&(o=Math.floor(r=i*(1+t))),a(e[(o-1+i)%i],e[o],e[(o+1)%i],e[(o+2)%i],r-o)):0>t?e[0]-(a(e[0],e[0],e[1],e[1],-r)-e[0]):t>1?e[i]-(a(e[i],e[i],e[i-1],e[i-1],r-i)-e[i]):a(e[o?o-1:0],e[o],e[o+1>i?i:o+1],e[o+2>i?i:o+2],r-o)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(e,t){var i=n.Interpolation.Utils.Factorial;return i(e)/i(t)/i(e-t)},Factorial:function(){var e=[1];return function(t){var i,r=1;if(e[t])return e[t];for(i=t;i>1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,c=n*s;return(2*t-2*i+o+a)*c+(-3*t+3*i-2*o-a)*s+o*n+t}}},function(e){"function"==typeof t&&t.amd?t([],function(){return n}):"object"==typeof r?i.exports=n:e.TWEEN=n}(this)},{}],19:[function(e){(function(i){!function r(t,i,n){function o(s,c){if(!i[s]){if(!t[s]){var u="function"==typeof e&&e;if(!c&&u)return u(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[s]={exports:{}};t[s][0].call(h.exports,function(e){var i=t[s][1][e];return o(i?i:e)},h,h.exports,r,t,i,n)}return i[s].exports}for(var a="function"==typeof e&&e,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,r){(function(i,n){(function(){"use strict";function o(e){return"function"==typeof e||"object"==typeof e&&null!==e}function a(e){return"function"==typeof e}function s(e){H=e}function c(e){Z=e}function u(){return function(){i.nextTick(f)}}function l(){return function(){Y(f)}}function h(){var e=0,t=new $(f),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){i.data=e=++e%2}}function d(){var e=new MessageChannel;return e.port1.onmessage=f,function(){e.port2.postMessage(0)}}function p(){return function(){setTimeout(f,1)}}function f(){for(var e=0;q>e;e+=2){var t=ie[e],i=ie[e+1];t(i),ie[e]=void 0,ie[e+1]=void 0}q=0}function m(){try{var t=e,i=t("vertx");return Y=i.runOnLoop||i.runOnContext,l()}catch(r){return p()}}function g(e,t){var i=this,r=i._state;if(r===ae&&!e||r===se&&!t)return this;var n=new this.constructor(y),o=i._result;if(r){var a=arguments[r-1];Z(function(){O(r,n,a,o)})}else C(i,n,e,t);return n}function v(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var i=new t(y);return L(i,e),i}function y(){}function M(){return new TypeError("You cannot resolve a promise with itself")}function A(){return new TypeError("A promises callback cannot return that same promise.")}function x(e){try{return e.then}catch(t){return ce.error=t,ce}}function w(e,t,i,r){try{e.call(t,i,r)}catch(n){return n}}function E(e,t,i){Z(function(e){var r=!1,n=w(i,t,function(i){r||(r=!0,t!==i?L(e,i):N(e,i))},function(t){r||(r=!0,S(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&n&&(r=!0,S(e,n))},e)}function b(e,t){t._state===ae?N(e,t._result):t._state===se?S(e,t._result):C(t,void 0,function(t){L(e,t)},function(t){S(e,t)})}function T(e,t,i){t.constructor===e.constructor&&i===re&&constructor.resolve===ne?b(e,t):i===ce?S(e,ce.error):void 0===i?N(e,t):a(i)?E(e,t,i):N(e,t)}function L(e,t){e===t?S(e,M()):o(t)?T(e,t,x(t)):N(e,t)}function D(e){e._onerror&&e._onerror(e._result),I(e)}function N(e,t){e._state===oe&&(e._result=t,e._state=ae,0!==e._subscribers.length&&Z(I,e))}function S(e,t){e._state===oe&&(e._state=se,e._result=t,Z(D,e))}function C(e,t,i,r){var n=e._subscribers,o=n.length;e._onerror=null,n[o]=t,n[o+ae]=i,n[o+se]=r,0===o&&e._state&&Z(I,e)}function I(e){var t=e._subscribers,i=e._state;if(0!==t.length){for(var r,n,o=e._result,a=0;a<t.length;a+=3)r=t[a],n=t[a+i],r?O(i,r,n,o):n(o);e._subscribers.length=0}}function j(){this.error=null}function _(e,t){try{return e(t)}catch(i){return ue.error=i,ue}}function O(e,t,i,r){var n,o,s,c,u=a(i);if(u){if(n=_(i,r),n===ue?(c=!0,o=n.error,n=null):s=!0,t===n)return void S(t,A())}else n=r,s=!0;t._state!==oe||(u&&s?L(t,n):c?S(t,o):e===ae?N(t,n):e===se&&S(t,n))}function z(e,t){try{t(function(t){L(e,t)},function(t){S(e,t)})}catch(i){S(e,i)}}function k(e){return new me(this,e).promise}function R(e){function t(e){L(n,e)}function i(e){S(n,e)}var r=this,n=new r(y);if(!X(e))return S(n,new TypeError("You must pass an array to race.")),n;for(var o=e.length,a=0;n._state===oe&&o>a;a++)C(r.resolve(e[a]),void 0,t,i);return n}function B(e){var t=this,i=new t(y);return S(i,e),i}function U(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function P(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function F(e){this._id=pe++,this._state=void 0,this._result=void 0,this._subscribers=[],y!==e&&("function"!=typeof e&&U(),this instanceof F?z(this,e):P())}function G(e,t){this._instanceConstructor=e,this.promise=new e(y),Array.isArray(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?N(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&N(this.promise,this._result))):S(this.promise,this._validationError())}function V(){var e;if("undefined"!=typeof n)e=n;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var i=e.Promise;(!i||"[object Promise]"!==Object.prototype.toString.call(i.resolve())||i.cast)&&(e.Promise=fe)}var Q;Q=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var Y,H,W,X=Q,q=0,Z=function(e,t){ie[q]=e,ie[q+1]=t,q+=2,2===q&&(H?H(f):W())},K="undefined"!=typeof window?window:void 0,J=K||{},$=J.MutationObserver||J.WebKitMutationObserver,ee="undefined"!=typeof i&&"[object process]"==={}.toString.call(i),te="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ie=new Array(1e3);W=ee?u():$?h():te?d():void 0===K&&"function"==typeof e?m():p();var re=g,ne=v,oe=void 0,ae=1,se=2,ce=new j,ue=new j,le=k,he=R,de=B,pe=0,fe=F;F.all=le,F.race=he,F.resolve=ne,F.reject=de,F._setScheduler=s,F._setAsap=c,F._asap=Z,F.prototype={constructor:F,then:re,"catch":function(e){return this.then(null,e)}};var me=G;G.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},G.prototype._enumerate=function(){for(var e=this.length,t=this._input,i=0;this._state===oe&&e>i;i++)this._eachEntry(t[i],i)},G.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,r=i.resolve;if(r===ne){var n=x(e);if(n===re&&e._state!==oe)this._settledAt(e._state,t,e._result);else if("function"!=typeof n)this._remaining--,this._result[t]=e;else if(i===fe){var o=new i(y);T(o,e,n),this._willSettleAt(o,t)}else this._willSettleAt(new i(function(t){t(e)}),t)}else this._willSettleAt(r(e),t)},G.prototype._settledAt=function(e,t,i){var r=this.promise;r._state===oe&&(this._remaining--,e===se?S(r,i):this._result[t]=i),0===this._remaining&&N(r,this._result)},G.prototype._willSettleAt=function(e,t){var i=this;C(e,void 0,function(e){i._settledAt(ae,t,e)},function(e){i._settledAt(se,t,e)})};var ge=V,ve={Promise:fe,polyfill:ge};"function"==typeof t&&t.amd?t(function(){return ve}):"undefined"!=typeof r&&r.exports?r.exports=ve:"undefined"!=typeof this&&(this.ES6Promise=ve),ge()}).call(this)}).call(this,e("_process"),"undefined"!=typeof i?i:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],2:[function(e,t){"use strict";function i(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e){for(var t,o,a=i(e),s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var c in t)r.call(t,c)&&(a[c]=t[c]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(t);for(var u=0;u<o.length;u++)n.call(t,o[u])&&(a[o[u]]=t[o[u]])}}return a}},{}],3:[function(e,t){function i(){u=!1,a.length?c=a.concat(c):l=-1,c.length&&r()}function r(){if(!u){var e=setTimeout(i);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l<t;)a&&a[l].run();l=-1,t=c.length}a=null,u=!1,clearTimeout(e)}}function n(e,t){this.fun=e,this.array=t}function o(){}var a,s=t.exports={},c=[],u=!1,l=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];c.push(new n(e,t)),1!==c.length||u||setTimeout(r,0)},n.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=o,s.addListener=o,s.once=o,s.off=o,s.removeListener=o,s.removeAllListeners=o,s.emit=o,s.binding=function(){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],4:[function(e,t){function i(){this.isPolyfilled=!0,this.displayId=c++,this.displayName="webvr-polyfill displayName",this.isConnected=!0,this.isPresenting=!1,this.capabilities={hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1},this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,this.wakelock_=new s}function r(){this.isPolyfilled=!0,this.hardwareUnitId="webvr-polyfill hardwareUnitId",this.deviceId="webvr-polyfill deviceId",this.deviceName="webvr-polyfill deviceName"}function n(){}function o(){}var a=e("./util.js"),s=e("./wakelock.js"),c=1e3,u=!1;i.prototype.getPose=function(){return this.getImmediatePose()},i.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},i.prototype.cancelAnimationFrame=function(e){return window.cancelAnimationFrame(e)},i.prototype.wrapForFullscreen=function(e){function t(){if(n.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];n.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}if(a.isIOS())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var i=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",i.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;this.removeFullscreenWrapper(),this.fullscreenElement_=e;var r=this.fullscreenElement_.parentElement;r.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),r.removeChild(this.fullscreenElement_),this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var n=this;return t(),this.fullscreenWrapper_},i.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),t.insertBefore(e,this.fullscreenWrapper_),t.removeChild(this.fullscreenWrapper_),e}},i.prototype.requestPresent=function(e){if(this.isPresenting)return void console.error("Already presenting!");var t=this;return e instanceof Array||(u||(console.warn("Using a deprecated form of requestPresent. Should pass in an array of VRLayers."),u=!0),e=[e]),new Promise(function(i,r){function n(){var e=a.getFullscreenElement();t.isPresenting=s===e,t.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary"),t.waitingForPresent_=!1,t.beginPresent_(),i()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),t.removeFullscreenWrapper(),t.wakelock_.release(),t.endPresent_(),t.removeFullscreenListeners_()),t.fireVRDisplayPresentChange_()}function o(){t.waitingForPresent_&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.wakelock_.release(),t.waitingForPresent_=!1,t.isPresenting=!1,r(new Error("Unable to present.")))}if(!t.capabilities.canPresent)return void r(new Error("VRDisplay is not capable of presenting."));if(0==e.length||e.length>t.capabilities.maxLayers)return void r(new Error("Invalid number of layers."));if(t.layer_=e[0],t.waitingForPresent_=!1,t.layer_&&t.layer_.source){var s=t.wrapForFullscreen(t.layer_.source);t.addFullscreenListeners_(s,n,o),a.requestFullscreen(s)?(t.wakelock_.request(),t.waitingForPresent_=!0):a.isIOS()&&(t.wakelock_.request(),t.isPresenting=!0,t.beginPresent_(),t.fireVRDisplayPresentChange_(),i())}t.waitingForPresent_||a.isIOS()||(a.exitFullscreen(),r(new Error("Unable to present.")))})},i.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.wakelock_.release(),new Promise(function(i,r){e?(!a.exitFullscreen()&&a.isIOS()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),i()):r(new Error("Was not presenting to VRDisplay."))})},i.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},i.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{vrdisplay:this}});window.dispatchEvent(e)},i.prototype.addFullscreenListeners_=function(e,t,i){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=i,t&&(e.addEventListener("fullscreenchange",t,!1),e.addEventListener("webkitfullscreenchange",t,!1),document.addEventListener("mozfullscreenchange",t,!1),e.addEventListener("msfullscreenchange",t,!1)),i&&(e.addEventListener("fullscreenerror",i,!1),e.addEventListener("webkitfullscreenerror",i,!1),document.addEventListener("mozfullscreenerror",i,!1),e.addEventListener("msfullscreenerror",i,!1))},i.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var i=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",i,!1),e.removeEventListener("webkitfullscreenerror",i,!1),document.removeEventListener("mozfullscreenerror",i,!1),e.removeEventListener("msfullscreenerror",i,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},i.prototype.beginPresent_=function(){},i.prototype.endPresent_=function(){},i.prototype.submitFrame=function(){},i.prototype.getEyeParameters=function(){return null},n.prototype=new r,o.prototype=new r,t.exports.VRDisplay=i,t.exports.VRDevice=r,t.exports.HMDVRDevice=n,t.exports.PositionSensorVRDevice=o},{"./util.js":24,"./wakelock.js":26}],5:[function(e,t){function i(e){this.gl=e,this.ctxAttribs=e.getContextAttributes(),this.meshWidth=20,this.meshHeight=20,this.bufferScale=WebVRConfig.BUFFER_SCALE,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,n.isIOS()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=n.linkProgram(e,a,s,this.attribs),this.uniforms=n.getProgramUniforms(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize(),WebVRConfig.CARDBOARD_UI_DISABLED||(this.cardboardUI=new r(e))}var r=e("./cardboard-ui.js"),n=e("./util.js"),o=e("./deps/wglu-preserve-state.js"),a=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),s=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");i.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},i.prototype.onResize=function(){var e=this.gl,t=this,i=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];o(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)}),this.cardboardUI&&this.cardboardUI.onResize()},i.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,i=this.gl;n.isIOS()||(t.width=n.getScreenWidth()*this.bufferScale,t.height=n.getScreenHeight()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(t){e.bufferWidth=t,e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(t){e.bufferHeight=t,e.onResize()}})),this.lastBoundFramebuffer=i.getParameter(i.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,r){e.lastBoundFramebuffer=r?r:e.framebuffer,e.realBindFramebuffer.call(i,t,e.lastBoundFramebuffer)},this.cullFace=i.getParameter(i.CULL_FACE),this.depthTest=i.getParameter(i.DEPTH_TEST),this.blend=i.getParameter(i.BLEND),this.scissorTest=i.getParameter(i.SCISSOR_TEST),this.stencilTest=i.getParameter(i.STENCIL_TEST),i.enable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!0;break;case i.DEPTH_TEST:e.depthTest=!0;break;case i.BLEND:e.blend=!0;break;case i.SCISSOR_TEST:e.scissorTest=!0;break;case i.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(i,t)},i.disable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!1;break;case i.DEPTH_TEST:e.depthTest=!1;break;case i.BLEND:e.blend=!1;break;case i.SCISSOR_TEST:e.scissorTest=!1;break;case i.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(i,t)},this.colorMask=i.getParameter(i.COLOR_WRITEMASK),i.colorMask=function(t,r,n,o){e.colorMask[0]=t,e.colorMask[1]=r,e.colorMask[2]=n,e.colorMask[3]=o,e.realColorMask.call(i,t,r,n,o)},this.clearColor=i.getParameter(i.COLOR_CLEAR_VALUE),i.clearColor=function(t,r,n,o){e.clearColor[0]=t,e.clearColor[1]=r,e.clearColor[2]=n,e.clearColor[3]=o,e.realClearColor.call(i,t,r,n,o)},this.viewport=i.getParameter(i.VIEWPORT),i.viewport=function(t,r,n,o){e.viewport[0]=t,e.viewport[1]=r,e.viewport[2]=n,e.viewport[3]=o,e.realViewport.call(i,t,r,n,o)},this.isPatched=!0,n.safariCssSizeWorkaround(t)}},i.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;n.isIOS()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout(function(){n.safariCssSizeWorkaround(t)},1)}},i.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},i.prototype.submitFrame=function(){var e=this.gl,t=this,i=[];if(WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||i.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),o(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||n.isIOS())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),(t.ctxAttribs.alpha||!t.ctxAttribs.preserveDrawingBuffer)&&t.realClearColor.apply(e,t.clearColor)}),n.isIOS()){var r=e.canvas;(r.width!=t.bufferWidth||r.height!=t.bufferHeight)&&(t.bufferWidth=r.width,t.bufferHeight=r.height,t.onResize())}},i.prototype.updateDeviceInfo=function(e){var t=this.gl,i=this,r=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];o(t,r,function(t){var r=i.computeMeshVertices_(i.meshWidth,i.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,i.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW),!i.indexCount){var n=i.computeMeshIndices_(i.meshWidth,i.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,n,t.STATIC_DRAW),i.indexCount=n.length}})},i.prototype.computeMeshVertices_=function(e,t,i){for(var r=new Float32Array(2*e*t*5),o=i.getLeftEyeVisibleTanAngles(),a=i.getLeftEyeNoLensTanAngles(),s=i.getLeftEyeVisibleScreenRect(a),c=0,u=0;2>u;u++){for(var l=0;t>l;l++)for(var h=0;e>h;h++,c++){var d=h/(e-1),p=l/(t-1),f=d,m=p,g=n.lerp(o[0],o[2],d),v=n.lerp(o[3],o[1],p),y=Math.sqrt(g*g+v*v),M=i.distortion.distortInverse(y),A=g*M/y,x=v*M/y;d=(A-a[0])/(a[2]-a[0]),p=(x-a[3])/(a[1]-a[3]);{i.device.widthMeters/i.device.heightMeters}d=2*(s.x+d*s.width-.5),p=2*(s.y+p*s.height-.5),r[5*c+0]=d,r[5*c+1]=p,r[5*c+2]=f,r[5*c+3]=m,r[5*c+4]=u}var w=o[2]-o[0];o[0]=-(w+o[0]),o[2]=w-o[2],w=a[2]-a[0],a[0]=-(w+a[0]),a[2]=w-a[2],s.x=1-(s.x+s.width)}return r},i.prototype.computeMeshIndices_=function(e,t){for(var i=new Uint16Array(2*(e-1)*(t-1)*6),r=e/2,n=t/2,o=0,a=0,s=0;2>s;s++)for(var c=0;t>c;c++)for(var u=0;e>u;u++,o++)0!=u&&0!=c&&(r>=u==n>=c?(i[a++]=o,i[a++]=o-e-1,i[a++]=o-e,i[a++]=o-e-1,i[a++]=o,i[a++]=o-1):(i[a++]=o-1,i[a++]=o-e,i[a++]=o,i[a++]=o-e,i[a++]=o-1,i[a++]=o-e-1));return i},i.prototype.getOwnPropertyDescriptor_=function(e,t){var i=Object.getOwnPropertyDescriptor(e,t);return(void 0===i.get||void 0===i.set)&&(i.configurable=!0,i.enumerable=!0,i.get=function(){return this.getAttribute(t)},i.set=function(e){this.setAttribute(t,e)}),i},t.exports=i},{"./cardboard-ui.js":6,"./deps/wglu-preserve-state.js":8,"./util.js":24}],6:[function(e,t){function i(e){this.gl=e,this.attribs={position:0},this.program=r.linkProgram(e,o,a,this.attribs),this.uniforms=r.getProgramUniforms(e,this.program),this.vertexBuffer=e.createBuffer(),this.gearOffset=0,this.gearVertexCount=0,this.arrowOffset=0,this.arrowVertexCount=0,this.projMat=new Float32Array(16),this.listener=null,this.onResize()}var r=e("./util.js"),n=e("./deps/wglu-preserve-state.js"),o=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {"," gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),a=["precision mediump float;","uniform vec4 color;","void main() {"," gl_FragColor = color;","}"].join("\n"),s=Math.PI/180,c=60,u=12,l=20,h=1,d=.75,p=.3125,f=4,m=28,g=1.5; i.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},i.prototype.listen=function(e,t){var i=this.gl.canvas;this.listener=function(r){var n=i.clientWidth/2,o=m*g;r.clientX>n-o&&r.clientX<n+o&&r.clientY>i.clientHeight-o?e(r):r.clientX<o&&r.clientY<o&&t(r)},i.addEventListener("click",this.listener,!1)},i.prototype.onResize=function(){var e=this.gl,t=this,i=[e.ARRAY_BUFFER_BINDING];n(e,i,function(e){function i(e,t){var i=(90-e)*s,r=Math.cos(i),n=Math.sin(i);o.push(p*r*A+a,p*n*A+A),o.push(t*r*A+a,t*n*A+A)}function n(t,i){o.push(x+t,e.drawingBufferHeight-x-i)}var o=[],a=e.drawingBufferWidth/2,v=e.drawingBufferWidth/(screen.width*window.devicePixelRatio);r.isIOS()||(v*=window.devicePixelRatio);var y=f*v/2,M=m*g*v,A=m*v/2,x=(m*g-m)*v;o.push(a-y,M),o.push(a-y,e.drawingBufferHeight),o.push(a+y,M),o.push(a+y,e.drawingBufferHeight),t.gearOffset=o.length/2;for(var w=0;6>=w;w++){var E=w*c;i(E,h),i(E+u,h),i(E+l,d),i(E+(c-l),d),i(E+(c-u),h)}t.gearVertexCount=o.length/2-t.gearOffset,t.arrowOffset=o.length/2;var b=y/Math.sin(45*s);n(0,A),n(A,0),n(A+b,b),n(b,A+b),n(b,A-b),n(0,A),n(A,2*A),n(A+b,2*A-b),n(b,A-b),n(0,A),n(b,A-y),n(m*v,A-y),n(b,A+y),n(m*v,A+y),t.arrowVertexCount=o.length/2-t.arrowOffset,e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(o),e.STATIC_DRAW)})},i.prototype.render=function(){var e=this.gl,t=this,i=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];n(e,i,function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()})},i.prototype.renderNoState=function(){var e=this.gl;e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.enableVertexAttribArray(this.attribs.position),e.vertexAttribPointer(this.attribs.position,2,e.FLOAT,!1,8,0),e.uniform4f(this.uniforms.color,1,1,1,1),r.orthoMatrix(this.projMat,0,e.drawingBufferWidth,0,e.drawingBufferHeight,.1,1024),e.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.drawArrays(e.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),e.drawArrays(e.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},t.exports=i},{"./deps/wglu-preserve-state.js":8,"./util.js":24}],7:[function(e,t){function i(){this.displayName="Cardboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,this.capabilities.canPresent=!0,this.bufferScale_=WebVRConfig.BUFFER_SCALE,this.poseSensor_=new s,this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new a(!0,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new o(this.dpdb_.getDeviceParams()),this.viewerSelector_=new u,this.viewerSelector_.on("change",this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),WebVRConfig.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new c),h.isIOS()&&window.addEventListener("resize",this.onResize_.bind(this))}var r=e("./cardboard-distorter.js"),n=e("./cardboard-ui.js"),o=e("./device-info.js"),a=e("./dpdb/dpdb.js"),s=e("./sensor-fusion/fusion-pose-sensor.js"),c=e("./rotate-instructions.js"),u=e("./viewer-selector.js"),l=e("./base.js").VRDisplay,h=e("./util.js"),d={LEFT:"left",RIGHT:"right"};i.prototype=new l,i.prototype.getImmediatePose=function(){return{position:this.poseSensor_.getPosition(),orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},i.prototype.resetPose=function(){this.poseSensor_.resetPose()},i.prototype.getEyeParameters=function(e){var t,i=[.5*this.deviceInfo_.viewer.interLensDistance,0,0];if(e==d.LEFT)i[0]*=-1,t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=d.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return{fieldOfView:t,offset:i,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_}},i.prototype.onDeviceParamsUpdated_=function(e){console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter.updateDeviceInfo(this.deviceInfo_)},i.prototype.beginPresent_=function(){var e=this.layer_.source.getContext("webgl");e||(e=this.layer_.source.getContext("experimental-webgl")),e||(e=this.layer_.source.getContext("webgl2")),e&&(this.layer_.predistorted?WebVRConfig.CARDBOARD_UI_DISABLED||(e.canvas.width=h.getScreenWidth()*this.bufferScale_,e.canvas.height=h.getScreenHeight()*this.bufferScale_,this.cardboardUI_=new n(e)):(this.distorter_=new r(e),this.distorter_.updateDeviceInfo(this.deviceInfo_),this.cardboardUI_=this.distorter_.cardboardUI,(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(h.isLandscapeMode()&&h.isMobile()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),window.addEventListener("orientationchange",this.orientationHandler),this.fireVRDisplayDeviceParamsChange_())},i.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),window.removeEventListener("orientationchange",this.orientationHandler)},i.prototype.submitFrame=function(){if(this.distorter_)this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var e=this.layer_.source.getContext("webgl").canvas;(e.width!=this.lastWidth||e.height!=this.lastHeight)&&this.cardboardUI_.onResize(),this.lastWidth=e.width,this.lastHeight=e.height,this.cardboardUI_.render()}},i.prototype.onOrientationChange_=function(){console.log("onOrientationChange_"),this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},i.prototype.onResize_=function(){if(this.layer_){var e=this.layer_.source.getContext("webgl"),t=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0 10px 10px 0"];e.canvas.setAttribute("style",t.join("; ")+";"),h.safariCssSizeWorkaround(e.canvas)}},i.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},i.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},t.exports=i},{"./base.js":4,"./cardboard-distorter.js":5,"./cardboard-ui.js":6,"./device-info.js":9,"./dpdb/dpdb.js":13,"./rotate-instructions.js":18,"./sensor-fusion/fusion-pose-sensor.js":20,"./util.js":24,"./viewer-selector.js":25}],8:[function(e,t){function i(e,t,i){if(!t)return void i(e);for(var r=[],n=null,o=0;o<t.length;++o){var a=t[o];switch(a){case e.TEXTURE_BINDING_2D:case e.TEXTURE_BINDING_CUBE_MAP:var s=t[++o];if(s<e.TEXTURE0||s>e.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),r.push(null,null);break}n||(n=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(s),r.push(e.getParameter(a),null);break;case e.ACTIVE_TEXTURE:n=e.getParameter(e.ACTIVE_TEXTURE),r.push(null);break;default:r.push(e.getParameter(a))}}i(e);for(var o=0;o<t.length;++o){var a=t[o],c=r[o];switch(a){case e.ACTIVE_TEXTURE:break;case e.ARRAY_BUFFER_BINDING:e.bindBuffer(e.ARRAY_BUFFER,c);break;case e.COLOR_CLEAR_VALUE:e.clearColor(c[0],c[1],c[2],c[3]);break;case e.COLOR_WRITEMASK:e.colorMask(c[0],c[1],c[2],c[3]);break;case e.CURRENT_PROGRAM:e.useProgram(c);break;case e.ELEMENT_ARRAY_BUFFER_BINDING:e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,c);break;case e.FRAMEBUFFER_BINDING:e.bindFramebuffer(e.FRAMEBUFFER,c);break;case e.RENDERBUFFER_BINDING:e.bindRenderbuffer(e.RENDERBUFFER,c);break;case e.TEXTURE_BINDING_2D:var s=t[++o];if(s<e.TEXTURE0||s>e.TEXTURE31)break;e.activeTexture(s),e.bindTexture(e.TEXTURE_2D,c);break;case e.TEXTURE_BINDING_CUBE_MAP:var s=t[++o];if(s<e.TEXTURE0||s>e.TEXTURE31)break;e.activeTexture(s),e.bindTexture(e.TEXTURE_CUBE_MAP,c);break;case e.VIEWPORT:e.viewport(c[0],c[1],c[2],c[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:c?e.enable(a):e.disable(a);break;default:console.log("No GL restore behavior for 0x"+a.toString(16))}n&&e.activeTexture(n)}}t.exports=i},{}],9:[function(e,t){function i(e){this.width=e.width||s.getScreenWidth(),this.height=e.height||s.getScreenHeight(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}function r(e){this.viewer=l.CardboardV2,this.updateDeviceParams(e),this.distortion=new o(this.viewer.distortionCoefficients)}function n(e){this.id=e.id,this.label=e.label,this.fov=e.fov,this.interLensDistance=e.interLensDistance,this.baselineLensDistance=e.baselineLensDistance,this.screenLensDistance=e.screenLensDistance,this.distortionCoefficients=e.distortionCoefficients,this.inverseCoefficients=e.inverseCoefficients}var o=e("./distortion/distortion.js"),a=e("./math-util.js"),s=e("./util.js"),c=new i({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),u=new i({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),l={CardboardV1:new n({id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]}),CardboardV2:new n({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})};r.prototype.updateDeviceParams=function(e){this.device=this.determineDevice_(e)||this.device},r.prototype.getDevice=function(){return this.device},r.prototype.setViewer=function(e){this.viewer=e,this.distortion=new o(this.viewer.distortionCoefficients)},r.prototype.determineDevice_=function(e){if(!e)return s.isIOS()?(console.warn("Using fallback iOS device measurements."),u):(console.warn("Using fallback Android device measurements."),c);var t=.0254,r=t/e.xdpi,n=t/e.ydpi,o=s.getScreenWidth(),a=s.getScreenHeight();return new i({widthMeters:r*o,heightMeters:n*a,bevelMeters:.001*e.bevelMm})},r.prototype.getDistortedFieldOfViewLeftEye=function(){var e=this.viewer,t=this.device,i=this.distortion,r=e.screenLensDistance,n=(t.widthMeters-e.interLensDistance)/2,o=e.interLensDistance/2,s=e.baselineLensDistance-t.bevelMeters,c=t.heightMeters-s,u=a.radToDeg*Math.atan(i.distort(n/r)),l=a.radToDeg*Math.atan(i.distort(o/r)),h=a.radToDeg*Math.atan(i.distort(s/r)),d=a.radToDeg*Math.atan(i.distort(c/r));return{leftDegrees:Math.min(u,e.fov),rightDegrees:Math.min(l,e.fov),downDegrees:Math.min(h,e.fov),upDegrees:Math.min(d,e.fov)}},r.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,r=Math.tan(-a.degToRad*e.fov),n=Math.tan(a.degToRad*e.fov),o=Math.tan(a.degToRad*e.fov),s=Math.tan(-a.degToRad*e.fov),c=t.widthMeters/4,u=t.heightMeters/2,l=e.baselineLensDistance-t.bevelMeters-u,h=e.interLensDistance/2-c,d=-l,p=e.screenLensDistance,f=i.distort((h-c)/p),m=i.distort((d+u)/p),g=i.distort((h+c)/p),v=i.distort((d-u)/p),y=new Float32Array(4);return y[0]=Math.max(r,f),y[1]=Math.min(n,m),y[2]=Math.min(o,g),y[3]=Math.max(s,v),y},r.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,r=new Float32Array(4),n=i.distortInverse(Math.tan(-a.degToRad*e.fov)),o=i.distortInverse(Math.tan(a.degToRad*e.fov)),s=i.distortInverse(Math.tan(a.degToRad*e.fov)),c=i.distortInverse(Math.tan(-a.degToRad*e.fov)),u=t.widthMeters/4,l=t.heightMeters/2,h=e.baselineLensDistance-t.bevelMeters-l,d=e.interLensDistance/2-u,p=-h,f=e.screenLensDistance,m=(d-u)/f,g=(p+l)/f,v=(d+u)/f,y=(p-l)/f;return r[0]=Math.max(n,m),r[1]=Math.min(o,g),r[2]=Math.min(s,v),r[3]=Math.max(c,y),r},r.prototype.getLeftEyeVisibleScreenRect=function(e){var t=this.viewer,i=this.device,r=t.screenLensDistance,n=(i.widthMeters-t.interLensDistance)/2,o=t.baselineLensDistance-i.bevelMeters,a=(e[0]*r+n)/i.widthMeters,s=(e[1]*r+o)/i.heightMeters,c=(e[2]*r+n)/i.widthMeters,u=(e[3]*r+o)/i.heightMeters;return{x:a,y:u,width:c-a,height:s-u}},r.prototype.getFieldOfViewLeftEye=function(e){return e?this.getUndistortedFieldOfViewLeftEye():this.getDistortedFieldOfViewLeftEye()},r.prototype.getFieldOfViewRightEye=function(e){var t=this.getFieldOfViewLeftEye(e);return{leftDegrees:t.rightDegrees,rightDegrees:t.leftDegrees,upDegrees:t.upDegrees,downDegrees:t.downDegrees}},r.prototype.getUndistortedFieldOfViewLeftEye=function(){var e=this.getUndistortedParams_();return{leftDegrees:a.radToDeg*Math.atan(e.outerDist),rightDegrees:a.radToDeg*Math.atan(e.innerDist),downDegrees:a.radToDeg*Math.atan(e.bottomDist),upDegrees:a.radToDeg*Math.atan(e.topDist)}},r.prototype.getUndistortedViewportLeftEye=function(){var e=this.getUndistortedParams_(),t=this.viewer,i=this.device,r=t.screenLensDistance,n=i.widthMeters/r,o=i.heightMeters/r,a=i.width/n,s=i.height/o,c=Math.round((e.eyePosX-e.outerDist)*a),u=Math.round((e.eyePosY-e.bottomDist)*s);return{x:c,y:u,width:Math.round((e.eyePosX+e.innerDist)*a)-c,height:Math.round((e.eyePosY+e.topDist)*s)-u}},r.prototype.getUndistortedParams_=function(){var e=this.viewer,t=this.device,i=this.distortion,r=e.screenLensDistance,n=e.interLensDistance/2/r,o=t.widthMeters/r,s=t.heightMeters/r,c=o/2-n,u=(e.baselineLensDistance-t.bevelMeters)/r,l=e.fov,h=i.distortInverse(Math.tan(a.degToRad*l)),d=Math.min(c,h),p=Math.min(n,h),f=Math.min(u,h),m=Math.min(s-u,h);return{outerDist:d,innerDist:p,topDist:m,bottomDist:f,eyePosX:c,eyePosY:u}},r.Viewers=l,t.exports=r},{"./distortion/distortion.js":11,"./math-util.js":16,"./util.js":24}],10:[function(e,t){function i(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:HMD:"+e.displayId,this.deviceName=e.displayName+" (HMD)"}function r(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:PositionSensor: "+e.displayId,this.deviceName=e.displayName+" (PositionSensor)"}var n=(e("./base.js").VRDisplay,e("./base.js").HMDVRDevice),o=e("./base.js").PositionSensorVRDevice;i.prototype=new n,i.prototype.getEyeParameters=function(e){var t=this.display.getEyeParameters(e);return{currentFieldOfView:t.fieldOfView,maximumFieldOfView:t.fieldOfView,minimumFieldOfView:t.fieldOfView,recommendedFieldOfView:t.fieldOfView,eyeTranslation:{x:t.offset[0],y:t.offset[1],z:t.offset[2]},renderRect:{x:"right"==e?t.renderWidth:0,y:0,width:t.renderWidth,height:t.renderHeight}}},i.prototype.setFieldOfView=function(){},r.prototype=new o,r.prototype.getState=function(){var e=this.display.getPose();return{position:e.position?{x:e.position[0],y:e.position[1],z:e.position[2]}:null,orientation:e.orientation?{x:e.orientation[0],y:e.orientation[1],z:e.orientation[2],w:e.orientation[3]}:null,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},r.prototype.resetState=function(){return this.positionDevice.resetPose()},t.exports.VRDisplayHMDDevice=i,t.exports.VRDisplayPositionSensorDevice=r},{"./base.js":4}],11:[function(e,t){function i(e){this.coefficients=e}i.prototype.distortInverse=function(e){for(var t=0,i=1,r=e-this.distort(t);Math.abs(i-t)>1e-4;){var n=e-this.distort(i),o=i-n*((i-t)/(n-r));t=i,i=o,r=n}return i},i.prototype.distort=function(e){for(var t=e*e,i=0,r=0;r<this.coefficients.length;r++)i=t*(i+this.coefficients[r]);return(i+1)*e},i.prototype.solveLinear_=function(e,t){for(var i=e.length,r=0;i-1>r;++r)for(var n=r+1;i>n;++n){for(var o=e[r][n]/e[r][r],a=r+1;i>a;++a)e[a][n]-=o*e[a][r];t[n]-=o*t[r]}for(var s=new Array(i),r=i-1;r>=0;--r){for(var c=t[r],a=r+1;i>a;++a)c-=e[a][r]*s[a];s[r]=c/e[r][r]}return s},i.prototype.solveLeastSquares_=function(e,t){var i,r,n,o,a=e.length,s=e[0].length;if(a!=t.Length)throw new Error("Matrix / vector dimension mismatch");var c=new Array(s);for(n=0;s>n;++n)for(c[n]=new Array(s),r=0;s>r;++r){for(o=0,i=0;a>i;++i)o+=e[r][i]*e[n][i];c[n][r]=o}var u=new Array(s);for(r=0;s>r;++r){for(o=0,i=0;a>i;++i)o+=e[r][i]*t[i];u[r]=o}return this.solveLinear_(c,u)},i.prototype.approximateInverse=function(e,t){e=e||1,t=t||100;var r,n,o=6,a=new Array(o);for(n=0;o>n;++n)a[n]=new Array(t);var s=new Array(t);for(r=0;t>r;++r){var c=e*(r+1)/t,u=this.distort(c),l=u;for(n=0;o>n;++n)l*=u*u,a[n][r]=l;s[r]=c-u}var h=this.solveLeastSquares_(a,s);return new i(h)},t.exports=i},{}],12:[function(e,t){var i={format:1,last_updated:"2016-01-20T00:18:35Z",devices:[{type:"android",rules:[{mdmh:"asus/*/Nexus 7/*"},{ua:"Nexus 7"}],dpi:[320.8,323],bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_Z00AD/*"},{ua:"ASUS_Z00AD"}],dpi:[403,404.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC6435LVW/*"},{ua:"HTC6435LVW"}],dpi:[449.7,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC One XL/*"},{ua:"HTC One XL"}],dpi:[315.3,314.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"htc/*/Nexus 9/*"},{ua:"Nexus 9"}],dpi:289,bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One M9/*"},{ua:"HTC One M9"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One_M8/*"},{ua:"HTC One_M8"}],dpi:[449.7,447.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One/*"},{ua:"HTC One"}],dpi:472.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/Nexus 6P/*"},{ua:"Nexus 6P"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5X/*"},{ua:"Nexus 5X"}],dpi:[422,419.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS345/*"},{ua:"LGMS345"}],dpi:[221.7,219.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D800/*"},{ua:"LG-D800"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D850/*"},{ua:"LG-D850"}],dpi:[537.9,541.9],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/VS985 4G/*"},{ua:"VS985 4G"}],dpi:[537.9,535.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5/*"},{ua:"Nexus 5 "}],dpi:[442.4,444.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 4/*"},{ua:"Nexus 4"}],dpi:[319.8,318.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LG-P769/*"},{ua:"LG-P769"}],dpi:[240.6,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS323/*"},{ua:"LGMS323"}],dpi:[206.6,204.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGLS996/*"},{ua:"LGLS996"}],dpi:[403.4,401.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/4560MMX/*"},{ua:"4560MMX"}],dpi:[240,219.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/A250/*"},{ua:"Micromax A250"}],dpi:[480,446.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/Micromax AQ4501/*"},{ua:"Micromax AQ4501"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/DROID RAZR/*"},{ua:"DROID RAZR"}],dpi:[368.1,256.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT830C/*"},{ua:"XT830C"}],dpi:[254,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1021/*"},{ua:"XT1021"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1023/*"},{ua:"XT1023"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1028/*"},{ua:"XT1028"}],dpi:[326.6,327.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1034/*"},{ua:"XT1034"}],dpi:[326.6,328.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1053/*"},{ua:"XT1053"}],dpi:[315.3,316.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1562/*"},{ua:"XT1562"}],dpi:[403.4,402.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/Nexus 6/*"},{ua:"Nexus 6 "}],dpi:[494.3,489.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1063/*"},{ua:"XT1063"}],dpi:[295,296.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1064/*"},{ua:"XT1064"}],dpi:[295,295.6],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1092/*"},{ua:"XT1092"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1095/*"},{ua:"XT1095"}],dpi:[422,423.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/A0001/*"},{ua:"A0001"}],dpi:[403.4,401],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1005/*"},{ua:"ONE E1005"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2005/*"},{ua:"ONE A2005"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OPPO/*/X909/*"},{ua:"X909"}],dpi:[442.4,444.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9082/*"},{ua:"GT-I9082"}],dpi:[184.7,185.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G360P/*"},{ua:"SM-G360P"}],dpi:[196.7,205.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Nexus S/*"},{ua:"Nexus S"}],dpi:[234.5,229.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[304.8,303.9],bw:5,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-T230NU/*"},{ua:"SM-T230NU"}],dpi:216,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SGH-T399/*"},{ua:"SGH-T399"}],dpi:[217.7,231.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N9005/*"},{ua:"SM-N9005"}],dpi:[386.4,387],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SM-N900A/*"},{ua:"SAMSUNG-SM-N900A"}],dpi:[386.4,387.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9500/*"},{ua:"GT-I9500"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/GT-I9505/*"},{ua:"GT-I9505"}],dpi:439.4,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900F/*"},{ua:"SM-G900F"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900M/*"},{ua:"SM-G900M"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G800F/*"},{ua:"SM-G800F"}],dpi:326.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G906S/*"},{ua:"SM-G906S"}],dpi:[562.7,572.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[306.7,304.8],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-T535/*"},{ua:"SM-T535"}],dpi:[142.6,136.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-N920C/*"},{ua:"SM-N920C"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300I/*"},{ua:"GT-I9300I"}],dpi:[304.8,305.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9195/*"},{ua:"GT-I9195"}],dpi:[249.4,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SPH-L520/*"},{ua:"SPH-L520"}],dpi:[249.4,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SGH-I717/*"},{ua:"SAMSUNG-SGH-I717"}],dpi:285.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SPH-D710/*"},{ua:"SPH-D710"}],dpi:[217.7,204.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-N7100/*"},{ua:"GT-N7100"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SCH-I605/*"},{ua:"SCH-I605"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Galaxy Nexus/*"},{ua:"Galaxy Nexus"}],dpi:[315.3,314.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910H/*"},{ua:"SM-N910H"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910C/*"},{ua:"SM-N910C"}],dpi:[515.2,520.2],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G130M/*"},{ua:"SM-G130M"}],dpi:[165.9,164.8],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G928I/*"},{ua:"SM-G928I"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G920F/*"},{ua:"SM-G920F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G920P/*"},{ua:"SM-G920P"}],dpi:[522.5,577],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G925F/*"},{ua:"SM-G925F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G925V/*"},{ua:"SM-G925V"}],dpi:[522.5,576.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/C6903/*"},{ua:"C6903"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/D6653/*"},{ua:"D6653"}],dpi:[428.6,427.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6653/*"},{ua:"E6653"}],dpi:[428.6,425.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6853/*"},{ua:"E6853"}],dpi:[403.4,401.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/SGP321/*"},{ua:"SGP321"}],dpi:[224.7,224.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"TCT/*/ALCATEL ONE TOUCH Fierce/*"},{ua:"ALCATEL ONE TOUCH Fierce"}],dpi:[240,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"THL/*/thl 5000/*"},{ua:"thl 5000"}],dpi:[480,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"ZTE/*/ZTE Blade L2/*"},{ua:"ZTE Blade L2"}],dpi:240,bw:3,ac:500},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3}]};t.exports=i},{}],13:[function(e,t){function i(e,t){if(this.dpdb=n,this.recalculateDeviceParams_(),e){this.onDeviceParamsUpdated=t,console.log("Fetching DPDB...");var i=new XMLHttpRequest,r=this;i.open("GET",a,!0),i.addEventListener("load",function(){r.loading=!1,i.status>=200&&i.status<=299?(console.log("Successfully loaded online DPDB."),r.dpdb=JSON.parse(i.response),r.recalculateDeviceParams_()):console.error("Error loading online DPDB!")}),i.send()}}function r(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}var n=e("./dpdb-cache.js"),o=e("../util.js"),a="path_to_url";i.prototype.getDeviceParams=function(){return this.deviceParams},i.prototype.recalculateDeviceParams_=function(){console.log("Recalculating device params.");var e=this.calcDeviceParams_();console.log("New device parameters:"),console.log(e),e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},i.prototype.calcDeviceParams_=function(){var e=this.dpdb;if(!e)return console.error("DPDB not available."),null;if(1!=e.format)return console.error("DPDB has unexpected format version."),null;if(!e.devices||!e.devices.length)return console.error("DPDB does not have a devices section."),null;var t=navigator.userAgent||navigator.vendor||window.opera,i=o.getScreenWidth(),n=o.getScreenHeight();if(console.log("User agent: "+t),console.log("Pixel width: "+i),console.log("Pixel height: "+n),!e.devices)return console.error("DPDB has no devices section."),null;for(var a=0;a<e.devices.length;a++){var s=e.devices[a];if(s.rules)if("ios"==s.type||"android"==s.type){if(o.isIOS()==("ios"==s.type)){for(var c=!1,u=0;u<s.rules.length;u++){var l=s.rules[u];if(this.matchRule_(l,t,i,n)){console.log("Rule matched:"),console.log(l),c=!0;break}}if(c){var h=s.dpi[0]||s.dpi,d=s.dpi[1]||s.dpi;return new r({xdpi:h,ydpi:d,bevelMm:s.bw})}}}else console.warn("Device["+a+"] has invalid type.");else console.warn("Device["+a+"] has no rules section.")}return console.warn("No DPDB device match."),null},i.prototype.matchRule_=function(e,t,i,r){if(!e.ua&&!e.res)return!1;if(e.ua&&t.indexOf(e.ua)<0)return!1;if(e.res){if(!e.res[0]||!e.res[1])return!1;var n=e.res[0],o=e.res[1];if(Math.min(i,r)!=Math.min(n,o)||Math.max(i,r)!=Math.max(n,o))return!1}return!0},t.exports=i},{"../util.js":24,"./dpdb-cache.js":12}],14:[function(e,t){function i(){this.callbacks={}}i.prototype.emit=function(e){var t=this.callbacks[e];if(t){var i=[].slice.call(arguments);i.shift();for(var r=0;r<t.length;r++)t[r].apply(this,i)}},i.prototype.on=function(e,t){e in this.callbacks?this.callbacks[e].push(t):this.callbacks[e]=[t]},t.exports=i},{}],15:[function(e){var t=e("./util.js"),i=e("./webvr-polyfill.js");window.WebVRConfig=t.extend({FORCE_ENABLE_VR:!1,K_FILTER:.98,PREDICTION_TIME_S:.04,TOUCH_PANNER_DISABLED:!1,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,MOUSE_KEYBOARD_CONTROLS_DISABLED:!1,DEFER_INITIALIZATION:!1,ENABLE_DEPRECATED_API:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1},window.WebVRConfig),window.WebVRConfig.DEFER_INITIALIZATION?window.InitializeWebVRPolyfill=function(){new i}:new i},{"./util.js":24,"./webvr-polyfill.js":27}],16:[function(e,t){var i=window.MathUtil||{};i.degToRad=Math.PI/180,i.radToDeg=180/Math.PI,i.Vector2=function(e,t){this.x=e||0,this.y=t||0},i.Vector2.prototype={constructor:i.Vector2,set:function(e,t){return this.x=e,this.y=t,this},copy:function(e){return this.x=e.x,this.y=e.y,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},i.Vector3=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0},i.Vector3.prototype={constructor:i.Vector3,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var e=this.length();if(0!==e){var t=1/e;this.multiplyScalar(t)}else this.x=0,this.y=0,this.z=0;return this},multiplyScalar:function(e){this.x*=e,this.y*=e,this.z*=e},applyQuaternion:function(e){var t=this.x,i=this.y,r=this.z,n=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*r-a*i,u=s*i+a*t-n*r,l=s*r+n*i-o*t,h=-n*t-o*i-a*r;return this.x=c*s+h*-n+u*-a-l*-o,this.y=u*s+h*-o+l*-n-c*-a,this.z=l*s+h*-a+c*-o-u*-n,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},crossVectors:function(e,t){var i=e.x,r=e.y,n=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-n*a,this.y=n*o-i*s,this.z=i*a-r*o,this}},i.Quaternion=function(e,t,i,r){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1},i.Quaternion.prototype={constructor:i.Quaternion,set:function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},setFromEulerXYZ:function(e,t,i){var r=Math.cos(e/2),n=Math.cos(t/2),o=Math.cos(i/2),a=Math.sin(e/2),s=Math.sin(t/2),c=Math.sin(i/2);return this.x=a*n*o+r*s*c,this.y=r*s*o-a*n*c,this.z=r*n*c+a*s*o,this.w=r*n*o-a*s*c,this},setFromEulerYXZ:function(e,t,i){var r=Math.cos(e/2),n=Math.cos(t/2),o=Math.cos(i/2),a=Math.sin(e/2),s=Math.sin(t/2),c=Math.sin(i/2);return this.x=a*n*o+r*s*c,this.y=r*s*o-a*n*c,this.z=r*n*c-a*s*o,this.w=r*n*o+a*s*c,this},setFromAxisAngle:function(e,t){var i=t/2,r=Math.sin(i);return this.x=e.x*r,this.y=e.y*r,this.z=e.z*r,this.w=Math.cos(i),this},multiply:function(e){return this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e.x,r=e.y,n=e.z,o=e.w,a=t.x,s=t.y,c=t.z,u=t.w;return this.x=i*u+o*a+r*c-n*s,this.y=r*u+o*s+n*a-i*c,this.z=n*u+o*c+i*s-r*a,this.w=o*u-i*a-r*s-n*c,this},inverse:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x=this.x*e,this.y=this.y*e,this.z=this.z*e,this.w=this.w*e),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this.x,r=this.y,n=this.z,o=this.w,a=o*e.w+i*e.x+r*e.y+n*e.z; if(0>a?(this.w=-e.w,this.x=-e.x,this.y=-e.y,this.z=-e.z,a=-a):this.copy(e),a>=1)return this.w=o,this.x=i,this.y=r,this.z=n,this;var s=Math.acos(a),c=Math.sqrt(1-a*a);if(Math.abs(c)<.001)return this.w=.5*(o+this.w),this.x=.5*(i+this.x),this.y=.5*(r+this.y),this.z=.5*(n+this.z),this;var u=Math.sin((1-t)*s)/c,l=Math.sin(t*s)/c;return this.w=o*u+this.w*l,this.x=i*u+this.x*l,this.y=r*u+this.y*l,this.z=n*u+this.z*l,this},setFromUnitVectors:function(){var e,t,r=1e-6;return function(n,o){return void 0===e&&(e=new i.Vector3),t=n.dot(o)+1,r>t?(t=0,Math.abs(n.x)>Math.abs(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,o),this.x=e.x,this.y=e.y,this.z=e.z,this.w=t,this.normalize(),this}}()},t.exports=i},{}],17:[function(e,t){function i(){this.displayName="Mouse and Keyboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,window.addEventListener("keydown",this.onKeyDown_.bind(this)),window.addEventListener("mousemove",this.onMouseMove_.bind(this)),window.addEventListener("mousedown",this.onMouseDown_.bind(this)),window.addEventListener("mouseup",this.onMouseUp_.bind(this)),this.phi_=0,this.theta_=0,this.targetAngle_=null,this.angleAnimation_=null,this.orientation_=new n.Quaternion,this.rotateStart_=new n.Vector2,this.rotateEnd_=new n.Vector2,this.rotateDelta_=new n.Vector2,this.isDragging_=!1,this.orientationOut_=new Float32Array(4)}var r=e("./base.js").VRDisplay,n=e("./math-util.js"),o=e("./util.js"),a=.15,s=80,c=.5,u=.3;i.prototype=new r,i.prototype.getImmediatePose=function(){return this.orientation_.setFromEulerYXZ(this.phi_,this.theta_,0),this.orientationOut_[0]=this.orientation_.x,this.orientationOut_[1]=this.orientation_.y,this.orientationOut_[2]=this.orientation_.z,this.orientationOut_[3]=this.orientation_.w,{position:null,orientation:this.orientationOut_,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},i.prototype.onKeyDown_=function(e){38==e.keyCode?this.animatePhi_(this.phi_+a):39==e.keyCode?this.animateTheta_(this.theta_-a):40==e.keyCode?this.animatePhi_(this.phi_-a):37==e.keyCode&&this.animateTheta_(this.theta_+a)},i.prototype.animateTheta_=function(e){this.animateKeyTransitions_("theta_",e)},i.prototype.animatePhi_=function(e){e=o.clamp(e,-Math.PI/2,Math.PI/2),this.animateKeyTransitions_("phi_",e)},i.prototype.animateKeyTransitions_=function(e,t){this.angleAnimation_&&cancelAnimationFrame(this.angleAnimation_);var i=this[e],r=new Date;this.angleAnimation_=requestAnimationFrame(function n(){var o=new Date-r;if(o>=s)return this[e]=t,void cancelAnimationFrame(this.angleAnimation_);this.angleAnimation_=requestAnimationFrame(n.bind(this));var a=o/s;this[e]=i+(t-i)*a}.bind(this))},i.prototype.onMouseDown_=function(e){this.rotateStart_.set(e.clientX,e.clientY),this.isDragging_=!0},i.prototype.onMouseMove_=function(e){if(this.isDragging_||this.isPointerLocked_()){if(this.isPointerLocked_()){var t=e.movementX||e.mozMovementX||0,i=e.movementY||e.mozMovementY||0;this.rotateEnd_.set(this.rotateStart_.x-t,this.rotateStart_.y-i)}else this.rotateEnd_.set(e.clientX,e.clientY);this.rotateDelta_.subVectors(this.rotateEnd_,this.rotateStart_),this.rotateStart_.copy(this.rotateEnd_),this.phi_+=2*Math.PI*this.rotateDelta_.y/screen.height*u,this.theta_+=2*Math.PI*this.rotateDelta_.x/screen.width*c,this.phi_=o.clamp(this.phi_,-Math.PI/2,Math.PI/2)}},i.prototype.onMouseUp_=function(){this.isDragging_=!1},i.prototype.isPointerLocked_=function(){var e=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;return void 0!==e},i.prototype.resetPose=function(){this.phi_=0,this.theta_=0},t.exports=i},{"./base.js":4,"./math-util.js":16,"./util.js":24}],18:[function(e,t){function i(){this.loadIcon_();var e=document.createElement("div"),t=e.style;t.position="fixed",t.top=0,t.right=0,t.bottom=0,t.left=0,t.backgroundColor="gray",t.fontFamily="sans-serif",t.zIndex=1e6;var i=document.createElement("img");i.src=this.icon;var t=i.style;t.marginLeft="25%",t.marginTop="25%",t.width="50%",e.appendChild(i);var r=document.createElement("div"),t=r.style;t.textAlign="center",t.fontSize="16px",t.lineHeight="24px",t.margin="24px 25%",t.width="50%",r.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(r);var n=document.createElement("div"),t=n.style;t.backgroundColor="#CFD8DC",t.position="fixed",t.bottom=0,t.width="100%",t.height="48px",t.padding="14px 24px",t.boxSizing="border-box",t.color="#656A6B",e.appendChild(n);var o=document.createElement("div");o.style["float"]="left",o.innerHTML="No Cardboard viewer?";var a=document.createElement("a");a.href="path_to_url",a.innerHTML="get one",a.target="_blank";var t=a.style;t["float"]="right",t.fontWeight=600,t.textTransform="uppercase",t.borderLeft="1px solid gray",t.paddingLeft="24px",t.textDecoration="none",t.color="#656A6B",n.appendChild(o),n.appendChild(a),this.overlay=e,this.text=r,this.hide()}var r=e("./util.js");i.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img"),i=t.style;r.isLandscapeMode()?(i.width="20%",i.marginLeft="40%",i.marginTop="3%"):(i.width="50%",i.marginLeft="25%",i.marginTop="25%")},i.prototype.hide=function(){this.overlay.style.display="none"},i.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},i.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},i.prototype.update=function(){this.disableShowTemporarily(),!r.isLandscapeMode()&&r.isMobile()?this.show():this.hide()},i.prototype.loadIcon_=function(){this.icon=r.base64("image/svg+xml",your_sha256_hashIm5vIj8+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashL3NrZXRjaC9ucyI+your_sha256_hashOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+CiAgICA8dGl0bGU+dHJhbnNpdGlvbjwvdGl0bGU+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashcm91cCI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashL3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashQSI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLjk5NyBaIiBpZD0iRmlsbC03IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashOS41ODgsMjIuMzc1IiBpZD0iRmlsbC05IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashZD0iRmlsbC0xMCIgZmlsbD0iIzYwN0Q4QiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashMSIgZmlsbD0iI0ZGRkZGRiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIGlkPSJGaWxsLTEzIiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashOTQuNTE1LDYyLjk0OCBaIiBpZD0iRmlsbC0xOCIgZmlsbD0iIzYwN0Q4QiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLjUwNSBaIiBpZD0iRmlsbC0yMSIgZmlsbD0iIzYwN0Q4QiI+your_sha256_hashyour_sha256_hashyour_sha256_hashL3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLjc2Miw0OS40ODQiIGlkPSJGaWxsLTI2IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashNDIiIGlkPSJGaWxsLTI3IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashPSJGaWxsLTI4IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashRmlsbC0zMCIgZmlsbD0iIzYwN0Q4QiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashRmlsbC0zMSIgZmlsbD0iI0ZBRkFGQSI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIGlkPSJGaWxsLTMyIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIGlkPSJGaWxsLTMzIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashaWxsPSIjRkFGQUZBIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashaWxsLTM4IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICA8L2c+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashL3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashZmlsbD0iIzYwN0Q4QiI+your_sha256_hashyour_sha256_hashyour_sha256_hashMy43NjQsNDIuNjU0IiBpZD0iRmlsbC01IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashZD0iRmlsbC04IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashNy4yNjkgTDYuMTMsOTMuOTAxIiBpZD0iRmlsbC0xMSIgZmlsbD0iI0ZBRkFGQSI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashRkZGRiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashOC42NzQiIGlkPSJGaWxsLTE0IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashIGlkPSJGaWxsLTE1IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashNDQ0LDg1LjM1IiBpZD0iRmlsbC0xNiIgZmlsbD0iI0ZGRkZGRiI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashLTE4IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+your_sha256_hashyour_sha256_hashNy43NjkiIGlkPSJGaWxsLTE5IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"); },t.exports=i},{"./util.js":24}],19:[function(e,t){function i(e){this.kFilter=e,this.currentAccelMeasurement=new r,this.currentGyroMeasurement=new r,this.previousGyroMeasurement=new r,this.filterQ=new n.Quaternion,this.previousFilterQ=new n.Quaternion,this.accelQ=new n.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new n.Vector3,this.measuredGravity=new n.Vector3,this.gyroIntegralQ=new n.Quaternion}var r=e("./sensor-sample.js"),n=e("../math-util.js"),o=e("../util.js"),a=!1;i.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},i.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i=t-this.previousGyroMeasurement.timestampS;o.isTimestampDeltaValid(i)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},i.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var i=new n.Quaternion;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r=new n.Quaternion;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse(),a&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",n.radToDeg*o.getQuaternionAngle(r),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var s=new n.Quaternion;s.copy(this.filterQ),s.multiply(r),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},i.prototype.getOrientation=function(){return this.filterQ},i.prototype.accelToQuaternion_=function(e){var t=new n.Vector3;t.copy(e),t.normalize();var i=new n.Quaternion;return i.setFromUnitVectors(new n.Vector3(0,0,-1),t),i.inverse(),i},i.prototype.gyroToQuaternionDelta_=function(e,t){var i=new n.Quaternion,r=new n.Vector3;return r.copy(e),r.normalize(),i.setFromAxisAngle(r,e.length()*t),i},t.exports=i},{"../math-util.js":16,"../util.js":24,"./sensor-sample.js":22}],20:[function(e,t){function i(){this.deviceId="webvr-polyfill:fused",this.deviceName="VR Position Device (webvr-polyfill:fused)",this.accelerometer=new a.Vector3,this.gyroscope=new a.Vector3,window.addEventListener("devicemotion",this.onDeviceMotionChange_.bind(this)),window.addEventListener("orientationchange",this.onScreenOrientationChange_.bind(this)),this.filter=new r(WebVRConfig.K_FILTER),this.posePredictor=new n(WebVRConfig.PREDICTION_TIME_S),this.touchPanner=new o,this.filterToWorldQ=new a.Quaternion,s.isIOS()?this.filterToWorldQ.setFromAxisAngle(new a.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new a.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new a.Quaternion,this.worldToScreenQ=new a.Quaternion,this.originalPoseAdjustQ=new a.Quaternion,this.originalPoseAdjustQ.setFromAxisAngle(new a.Vector3(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),s.isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new a.Quaternion,this.isFirefoxAndroid=s.isFirefoxAndroid(),this.isIOS=s.isIOS(),this.orientationOut_=new Float32Array(4)}var r=e("./complementary-filter.js"),n=e("./pose-predictor.js"),o=e("../touch-panner.js"),a=e("../math-util.js"),s=e("../util.js");i.prototype.getPosition=function(){return null},i.prototype.getOrientation=function(){var e=this.filter.getOrientation();this.predictedQ=this.posePredictor.getPrediction(e,this.gyroscope,this.previousTimestampS);var t=new a.Quaternion;return t.copy(this.filterToWorldQ),t.multiply(this.resetQ),WebVRConfig.TOUCH_PANNER_DISABLED||t.multiply(this.touchPanner.getOrientation()),t.multiply(this.predictedQ),t.multiply(this.worldToScreenQ),WebVRConfig.YAW_ONLY&&(t.x=0,t.z=0,t.normalize()),this.orientationOut_[0]=t.x,this.orientationOut_[1]=t.y,this.orientationOut_[2]=t.z,this.orientationOut_[3]=t.w,this.orientationOut_},i.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),s.isLandscapeMode()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ),WebVRConfig.TOUCH_PANNER_DISABLED||this.touchPanner.resetSensor()},i.prototype.onDeviceMotionChange_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,r=e.timeStamp/1e3;this.isFirefoxAndroid&&(r/=1e3);var n=r-this.previousTimestampS;return n<=s.MIN_TIMESTEP||n>s.MAX_TIMESTEP?(console.warn("Invalid timestamps detected. Time step between successive gyroscope sensor samples is very small or not monotonic"),void(this.previousTimestampS=r)):(this.accelerometer.set(-t.x,-t.y,-t.z),this.gyroscope.set(i.alpha,i.beta,i.gamma),(this.isIOS||this.isFirefoxAndroid)&&this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addAccelMeasurement(this.accelerometer,r),this.filter.addGyroMeasurement(this.gyroscope,r),void(this.previousTimestampS=r))},i.prototype.onScreenOrientationChange_=function(){this.setScreenTransform_()},i.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new a.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new a.Vector3(0,0,1),Math.PI/2);break;case 180:}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},t.exports=i},{"../math-util.js":16,"../touch-panner.js":23,"../util.js":24,"./complementary-filter.js":19,"./pose-predictor.js":21}],21:[function(e,t){function i(e){this.predictionTimeS=e,this.previousQ=new r.Quaternion,this.previousTimestampS=null,this.deltaQ=new r.Quaternion,this.outQ=new r.Quaternion}var r=e("../math-util.js"),n=!1;i.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var o=new r.Vector3;o.copy(t),o.normalize();var a=t.length();if(a<20*r.degToRad)return n&&console.log("Moving slowly, at %s deg/s: no prediction",(r.radToDeg*a).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var s=(i-this.previousTimestampS,a*this.predictionTimeS);return this.deltaQ.setFromAxisAngle(o,s),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.outQ},t.exports=i},{"../math-util.js":16}],22:[function(e,t){function i(e,t){this.set(e,t)}i.prototype.set=function(e,t){this.sample=e,this.timestampS=t},i.prototype.copy=function(e){this.set(e.sample,e.timestampS)},t.exports=i},{}],23:[function(e,t){function i(){window.addEventListener("touchstart",this.onTouchStart_.bind(this)),window.addEventListener("touchmove",this.onTouchMove_.bind(this)),window.addEventListener("touchend",this.onTouchEnd_.bind(this)),this.isTouching=!1,this.rotateStart=new r.Vector2,this.rotateEnd=new r.Vector2,this.rotateDelta=new r.Vector2,this.theta=0,this.orientation=new r.Quaternion}var r=e("./math-util.js"),n=e("./util.js"),o=.5;i.prototype.getOrientation=function(){return this.orientation.setFromEulerXYZ(0,0,this.theta),this.orientation},i.prototype.resetSensor=function(){this.theta=0},i.prototype.onTouchStart_=function(e){1==e.touches.length&&(this.rotateStart.set(e.touches[0].pageX,e.touches[0].pageY),this.isTouching=!0)},i.prototype.onTouchMove_=function(e){if(this.isTouching){this.rotateEnd.set(e.touches[0].pageX,e.touches[0].pageY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd),n.isIOS()&&(this.rotateDelta.x*=-1);var t=document.body;this.theta+=2*Math.PI*this.rotateDelta.x/t.clientWidth*o}},i.prototype.onTouchEnd_=function(){this.isTouching=!1},t.exports=i},{"./math-util.js":16,"./util.js":24}],24:[function(e,t){var i=e("object-assign"),r=window.Util||{};r.MIN_TIMESTEP=.001,r.MAX_TIMESTEP=1,r.base64=function(e,t){return"data:"+e+";base64,"+t},r.clamp=function(e,t,i){return Math.min(Math.max(t,e),i)},r.lerp=function(e,t,i){return e+(t-e)*i},r.isIOS=function(){var e=/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),r.isSafari=function(){var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),r.isFirefoxAndroid=function(){var e=-1!==navigator.userAgent.indexOf("Firefox")&&-1!==navigator.userAgent.indexOf("Android");return function(){return e}}(),r.isLandscapeMode=function(){return 90==window.orientation||-90==window.orientation},r.isTimestampDeltaValid=function(e){return isNaN(e)?!1:e<=r.MIN_TIMESTEP?!1:e>r.MAX_TIMESTEP?!1:!0},r.getScreenWidth=function(){return Math.max(window.screen.width,window.screen.height)*window.devicePixelRatio},r.getScreenHeight=function(){return Math.min(window.screen.width,window.screen.height)*window.devicePixelRatio},r.requestFullscreen=function(e){if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0},r.exitFullscreen=function(){if(document.exitFullscreen)document.exitFullscreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},r.getFullscreenElement=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},r.linkProgram=function(e,t,i,r){var n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t),e.compileShader(n);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);var a=e.createProgram();e.attachShader(a,n),e.attachShader(a,o);for(var s in r)e.bindAttribLocation(a,r[s],s);return e.linkProgram(a),e.deleteShader(n),e.deleteShader(o),a},r.getProgramUniforms=function(e,t){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n="",o=0;r>o;o++){var a=e.getActiveUniform(t,o);n=a.name.replace("[0]",""),i[n]=e.getUniformLocation(t,n)}return i},r.orthoMatrix=function(e,t,i,r,n,o,a){var s=1/(t-i),c=1/(r-n),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*s,e[13]=(n+r)*c,e[14]=(a+o)*u,e[15]=1,e},r.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},r.extend=i,r.safariCssSizeWorkaround=function(e){if(r.isIOS()){var t=e.style.width,i=e.style.height;e.style.width=parseInt(t)+1+"px",e.style.height=parseInt(i)+"px",console.log("Resetting width to...",t),setTimeout(function(){console.log("Done. Width is now",t),e.style.width=t,e.style.height=i},100)}window.Util=r,window.canvas=e},t.exports=r},{"object-assign":2}],25:[function(e,t){function i(){try{this.selectedKey=localStorage.getItem(a)||o}catch(e){console.error("Failed to load viewer profile: %s",e)}this.dialog=this.createDialog_(n.Viewers),this.root=null}var r=e("./emitter.js"),n=(e("./util.js"),e("./device-info.js")),o="CardboardV1",a="WEBVR_CARDBOARD_VIEWER",s="webvr-polyfill-viewer-selector";i.prototype=new r,i.prototype.show=function(e){this.root=e,e.appendChild(this.dialog);var t=this.dialog.querySelector("#"+this.selectedKey);t.checked=!0,this.dialog.style.display="block"},i.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},i.prototype.getCurrentViewer=function(){return n.Viewers[this.selectedKey]},i.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},i.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),!this.selectedKey||!n.Viewers[this.selectedKey])return void console.error("ViewerSelector.onSave_: this should never happen!");this.emit("change",n.Viewers[this.selectedKey]);try{localStorage.setItem(a,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()},i.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add(s),t.style.display="none";var i=document.createElement("div"),r=i.style;r.position="fixed",r.left=0,r.top=0,r.width="100%",r.height="100%",r.background="rgba(0, 0, 0, 0.3)",i.addEventListener("click",this.hide.bind(this));var n=280,o=document.createElement("div"),r=o.style;r.boxSizing="border-box",r.position="fixed",r.top="24px",r.left="50%",r.marginLeft=-n/2+"px",r.width=n+"px",r.padding="24px",r.overflow="hidden",r.background="#fafafa",r.fontFamily="'Roboto', sans-serif",r.boxShadow="0px 5px 20px #666",o.appendChild(this.createH1_("Select your viewer"));for(var a in e)o.appendChild(this.createChoice_(a,e[a].label));return o.appendChild(this.createButton_("Save",this.onSave_.bind(this))),t.appendChild(i),t.appendChild(o),t},i.prototype.createH1_=function(e){var t=document.createElement("h1"),i=t.style;return i.color="black",i.fontSize="20px",i.fontWeight="bold",i.marginTop=0,i.marginBottom="24px",t.innerHTML=e,t},i.prototype.createChoice_=function(e,t){var i=document.createElement("div");i.style.marginTop="8px",i.style.color="black";var r=document.createElement("input");r.style.fontSize="30px",r.setAttribute("id",e),r.setAttribute("type","radio"),r.setAttribute("value",e),r.setAttribute("name","field");var n=document.createElement("label");return n.style.marginLeft="4px",n.setAttribute("for",e),n.innerHTML=t,i.appendChild(r),i.appendChild(n),i},i.prototype.createButton_=function(e,t){var i=document.createElement("button");i.innerHTML=e;var r=i.style;return r["float"]="right",r.textTransform="uppercase",r.color="#1094f7",r.fontSize="14px",r.letterSpacing=0,r.border=0,r.background="none",r.marginTop="16px",i.addEventListener("click",t),i},t.exports=i},{"./device-info.js":9,"./emitter.js":14,"./util.js":24}],26:[function(e,t){function i(){var e=document.createElement("video");e.addEventListener("ended",function(){e.play()}),this.request=function(){e.paused&&(e.src=o.base64("video/mp4",your_sha256_hash0mvb+gABX5AAlw/your_sha256_hashyour_sha256_hashkAAAAAdJr2/rSa9v6AAAAAQAAAAAAlw/your_sha256_hashyour_sha256_hashAAAAG3G1kaWEAAAAgbWRoZAAAAADSa9v60mvb+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAADFhdmNDAWQAC//your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashACRRtZGF0AAACrgX//6vcRem95tlIt5Ys2CDZI+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashWIhAAQ/8ltlOeyour_sha512_hash+fyaL6efyour_sha512_hashEgQAAAA5BmmhJqEFomUwIIf/+4QAAAApBnoZFESw//76BAAAACAGepXRDf8SBAAAACAGep2pDf8SAAAAADkGarEmoQWyZTAgh//7gAAAACkGeykUVLD//voEAAAAIAZ7pdEN/xIAAAAAIAZ7rakN/xIAAAAAOQZrwSahBbJlMCCH//uEAAAAKQZ8ORRUsP/++gQAAAAgBny10Q3/EgQAAAAgBny9qQ3/EgAAAAA5BmzRJqEFsmUwIIf/+4AAAAApBn1JFFSw//your_sha512_hash1dENyour_sha512_hash/tqQ3/EgQAAAA5Bm+your_sha512_hash//7gAAAACkGeQkUVLD//voEAAAAIAZ5hdEN/xIAAAAAIAZ5jakN/xIEAAAAOQZpoSahBbJlMCCH//uEAAAAKQZ6GRRUsP/++gQAAAAgBnqV0Q3/EgQAAAAgBnqdqQ3/EgAAAAA5BmqxJqEFsmUwIIf/+4AAAAApBnspFFSw//76BAAAACAGe6XRDf8SAAAAACAGe62pDf8SAAAAADkGa8EmoQWyZTAgh//7hAAAACkGfDkUVLD//voEAAAAIAZ8tdEN/xIEAAAAIAZ8vakN/xIAAAAAOQZs0SahBbJlMCCH//uAAAAAKQZ9SRRUsP/++gQAAAAgBn3F0Q3/EgAAAAAgBn3NqQ3/EgAAAAA5Bm3hJqEFsmUwIIf/+4QAAAApBn5ZFFSw//your_sha512_hash5dEN/xIAAAAAIAZ/7akN/xIEAAAAOQZvgSahBbJlMCCH//uEAAAAKQZ4eRRUsP/++gAAAAAgBnj10Q3/EgAAAAAgBnj9qQ3/EgQAAAA5BmiRJqEFsmUwIIf/+4AAAAApBnkJFFSw//76BAAAACAGeYXRDf8SAAAAACAGeY2pDf8SBAAAADkGaaEmoQWyZTAgh//7hAAAACkGehkUVLD//voEAAAAIAZ6ldEN/xIEAAAAIAZ6nakN/xIAAAAAOQZqsSahBbJlMCCH//uAAAAAKQZ7KRRUsP/++gQAAAAgBnul0Q3/EgAAAAAgBnutqQ3/EgAAAAA5BmvBJqEFsmUwIIf/+4QAAAApBnw5FFSw//your_sha256_hash12_hash+WRRUsP/++gAAAAAgBn7V0Q3your_sha512_hash+2pDf8SBAAAADkGb4EmoQWyZTAgh//7hAAAACkGeHkUVLD//voAAAAAIAZ49dEN/xIAAAAAIAZ4/akN/xIEAAAAOQZokSahBbJlMCCH//uAAAAAKQZ5CRRUsP/++gQAAAAgBnmF0Q3/EgAAAAAgBnmNqQ3/EgQAAAA5BmmhJqEFsmUwIIf/+4QAAAApBnoZFFSw//76BAAAACAGepXRDf8SBAAAACAGep2pDf8SAAAAADkGarEmoQWyZTAgh//7gAAAACkGeykUVLD//voEAAAAIAZ7pdEN/xIAAAAAIAZ7rakN/xIAAAAAPQZruSahBbJlMFEw3//7B"),e.play())},this.release=function(){e.pause(),e.src=""}}function r(){var e=null;this.request=function(){e||(e=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){e&&(clearInterval(e),e=null)}}function n(){var e=navigator.userAgent||navigator.vendor||window.opera;return e.match(/iPhone/i)||e.match(/iPod/i)?r:i}var o=e("./util.js");t.exports=n()},{"./util.js":24}],27:[function(e,t){function i(){this.displays=[],this.devices=[],this.devicesPopulated=!1,this.nativeWebVRAvailable=this.isWebVRAvailable(),this.nativeLegacyWebVRAvailable=this.isDeprecatedWebVRAvailable(),this.nativeLegacyWebVRAvailable||(this.nativeWebVRAvailable||this.enablePolyfill(),WebVRConfig.ENABLE_DEPRECATED_API&&this.enableDeprecatedPolyfill())}e("es6-promise").polyfill();var r=e("./cardboard-vr-display.js"),n=e("./mouse-keyboard-vr-display.js"),o=e("./base.js").VRDisplay,a=e("./base.js").HMDVRDevice,s=e("./base.js").PositionSensorVRDevice,c=e("./display-wrappers.js").VRDisplayHMDDevice,u=e("./display-wrappers.js").VRDisplayPositionSensorDevice;i.prototype.isWebVRAvailable=function(){return"getVRDisplays"in navigator},i.prototype.isDeprecatedWebVRAvailable=function(){return"getVRDevices"in navigator||"mozGetVRDevices"in navigator},i.prototype.populateDevices=function(){if(!this.devicesPopulated){var e=null;this.isCardboardCompatible()&&(e=new r,this.displays.push(e),WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new c(e)),this.devices.push(new u(e)))),this.isMobile()||WebVRConfig.MOUSE_KEYBOARD_CONTROLS_DISABLED||(e=new n,this.displays.push(e),WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new c(e)),this.devices.push(new u(e)))),this.devicesPopulated=!0}},i.prototype.enablePolyfill=function(){navigator.getVRDisplays=this.getVRDisplays.bind(this),window.VRDisplay=o},i.prototype.enableDeprecatedPolyfill=function(){navigator.getVRDevices=this.getVRDevices.bind(this),window.HMDVRDevice=a,window.PositionSensorVRDevice=s},i.prototype.getVRDisplays=function(){this.populateDevices();var e=this.displays;return new Promise(function(t,i){try{t(e)}catch(r){i(r)}})},i.prototype.getVRDevices=function(){console.warn("getVRDevices is deprecated. Please update your code to use getVRDisplays instead.");var e=this;return new Promise(function(t,i){try{if(!e.devicesPopulated){if(e.nativeWebVRAvailable)return navigator.getVRDisplays(function(i){for(var r=0;r<i.length;++r)e.devices.push(new c(i[r])),e.devices.push(new u(i[r]));e.devicesPopulated=!0,t(e.devices)},i);if(e.nativeLegacyWebVRAvailable)return(navigator.getVRDDevices||navigator.mozGetVRDevices)(function(i){for(var r=0;r<i.length;++r)i[r]instanceof a&&e.devices.push(i[r]),i[r]instanceof s&&e.devices.push(i[r]);e.devicesPopulated=!0,t(e.devices)},i)}e.populateDevices(),t(e.devices)}catch(r){i(r)}})},i.prototype.isMobile=function(){return/Android/i.test(navigator.userAgent)||/iPhone|iPad|iPod/i.test(navigator.userAgent)},i.prototype.isCardboardCompatible=function(){return this.isMobile()||WebVRConfig.FORCE_ENABLE_VR},t.exports=i},{"./base.js":4,"./cardboard-vr-display.js":7,"./display-wrappers.js":10,"./mouse-keyboard-vr-display.js":17,"es6-promise":1}]},{},[15])}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],20:[function(e,t){t.exports={name:"aframe",version:"0.2.0",description:"Building blocks for the VR Web",homepage:"path_to_url",main:"dist/aframe.js",scripts:{browserify:"browserify src/index.js -s 'AFRAME' -p browserify-derequire",build:"mkdirp build/ && npm run browserify -- --debug -o build/aframe.js",dev:"npm run build && node ./scripts/budo",dist:"mkdirp dist/ && npm run browserify -s -- --debug | exorcist dist/aframe.js.map > dist/aframe.js && uglifyjs dist/aframe.js -c warnings=false -m -o dist/aframe.min.js","gh-pages":"npm run ghpages",ghpages:"node ./scripts/gh-pages",lint:"semistandard -v | snazzy",precommit:"npm run lint",preghpages:"npm run dist && rimraf gh-pages && mkdirp gh-pages && cp -r {.nojekyll,dist,lib,examples,index.html,style} gh-pages/. 2>/dev/null || : && git checkout dist/ && replace 'build/aframe.js' 'dist/aframe.min.js' gh-pages/ -r --silent","release:bump":"npm run dist && git commit -am 'bump dist' && npm version patch --preminor","release:push":"npm login && npm publish && git push --follow-tags",start:"npm run dev",test:"karma start ./tests/karma.conf.js","test:firefox":"karma start ./tests/karma.conf.js --browsers firefox_latest","test:chrome":"karma start ./tests/karma.conf.js --browsers Chrome","test:ci":"TEST_ENV=ci karma start ./tests/karma.conf.js --single-run --browsers firefox_latest",version:"npm run dist"},repository:"aframevr/aframe",license:"MIT",dependencies:{"browserify-css":"^0.8.2",debug:"^2.2.0","deep-assign":"^2.0.0","document-register-element":"dmarcos/document-register-element#8ccc532b7","promise-polyfill":"^3.1.0","object-assign":"^4.0.1",present:"0.0.6","style-attr":"^1.0.2",three:"^0.76.1","tween.js":"^15.0.0","webvr-polyfill":"borismus/webvr-polyfill#5fdd44b"},devDependencies:{browserify:"^11.0.1","browserify-derequire":"^0.9.4",budo:"^8.1.0",chai:"^3.5.0","chai-shallow-deep-equal":"^1.3.0",exorcist:"^0.4.0","gh-pages":"^0.6.0",husky:"^0.10.1",karma:"^0.13.15","karma-browserify":"^4.4.0","karma-chai-shallow-deep-equal":"0.0.4","karma-chrome-launcher":"^0.2.3","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^0.1.6","karma-mocha":"^0.2.0","karma-mocha-reporter":"^1.1.0","karma-sinon-chai":"^1.1.0",lolex:"^1.4.0",mkdirp:"0.5.1",mocha:"^2.3.3","mozilla-download":"^1.0.5",open:"0.0.5",replace:"^0.3.0",rimraf:"2.5.0",semistandard:"^7.0.2",sinon:"^1.17.3","sinon-chai":"^2.8.0",snazzy:"^3.0.0",uglifyjs:"^2.4.10"},link:!0,browserify:{transform:["browserify-css"]},semistandard:{ignore:["build/**","dist/**","examples/**/shaders/*.js","**/vendor/**"]},keywords:["aframe","vr","webvr","3d","three","components","elements"],"browserify-css":{minify:!0},engines:{node:">= 0.12.7",npm:"^2.12.1"}}},{}],21:[function(e,t){var i=e("../core/component").registerComponent,r=e("../lib/three");t.exports.Component=i("blend-model",{schema:{type:"src"},init:function(){this.model=null},update:function(){var e=this,t=this.el,i=this.data;i&&(this.remove(),this.model=new r.BlendCharacter,this.model.load(i,function(){t.setObject3D("mesh",e.model),t.emit("model-loaded",{format:"blend",model:e.model}),e.model.castShadow=!0,e.model.receiveShadow=!0,e.model.material.shading=r.FlatShading,e.model.geometry.computeBoundingBox()}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}})},{"../core/component":57,"../lib/three":101}],22:[function(e,t){var i=e("../core/component").registerComponent,r=e("../lib/three"),n=e("../utils/"),o=n.checkHeadsetConnected;t.exports.Component=i("camera",{schema:{active:{"default":!0},far:{"default":1e4},fov:{"default":80,min:0},near:{"default":.5,min:0},userHeight:{"default":0,min:0},zoom:{"default":1,min:0}},init:function(){var e=this.camera=new r.PerspectiveCamera,t=this.el.sceneEl;this.el.setObject3D("camera",e),this.bindMethods(),t.addEventListener("enter-vr",this.removeHeightOffset),t.addEventListener("enter-vr",this.saveCameraPose),t.addEventListener("exit-vr",this.restoreCameraPose),t.addEventListener("exit-vr",this.addHeightOffset)},bindMethods:function(){this.addHeightOffset=this.addHeightOffset.bind(this),this.removeHeightOffset=this.removeHeightOffset.bind(this),this.saveCameraPose=this.saveCameraPose.bind(this),this.restoreCameraPose=this.restoreCameraPose.bind(this)},addHeightOffset:function(){var e,t=this.el;this.userHeightOffset||(e=t.getComputedAttribute("position")||{x:0,y:0,z:0},this.userHeightOffset=this.data.userHeight,t.setAttribute("position",{x:e.x,y:e.y+this.userHeightOffset,z:e.z}))},removeHeightOffset:function(){var e,t=this.el,i=this.userHeightOffset,r=this.headsetConnected||o();i&&r&&(this.userHeightOffset=void 0,e=t.getAttribute("position")||{x:0,y:0,z:0},t.setAttribute("position",{x:e.x,y:e.y-i,z:e.z}))},saveCameraPose:function(){var e=this.el,t=this.headsetConnected||o();!this.savedPose&&t&&(this.savedPose={position:e.getAttribute("position"),rotation:e.getAttribute("rotation")})},restoreCameraPose:function(){var e=this.el,t=this.savedPose;t&&(e.setAttribute("position",t.position),e.setAttribute("rotation",t.rotation),this.savedPose=void 0)},remove:function(){var e=this.el.sceneEl;this.el.removeObject3D("camera"),e.removeEventListener("enter-vr",this.removeHeightOffset),e.removeEventListener("enter-vr",this.saveCameraPose),e.removeEventListener("exit-vr",this.restoreCameraPose),e.removeEventListener("exit-vr",this.addHeightOffset)},update:function(e){var t=this.el,i=this.data,r=this.camera,n=this.system;e&&e.userHeight===i.userHeight||(this.removeHeightOffset(),this.addHeightOffset()),r.aspect=i.aspect||window.innerWidth/window.innerHeight,r.far=i.far,r.fov=i.fov,r.near=i.near,r.zoom=i.zoom,r.updateProjectionMatrix(),e&&e.active===i.active||(i.active&&n.activeCameraEl!==this.el?n.setActiveCamera(t):i.active||n.activeCameraEl!==this.el||n.disableActiveCamera())}})},{"../core/component":57,"../lib/three":101,"../utils/":117}],23:[function(e,t){var i=e("../core/component").registerComponent,r=e("../lib/three");t.exports.Component=i("collada-model",{schema:{type:"src"},init:function(){this.model=null,this.loader=new r.ColladaLoader,this.loader.options.convertUpAxis=!0},update:function(){var e=this,t=this.el,i=this.data;i&&(this.remove(),this.loader.load(i,function(i){e.model=i.scene,t.setObject3D("mesh",e.model),t.emit("model-loaded",{format:"collada",model:e.model})}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}})},{"../core/component":57, "../lib/three":101}],24:[function(e,t){var i=e("../core/component").registerComponent,r=e("../utils/"),n={CLICK:"click",MOUSEENTER:"mouseenter",MOUSEDOWN:"mousedown",MOUSELEAVE:"mouseleave",MOUSEUP:"mouseup"},o={FUSING:"cursor-fusing",HOVERING:"cursor-hovering",HOVERED:"cursor-hovered"};t.exports.Component=i("cursor",{dependencies:["raycaster"],schema:{fuse:{"default":r.isMobile()},fuseTimeout:{"default":1500,min:0}},init:function(){var e=this.el,t=e.sceneEl.canvas;return this.fuseTimeout=void 0,this.mouseDownEl=null,this.intersectedEl=null,t?(t.addEventListener("mousedown",this.onMouseDown.bind(this)),t.addEventListener("mouseup",this.onMouseUp.bind(this)),e.addEventListener("raycaster-intersection",this.onIntersection.bind(this)),void e.addEventListener("raycaster-intersection-cleared",this.onIntersectionCleared.bind(this))):void e.sceneEl.addEventListener("render-target-loaded",this.init.bind(this))},onMouseDown:function(){this.twoWayEmit(n.MOUSEDOWN),this.mouseDownEl=this.intersectedEl},onMouseUp:function(){this.twoWayEmit(n.MOUSEUP),!this.data.fuse&&this.intersectedEl&&this.mouseDownEl===this.intersectedEl&&this.twoWayEmit(n.CLICK)},onIntersection:function(e){var t=this,i=this.el,r=this.data,a=e.detail.els[0];this.intersectedEl!==a&&(this.intersectedEl=a,i.addState(o.HOVERING),a.addState(o.HOVERED),t.twoWayEmit(n.MOUSEENTER),0!==r.fuseTimeout&&r.fuse&&(i.addState(o.FUSING),this.fuseTimeout=setTimeout(function(){i.removeState(o.FUSING),t.twoWayEmit(n.CLICK)},r.fuseTimeout)))},onIntersectionCleared:function(e){var t=this.el,i=e.detail.el;i&&this.intersectedEl&&(i.removeState(o.HOVERED),t.removeState(o.HOVERING),t.removeState(o.FUSING),this.twoWayEmit(n.MOUSELEAVE),this.intersectedEl=null,clearTimeout(this.fuseTimeout))},twoWayEmit:function(e){var t=this.intersectedEl;this.el.emit(e,{intersectedEl:this.intersectedEl}),t&&t.emit(e,{cursorEl:this.el})}})},{"../core/component":57,"../utils/":117}],25:[function(e,t){var i=e("../utils/debug"),r=e("../core/geometry").geometries,n=e("../core/geometry").geometryNames,o=e("../core/component").registerComponent,a=e("../lib/three"),s=new a.Geometry,c=i("components:geometry:warn");t.exports.Component=o("geometry",{schema:{buffer:{"default":!0},mergeTo:{type:"selector"},primitive:{"default":"box",oneOf:n},skipCache:{"default":!1}},init:function(){this.geometry=null},update:function(e){var t=this.data,i=this.el.getOrCreateObject3D("mesh",a.Mesh),r=this.system;this.geometry&&(r.unuseGeometry(e),this.geometry=null),this.geometry=i.geometry=r.getOrCreateGeometry(t),t.mergeTo&&this.mergeTo(t.mergeTo)},mergeTo:function(e){var t,i=this.el,r=i.getObject3D("mesh");return e?e===i?void c("Source and target geometries cannot be the same for merge"):(t=e.getObject3D("mesh"))?t.geometry instanceof a.Geometry==!1||r.geometry instanceof a.Geometry==!1?void c("Geometry merge is only available for `THREE.Geometry` types. Check that both of the merging geometry and the target geometry have `buffer` set to false"):this.data.skipCache===!1?void c("Cached geometries are not allowed to merge. Set `skipCache` to true"):(r.parent.updateMatrixWorld(),t.geometry.merge(r.geometry,r.matrixWorld),i.emit("geometry-merged",{mergeTarget:e}),void i.parentNode.removeChild(i)):(t=e.getOrCreateObject3D("mesh",a.Mesh),void e.setAttribute("material",i.getComputedAttribute("material"))):void c("There is not a valid entity to merge the geometry to")},remove:function(){this.system.unuseGeometry(this.data),this.el.getObject3D("mesh").geometry=s,this.geometry=null},updateSchema:function(e){var t=e.primitive,i=this.data&&this.data.primitive,n=r[t]&&r[t].schema;if(!n)throw new Error("Unknown geometry schema `"+t+"`");i&&i===t||this.extendSchema(n)}})},{"../core/component":57,"../core/geometry":58,"../lib/three":101,"../utils/debug":115}],26:[function(e,t){var i=e("../core/component").registerComponent,r="path_to_url",n="path_to_url";t.exports.Component=i("hand-controls",{schema:{"default":"left"},init:function(){var e=this;this.onGripDown=function(){e.handleButton("grip","down")},this.onGripUp=function(){e.handleButton("grip","up")},this.onTrackpadDown=function(){e.handleButton("trackpad","down")},this.onTrackpadUp=function(){e.handleButton("trackpad","up")},this.onTriggerDown=function(){e.handleButton("trigger","down")},this.onTriggerUp=function(){e.handleButton("trigger","up")},this.addEventListeners()},play:function(){this.addEventListeners()},stop:function(){this.removeEventListeners()},addEventListeners:function(){var e=this.el;e.addEventListener("gripdown",this.onGripDown),e.addEventListener("gripup",this.onGripUp),e.addEventListener("trackpaddown",this.onTrackpadDown),e.addEventListener("trackpadup",this.onTrackpadUp),e.addEventListener("triggerdown",this.onTriggerDown),e.addEventListener("triggerup",this.onTriggerUp)},removeEventListeners:function(){var e=this.el;e.removeEventListener("gripdown",this.onGripDown),e.removeEventListener("gripup",this.onGripUp),e.removeEventListener("trackpaddown",this.onTrackpadDown),e.removeEventListener("trackpadup",this.onTrackpadUp),e.removeEventListener("triggerdown",this.onTriggerDown),e.removeEventListener("triggerup",this.onTriggerUp)},update:function(){var e,t=this.el,i=this.data;e="left"===i?"url("+r+")":"url("+n+")",t.setAttribute("vive-controls",{hand:i,model:!1}),t.setAttribute("blend-model",e)},handleButton:function(e,t){var i=this.el,r="down"===t;switch(e){case"trackpad":if(r===this.trackpadPressed)return;this.trackpadPressed=r,this.playAnimation("thumb",!r),t=r?"thumbup":"thumbdown",i.emit(t);break;case"trigger":if(r===this.triggerPressed)return;this.triggerPressed=r,this.playAnimation("pointing",!r),t=r?"pointup":"pointdown",i.emit(t);break;case"grip":if(r===this.gripPressed)return;this.gripPressed=r,this.playAnimation("close",!r),t=r?"gripclose":"gripopen",i.emit(t)}},playAnimation:function(e,t){var i=this.animationActive,r=1,n=this.el.getObject3D("mesh");n&&(t&&(r=-1),i&&n.play(i,0),n.mixer.clipAction(e).loop=2200,n.mixer.clipAction(e).clampWhenFinished=!0,n.mixer.clipAction(e).timeScale=r,n.play(e,1),this.animationActive=e)}})},{"../core/component":57}],27:[function(e){e("./blend-model"),e("./camera"),e("./collada-model"),e("./cursor"),e("./geometry"),e("./hand-controls"),e("./light"),e("./look-at"),e("./look-controls"),e("./material"),e("./obj-model"),e("./position"),e("./raycaster"),e("./rotation"),e("./scale"),e("./sound"),e("./tracked-controls"),e("./visible"),e("./vive-controls"),e("./wasd-controls"),e("./scene/canvas"),e("./scene/debug"),e("./scene/embedded"),e("./scene/fog"),e("./scene/keyboard-shortcuts"),e("./scene/stats"),e("./scene/vr-mode-ui")},{"./blend-model":21,"./camera":22,"./collada-model":23,"./cursor":24,"./geometry":25,"./hand-controls":26,"./light":28,"./look-at":29,"./look-controls":30,"./material":31,"./obj-model":32,"./position":33,"./raycaster":34,"./rotation":35,"./scale":36,"./scene/canvas":37,"./scene/debug":38,"./scene/embedded":39,"./scene/fog":40,"./scene/keyboard-shortcuts":41,"./scene/stats":42,"./scene/vr-mode-ui":43,"./sound":44,"./tracked-controls":45,"./visible":46,"./vive-controls":47,"./wasd-controls":48}],28:[function(e,t){function i(e){var t=e.angle,i=new a.Color(e.color).getHex(),r=e.decay,n=e.distance,o=new a.Color(e.groundColor).getHex(),u=e.intensity,l=e.type;switch(l.toLowerCase()){case"ambient":return new a.AmbientLight(i,u);case"directional":return new a.DirectionalLight(i,u);case"hemisphere":return new a.HemisphereLight(i,o,u);case"point":return new a.PointLight(i,u,n,r);case"spot":return new a.SpotLight(i,u,n,s(t),e.penumbra,r);default:c("%s is not a valid light type. Choose from ambient, directional, hemisphere, point, spot.",l)}}var r=e("../utils").diff,n=e("../utils/debug"),o=e("../core/component").registerComponent,a=e("../lib/three"),s=a.Math.degToRad,c=n("components:light:warn");t.exports.Component=o("light",{schema:{angle:{"default":60,"if":{type:["spot"]}},color:{type:"color"},groundColor:{type:"color","if":{type:["hemisphere"]}},decay:{"default":1,"if":{type:["point","spot"]}},distance:{"default":0,min:0,"if":{type:["point","spot"]}},intensity:{"default":1,min:0,"if":{type:["ambient","directional","hemisphere","point","spot"]}},penumbra:{"default":0,min:0,max:1,"if":{type:["spot"]}},type:{"default":"directional",oneOf:["ambient","directional","hemisphere","point","spot"]}},init:function(){var e=this.el;this.light=null,this.system.registerLight(e)},update:function(e){var t=this.data,i=r(t,e),n=this.light;return!n||"type"in i?void this.setLight(this.data):void Object.keys(i).forEach(function(e){var i=t[e];-1!==["color","groundColor"].indexOf(e)&&(i=new a.Color(i)),n[e]=i})},setLight:function(e){var t=this.el,r=i(e);r&&(this.light&&t.removeObject3D("light"),this.light=r,this.light.el=t,t.setObject3D("light",this.light))},remove:function(){this.el.removeObject3D("light")}})},{"../core/component":57,"../lib/three":101,"../utils":117,"../utils/debug":115}],29:[function(e,t){var i=e("../utils/debug"),r=e("../utils/coordinates"),n=e("../core/component").registerComponent,o=e("../lib/three"),a=i("components:look-at:warn"),s=r.isCoordinate;t.exports.Component=n("look-at",{schema:{"default":"",parse:function(e){return s(e)||"object"==typeof e?r.parse(e):e},stringify:function(e){return"object"==typeof e?r.stringify(e):e}},init:function(){this.target3D=null,this.vector=new o.Vector3,a("The `look-at` component is deprecated - use path_to_url instead.")},update:function(){var e,t=this,i=t.data,r=t.el.object3D;return!i||"object"==typeof i&&!Object.keys(i).length?t.remove():"object"==typeof i?r.lookAt(new o.Vector3(i.x,i.y,i.z)):(e=t.el.sceneEl.querySelector(i),e?e.hasLoaded?t.beginTracking(e):e.addEventListener("loaded",function(){t.beginTracking(e)}):void a('"'+i+'" does not point to a valid entity to look-at'))},tick:function(){var e=this.target3D;return e?this.el.object3D.lookAt(this.vector.setFromMatrixPosition(e.matrixWorld)):void 0},beginTracking:function(e){this.target3D=e.object3D}})},{"../core/component":57,"../lib/three":101,"../utils/coordinates":114,"../utils/debug":115}],30:[function(e,t){function i(e){return 0===e.x&&0===e.y&&0===e.z}var r=e("../core/component").registerComponent,n=e("../lib/three"),o=e("../utils/").isMobile(),a=Math.PI/2,s=n.Math.radToDeg;t.exports.Component=r("look-controls",{dependencies:["position","rotation"],schema:{enabled:{"default":!0},hmdEnabled:{"default":!0},standing:{"default":!0}},init:function(){this.previousHMDPosition=new n.Vector3,this.setupMouseControls(),this.setupHMDControls(),this.bindMethods()},update:function(e){var t=this.data,i=t.hmdEnabled;t.enabled&&(!i&&e&&i!==e.hmdEnabled&&(this.pitchObject.rotation.set(0,0,0),this.yawObject.rotation.set(0,0,0)),this.controls.standing=t.standing,this.controls.update(),this.updateOrientation(),this.updatePosition())},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},tick:function(){this.update()},remove:function(){this.pause()},bindMethods:function(){this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.releaseMouse=this.releaseMouse.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this)},setupMouseControls:function(){this.mouseDown=!1,this.pitchObject=new n.Object3D,this.yawObject=new n.Object3D,this.yawObject.position.y=10,this.yawObject.add(this.pitchObject)},setupHMDControls:function(){this.dolly=new n.Object3D,this.euler=new n.Euler,this.controls=new n.VRControls(this.dolly),this.controls.userHeight=0},addEventListeners:function(){var e=this.el.sceneEl,t=e.canvas;return t?(t.addEventListener("mousedown",this.onMouseDown,!1),window.addEventListener("mousemove",this.onMouseMove,!1),window.addEventListener("mouseup",this.releaseMouse,!1),t.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove),void window.addEventListener("touchend",this.onTouchEnd)):void e.addEventListener("render-target-loaded",this.addEventListeners.bind(this))},removeEventListeners:function(){var e=this.el.sceneEl,t=e&&e.canvas;t&&(t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mouseup",this.releaseMouse),t.removeEventListener("mouseout",this.releaseMouse),t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd))},updateOrientation:function(){var e=new n.Euler;return function(){var t,r,n,a=this.pitchObject,c=this.yawObject,u=this.calculateHMDQuaternion(),l=this.el.sceneEl;e.setFromQuaternion(u,"YXZ"),o?n={x:s(e.x)+s(a.rotation.x),y:s(e.y)+s(c.rotation.y),z:s(e.z)}:l.is("vr-mode")&&!i(e)&&this.data.hmdEnabled?n={x:s(e.x),y:s(e.y),z:s(e.z)}:(t=this.el.getComputedAttribute("rotation"),r=this.calculateDeltaRotation(),n={x:t.x+r.x,y:t.y+r.y,z:t.z}),this.el.setAttribute("rotation",n)}}(),calculateDeltaRotation:function(){var e,t;return function(){var i,r=s(this.pitchObject.rotation.x),n=s(this.yawObject.rotation.y);return e=e||r,t=t||n,i={x:r-e,y:n-t},e=r,t=n,i}}(),calculateHMDQuaternion:function(){var e=new n.Quaternion;return function(){return e.copy(this.dolly.quaternion),e}}(),updatePosition:function(){var e=new n.Vector3;return function(){var t,r=this.el,n=r.getComputedAttribute("position"),o=this.previousHMDPosition,a=this.el.sceneEl;t=this.calculateHMDPosition(),e.copy(t).sub(o),a.is("vr-mode")&&!i(e)&&(o.copy(t),a.is("vr-mode")&&r.setAttribute("position",{x:n.x+e.x,y:n.y+e.y,z:n.z+e.z}))}}(),calculateHMDPosition:function(){var e=this.dolly,t=new n.Vector3;return e.updateMatrix(),t.setFromMatrixPosition(e.matrix),t},onMouseMove:function(e){var t=this.pitchObject,i=this.yawObject,r=this.previousMouseEvent;if(this.mouseDown&&this.data.enabled){var n=e.movementX||e.mozMovementX,o=e.movementY||e.mozMovementY;(void 0===n||void 0===o)&&(n=e.screenX-r.screenX,o=e.screenY-r.screenY),this.previousMouseEvent=e,i.rotation.y-=.002*n,t.rotation.x-=.002*o,t.rotation.x=Math.max(-a,Math.min(a,t.rotation.x))}},onMouseDown:function(e){this.mouseDown=!0,this.previousMouseEvent=e,e.preventDefault()},releaseMouse:function(){this.mouseDown=!1},onTouchStart:function(e){1===e.touches.length&&(this.touchStart={x:e.touches[0].pageX,y:e.touches[0].pageY},this.touchStarted=!0)},onTouchMove:function(e){var t,i=this.yawObject;this.touchStarted&&(t=2*Math.PI*(e.touches[0].pageX-this.touchStart.x)/this.el.sceneEl.canvas.clientWidth,i.rotation.y-=.5*t,this.touchStart={x:e.touches[0].pageX,y:e.touches[0].pageY})},onTouchEnd:function(){this.touchStarted=!1}})},{"../core/component":57,"../lib/three":101,"../utils/":117}],31:[function(e,t){function i(e){switch(e){case"back":return a.BackSide;case"double":return a.DoubleSide;default:return a.FrontSide}}function r(e,t){e.dispose(),t.unregisterMaterial(e)}var n=e("../utils/"),o=e("../core/component"),a=e("../lib/three"),s=e("../core/shader"),c=n.debug("components:material:error"),u=o.registerComponent,l=s.shaders,h=s.shaderNames;t.exports.Component=u("material",{schema:{shader:{"default":"standard",oneOf:h},transparent:{"default":!1},opacity:{"default":1,min:0,max:1},side:{"default":"front",oneOf:["front","back","double"]},depthTest:{"default":!0},flatShading:{"default":!1}},init:function(){this.material=null},update:function(e){var t=this.data;this.shader&&t.shader===e.shader||this.updateShader(t.shader),this.shader.update(this.data),this.updateMaterial()},updateSchema:function(e){var t=e.shader,i=this.data&&this.data.shader,r=t||i,n=l[r]&&l[r].schema;n||c("Unknown shader schema "+r),i&&t===i||(this.extendSchema(n),this.updateBehavior())},updateBehavior:function(){var e=this.el.sceneEl,t=this.schema,i=this,r={},n=function(e){function t(t){r[t]=e}var n=Object.keys(r);n.forEach(t),i.shader.update(r)},o=Object.keys(t);o.forEach(function(o){"time"===t[o].type&&(i.tick=n,r[o]=!0,e.addBehavior(i))}),0===Object.keys(r).length&&e.removeBehavior(this)},updateShader:function(e){var t,i=this.data,r=l[e]&&l[e].Shader;if(!r)throw new Error("Unknown shader "+e);t=this.shader=new r,t.el=this.el,t.init(i),this.setMaterial(t.material),this.updateSchema(i)},updateMaterial:function(){var e=this.data,t=this.material;t.side=i(e.side),t.opacity=e.opacity,t.transparent=e.transparent!==!1||e.opacity<1,t.depthTest=e.depthTest!==!1,t.shading=e.flatShading?a.FlatShading:a.SmoothShading},remove:function(){var e=new a.MeshBasicMaterial,t=this.material,i=this.el.getObject3D("mesh");i&&(i.material=e),r(t,this.system)},setMaterial:function(e){var t=this.el.getOrCreateObject3D("mesh",a.Mesh),i=this.system;this.material&&r(this.material,i),this.material=t.material=e,i.registerMaterial(e)}})},{"../core/component":57,"../core/shader":65,"../lib/three":101,"../utils/":117}],32:[function(e,t){var i=e("../utils/debug"),r=e("../core/component").registerComponent,n=e("../lib/three"),o=i("components:obj-model:warn");t.exports.Component=r("obj-model",{dependencies:["material"],schema:{mtl:{type:"src"},obj:{type:"src"}},init:function(){this.model=null,this.objLoader=new n.OBJLoader,this.mtlLoader=new n.MTLLoader(this.objLoader.manager),this.mtlLoader.crossOrigin=""},update:function(){var e=this.data;e.obj&&(this.remove(),this.loadObj(e.obj,e.mtl))},remove:function(){this.model&&this.el.removeObject3D("mesh")},loadObj:function(e,t){var i=this,r=this.el,a=this.mtlLoader,s=this.objLoader;return t?(r.hasAttribute("material")&&o("Material component properties are ignored when a .MTL is provided"),a.setBaseUrl(t.substr(0,t.lastIndexOf("/")+1)),void a.load(t,function(t){t.preload(),s.setMaterials(t),s.load(e,function(e){i.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})})):void s.load(e,function(e){var t=r.components.material;t&&e.traverse(function(e){e instanceof n.Mesh&&(e.material=t.material)}),i.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})}})},{"../core/component":57,"../lib/three":101,"../utils/debug":115}],33:[function(e,t){var i=e("../core/component").registerComponent;t.exports.Component=i("position",{schema:{type:"vec3"},update:function(){var e=this.el.object3D,t=this.data;e.position.set(t.x,t.y,t.z)}})},{"../core/component":57}],34:[function(e,t){var i=e("../core/component").registerComponent,r=e("../lib/three"),n=new r.Vector3;t.exports.Component=i("raycaster",{schema:{far:{"default":1/0},interval:{"default":100},near:{"default":0},objects:{"default":""},recursive:{"default":!0}},init:function(){this.direction=new r.Vector3,this.intersectedEls=[],this.objects=null,this.prevCheckTime=void 0,this.raycaster=new r.Raycaster,this.updateOriginDirection()},update:function(){var e=this.data,t=this.raycaster;t.far=e.far,t.near=e.near,this.refreshObjects()},refreshObjects:function(){var e,t,i=this.data;if(i.objects)for(t=this.el.sceneEl.querySelectorAll(i.objects),this.objects=[],e=0;e<t.length;e++)this.objects.push(t[e].object3D);else this.objects=this.el.sceneEl.object3D.children},tick:function(e){var t,i=this.el,r=this.data,n=this.intersectedEls.slice(),o=this.intersectedEls=[],a=this.prevCheckTime;a&&e-a<r.interval||(this.updateOriginDirection(),t=this.raycaster.intersectObjects(this.objects,r.recursive),t.forEach(function(e){o.push(e.object.el)}),t.forEach(function(e){var t=e.object.el;t.emit("raycaster-intersected",{el:i,intersection:e})}),t.length&&i.emit("raycaster-intersection",{els:t.map(function(e){return e.object.el}),intersections:t}),n.forEach(function(e){-1===o.indexOf(e)&&(i.emit("raycaster-intersection-cleared",{el:e}),e.emit("raycaster-intersected-cleared",{el:i}))}))},updateOriginDirection:function(){var e=new r.Quaternion,t=new r.Vector3;return function(){var i=this.el,r=i.object3D;r.updateMatrixWorld(),r.matrixWorld.decompose(t,e,n),this.direction.set(0,0,-1),this.direction.applyQuaternion(e),this.raycaster.set(t,this.direction)}}()})},{"../core/component":57,"../lib/three":101}],35:[function(e,t){var i=e("../lib/three").Math.degToRad,r=e("../core/component").registerComponent;t.exports.Component=r("rotation",{schema:{type:"vec3"},update:function(){var e=this.data,t=this.el.object3D;t.rotation.set(i(e.x),i(e.y),i(e.z)),t.rotation.order="YXZ"}})},{"../core/component":57,"../lib/three":101}],36:[function(e,t){var i=e("../core/component").registerComponent,r=1e-5;t.exports.Component=i("scale",{schema:{type:"vec3","default":{x:1,y:1,z:1}},update:function(){var e=this.data,t=this.el.object3D,i=0===e.x?r:e.x,n=0===e.y?r:e.y,o=0===e.z?r:e.z;t.scale.set(i,n,o)}})},{"../core/component":57}],37:[function(e,t){var i=e("../../core/component").registerComponent;t.exports.Component=i("canvas",{init:function(){function e(){n.classList.add("fullscreen")}function t(){n.classList.remove("fullscreen")}function i(){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;e||r.exitVR(),document.activeElement.blur(),document.body.focus(),setTimeout(r.resize.bind(r),0)}var r=this.el,n=document.createElement("canvas");n.classList.add("a-canvas"),n.dataset.aframeCanvas=!0,r.appendChild(n),document.addEventListener("fullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),n.addEventListener("touchmove",function(e){e.preventDefault()}),r.addEventListener("enter-vr",e),r.addEventListener("exit-vr",t),r.canvas=n,r.emit("render-target-loaded",{target:n})}})},{"../../core/component":57}],38:[function(e,t){var i=e("../../core/component").registerComponent;t.exports.Component=i("debug",{schema:{"default":!0}})},{"../../core/component":57}],39:[function(e,t){var i=e("../../core/component").registerComponent;t.exports.Component=i("embedded",{dependencies:["vr-mode-ui"],schema:{"default":!0},update:function(){var e=this.el,t=e.querySelector(".a-enter-vr");this.data===!0?(t.classList.add("embedded"),e.removeFullScreenStyles()):(t.classList.remove("embedded"),e.addFullScreenStyles())}})},{"../../core/component":57}],40:[function(e,t){function i(e){var t;return t="exponential"===e.type?new n.FogExp2(e.color,e.density):new n.Fog(e.color,e.near,e.far),t.name=e.type,t}var r=e("../../core/component").registerComponent,n=e("../../lib/three"),o=e("../../utils/debug"),a=o("components:fog:warn");t.exports.Component=r("fog",{schema:{color:{"default":"#000"},density:{"default":25e-5},far:{"default":1e3,min:0},near:{"default":1,min:0},type:{"default":"linear",oneOf:["linear","exponential"]}},update:function(){var e=this.data,t=this.el,r=this.el.object3D.fog;return t.isScene?r&&e.type===r.name?void Object.keys(this.schema).forEach(function(t){var i=e[t];"color"===t&&(i=new n.Color(i)),r[t]=i}):(t.object3D.fog=i(e),void t.systems.material.updateMaterials()):void a("Fog component can only be applied to <a-scene>")},remove:function(){var e=this.el.object3D.fog;e&&(e.density=0,e.far=0,e.near=0)}})},{"../../core/component":57,"../../lib/three":101,"../../utils/debug":115}],41:[function(e,t){var i=e("../../core/component").registerComponent,r=e("../../utils/").shouldCaptureKeyEvent,n=e("../../lib/three"),o=new n.VRControls(new n.Object3D);t.exports.Component=i("keyboard-shortcuts",{schema:{enterVR:{"default":!0},exitVR:{"default":!0},resetSensor:{"default":!0}},init:function(){var e=this,t=this.el;this.listener=window.addEventListener("keyup",function(i){r(i)&&(e.enterVREnabled&&70===i.keyCode&&t.enterVR(),e.enterVREnabled&&27===i.keyCode&&t.exitVR(),e.resetSensorEnabled&&90===i.keyCode&&o.resetSensor())},!1)},update:function(){var e=this.data;this.enterVREnabled=e.enterVR,this.resetSensorEnabled=e.resetSensor},remove:function(){window.removeEventListener("keyup",this.listener)}})},{"../../core/component":57,"../../lib/three":101,"../../utils/":117}],42:[function(e,t){function i(e){var t=new a(e.renderer),i=new s(e),r=e.isMobile?[]:[t,i];return new n({css:[],values:{fps:{caption:"fps",below:30}},groups:[{caption:"Framerate",values:["fps","raf"]}],plugins:r})}var r=e("../../core/component").registerComponent,n=e("../../../vendor/rStats");e("../../../vendor/rStats.extras"),e("../../lib/rStatsAframe");var o="a-hidden",a=window.threeStats,s=window.aframeStats;t.exports.Component=r("stats",{schema:{"default":!0},init:function(){var e=this.el;this.stats=i(e),this.statsEl=document.querySelector(".rs-base"),this.hideBound=this.hide.bind(this),this.showBound=this.show.bind(this),e.addEventListener("enter-vr",this.hideBound),e.addEventListener("exit-vr",this.showBound)},update:function(){return this.data?this.show():this.hide()},remove:function(){this.el.removeEventListener("enter-vr",this.hideBound),this.el.removeEventListener("exit-vr",this.showBound),this.statsEl.parentNode.removeChild(this.statsEl)},tick:function(){var e=this.stats;e("rAF").tick(),e("FPS").frame(),e().update()},hide:function(){this.statsEl.classList.add(o)},show:function(){this.statsEl.classList.remove(o)}})},{"../../../vendor/rStats":124,"../../../vendor/rStats.extras":123,"../../core/component":57,"../../lib/rStatsAframe":100}],43:[function(e,t){function i(e){var t,i,r=window.hasNativeWebVRImplementation&&l();return i=document.createElement("div"),i.classList.add(a),t=document.createElement("button"),t.classList.add(s),h||r||t.classList.add("fullscreen"),i.appendChild(t),t.addEventListener("click",e),i}function r(e){var t=document.createElement("div");t.className=u,t.classList.add(c);var i=document.createElement("button");return i.innerHTML="Exit VR",i.addEventListener("click",e),t.appendChild(i),t}var n=e("../../core/component").registerComponent,o=e("../../utils/"),a="a-enter-vr",s="a-enter-vr-button",c="a-hidden",u="a-orientation-modal",l=o.checkHeadsetConnected,h=o.isMobile();t.exports.Component=n("vr-mode-ui",{dependencies:["canvas"],schema:{enabled:{"default":!0}},init:function(){var e=this,t=this.el;"false"!==o.getUrlParameter("ui")&&(this.enterVR=t.enterVR.bind(t),this.exitVR=t.exitVR.bind(t),this.insideLoader=!1,this.enterVREl=null,this.orientationModalEl=null,t.addEventListener("enter-vr",this.updateEnterVRInterface.bind(this)),t.addEventListener("exit-vr",this.updateEnterVRInterface.bind(this)),window.addEventListener("message",function(t){"loaderReady"===t.data.type&&(e.insideLoader=!0,e.remove())}),window.addEventListener("orientationchange",this.toggleOrientationModalIfNeeded.bind(this)))},update:function(){var e=this.el;return!this.data.enabled||this.insideLoader||"false"===o.getUrlParameter("ui")?this.remove():void(this.enterVREl||this.orientationModalEl||(this.enterVREl=i(this.enterVR),e.appendChild(this.enterVREl),this.orientationModalEl=r(this.exitVR),e.appendChild(this.orientationModalEl),this.updateEnterVRInterface()))},remove:function(){[this.enterVREl,this.orientationModalEl].forEach(function(e){e&&e.parentNode.removeChild(e)})},updateEnterVRInterface:function(){this.toggleEnterVRButtonIfNeeded(),this.toggleOrientationModalIfNeeded()},toggleEnterVRButtonIfNeeded:function(){var e=this.el;this.enterVREl&&(e.is("vr-mode")?this.enterVREl.classList.add(c):this.enterVREl.classList.remove(c))},toggleOrientationModalIfNeeded:function(){var e=this.el,t=this.orientationModalEl;t&&e.isMobile&&(!o.isLandscape()&&e.is("vr-mode")?t.classList.remove(c):t.classList.add(c))}})},{"../../core/component":57,"../../utils/":117}],44:[function(e,t){var i=e("../utils/debug"),r=e("../core/component").registerComponent,n=e("../lib/three"),o=i("components:sound:warn");t.exports.Component=r("sound",{schema:{src:{type:"src"},on:{"default":""},autoplay:{"default":!1},loop:{"default":!1},volume:{"default":1}},multiple:!0,init:function(){this.listener=null,this.audioLoader=new n.AudioLoader,this.sound=null,this.playSound=this.playSound.bind(this)},update:function(e){var t=this.data,i=this.sound,r=t.src!==e.src;if(r){if(!t.src)return void o("Audio source was not specified with `src`");i=this.setupSound()}i.autoplay=t.autoplay,i.setLoop(t.loop),i.setVolume(t.volume),t.on!==e.on&&this.updateEventListener(e.on),r&&this.audioLoader.load(t.src,function(e){i.setBuffer(e),n.Cache.remove(t.src)})},updateEventListener:function(e){var t=this.el;e&&t.removeEventListener(e,this.playSound),t.addEventListener(this.data.on,this.playSound)},removeEventListener:function(){this.el.removeEventListener(this.data.on,this.playSound)},remove:function(){this.removeEventListener(),this.el.removeObject3D(this.attrName);try{this.sound.disconnect()}catch(e){o("Audio source not properly disconnected")}},play:function(){this.sound&&(this.sound.source.buffer&&this.data.autoplay&&this.sound.play(),this.updateEventListener())},pause:function(){this.sound&&(this.sound.source.buffer&&this.sound.isPlaying&&this.sound.pause(),this.removeEventListener())},setupSound:function(){var e=this.el,t=e.sceneEl,i=this.sound;i&&(this.stopSound(),e.removeObject3D("sound"));var r=this.listener=t.audioListener||new n.AudioListener;return t.audioListener=r,t.camera&&t.camera.add(r),t.addEventListener("camera-set-active",function(e){e.detail.cameraEl.getObject3D("camera").add(r)}),i=this.sound=new n.PositionalAudio(r),e.setObject3D(this.attrName,i),i.source.onended=function(){i.onEnded(),e.emit("sound-ended")},i},playSound:function(){this.sound.source.buffer&&this.sound.play()},stopSound:function(){this.sound.source.buffer&&this.sound.stop()}})},{"../core/component":57,"../lib/three":101,"../utils/debug":115}],45:[function(e,t){var i=e("../core/component").registerComponent,r=e("../lib/three");t.exports.Component=i("tracked-controls",{schema:{controller:{"default":0},id:{"default":"OpenVR Gamepad"}},init:function(){this.buttonStates={},this.axisState=[]},update:function(){function e(e){return e.id===i.id}var t=this.system.controllers,i=this.data;t=t.filter(e),this.controller=t[i.controller]},tick:function(e,t){var i=this.el.getObject3D("mesh");i&&(i.update&&i.update(t/1e3),this.updatePose(),this.updateButtons())},updatePose:function(){var e=new r.Euler,t=new r.Vector3,i=new r.Quaternion,n=new r.Object3D,o=new r.Matrix4;return e.order="YXZ",function(){var a,s,c,u,l=this.el,h=this.system.vrDisplay;this.update(),a=this.controller,a&&(s=a.pose,c=s.orientation||[0,0,0,1],u=s.position||[0,0,0],i.fromArray(c),n.quaternion.fromArray(c),n.position.fromArray(u),n.updateMatrix(),h&&h.stageParameters&&(o.fromArray(h.stageParameters.sittingToStandingTransform),n.applyMatrix(o)),e.setFromRotationMatrix(n.matrix),t.setFromMatrixPosition(n.matrix),l.setAttribute("rotation",{x:r.Math.radToDeg(e.x),y:r.Math.radToDeg(e.y),z:r.Math.radToDeg(e.z)}),l.setAttribute("position",{x:t.x,y:t.y,z:t.z}))}}(),updateButtons:function(){var e,t,i=this.controller;if(this.controller){for(e=0;e<i.buttons.length;++e)t=i.buttons[e],this.handleButton(e,t);this.handleAxes(i.axes)}},handleAxes:function(e){var t,i=this.axisState,r=!1;for(t=0;t<e.length;++t)if(i[t]!==e[t]){r=!0;break}r&&(i=e.slice(),this.el.emit("axismove",{axis:i}))},handleButton:function(e,t){var i=!1;i=i||this.handlePress(e,t),i=i||this.handleTouch(e,t),i=i||this.handleValue(e,t),i&&this.el.emit("buttonchanged",{id:e,state:t})},handlePress:function(e,t){var i,r=this.buttonStates,n=r[e]=r[e]||{};t.pressed!==n.pressed&&(i=t.pressed?"down":"up",this.el.emit("button"+i,{id:e}),n.pressed=t.pressed)},handleTouch:function(e,t){var i,r=this.buttonStates,n=r[e]=r[e]||{};return t.touched===n.touched?!1:(i=t.touched?"start":"end",n.touched=t.touched,this.el.emit("touch"+i,{id:e,state:n}),!0)},handleValue:function(e,t){var i=this.buttonStates,r=i[e]=i[e]||{};return t.value===r.value?!1:(r.value=t.value,!0)}})},{"../core/component":57,"../lib/three":101}],46:[function(e,t){var i=e("../core/component").registerComponent;t.exports.Component=i("visible",{schema:{"default":!0},update:function(){this.el.object3D.visible=this.data}})},{"../core/component":57}],47:[function(e,t){var i=e("../core/component").registerComponent,r="path_to_url",n="path_to_url"; t.exports.Component=i("vive-controls",{dependencies:["tracked-controls"],schema:{hand:{"default":"left"},buttonColor:{"default":"white"},buttonHighlightColor:{"default":"yellow"},model:{"default":!0}},mapping:{axis0:"trackpad",axis1:"trackpad",button0:"trackpad",button1:"trigger",button2:"grip",button3:"menu",button4:"system"},init:function(){var e=this;this.animationActive="pointing",this.onButtonChanged=this.onButtonChanged.bind(this),this.onButtonDown=function(t){e.onButtonEvent(t.detail.id,"down")},this.onButtonUp=function(t){e.onButtonEvent(t.detail.id,"up")},this.onModelLoaded=this.onModelLoaded.bind(this)},play:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("model-loaded",this.onModelLoaded)},pause:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("model-loaded",this.onModelLoaded)},update:function(){var e=this.el,t=this.data,i="url("+r+")",o="url("+n+")",a="right"===t.hand?0:1;e.setAttribute("tracked-controls","controller",a),t.model&&e.setAttribute("obj-model",{obj:i,mtl:o})},onButtonChanged:function(e){var t,i=this.mapping["button"+e.detail.id],r=this.buttonMeshes;"trigger"===i&&r&&(t=e.detail.state.value,r.trigger.rotation.x=-t*(Math.PI/12))},onModelLoaded:function(e){var t,i=e.detail.model;this.data.model&&(t=this.buttonMeshes={},t.grip={left:i.getObjectByName("leftgrip"),right:i.getObjectByName("rightgrip")},t.menu=i.getObjectByName("menubutton"),t.system=i.getObjectByName("systembutton"),t.trackpad=i.getObjectByName("touchpad"),t.trigger=i.getObjectByName("trigger"),i.position.set(0,-.015,.04))},onButtonEvent:function(e,t){var i=this.mapping["button"+e];this.el.emit(i+t),this.data.model&&this.updateModel(i,t)},updateModel:function(e,t){var i="up"===t?this.data.buttonColor:this.data.buttonHighlightColor,r=this.buttonMeshes;return r?"grip"===e?(r.grip.left.material.color.set(i),void r.grip.right.material.color.set(i)):void r[e].material.color.set(i):void 0}})},{"../core/component":57}],48:[function(e,t){var i=e("../core/component").registerComponent,r=e("../utils/").shouldCaptureKeyEvent,n=e("../lib/three"),o=.2;t.exports.Component=i("wasd-controls",{schema:{easing:{"default":20},acceleration:{"default":65},enabled:{"default":!0},fly:{"default":!1},wsAxis:{"default":"z",oneOf:["x","y","z"]},adAxis:{"default":"x",oneOf:["x","y","z"]},wsInverted:{"default":!1},wsEnabled:{"default":!0},adInverted:{"default":!1},adEnabled:{"default":!0}},init:function(){this.velocity=new n.Vector3,this.keys={},this.onBlur=this.onBlur.bind(this),this.onFocus=this.onFocus.bind(this),this.onVisibilityChange=this.onVisibilityChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.attachVisibilityEventListeners()},update:function(e){var t,i=this.data,r=i.acceleration,n=i.easing,a=this.velocity,s=this.prevTime=this.prevTime||Date.now(),c=window.performance.now(),u=(c-s)/1e3,l=this.keys,h=i.adAxis,d=i.wsAxis,p=i.adInverted?-1:1,f=i.wsInverted?-1:1,m=this.el;if(this.prevTime=c,e||u>o)return a[h]=0,void(a[d]=0);a[h]-=a[h]*n*u,a[d]-=a[d]*n*u;var g=m.getComputedAttribute("position");i.enabled&&(i.adEnabled&&(l[65]&&(a[h]-=p*r*u),l[68]&&(a[h]+=p*r*u)),i.wsEnabled&&(l[87]&&(a[d]-=f*r*u),l[83]&&(a[d]+=f*r*u))),t=this.getMovementVector(u),m.object3D.translateX(t.x),m.object3D.translateY(t.y),m.object3D.translateZ(t.z),m.setAttribute("position",{x:g.x+t.x,y:g.y+t.y,z:g.z+t.z})},play:function(){this.attachKeyEventListeners()},pause:function(){this.keys={},this.removeKeyEventListeners()},tick:function(){this.update()},remove:function(){this.pause(),this.removeVisibilityEventListeners()},attachVisibilityEventListeners:function(){window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus),document.addEventListener("visibilitychange",this.onVisibilityChange)},removeVisibilityEventListeners:function(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),document.removeEventListener("visibilitychange",this.onVisibilityChange)},attachKeyEventListeners:function(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)},removeKeyEventListeners:function(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},onBlur:function(){this.pause()},onFocus:function(){this.play()},onVisibilityChange:function(){document.hidden?this.onBlur():this.onFocus()},onKeyDown:function(e){r(e)&&(this.keys[e.keyCode]=!0)},onKeyUp:function(e){r(e)&&(this.keys[e.keyCode]=!1)},getMovementVector:function(){var e=new n.Vector3(0,0,0),t=new n.Euler(0,0,0,"YXZ");return function(i){var r=this.velocity,o=this.el.getComputedAttribute("rotation");return e.copy(r),e.multiplyScalar(i),o?(this.data.fly||(o.x=0),t.set(n.Math.degToRad(o.x),n.Math.degToRad(o.y),0),e.applyEuler(t),e):e}}()})},{"../core/component":57,"../lib/three":101,"../utils/":117}],49:[function(e,t){var i=e("tween.js"),r={alternate:"alternate",alternateReverse:"alternate-reverse",normal:"normal",reverse:"reverse"},n={linear:i.Easing.Linear.None,ease:i.Easing.Cubic.InOut,"ease-in":i.Easing.Cubic.In,"ease-out":i.Easing.Cubic.Out,"ease-in-out":i.Easing.Cubic.InOut,"ease-cubic":i.Easing.Cubic.In,"ease-in-cubic":i.Easing.Cubic.In,"ease-out-cubic":i.Easing.Cubic.Out,"ease-in-out-cubic":i.Easing.Cubic.InOut,"ease-quad":i.Easing.Quadratic.InOut,"ease-in-quad":i.Easing.Quadratic.In,"ease-out-quad":i.Easing.Quadratic.Out,"ease-in-out-quad":i.Easing.Quadratic.InOut,"ease-quart":i.Easing.Quartic.InOut,"ease-in-quart":i.Easing.Quartic.In,"ease-out-quart":i.Easing.Quartic.Out,"ease-in-out-quart":i.Easing.Quartic.InOut,"ease-quint":i.Easing.Quintic.InOut,"ease-in-quint":i.Easing.Quintic.In,"ease-out-quint":i.Easing.Quintic.Out,"ease-in-out-quint":i.Easing.Quintic.InOut,"ease-sine":i.Easing.Sinusoidal.InOut,"ease-in-sine":i.Easing.Sinusoidal.In,"ease-out-sine":i.Easing.Sinusoidal.Out,"ease-in-out-sine":i.Easing.Sinusoidal.InOut,"ease-expo":i.Easing.Exponential.InOut,"ease-in-expo":i.Easing.Exponential.In,"ease-out-expo":i.Easing.Exponential.Out,"ease-in-out-expo":i.Easing.Exponential.InOut,"ease-circ":i.Easing.Circular.InOut,"ease-in-circ":i.Easing.Circular.In,"ease-out-circ":i.Easing.Circular.Out,"ease-in-out-circ":i.Easing.Circular.InOut,"ease-elastic":i.Easing.Elastic.InOut,"ease-in-elastic":i.Easing.Elastic.In,"ease-out-elastic":i.Easing.Elastic.Out,"ease-in-out-elastic":i.Easing.Elastic.InOut,"ease-back":i.Easing.Back.InOut,"ease-in-back":i.Easing.Back.In,"ease-out-back":i.Easing.Back.Out,"ease-in-out-back":i.Easing.Back.InOut,"ease-bounce":i.Easing.Bounce.InOut,"ease-in-bounce":i.Easing.Bounce.In,"ease-out-bounce":i.Easing.Bounce.Out,"ease-in-out-bounce":i.Easing.Bounce.InOut},o={backwards:"backwards",both:"both",forwards:"forwards",none:"none"},a={indefinite:"indefinite"},s={attribute:"rotation",begin:"",end:"",delay:0,dur:1e3,easing:"ease",direction:r.normal,fill:o.forwards,from:void 0,repeat:0,to:void 0};t.exports.defaults=s,t.exports.directions=r,t.exports.easingFunctions=n,t.exports.fills=o,t.exports.repeats=a},{"tween.js":18}],50:[function(e,t){function i(e){return g.extend({},e)}function r(e,t,i,r,a){function s(){var t=b[0],i=b[1],r=e.components[t],n=r&&r.schema;return n&&n[i]&&"color"===n[i].type}function u(){x=b[0],A=b[1],M=e.components[x],M||(e.setAttribute(x,""),M=e.components[x]),y=M.schema,T[t]=void 0===i?v(e,t):i,T[t]=d(T[t],y[A]),L[t]=d(r,y[A]),w=function(i){t in i&&e.setAttribute(x,A,i[t])}}function l(){T=i?h.parse(i):a,L=h.parse(r),w=function(i){e.setAttribute(t,i)}}function p(){T[t]=void 0===i?!1:n(i),T[t]=o(T[t]),L[t]=o(n(r)),w=function(i){e.setAttribute(t,!!i[t])}}function f(){T=new m.Color(i),L=new m.Color(r),w=function(i){b.length>1&&e.setAttribute(b[0],b[1],c(i)),e.setAttribute(t,c(i))}}function g(){T[t]=parseFloat(void 0===i?e.getAttribute(t):i),L[t]=parseFloat(r),w=function(i){e.setAttribute(t,i[t])}}var y,M,A,x,w,b=t.split("."),T={},L={};return 2===b.length?s()?f():u():r&&E(r)?l():-1!==["true","false"].indexOf(r)?p():isNaN(r)?f():g(),{from:T,partialSetAttribute:w,to:L}}function n(e){return"true"===e?!0:!1}function o(e){return e?1:0}function a(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function s(e){return Math.floor(255*Math.min(Math.abs(e),1))}function c(e){return"#"+["r","g","b"].map(function(t){return a(s(e[t]))}).join("")}var u=e("./a-node"),l=e("../constants/animation"),h=e("../utils/").coordinates,d=e("./schema").parseProperty,p=e("./a-register-element").registerElement,f=e("tween.js"),m=e("../lib/three"),g=e("../utils/"),v=g.entity.getComponentProperty,y=l.defaults,M=l.directions,A=l.easingFunctions,x=l.fills,w=l.repeats,E=h.isCoordinate;t.exports.AAnimation=p("a-animation",{prototype:Object.create(u.prototype,{createdCallback:{value:function(){this.bindMethods(),this.isRunning=!1,this.partialSetAttribute=function(){},this.tween=null}},attachedCallback:{value:function(){function e(){return i.isPlaying?i.hasLoaded?(t.applyMixin(),t.update(),void t.load()):void i.addEventListener("loaded",e):void i.addEventListener("play",e)}var t=this,i=this.el=this.parentNode;e()}},attributeChangedCallback:{value:function(){this.hasLoaded&&this.isRunning&&(this.stop(),this.applyMixin(),this.update())}},detachedCallback:{value:function(){this.isRunning&&this.stop()}},getTween:{value:function(){var e,t,n,o,a=this,s=a.data,c=a.el,u=s.attribute,l=parseInt(s.delay,10),h=v(c,u),d=a.getDirection(s.direction),p=A[s.easing],m=s.fill,g=s.repeat===w.indefinite?1/0:0,y=!1;return e=r(c,u,s.from||a.initialValue,s.to,h),t=e.from,n=e.to,a.partialSetAttribute=e.partialSetAttribute,void 0===a.count&&(a.count=g===1/0?0:parseInt(s.repeat,10)),isNaN(l)&&(l=0),a.initialValue=a.initialValue||i(h),g===1/0&&m===x.forwards&&-1!==[M.alternate,M.alternateReverse].indexOf(s.direction)&&(y=!0),d===M.reverse&&(o=n,n=i(t),t=i(o)),-1!==[x.backwards,x.both].indexOf(m)&&a.partialSetAttribute(t),new f.Tween(i(t)).to(n,s.dur).delay(l).easing(p).repeat(g).yoyo(y).onUpdate(function(){a.partialSetAttribute(this)}).onComplete(a.onCompleted.bind(a))}},update:{value:function(){var e=this.data;"infinite"===e.repeat&&console.warn("Using 'infinite' as 'repeat' value is invalid. Use 'indefinite' instead."),""===e.begin||isNaN(e.begin)||(console.warn("Using 'begin' to specify a delay is deprecated. Use 'delay' instead."),e.delay=e.begin,e.begin="");var t=e.begin,i=e.end;this.evt&&this.removeEventListeners(this.evt),this.evt={begin:t,end:i},this.addEventListeners(this.evt),""===t&&(this.stop(),this.start())},writable:window.debug},onCompleted:{value:function(){var e=this.data;return this.isRunning=!1,-1!==[x.backwards,x.none].indexOf(e.fill)&&this.partialSetAttribute(this.initialValue),0===this.count?(this.count=void 0,void this.emit("animationend")):(this.isRunning=!1,this.count--,void this.start())}},start:{value:function(){!this.isRunning&&this.el.isPlaying&&(this.tween=this.getTween(),this.isRunning=!0,this.tween.start(),this.emit("animationstart"))},writable:!0},stop:{value:function(){var e=this.tween;e&&(e.stop(),this.isRunning=!1,-1!==[x.backwards,x.none].indexOf(this.data.fill)&&this.partialSetAttribute(this.initialValue),this.emit("animationstop"))},writable:!0},getDirection:{value:function(e){return e===M.alternate?(this.prevDirection=this.prevDirection===M.normal?M.reverse:M.normal,this.prevDirection):e===M.alternateReverse?(this.prevDirection=this.prevDirection===M.reverse?M.normal:M.reverse,this.prevDirection):e}},bindMethods:{value:function(){this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.onStateAdded=this.onStateAdded.bind(this),this.onStateRemoved=this.onStateRemoved.bind(this)}},addEventListeners:{value:function(e){var t=this.el,i=this;g.splitString(e.begin).forEach(function(e){t.addEventListener(e,i.start)}),g.splitString(e.end).forEach(function(e){t.addEventListener(e,i.stop)}),""===e.begin&&t.addEventListener("play",this.start),t.addEventListener("pause",this.stop),t.addEventListener("stateadded",this.onStateAdded),t.addEventListener("stateremoved",this.onStateRemoved)}},removeEventListeners:{value:function(e){var t=this.el,i=this.start,r=this.stop;g.splitString(e.begin).forEach(function(e){t.removeEventListener(e,i)}),g.splitString(e.end).forEach(function(e){t.removeEventListener(e,r)}),t.removeEventListener("stateadded",this.onStateAdded),t.removeEventListener("stateremoved",this.onStateRemoved)}},onStateAdded:{value:function(e){e.detail.state===this.data.begin&&this.start()},writable:!0},onStateRemoved:{value:function(e){e.detail.state===this.data.begin&&this.stop()},writable:!0},applyMixin:{value:function(){var e,t,i,r={};i=document.querySelector("#"+this.getAttribute("mixin")),t=i?g.getElData(i,y):{},e=g.getElData(this,y),g.extend(r,y,t,e),this.data=r}}})}),t.exports.getAnimationValues=r},{"../constants/animation":49,"../lib/three":101,"../utils/":117,"./a-node":55,"./a-register-element":56,"./schema":64,"tween.js":18}],51:[function(e,t){function i(e){return e.hasAttribute("autoplay")||"auto"===e.getAttribute("preload")?new Promise(function(t,i){function r(){for(var i=0,r=0;r<e.buffered.length;r++)i+=e.buffered.end(r)-e.buffered.start(r);i>=e.duration&&t()}return 4===e.readyState?t():e.error?i():(e.addEventListener("loadeddata",r,!1),e.addEventListener("progress",r,!1),void e.addEventListener("error",i,!1))}):void 0}var r=e("./a-node"),n=e("../utils/debug"),o=e("./a-register-element").registerElement,a=e("../lib/three"),s=new a.XHRLoader,c=n("core:a-assets:warn");t.exports=o("a-assets",{prototype:Object.create(r.prototype,{createdCallback:{value:function(){this.isAssets=!0}},attachedCallback:{value:function(){var e=this,t=[],r=this.querySelectorAll("audio"),n=this.querySelectorAll("img"),o=parseInt(this.getAttribute("timeout"),10)||3e3,a=this.querySelectorAll("video");if(!this.parentNode.isScene)throw new Error("<a-assets> must be a child of a <a-scene>.");for(var s=0;s<n.length;s++)t.push(new Promise(function(e,t){var i=n[s];i.onload=e,i.onerror=t}));for(s=0;s<r.length;s++)t.push(i(r[s]));for(s=0;s<a.length;s++)t.push(i(a[s]));Promise.all(t).then(this.load.bind(this)),setTimeout(function(){e.hasLoaded||(c("Asset loading timed out in ",o,"ms"),e.emit("timeout"),e.load())},o)}},load:{value:function(){r.prototype.load.call(this,null,function(e){return e.isAssetItem&&e.hasAttribute("src")})}}})}),o("a-asset-item",{prototype:Object.create(r.prototype,{createdCallback:{value:function(){this.data=null,this.isAssetItem=!0}},attachedCallback:{value:function(){var e=this,t=this.getAttribute("src");s.load(t,function(t){e.data=t,r.prototype.load.call(e)})}}})})},{"../lib/three":101,"../utils/debug":115,"./a-node":55,"./a-register-element":56}],52:[function(e,t){var i=e("../utils/debug"),r=e("./a-register-element").registerElement,n=i("core:cubemap:warn");t.exports=r("a-cubemap",{prototype:Object.create(HTMLElement.prototype,{attachedCallback:{value:function(){this.srcs=this.validate()},writable:window.debug},validate:{value:function(){var e,t=this.querySelectorAll("[src]"),i=[];if(6===t.length){for(e=0;e<t.length;e++)i.push(t[e].getAttribute("src"));return i}n("<a-cubemap> did not contain exactly six elements each with a `src` attribute.")},writable:window.debug}})})},{"../utils/debug":115,"./a-register-element":56}],53:[function(e,t){function i(e,t){return void 0!==e.defaultComponents[t]?!0:e.components[t]&&e.components[t].attrValue?!0:n(t,e.mixinEls)}function r(e){var t=[];return e.mixinEls.forEach(function(e){function i(e){t.push(e)}Object.keys(e.componentAttrCache).forEach(i)}),t}function n(e,t){var i,r=!1;for(i=0;i<t.length&&!(r=t[i].hasAttribute(e));++i);return r}function o(e){return e.isEntity}var a,s=e("./a-node"),c=e("./component").components,u=e("./a-register-element"),l=e("../lib/three"),h=e("../utils/"),d=u.isNode,p=h.debug("core:a-entity:debug"),f=u.registerElement,m="__",g=Object.create(s.prototype,{defaultComponents:{value:{position:"",rotation:"",scale:"",visible:""}},createdCallback:{value:function(){this.components={},this.isEntity=!0,this.isPlaying=!1,this.object3D=new l.Group,this.object3D.el=this,this.object3DMap={},this.states=[]}},attributeChangedCallback:{value:function(e,t,i){var r=this.components[e];return r&&r.justInitialized&&""===i?void delete r.justInitialized:void((r||null!==i)&&this.setEntityAttribute(e,t,i))}},attachedCallback:{value:function(){this.addToParent(),this.isScene||this.load()}},detachedCallback:{value:function(){this.parentEl&&!this.isScene&&(Object.keys(this.components).forEach(this.removeComponent.bind(this)),this.parentEl.remove(this))}},applyMixin:{value:function(e){return e?void this.updateComponent(e,this.getAttribute(e)):void this.updateComponents()}},mapStateMixins:{value:function(e,t){var i,r=this.getAttribute("mixin");r&&(i=r.split(" "),i.forEach(function(i){var r=i+"-"+e;t(r)}),this.updateComponents())}},updateStateMixins:{value:function(e,t){var i=this;t=t||"";var r=e.split(" "),n=t?t.split(" "):[],o=n.filter(function(e){return r.indexOf(e)<0});o.forEach(function(e){var t=Array.prototype.forEach,r=document.querySelectorAll("[id^="+e+"-]"),n=[];t.call(r,function(e){n.push(e.id)}),n.forEach(i.unregisterMixin.bind(i))}),this.states.forEach(function(e){r.forEach(function(t){var r=t+"-"+e;i.registerMixin(r)})})}},getObject3D:{value:function(e){return this.object3DMap[e]}},setObject3D:{value:function(e,t){var i=this,r=this.object3DMap[e];r&&this.object3D.remove(r),t instanceof l.Object3D&&(t.el=i,this.object3D.add(t),t.children.length&&t.traverse(function(e){e.el=i})),this.object3DMap[e]=t}},removeObject3D:{value:function(e){this.setObject3D(e,null)}},getOrCreateObject3D:{value:function(e,t){var i=this.getObject3D(e);return!i&&t&&(i=new t,this.setObject3D(e,i)),i}},add:{value:function(e){if(!e.object3D)throw new Error("Trying to add an element that doesn't have an `object3D`");this.emit("child-attached",{el:e}),this.object3D.add(e.object3D)}},addToParent:{value:function(){function e(){t.attachedToParent=!0,i.add&&i.add(t)}var t=this,i=this.parentEl=this.parentNode,r=this.attachedToParent;return i&&!r?d(i)?void e():void i.addEventListener("nodeready",e):void 0}},load:{value:function(){function e(){i.updateComponents()}function t(){i.updateComponents(),i.parentEl.isPlaying&&i.play()}var i=this;if(!this.hasLoaded)return this.addToParent(),this.isScene?void s.prototype.load.call(this,e):void s.prototype.load.call(this,t,o)},writable:window.debug},remove:{value:function(e){this.object3D.remove(e.object3D)}},getChildEntities:{value:function(){for(var e=this.children,t=[],i=0;i<e.length;i++){var r=e[i];r instanceof a&&t.push(r)}return t}},initComponent:{value:function(e,t,r){var n,o=e.split(m),a=o[1],s=o[0],u=i(this,e)||void 0!==t;if(c[s]&&(u||r)&&!(e in this.components)){if(this.initComponentDependencies(s),a&&!c[s].multiple)throw new Error("Trying to initialize multiple components of type `"+s+"`. There can only be one component of this type per entity.");n=this.components[e]=new c[s].Component(this,t,a),this.isPlaying&&n.play(),this.hasAttribute(e)||(n.justInitialized=!0,HTMLElement.prototype.setAttribute.call(this,e,"")),p("Component initialized: %s",e)}},writable:window.debug},initComponentDependencies:{value:function(e){var t,i=this,r=c[e];r&&(t=c[e].dependencies,t&&t.forEach(function(e){i.initComponent(e,void 0,!0)}))}},removeComponent:{value:function(e){var t=this.components[e],i=e in this.defaultComponents,r=n(e,this.mixinEls);i||r||(t.pause(),t.remove(),delete this.components[e],this.emit("componentremoved",{name:e}))}},updateComponents:{value:function(){function e(e){var t=e.split(m)[0];c[t]&&(n[e]=!0)}function t(e){var t=o.getAttribute(e);delete n[e],o.updateComponent(e,t)}var i,n={},o=this;if(this.hasLoaded){var a=this.attributes;for(i=0;i<a.length;++i)e(a[i].name);r(this).forEach(e),Object.keys(this.defaultComponents).forEach(t),Object.keys(n).forEach(t)}}},updateComponent:{value:function(e,t){var i=this.components[e],r=e in this.defaultComponents;return i?null!==t||r?void i.updateProperties(t):void this.removeComponent(e):void this.initComponent(e,t,!1)}},updateComponentProperty:{value:function(e,t,i){var r=this.components[e],n=r&&r.attrValue,o=n?h.extend({},n):{};o[t]=i,this.updateComponent(e,o)}},removeAttribute:{value:function(e){var t=this.components[e];t&&(this.setEntityAttribute(e,void 0,null),this.components[e])||HTMLElement.prototype.removeAttribute.call(this,e)}},play:{value:function(){var e=this.components,t=Object.keys(e);!this.isPlaying&&this.hasLoaded&&(this.isPlaying=!0,t.forEach(function(t){e[t].play()}),this.getChildEntities().forEach(function(e){e.play()}),this.emit("play"))},writable:!0},pause:{value:function(){var e=this.components,t=Object.keys(e);this.isPlaying&&(this.isPlaying=!1,t.forEach(function(t){e[t].pause()}),this.getChildEntities().forEach(function(e){e.pause()}),this.emit("pause"))},writable:!0},setEntityAttribute:{value:function(e,t,i){return c[e]||this.components[e]?void this.updateComponent(e,i):"mixin"===e?void this.mixinUpdate(i,t):void 0}},mixinUpdate:{value:function(e,t){t=t||this.getAttribute("mixin"),this.updateStateMixins(e,t),this.updateComponents()}},setAttribute:{value:function(e,t,i){var r=this.sceneEl&&this.sceneEl.getAttribute("debug"),n=e.split(m)[0];return c[n]?("string"==typeof t&&void 0!==i?this.updateComponentProperty(e,t,i):this.updateComponent(e,t),void(r&&this.components[e].flushToDOM())):(s.prototype.setAttribute.call(this,e,t),void("mixin"===e&&this.mixinUpdate(t)))},writable:window.debug},flushToDOM:{value:function(e){function t(e){n[e].flushToDOM()}var i,r,n=this.components,o=this.children;if(Object.keys(n).forEach(t),e)for(r=0;r<o.length;++r)i=o[r],i.flushToDOM&&i.flushToDOM(e)}},getAttribute:{value:function(e){var t=this.components[e];return t?t.attrValue:HTMLElement.prototype.getAttribute.call(this,e)},writable:window.debug},getComputedAttribute:{value:function(e){var t=this.components[e];return t?t.getData():HTMLElement.prototype.getAttribute.call(this,e)}},addState:{value:function(e){this.is(e)||(this.states.push(e),this.mapStateMixins(e,this.registerMixin.bind(this)),this.emit("stateadded",{state:e}))}},removeState:{value:function(e){var t=this.states.indexOf(e);-1!==t&&(this.states.splice(t,1),this.mapStateMixins(e,this.unregisterMixin.bind(this)),this.emit("stateremoved",{state:e}))}},is:{value:function(e){return-1!==this.states.indexOf(e)}}});a=f("a-entity",{prototype:g}),t.exports=a},{"../lib/three":101,"../utils/":117,"./a-node":55,"./a-register-element":56,"./component":57}],54:[function(e,t){var i=e("./a-node"),r=e("./a-register-element").registerElement,n=e("./component").components;t.exports=r("a-mixin",{prototype:Object.create(i.prototype,{createdCallback:{value:function(){this.componentAttrCache={}}},attributeChangedCallback:{value:function(e,t,i){this.cacheAttribute(e,i)}},attachedCallback:{value:function(){this.cacheAttributes(),this.load()},writable:window.debug},setAttribute:{value:function(e,t){this.cacheAttribute(e,t),HTMLElement.prototype.setAttribute.call(this,e,t)},writable:window.debug},cacheAttribute:{value:function(e,t){var i=n[e];i&&(t=void 0===t?HTMLElement.prototype.getAttribute.call(this,e):t,this.componentAttrCache[e]=i.parseAttrValueForCache(t))}},getAttribute:{value:function(e){return this.componentAttrCache[e]||HTMLElement.prototype.getAttribute.call(this,e)},writable:window.debug},cacheAttributes:{value:function(){var e,t,i=this.attributes;for(t=0;t<i.length;++t)e=i[t].name,this.cacheAttribute(e)}}})})},{"./a-node":55,"./a-register-element":56,"./component":57}],55:[function(e,t){var i=e("./a-register-element").registerElement,r=e("../utils/");t.exports=i("a-node",{prototype:Object.create(HTMLElement.prototype,{createdCallback:{value:function(){this.hasLoaded=!1,this.isNode=!0,this.mixinEls=[],this.mixinObservers={}}},attachedCallback:{value:function(){var e=this.getAttribute("mixin");this.sceneEl=this.isScene?this:this.closestScene(),this.emit("nodeready",{},!1),e&&this.updateMixins(e)}},attributeChangedCallback:{value:function(e,t,i){"mixin"===e&&this.updateMixins(i,t)}},closestScene:{value:function(){for(var e=this;e&&!e.isScene;)e=e.parentElement;return e}},closest:{value:function(e){for(var t=this.matches||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector,i=this;i&&!t.call(i,e);)i=i.parentElement;return i}},detachedCallback:{value:function(){}},load:{value:function(e,t){var i,r,n=this;this.hasLoaded||(t=t||function(e){return e.isNode},i=this.getChildren(),r=i.filter(t).map(function(e){return new Promise(function(t){return e.hasLoaded?t():void e.addEventListener("loaded",t)})}),Promise.all(r).then(function(){n.hasLoaded=!0,e&&e(),n.emit("loaded",{},!1)}))},writable:!0},getChildren:{value:function(){for(var e=[],t=0;t<this.children.length;t++)e.push(this.children[t]);return e}},updateMixins:{value:function(e,t){var i=e.split(" "),r=t?t.split(" "):[],n=r.filter(function(e){return i.indexOf(e)<0});this.mixinEls=[],n.forEach(this.unregisterMixin.bind(this)),i.forEach(this.registerMixin.bind(this))}},registerMixin:{value:function(e){if(this.sceneEl){var t=this.sceneEl.querySelector("a-mixin#"+e);t&&(this.attachMixinListener(t),this.mixinEls.push(t))}}},setAttribute:{value:function(e,t){"mixin"===e&&this.updateMixins(t),HTMLElement.prototype.setAttribute.call(this,e,t)}},unregisterMixin:{value:function(e){var t,i,r=this.mixinEls;for(i=0;i<r.length;++i)if(t=r[i],e===t.id){r.splice(i,1);break}this.removeMixinListener(e)}},removeMixinListener:{value:function(e){var t=this.mixinObservers[e];t&&(t.disconnect(),this.mixinObservers[e]=null)}},attachMixinListener:{value:function(e){var t=this,i=e.id,r=this.mixinObservers[i];if(e&&!r){var n=new MutationObserver(function(e){var i=e[0].attributeName;t.applyMixin(i)}),o={attributes:!0};n.observe(e,o),this.mixinObservers[i]=n}}},applyMixin:{value:function(){}},emit:{value:function(e,t,i){var n=this;t=t||{},void 0===i&&(i=!0);var o={bubbles:!!i,detail:t};return e.split(" ").map(function(e){return r.fireEvent(n,e,o)})}},emitter:{value:function(e,t,i){var r=this;return function(){r.emit(e,t,i)}}}})})},{"../utils/":117,"./a-register-element":56}],56:[function(e,t){function i(e){var t={},i=["attachedCallback","attributeChangedCallback","createdCallback"];return n(t,i,l.prototype,e),a(e,t),t}function r(e){var t={},i=["attachedCallback","attributeChangedCallback","createdCallback"],r=["attributeChangedCallback","attachedCallback","createdCallback","detachedCallback"];return n(t,i,e,l.prototype),n(t,r,e,h.prototype),a(e,t),t}function n(e,t,i,r){t.forEach(function(t){o(e,t,i,r)})}function o(e,t,i,r){var n=i[t],o=r[t];if(n&&o&&n!==o){var a=function(){return o.apply(this,arguments),n.apply(this,arguments)};e[t]={value:a,writable:window.debug}}}function a(e,t){var i=Object.getOwnPropertyNames(e);i.forEach(function(i){var r;t[i]||(r=Object.getOwnPropertyDescriptor(e,i),t[i]={value:e[i],writable:r.writable})})}e("document-register-element");var s=document.registerElement,c=t.exports.knownTags={},u=function(e){c[e.toLowerCase()]=!0};t.exports.isNode=function(e){return e.tagName.toLowerCase()in c||e.isNode},t.exports.registerElement=function(e,t){var n=Object.getPrototypeOf(t.prototype),o=t,a=l&&n===l.prototype,c=h&&n===h.prototype;return(a||c)&&u(e),a&&(o=i(t.prototype),o={prototype:Object.create(n,o)}),c&&(o=r(t.prototype),o={prototype:Object.create(n,o)}),s.call(document,e,o)};var l=e("./a-node"),h=e("./a-entity")},{"./a-entity":53,"./a-node":55,"document-register-element":8}],57:[function(e,t){function i(e,t,i,n,o){function a(e){var i=e.getAttribute(t);i&&(s=r(s,i,u))}var s,c=void 0!==n&&null!==n,u=p(i),d=e.mixinEls;return u?s=i["default"]:(s={},Object.keys(i).forEach(function(e){s[e]=i[e]["default"]})),d.forEach(a),c?u?h(n,i):(s=r(s,n,u),l(s,i,void 0,t,o)):u?h(s,i):l(s,i,void 0,t,o)}function r(e,t,i){return i?t:c.extend(e,t)}function n(e){return function(){var t=this.el.sceneEl;this.isPlaying&&(e.call(this),this.isPlaying=!1,this.tick&&t.removeBehavior(this))}}function o(e){return function(){var t=this.el.sceneEl,i=this.el.isPlaying&&!this.isPlaying;this.initialized&&i&&(e.call(this),this.isPlaying=!0,this.tick&&t.addBehavior(this))}}var a=e("./schema"),s=e("./system"),c=e("../utils/"),u=t.exports.components={},l=a.parseProperties,h=a.parseProperty,d=a.process,p=a.isSingleProperty,f=a.stringifyProperties,m=a.stringifyProperty,g=c.styleParser,v=t.exports.Component=function(e,t,i){this.el=e,this.id=i,this.attrName=this.name+(i?"__"+i:""),this.updateCachedAttrValue(t)};v.prototype={schema:{},init:function(){},update:function(){},updateSchema:void 0,tick:void 0,play:function(){},pause:function(){},remove:function(){},parse:function(e,t){var i=this.schema;return p(i)?h(e,i):l(g.parse(e),i,!0,this.name,t)},stringify:function(e){var t=this.schema;return"string"==typeof e?e:p(t)?m(e,t):(e=f(e,t),g.stringify(e))},getData:function(){var e=this.data;return"object"!=typeof e?e:c.extend({},e)},updateCachedAttrValue:function(e){var t=p(this.schema),i=this.parseAttrValueForCache(e);this.attrValue=r({},i,t)},parseAttrValueForCache:function(e){var t;return"string"!=typeof e?e:(p(this.schema)?(t=this.schema.parse(e),"string"==typeof t&&(t=e)):t=g.parse(e),t)},flushToDOM:function(){var e=this.attrValue;e&&HTMLElement.prototype.setAttribute.call(this.el,this.attrName,this.stringify(e))},updateProperties:function(e){var t=this.el,n=p(this.schema),o=r({},this.data,n);this.updateCachedAttrValue(e),this.updateSchema&&this.updateSchema(i(t,this.name,this.schema,this.attrValue,!0)),this.data=i(t,this.name,this.schema,this.attrValue),(n||!c.deepEqual(o,this.data))&&(this.initialized?this.update(o):(this.init(),this.initialized=!0,this.update(o),t.isPlaying&&this.play()),t.emit("componentchanged",{id:this.id,name:this.name,newData:this.getData(),oldData:o}))},extendSchema:function(e){var t=c.extend({},u[this.name].schema);c.extend(t,e),this.schema=d(t),this.el.emit("schemachanged",{component:this.name})}},t.exports.registerComponent=function(e,t){var i,r={};if(-1!==e.indexOf("__"))throw new Error("The component name `"+e+"` is not allowed. The sequence __ (double underscore) is reserved to specify an id for multiple components of the same type");if(Object.keys(t).forEach(function(e){r[e]={value:t[e],writable:!0}}),u[e])throw new Error("The component `"+e+"` has been already registered. Check that you are not loading two versions of the same component or two different components of the same name.");return i=function(e,t,i){v.call(this,e,t,i),e.hasLoaded&&this.updateProperties(this.attrValue)},i.prototype=Object.create(v.prototype,r),i.prototype.name=e,i.prototype.constructor=i,i.prototype.system=s&&s.systems[e],i.prototype.play=o(i.prototype.play),i.prototype.pause=n(i.prototype.pause),u[e]={Component:i,dependencies:i.prototype.dependencies,multiple:i.prototype.multiple,parse:i.prototype.parse,parseAttrValueForCache:i.prototype.parseAttrValueForCache,schema:c.extend(d(i.prototype.schema)),stringify:i.prototype.stringify,type:i.prototype.type},i},t.exports.buildData=i},{"../utils/":117,"./schema":64,"./system":66}],58:[function(e,t){var i=e("./schema"),r=i.process,n=t.exports.geometries={},o=t.exports.geometryNames=[],a=e("../lib/three"),s=t.exports.Geometry=function(){};s.prototype={schema:{},init:function(){return this.geometry=new a.Geometry,this.geometry},update:function(){}},t.exports.registerGeometry=function(e,t){var i,a={};if(Object.keys(t).forEach(function(e){a[e]={value:t[e],writable:!0}}),n[e])throw new Error("The geometry `"+e+"` has been already registered");return i=function(){s.call(this)},i.prototype=Object.create(s.prototype,a),i.prototype.name=e,i.prototype.constructor=i,n[e]={Geometry:i,schema:r(i.prototype.schema)},o.push(e),i}},{"../lib/three":101,"./schema":64 }],59:[function(e,t){function i(e,t,i,r){return"type"in M?void y("Property type "+e+" is already registered."):void(M[e]={"default":t,parse:i||o,stringify:r||a})}function r(e){function t(e){return e.trim()}return Array.isArray(e)?e:e&&"string"==typeof e?e.split(",").map(t):[]}function n(e){return e.join(", ")}function o(e){return e}function a(e){return null===e?"null":e.toString()}function s(e){return"false"!==e&&e!==!1}function c(e){return parseInt(e,10)}function u(e){return parseFloat(e,10)}function l(e){return e?"string"!=typeof e?e:document.querySelector(e):null}function h(e){return e?"string"!=typeof e?e:Array.from(document.querySelectorAll(e)):null}function d(e){return e.getAttribute?"#"+e.getAttribute("id"):a(e)}function p(e){return e instanceof Array?e.map(function(e){return"#"+e.getAttribute("id")}).join(", "):a(e)}function f(e){var t=e.match(/\url\((.+)\)/);if(t)return t[1];var i=l(e);return i?i.getAttribute("src"):""}function m(e){return g.parse(e,this["default"])}var g=e("../utils/coordinates"),v=e("debug"),y=v("core:propertyTypes:warn"),M=t.exports.propertyTypes={};i("array",[],r,n),i("boolean",!1,s),i("color","#FFF",o,a),i("int",0,c),i("number",0,u),i("selector","",l,d),i("selectorAll","",h,p),i("src","",f),i("string","",o,a),i("time",0,c),i("vec2",{x:0,y:0},m,g.stringify),i("vec3",{x:0,y:0,z:0},m,g.stringify),i("vec4",{x:0,y:0,z:0,w:0},m,g.stringify),t.exports.registerPropertyType=i},{"../utils/coordinates":114,debug:3}],60:[function(e,t){function i(e,t){return t?{height:e.parentElement.offsetHeight,width:e.parentElement.offsetWidth}:{height:window.innerHeight,width:window.innerWidth}}var r=e("./metaTags").inject,n=e("./wakelock"),o=e("../a-register-element"),a=e("../system").systems,s=e("../../lib/three"),c=e("tween.js"),u=e("../../utils/"),l=e("../a-entity"),h=e("../a-node"),d=e("./postMessage"),p=u.checkHeadsetConnected,f=o.registerElement,m=u.isIOS(),g=u.isMobile();t.exports=f("a-scene",{prototype:Object.create(l.prototype,{defaultComponents:{value:{canvas:"","keyboard-shortcuts":"","vr-mode-ui":""}},createdCallback:{value:function(){this.isMobile=g,this.isIOS=m,this.isScene=!0,this.object3D=new s.Scene,this.systems={},this.time=0,this.init()}},init:{value:function(){this.behaviors=[],this.hasLoaded=!1,this.isPlaying=!1,this.originalHTML=this.innerHTML,this.addEventListener("render-target-loaded",function(){this.setupRenderer(),this.resize()}),this.addFullScreenStyles(),d(this)},writable:!0},addFullScreenStyles:{value:function(){var e=document.documentElement;e.classList.add("a-html"),document.body.classList.add("a-body"),this.classList.add("fullscreen")}},removeFullScreenStyles:{value:function(){var e=document.documentElement;e.classList.remove("a-html"),document.body.classList.remove("a-body"),this.classList.remove("fullscreen")}},attachedCallback:{value:function(){var e=this.resize.bind(this);r(this),n(this),this.initSystems(),window.addEventListener("load",e),window.addEventListener("resize",e),this.play()},writable:window.debug},initSystems:{value:function(){Object.keys(a).forEach(this.initSystem.bind(this))}},initSystem:{value:function(e){var t;this.systems[e]||(t=this.systems[e]=new a[e](this),t.init())}},detachedCallback:{value:function(){window.cancelAnimationFrame(this.animationFrameID),this.animationFrameID=null}},addBehavior:{value:function(e){var t=this.behaviors;-1===t.indexOf(e)&&t.push(e)}},enterVR:{value:function(e){function t(){r.addState("vr-mode"),r.emit("enter-vr",e),r.isMobile&&window.screen.orientation&&window.screen.orientation.lock("landscape"),r.addFullScreenStyles(),r.isMobile||r.requestFullscreen(),r.resize()}function i(e){throw new Error(e&&e.message?"Failed to enter VR mode (`requestPresent`): "+e.message:"Failed to enter VR mode (`requestPresent`).")}var r=this;if(!this.is("vr-mode"))return p()||this.isMobile?this.effect.requestPresent().then(t,i):void t()}},requestFullscreen:{value:function(){var e=this.canvas,t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen;t.apply(e)}},exitVR:{value:function(){function e(){var e=i.getAttribute("embedded");i.removeState("vr-mode"),i.isMobile&&window.screen.orientation&&window.screen.orientation.unlock(),e&&i.removeFullScreenStyles(),i.resize(),i.emit("exit-vr",{target:i})}function t(e){throw new Error(e&&e.message?"Failed to exit VR mode (`exitPresent`): "+e.message:"Failed to exit VR mode (`exitPresent`).")}var i=this;return this.is("vr-mode")?p()||this.isMobile?this.effect.exitPresent().then(e,t):void e():Promise.resolve()}},getAttribute:{value:function(e){var t=this.systems[e];return t?t.data:l.prototype.getAttribute.call(this,e)}},getComputedAttribute:{value:function(e){var t=this.systems[e];return t?t.data:l.prototype.getComputedAttribute.call(this,e)}},setAttribute:{value:function(e,t,i){var r=this.systems[e];return r?void h.prototype.setAttribute.call(this,e,t):void l.prototype.setAttribute.call(this,e,t,i)}},removeBehavior:{value:function(e){var t=this.behaviors,i=t.indexOf(e);-1!==i&&t.splice(i,1)}},resize:{value:function(){var e,t=this.camera,r=this.canvas,n=this.getAttribute("embedded")&&!this.is("vr-mode");t&&r&&(e=i(r,n),t.aspect=e.width/e.height,t.updateProjectionMatrix(),this.renderer.setSize(e.width,e.height))},writable:window.debug},setupRenderer:{value:function(){var e=this.canvas,t="true"===this.getAttribute("antialias"),i=this.renderer=new s.WebGLRenderer({canvas:e,antialias:t||window.hasNativeWebVRImplementation,alpha:!0});i.setPixelRatio(window.devicePixelRatio),i.sortObjects=!1,this.effect=new s.VREffect(i)},writable:window.debug},play:{value:function(){var e=this;return this.renderStarted?void l.prototype.play.call(this):(this.addEventListener("loaded",function(){this.renderStarted||(l.prototype.play.call(this),this.resize(),this.renderer&&(window.performance&&window.performance.mark("render-started"),this.render(0),this.renderStarted=!0,this.emit("renderstart")))}),void setTimeout(function(){l.prototype.load.call(e)}))}},reload:{value:function(e){function t(){i.isPlaying&&l.prototype.play.call(i)}var i=this;e&&this.pause(),this.innerHTML=this.originalHTML,this.init(),h.prototype.load.call(this,t)}},tick:{value:function(e,t){var i=this.systems;c.update(e),this.behaviors.forEach(function(i){i.el.isPlaying&&i.tick(e,t)}),Object.keys(i).forEach(function(r){i[r].tick&&i[r].tick(e,t)})}},render:{value:function(e){var t=this.camera,i=e-this.time;this.isPlaying&&this.tick(e,i),this.effect.render(this.object3D,t),this.time=e,this.animationFrameID=window.requestAnimationFrame(this.render.bind(this))},writable:window.debug}})})},{"../../lib/three":101,"../../utils/":117,"../a-entity":53,"../a-node":55,"../a-register-element":56,"../system":66,"./metaTags":61,"./postMessage":62,"./wakelock":63,"tween.js":18}],61:[function(e,t){function i(e){return{tagName:"meta",attributes:e,exists:function(){return document.querySelector('meta[name="'+e.name+'"]')}}}function r(e){return{tagName:"link",attributes:e,exists:function(){return document.querySelector('link[rel="'+e.rel+'"]')}}}function n(e){if(e&&e.tagName){var t=document.createElement(e.tagName);return o(t,e.attributes)}}var o=e("../../utils").extend,a=t.exports.MOBILE_HEAD_TAGS=[i({name:"viewport",content:"width=device-width,initial-scale=1,maximum-scale=1,shrink-to-fit=no,user-scalable=no,minimal-ui"}),i({name:"mobile-web-app-capable",content:"yes"}),i({name:"theme-color",content:"black"})],s=[i({name:"apple-mobile-web-app-capable",content:"yes"}),i({name:"apple-mobile-web-app-status-bar-style",content:"black"}),r({rel:"apple-touch-icon",href:"path_to_url"})];t.exports.inject=function(e){function t(e){e&&!e.exists()&&(i=n(e),i&&(o?o.parentNode.insertBefore(i,o):r.appendChild(i),c.push(i)))}var i,r=document.head,o=r.querySelector("script"),c=[];return a.forEach(t),e.isIOS&&s.forEach(t),c}},{"../../utils":117}],62:[function(e,t){function i(e){var t=this;if(e.data)switch(e.data.type){case"vr":switch(e.data.data){case"enter":t.enterVR();break;case"exit":t.exitVR()}}}var r=e("../../utils/").isIframed;t.exports=function(e){r()&&window.addEventListener("message",i.bind(e))}},{"../../utils/":117}],63:[function(e,t){var i=e("../../../vendor/wakelock/wakelock");t.exports=function(e){if(e.isMobile){var t=e.wakelock=new i;e.addEventListener("enter-vr",function(){t.request()}),e.addEventListener("exit-vr",function(){t.release()})}}},{"../../../vendor/wakelock/wakelock":126}],64:[function(e,t){function i(e){return"type"in e?"string"==typeof e.type:"default"in e}function r(e){var t,i=e["default"],r=e.type;return e.type?"bool"===e.type?r="boolean":"float"===e.type&&(r="number"):r=void 0!==i&&-1!==["boolean","number"].indexOf(typeof i)?typeof i:Array.isArray(i)?"array":"string",t=s[r],t||c("Unknown property type: "+r),e.parse=e.parse||t.parse,e.stringify=e.stringify||t.stringify,e.type=r,"default"in e||(e["default"]=t["default"]),e}function n(e,t){return e=void 0===e||null===e?t["default"]:e,t.parse(e)}function o(e,t){return"object"!=typeof e?e:t?t.stringify(e):JSON.stringify(e)}var a=e("../utils/debug"),s=e("./propertyTypes").propertyTypes,c=a("core:schema:warn");t.exports.isSingleProperty=i,t.exports.process=function(e){return i(e)?r(e):(Object.keys(e).forEach(function(t){e[t]=r(e[t])}),e)},t.exports.processPropertyDefinition=r,t.exports.parseProperties=function(e,t,i,r,o){var a=Object.keys(i?e:t);return null===e||"object"!=typeof e?e:(Object.keys(e).forEach(function(e){t[e]||o||c("Unknown property `"+e+"` for component/system `"+r+"`.")}),a.forEach(function(i){var r=t[i],o=e[i];t[i]&&(e[i]=n(o,r))}),e)},t.exports.parseProperty=n,t.exports.stringifyProperties=function(e,t){var i={};return Object.keys(e).forEach(function(r){var n=t[r],a=e[r],s=a;"object"==typeof s&&(s=o(a,n),n||c("Unknown component property: "+r)),i[r]=s}),i},t.exports.stringifyProperty=o},{"../utils/debug":115,"./propertyTypes":59}],65:[function(e,t){var i=e("./schema"),r=i.process,n=t.exports.shaders={},o=t.exports.shaderNames=[],a=e("../lib/three"),s={number:"f",time:"f",vec4:"v4",vec3:"v3",vec2:"v2",color:"v3"},c=t.exports.Shader=function(){};c.prototype={schema:{},vertexShader:"void main() {gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);}",fragmentShader:"void main() {gl_FragColor = vec4(1.0,0.0,1.0,1.0);}",init:function(e){return this.attributes=this.initVariables(e,"attribute"),this.uniforms=this.initVariables(e,"uniform"),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:this.vertexShader,fragmentShader:this.fragmentShader}),this.material},initVariables:function(e,t){function i(i){if(o[i].is===t){var a=s[o[i].type],c=o[i].parse(e[i]||o[i]["default"]);n[i]={type:a,value:r.parseValue(o[i].type,c)}}}var r=this,n={},o=this.schema,a=Object.keys(o);return a.forEach(i),n},update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform")},updateVariables:function(e,t){function i(i){a[i]&&a[i].is===t&&n[i].value!==e[i]&&(n[i].value=r.parseValue(a[i].type,e[i]),n[i].needsUpdate=!0)}var r=this,n="uniform"===t?this.uniforms:this.attributes,o=Object.keys(e),a=this.schema;o.forEach(i)},parseValue:function(e,t){var i;switch(e){case"vec2":return new a.Vector2(t.x,t.y);case"vec3":return new a.Vector3(t.x,t.y,t.z);case"vec4":return new a.Vector4(t.x,t.y,t.z,t.w);case"color":return i=new a.Color(t),new a.Vector3(i.r,i.g,i.b);default:return t}}},t.exports.registerShader=function(e,t){var i,a={};if(Object.keys(t).forEach(function(e){a[e]={value:t[e],writable:!0}}),n[e])throw new Error("The shader "+e+" has been already registered");return i=function(){c.call(this)},i.prototype=Object.create(c.prototype,a),i.prototype.name=e,i.prototype.constructor=i,n[e]={Shader:i,schema:r(i.prototype.schema)},o.push(e),i}},{"../lib/three":101,"./schema":64}],66:[function(e,t){var i=e("./component"),r=e("./schema"),n=e("../utils/"),o=r.parseProperties,a=r.parseProperty,s=r.process,c=r.isSingleProperty,u=n.styleParser,l=t.exports.systems={},h=t.exports.System=function(e){var t,r=i&&i.components[this.name],n=this.schema;return this.sceneEl=e,r&&(r.Component.prototype.system=this),Object.keys(n).length?(t=HTMLElement.prototype.getAttribute.call(e,this.name),c(n)?void(this.data=a(t,n)):void(this.data=o(u.parse(t)||{},n,!1,this.name))):void 0};h.prototype={schema:{},init:function(){},tick:void 0,play:function(){},pause:function(){}},t.exports.registerSystem=function(e,t){var i,r,o={},a=n.findAllScenes(document);if(Object.keys(t).forEach(function(e){o[e]={value:t[e],writable:!0}}),l[e])throw new Error("The system `"+e+"` has been already registered. Check that you are not loading two versions of the same system or two different systems of the same name.");for(r=function(e){h.call(this,e)},r.prototype=Object.create(h.prototype,o),r.prototype.name=e,r.prototype.constructor=r,r.prototype.schema=n.extend(s(r.prototype.schema)),l[e]=r,i=0;i<a.length;i++)a[i].initSystem(e)}},{"../utils/":117,"./component":57,"./schema":64}],67:[function(e){e("./pivot")},{"./pivot":68}],68:[function(e){var t=e("../../core/component").registerComponent,i=e("../../lib/three"),r=new i.Vector3,n=new i.Vector3;t("pivot",{dependencies:["position"],schema:{type:"vec3"},init:function(){var e=this.data,t=this.el,o=t.object3D.parent,a=t.object3D,s=new i.Group;r.copy(a.position),n.copy(a.rotation),o.remove(a),s.add(a),o.add(s),t.object3D=s,a.position.set(-1*e.x,-1*e.y,-1*e.z),s.position.set(e.x+r.x,e.y+r.y,e.z+r.z),s.rotation.copy(a.rotation),a.rotation.set(0,0,0)}})},{"../../core/component":57,"../../lib/three":101}],69:[function(e,t){var i=e("../../core/a-node"),r=e("../../core/a-register-element").registerElement,n=e("../../utils/"),o=n.entity.setComponentProperty;t.exports=r("a-event",{prototype:Object.create(i.prototype,{createdCallback:{value:function(){this.el=null,this.isAEvent=!0,this.name="",this.targetEls=[]}},attachedCallback:{value:function(){var e=this.getAttribute("target");this.el=this.parentNode,this.name=this.getAttribute("name")||this.getAttribute("type"),console.log("<a-event> has been DEPRECATED. Use path_to_url instead."),this.targetEls=e?this.el.sceneEl.querySelectorAll(e):[this.el],this.deprecated&&console.warn("<"+this.tagName.toLowerCase()+'> has been DEPRECATED. Use <a-event name="'+this.name+'"> instead.'),this.hasAttribute("type")&&console.log("<a-event type> has been DEPRECATED. Use <a-event name> instead."),this.listener=this.attachEventListener(),this.load()}},detachedCallback:{value:function(){var e=this.listener;e&&this.removeEventListener(this.name,e)}},attachEventListener:{value:function(){var e=this.attributes,t=this.el,i=this.name,r=this.targetEls;return t.addEventListener(i,function(){for(var t,i,n,a,s=0;s<r.length;s++)for(var c=0;c<e.length;c++)t=e[c],i=t.name,n=t.value,a=r[s],"target"!==i&&o(a,i,n)})}}})})},{"../../core/a-node":55,"../../core/a-register-element":56,"../../utils/":117}],70:[function(e,t){t.exports=function(){return{defaultComponents:{material:{}},mappings:{color:"material.color",metalness:"material.metalness",opacity:"material.opacity",repeat:"material.repeat",roughness:"material.roughness",shader:"material.shader",side:"material.side",src:"material.src",transparent:"material.transparent"},transforms:{src:function(e){return"#"===e[0]?e:"url("+e+")"}}}}},{}],71:[function(e){e("./primitives/a-camera"),e("./primitives/a-collada-model"),e("./primitives/a-cursor"),e("./primitives/a-curvedimage"),e("./primitives/a-image"),e("./primitives/a-light"),e("./primitives/a-obj-model"),e("./primitives/a-sky"),e("./primitives/a-sound"),e("./primitives/a-video"),e("./primitives/a-videosphere"),e("./primitives/meshPrimitives")},{"./primitives/a-camera":73,"./primitives/a-collada-model":74,"./primitives/a-cursor":75,"./primitives/a-curvedimage":76,"./primitives/a-image":77,"./primitives/a-light":78,"./primitives/a-obj-model":79,"./primitives/a-sky":80,"./primitives/a-sound":81,"./primitives/a-video":82,"./primitives/a-videosphere":83,"./primitives/meshPrimitives":84}],72:[function(e,t){var i=e("../../core/a-entity"),r=e("../../core/component").components,n=e("../../core/a-register-element").registerElement,o=e("../../utils/"),a=o.debug,s=o.entity.setComponentProperty,c=a("extras:primitives:debug"),u=t.exports.primitives={};t.exports.registerPrimitive=function(e,t){e=e.toLowerCase(),c("Registering <%s>",e),t.defaultAttributes&&console.warn("The 'defaultAttributes' object is deprecated. Use 'defaultComponents' instead.");var o=n(e,{prototype:Object.create(i.prototype,{defaultComponentsFromPrimitive:{value:t.defaultComponents||t.defaultAttributes||{}},deprecated:{value:t.deprecated||null},deprecatedMappings:{value:t.deprecatedMappings||{}},mappings:{value:t.mappings||{}},transforms:{value:t.transforms||{}},createdCallback:{value:function(){this.componentData={},t.deprecated&&console.warn(t.deprecated)}},attachedCallback:{value:function(){var e=this,t=this.attributes;this.applyDefaultComponents(),Object.keys(t).forEach(function(i){var r=t[i];e.syncAttributeToComponent(r.name,r.value)})}},attributeChangedCallback:{value:function(e,t,i){this.syncAttributeToComponent(e,i)}},applyDefaultComponents:{value:function(){var e=this,t=this.defaultComponentsFromPrimitive;Object.keys(t).forEach(function(i){var n=t[i];if(n instanceof Object){var o=r[i],a=e.getAttribute(i)||{},s=o.parse(a);return Object.keys(n).forEach(function(e){s[e]||(s[e]=n[e])}),void e.setAttribute(i,s)}e.setAttribute(i,n)})}},syncAttributeToComponent:{value:function(e,t){var i=this.mappings[e];e in this.deprecatedMappings&&console.warn(this.deprecatedMappings[e]),e&&i&&(t=this.getTransformedValue(e,t),s(this,i,t))}},getTransformedValue:{value:function(e,t){return this.transforms&&this.transforms[e]?this.transforms[e].bind(this)(t):t}}})});return u[e]=o,o}},{"../../core/a-entity":53,"../../core/a-register-element":56,"../../core/component":57,"../../utils/":117}],73:[function(e){var t=e("../primitives").registerPrimitive;t("a-camera",{defaultComponents:{camera:{},"look-controls":{},"wasd-controls":{}},mappings:{active:"camera.active",far:"camera.far",fov:"camera.fov","look-controls-enabled":"look-controls.enabled",near:"camera.near","wasd-controls-enabled":"wasd-controls.enabled",zoom:"camera.zoom"},deprecatedMappings:{"cursor-color":"a-camera[cursor-color] has been removed. Use a-cursor[color] instead.","cursor-maxdistance":"a-camera[cursor-maxdistance] has been removed. Use a-cursor[max-distance] instead.","cursor-offset":"a-camera[cursor-offset] has been removed. Use a-cursor[position] instead.","cursor-opacity":"a-camera[cursor-offset] has been removed. Use a-cursor[opacity] instead.","cursor-scale":"a-camera[cursor-scale] has been removed. Use a-cursor[scale] instead.","cursor-visible":"a-camera[cursor-visible] has been removed. Use a-cursor[visible] instead."}})},{"../primitives":72}],74:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-collada-model",r.extendDeep({},t(),{mappings:{src:"collada-model"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],75:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-cursor",r.extendDeep({},t(),{defaultComponents:{cursor:{},geometry:{primitive:"ring",radiusOuter:.016,radiusInner:.01,segmentsTheta:64},material:{color:"#000",shader:"flat",opacity:.8},position:{x:0,y:0,z:-1},raycaster:{far:1e3}},mappings:{far:"raycaster.far",fuse:"cursor.fuse",interval:"raycaster.interval",objects:"raycaster.objects","fuse-timeout":"cursor.fuseTimeout"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],76:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-curvedimage",r.extendDeep({},t(),{defaultComponents:{geometry:{height:1,primitive:"cylinder",radius:2,segmentsRadial:48,thetaLength:270,openEnded:!0,thetaStart:0},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0,repeat:"-1 1"}},mappings:{height:"geometry.height","open-ended":"geometry.openEnded",radius:"geometry.radius",segments:"geometry.segmentsRadial",start:"geometry.thetaStart","theta-length":"geometry.thetaLength","theta-start":"geometry.thetaStart",width:"geometry.thetaLength"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],77:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-image",r.extendDeep({},t(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],78:[function(e){var t=e("../primitives").registerPrimitive;t("a-light",{defaultComponents:{light:{}},mappings:{angle:"light.angle",color:"light.color","ground-color":"light.groundColor",decay:"light.decay",distance:"light.distance",intensity:"light.intensity",penumbra:"light.penumbra",type:"light.type"}})},{"../primitives":72}],79:[function(e){var t=e("../getMeshMixin")(),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-obj-model",r.extendDeep({},t,{mappings:{src:"obj-model.obj",mtl:"obj-model.mtl"},transforms:{mtl:t.transforms.src}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],80:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-sky",r.extendDeep({},t(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:20},material:{color:"#FFF",shader:"flat"},scale:"-1 1 1"},mappings:{radius:"geometry.radius","segments-width":"geometry.segmentsWidth","segments-height":"geometry.segmentsHeight"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],81:[function(e){var t=e("../primitives").registerPrimitive;t("a-sound",{defaultComponents:{sound:{}},mappings:{src:"sound.src",on:"sound.on",autoplay:"sound.autoplay",loop:"sound.loop",volume:"sound.volume"}})},{"../primitives":72}],82:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-video",r.extendDeep({},t(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],83:[function(e){var t=e("../getMeshMixin"),i=e("../primitives").registerPrimitive,r=e("../../../utils/");i("a-videosphere",r.extendDeep({},t(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:20},material:{color:"#FFF",shader:"flat"},scale:"-1 1 1"},mappings:{radius:"geometry.radius","segments-height":"geometry.segmentsHeight","segments-width":"geometry.segmentsWidth"}}))},{"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],84:[function(e,t){function i(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var r=e("../getMeshMixin"),n=e("../../../core/geometry").geometries,o=e("../../../core/geometry").geometryNames,a=e("../primitives").registerPrimitive,s=e("../../../utils/"),c=t.exports={};o.forEach(function(e){var t=n[e],o=i(e),u={};Object.keys(t.schema).forEach(function(e){u[i(e)]="geometry."+e});var l="a-"+o,h=a(l,s.extendDeep({},r(),{defaultComponents:{geometry:{primitive:e}},mappings:u}));c[l]=h})},{"../../../core/geometry":58,"../../../utils/":117,"../getMeshMixin":70,"../primitives":72}],85:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("box",{schema:{depth:{"default":1,min:0},height:{"default":1,min:0},width:{"default":1,min:0},segmentsHeight:{"default":1,min:1,max:20,type:"int"},segmentsWidth:{"default":1,min:1,max:20,type:"int"},segmentsDepth:{"default":1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new i.BoxGeometry(e.width,e.height,e.depth)}})},{"../core/geometry":58,"../lib/three":101}],86:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("circle",{schema:{radius:{"default":1,min:0},segments:{"default":32,min:3,type:"int"},thetaLength:{"default":360,min:0},thetaStart:{"default":0}},init:function(e){this.geometry=new i.CircleGeometry(e.radius,e.segments,r(e.thetaStart),r(e.thetaLength))}})},{"../core/geometry":58,"../lib/three":101}],87:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("cone",{schema:{height:{"default":1,min:0},openEnded:{"default":!1},radiusBottom:{"default":1,min:0},radiusTop:{"default":.8,min:0},segmentsHeight:{"default":18,min:1,type:"int"},segmentsRadial:{"default":36,min:3,type:"int"},thetaLength:{"default":360,min:0},thetaStart:{"default":0}},init:function(e){this.geometry=new i.CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,r(e.thetaStart),r(e.thetaLength))}})},{"../core/geometry":58,"../lib/three":101}],88:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("cylinder",{schema:{height:{"default":1,min:0},openEnded:{"default":!1},radius:{"default":1,min:0},segmentsHeight:{"default":18,min:1,type:"int"},segmentsRadial:{"default":36,min:3,type:"int"},thetaLength:{"default":360,min:0},thetaStart:{"default":0}},init:function(e){this.geometry=new i.CylinderGeometry(e.radius,e.radius,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,r(e.thetaStart),r(e.thetaLength))}})},{"../core/geometry":58,"../lib/three":101}],89:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("dodecahedron",{schema:{detail:{"default":0,min:0,max:5,type:"int"},radius:{"default":1,min:0}},init:function(e){this.geometry=new i.DodecahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":58,"../lib/three":101}],90:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("icosahedron",{schema:{detail:{"default":0,min:0,max:5,type:"int"},radius:{"default":1,min:0}},init:function(e){this.geometry=new i.IcosahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":58,"../lib/three":101}],91:[function(e){e("./box.js"),e("./circle.js"),e("./cone.js"),e("./cylinder.js"),e("./dodecahedron.js"),e("./icosahedron.js"),e("./octahedron.js"),e("./plane.js"),e("./ring.js"),e("./sphere.js"),e("./tetrahedron.js"),e("./torus.js"),e("./torusKnot.js")},{"./box.js":85,"./circle.js":86,"./cone.js":87,"./cylinder.js":88,"./dodecahedron.js":89,"./icosahedron.js":90,"./octahedron.js":92,"./plane.js":93,"./ring.js":94,"./sphere.js":95,"./tetrahedron.js":96,"./torus.js":97,"./torusKnot.js":98}],92:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("octahedron",{schema:{detail:{"default":0,min:0,max:5,type:"int"},radius:{"default":1,min:0}},init:function(e){this.geometry=new i.OctahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":58,"../lib/three":101}],93:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("plane",{schema:{height:{"default":1,min:0},width:{"default":1,min:0},segmentsHeight:{"default":1,min:1,max:20,type:"int"},segmentsWidth:{"default":1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new i.PlaneGeometry(e.width,e.height)}})},{"../core/geometry":58,"../lib/three":101}],94:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("ring",{schema:{radiusInner:{"default":.8,min:0},radiusOuter:{"default":1.2,min:0},segmentsPhi:{"default":10,min:1,type:"int"},segmentsTheta:{"default":32,min:3,type:"int"},thetaLength:{"default":360,min:0},thetaStart:{"default":0}},init:function(e){this.geometry=new i.RingGeometry(e.radiusInner,e.radiusOuter,e.segmentsTheta,e.segmentsPhi,r(e.thetaStart),r(e.thetaLength))}})},{"../core/geometry":58,"../lib/three":101}],95:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("sphere",{schema:{radius:{"default":1,min:0},phiLength:{"default":360},phiStart:{"default":0,min:0},thetaLength:{"default":180,min:0},thetaStart:{"default":0},segmentsHeight:{"default":18,min:2,type:"int"},segmentsWidth:{"default":36,min:3,type:"int"}},init:function(e){this.geometry=new i.SphereGeometry(e.radius,e.segmentsWidth,e.segmentsHeight,r(e.phiStart),r(e.phiLength),r(e.thetaStart),r(e.thetaLength))}})},{"../core/geometry":58,"../lib/three":101}],96:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("tetrahedron",{schema:{detail:{"default":0,min:0,max:5,type:"int"},radius:{"default":1,min:0}},init:function(e){this.geometry=new i.TetrahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":58,"../lib/three":101}],97:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three"),r=i.Math.degToRad;t("torus",{schema:{arc:{"default":360},radius:{"default":1,min:0},radiusTubular:{"default":.2,min:0},segmentsRadial:{"default":36,min:2,type:"int"},segmentsTubular:{"default":32,min:3,type:"int"}},init:function(e){this.geometry=new i.TorusGeometry(e.radius,2*e.radiusTubular,e.segmentsRadial,e.segmentsTubular,r(e.arc))}})},{"../core/geometry":58,"../lib/three":101}],98:[function(e){var t=e("../core/geometry").registerGeometry,i=e("../lib/three");t("torusKnot",{schema:{p:{"default":2,min:1,type:"int"},q:{"default":3,min:1,type:"int"},radius:{"default":1,min:0},radiusTubular:{"default":.2,min:0},segmentsRadial:{"default":36,min:3,type:"int"},segmentsTubular:{"default":100,min:3,type:"int"}},init:function(e){this.geometry=new i.TorusKnotGeometry(e.radius,2*e.radiusTubular,e.segmentsTubular,e.segmentsRadial,e.p,e.q)}})},{"../core/geometry":58,"../lib/three":101}],99:[function(e,t){window.Promise=window.Promise||e("promise-polyfill"),window.hasNativeWebVRImplementation=!!navigator.getVRDisplays||!!navigator.getVRDevices,window.WebVRConfig=window.WebVRConfig||{CARDBOARD_UI_DISABLED:!0,ROTATE_INSTRUCTIONS_DISABLED:!0,TOUCH_PANNER_DISABLED:!0,MOUSE_KEYBOARD_CONTROLS_DISABLED:!0,BUFFER_SCALE:1/window.devicePixelRatio},e("webvr-polyfill"),e("present"),e("./style/aframe.css"),e("./style/rStats.css");var i=e("./core/scene/a-scene"),r=e("./core/component").components,n=e("./core/component").registerComponent,o=e("./core/geometry").registerGeometry,a=e("./extras/primitives/primitives").registerPrimitive,s=e("./core/shader").registerShader,c=e("./core/system").registerSystem,u=e("./core/shader").shaders,l=e("./core/system").systems,h=window.THREE=e("./lib/three"),d=window.TWEEN=e("tween.js"),p=e("../package"),f=e("./utils/");e("./components/index"),e("./geometries/index"),e("./shaders/index"),e("./systems/index");var m=e("./core/a-node"),g=e("./core/a-entity");e("./core/a-animation"),e("./core/a-assets"),e("./core/a-cubemap"),e("./core/a-mixin"),e("./extras/components/"),e("./extras/declarative-events/"),e("./extras/primitives/"),console.log("A-Frame Version:",p.version),console.log("three Version:",p.dependencies.three),console.log("WebVR Polyfill Version:",p.dependencies["webvr-polyfill"]),t.exports=window.AFRAME={AEntity:g,ANode:m,AScene:i,components:r,geometries:e("./core/geometry").geometries,registerComponent:n,registerElement:e("./core/a-register-element").registerElement,registerGeometry:o,registerPrimitive:a,registerShader:s,registerSystem:c,primitives:{getMeshMixin:e("./extras/primitives/getMeshMixin"),primitives:e("./extras/primitives/primitives").primitives},schema:e("./core/schema"),shaders:u,systems:l,THREE:h,TWEEN:d,utils:f,version:p.version}},{"../package":20,"./components/index":27,"./core/a-animation":50,"./core/a-assets":51,"./core/a-cubemap":52,"./core/a-entity":53,"./core/a-mixin":54,"./core/a-node":55,"./core/a-register-element":56,"./core/component":57,"./core/geometry":58,"./core/scene/a-scene":60,"./core/schema":64,"./core/shader":65,"./core/system":66,"./extras/components/":67,"./extras/declarative-events/":69,"./extras/primitives/":71,"./extras/primitives/getMeshMixin":70,"./extras/primitives/primitives":72,"./geometries/index":91,"./lib/three":101,"./shaders/index":103, "./style/aframe.css":105,"./style/rStats.css":106,"./systems/index":109,"./utils/":117,present:10,"promise-polyfill":11,"tween.js":18,"webvr-polyfill":19}],100:[function(e,t){window.aframeStats=function(e){function t(){o("te").set(a.querySelectorAll("a-entity").length),o("lt").set(window.performance.getEntriesByName("render-started")[0].startTime.toFixed(0))}function i(){}function r(){}function n(e){o=e}var o=null,a=e,s={te:{caption:"Entities"},lt:{caption:"Load Time"}},c=[{caption:"A-Frame",values:["te","lt"]}];return{update:t,start:i,end:r,attach:n,values:s,groups:c,fractions:[]}},"object"==typeof t&&(t.exports={aframeStats:window.aframeStats})},{}],101:[function(e,t){(function(i){var r=i.THREE=e("three");r.TextureLoader&&(r.TextureLoader.prototype.crossOrigin="anonymous"),r.ImageLoader&&(r.ImageLoader.prototype.crossOrigin="anonymous"),r.Cache&&(r.Cache.enabled=!0),e("three/examples/js/loaders/OBJLoader"),e("three/examples/js/loaders/MTLLoader"),e("three/examples/js/BlendCharacter"),e("three/examples/js/loaders/ColladaLoader"),e("../../vendor/VRControls"),e("../../vendor/VREffect"),r.ColladaLoader.prototype.crossOrigin="anonymous",r.MTLLoader.prototype.crossOrigin="anonymous",r.OBJLoader.prototype.crossOrigin="anonymous",t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../vendor/VRControls":121,"../../vendor/VREffect":122,three:17,"three/examples/js/BlendCharacter":13,"three/examples/js/loaders/ColladaLoader":14,"three/examples/js/loaders/MTLLoader":15,"three/examples/js/loaders/OBJLoader":16}],102:[function(e,t){function i(e){return{fog:e.fog,color:new n.Color(e.color)}}var r=e("../core/shader").registerShader,n=e("../lib/three"),o=e("../utils/");t.exports.Component=r("flat",{schema:{color:{type:"color"},fog:{"default":!0},height:{"default":256},repeat:{"default":""},src:{"default":""},width:{"default":512}},init:function(e){this.textureSrc=null,this.material=new n.MeshBasicMaterial(i(e)),o.material.updateMap(this,e)},update:function(e){this.updateMaterial(e),o.material.updateMap(this,e)},updateMaterial:function(e){var t=this.material;e=i(e),Object.keys(e).forEach(function(i){t[i]=e[i]})}})},{"../core/shader":65,"../lib/three":101,"../utils/":117}],103:[function(e){e("./flat"),e("./standard")},{"./flat":102,"./standard":104}],104:[function(e,t){function i(e){return{color:new n.Color(e.color),fog:e.fog,metalness:e.metalness,roughness:e.roughness}}var r=e("../core/shader").registerShader,n=e("../lib/three"),o=e("../utils/"),a=new n.CubeTextureLoader,s={};t.exports.Component=r("standard",{schema:{color:{type:"color"},envMap:{"default":""},fog:{"default":!0},height:{"default":256},metalness:{"default":0,min:0,max:1},repeat:{"default":""},roughness:{"default":.5,min:0,max:1},src:{"default":""},width:{"default":512}},init:function(e){this.material=new n.MeshStandardMaterial(i(e)),o.material.updateMap(this,e),this.updateEnvMap(e)},update:function(e){this.updateMaterial(e),o.material.updateMap(this,e),this.updateEnvMap(e)},updateMaterial:function(e){var t=this.material;e=i(e),Object.keys(e).forEach(function(i){t[i]=e[i]})},updateEnvMap:function(e){var t=this,i=this.material,r=e.envMap;return!r||this.isLoadingEnvMap?(i.envMap=null,void(i.needsUpdate=!0)):(this.isLoadingEnvMap=!0,s[r]?void s[r].then(function(e){t.isLoadingEnvMap=!1,i.envMap=e,i.needsUpdate=!0}):void(s[r]=new Promise(function(e){o.srcLoader.validateCubemapSrc(r,function(r){a.load(r,function(r){t.isLoadingEnvMap=!1,i.envMap=r,e(r)})})})))}})},{"../core/shader":65,"../lib/three":101,"../utils/":117}],105:[function(e,t){var i=".a-html{bottom:0;left:0;position:fixed;right:0;top:0}.a-body{height:100%;margin:0;overflow:hidden;padding:0;width:100%}:-webkit-full-screen{background-color:transparent}.a-hidden{display:none!important}.a-canvas{height:100%;left:0;position:absolute;top:0;width:100%}.a-canvas.fullscreen{width:100%!important;height:100%!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:999999!important;position:fixed}a-scene{display:block;position:relative;height:100%;width:100%}a-assets,a-scene audio,a-scene img,a-scene video{display:none}.a-enter-vr-modal,.a-orientation-modal{font-family:Consolas,Andale Mono,Courier New,monospace}.a-enter-vr-modal a{border-bottom:1px solid #fff;padding:2px 0;text-decoration:none;transition:.1s color ease-in}.a-enter-vr-modal a:hover{background-color:#fff;color:#111;padding:2px 4px;position:relative;left:-4px}.a-enter-vr{font-family:sans-serif,monospace;font-size:13px;width:100%;font-weight:200;line-height:16px;height:10%;position:absolute;right:20px;bottom:20px}.a-enter-vr.embedded{right:5px;bottom:5px}.a-enter-vr-button,.a-enter-vr-modal,.a-enter-vr-modal a{color:#fff}.a-enter-vr-button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20245.82%20141.73%22%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill%3A%23fff%3Bfill-rule%3Aevenodd%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Emask%3C%2Ftitle%3E%3Cpath%20class%3D%22a%22%20d%3D%22M175.56%2C111.37c-22.52%2C0-40.77-18.84-40.77-42.07S153%2C27.24%2C175.56%2C27.24s40.77%2C18.84%2C40.77%2C42.07S198.08%2C111.37%2C175.56%2C111.37ZM26.84%2C69.31c0-23.23%2C18.25-42.07%2C40.77-42.07s40.77%2C18.84%2C40.77%2C42.07-18.26%2C42.07-40.77%2C42.07S26.84%2C92.54%2C26.84%2C69.31ZM27.27%2C0C11.54%2C0%2C0%2C12.34%2C0%2C28.58V110.9c0%2C16.24%2C11.54%2C30.83%2C27.27%2C30.83H99.57c2.17%2C0%2C4.19-1.83%2C5.4-3.7L116.47%2C118a8%2C8%2C0%2C0%2C1%2C12.52-.18l11.51%2C20.34c1.2%2C1.86%2C3.22%2C3.61%2C5.39%2C3.61h72.29c15.74%2C0%2C27.63-14.6%2C27.63-30.83V28.58C245.82%2C12.34%2C233.93%2C0%2C218.19%2C0H27.27Z%22%2F%3E%3C%2Fsvg%3E) 50% 50%/70% 70% no-repeat rgba(0,0,0,.35);border:0;bottom:0;cursor:pointer;min-width:50px;min-height:30px;padding-right:5%;padding-top:4%;position:absolute;right:0;transition:background-color .05s ease;-webkit-transition:background-color .05s ease;z-index:9999}.a-enter-vr-button.fullscreen{background:url(data:image/svg+xml;base64,your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashdHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZpZXdCb3g9IjAgMCAxNiAxNiI+your_sha256_hashyour_sha256_hashyour_sha256_hashLjV6Ij48L3BhdGg+your_sha256_hashyour_sha256_hashyour_sha256_hashPjwvcGF0aD4KPC9zdmc+Cg==) 50% 50%/60% 60% no-repeat rgba(0,0,0,.35);min-width:45px;min-height:45px}.a-enter-vr-button:active,.a-enter-vr-button:hover{background-color:#666}[data-a-enter-vr-no-webvr] .a-enter-vr-button{border-color:#666;opacity:.65}[data-a-enter-vr-no-webvr] .a-enter-vr-button:active,[data-a-enter-vr-no-webvr] .a-enter-vr-button:hover{background-color:rgba(0,0,0,.35);cursor:not-allowed}.a-enter-vr-modal{background-color:#666;border-radius:0;display:none;min-height:32px;margin-right:70px;padding:9px;width:280px;right:2%;position:absolute}.a-enter-vr-modal:after{border-bottom:10px solid transparent;border-left:10px solid #666;border-top:10px solid transparent;display:inline-block;content:'';position:absolute;right:-5px;top:5px;width:0;height:0}.a-enter-vr-modal a,.a-enter-vr-modal p{display:inline}.a-enter-vr-modal p{margin:0}.a-enter-vr-modal p:after{content:' '}[data-a-enter-vr-no-headset].a-enter-vr:hover .a-enter-vr-modal,[data-a-enter-vr-no-webvr].a-enter-vr:hover .a-enter-vr-modal{display:block}.a-orientation-modal{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2090%2090%22%20enable-background%3D%22new%200%200%2090%2090%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%220%2C0%200%2C0%200%2C0%20%22%3E%3C/polygon%3E%3Cg%3E%3Cpath%20d%3D%22M71.545%2C48.145h-31.98V20.743c0-2.627-2.138-4.765-4.765-4.765H18.456c-2.628%2C0-4.767%2C2.138-4.767%2C4.765v42.789%20%20%20c0%2C2.628%2C2.138%2C4.766%2C4.767%2C4.766h5.535v0.959c0%2C2.628%2C2.138%2C4.765%2C4.766%2C4.765h42.788c2.628%2C0%2C4.766-2.137%2C4.766-4.765V52.914%20%20%20C76.311%2C50.284%2C74.173%2C48.145%2C71.545%2C48.145z%20M18.455%2C16.935h16.344c2.1%2C0%2C3.808%2C1.708%2C3.808%2C3.808v27.401H37.25V22.636%20%20%20c0-0.264-0.215-0.478-0.479-0.478H16.482c-0.264%2C0-0.479%2C0.214-0.479%2C0.478v36.585c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h7.507v7.644%20%20%20h-5.534c-2.101%2C0-3.81-1.709-3.81-3.81V20.743C14.645%2C18.643%2C16.354%2C16.935%2C18.455%2C16.935z%20M16.96%2C23.116h19.331v25.031h-7.535%20%20%20c-2.628%2C0-4.766%2C2.139-4.766%2C4.768v5.828h-7.03V23.116z%20M71.545%2C73.064H28.757c-2.101%2C0-3.81-1.708-3.81-3.808V52.914%20%20%20c0-2.102%2C1.709-3.812%2C3.81-3.812h42.788c2.1%2C0%2C3.809%2C1.71%2C3.809%2C3.812v16.343C75.354%2C71.356%2C73.645%2C73.064%2C71.545%2C73.064z%22%3E%3C/path%3E%3Cpath%20d%3D%22M28.919%2C58.424c-1.466%2C0-2.659%2C1.193-2.659%2C2.66c0%2C1.466%2C1.193%2C2.658%2C2.659%2C2.658c1.468%2C0%2C2.662-1.192%2C2.662-2.658%20%20%20C31.581%2C59.617%2C30.387%2C58.424%2C28.919%2C58.424z%20M28.919%2C62.786c-0.939%2C0-1.703-0.764-1.703-1.702c0-0.939%2C0.764-1.704%2C1.703-1.704%20%20%20c0.94%2C0%2C1.705%2C0.765%2C1.705%2C1.704C30.623%2C62.022%2C29.858%2C62.786%2C28.919%2C62.786z%22%3E%3C/path%3E%3Cpath%20d%3D%22M69.654%2C50.461H33.069c-0.264%2C0-0.479%2C0.215-0.479%2C0.479v20.288c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h36.585%20%20%20c0.263%2C0%2C0.477-0.214%2C0.477-0.478V50.939C70.131%2C50.676%2C69.917%2C50.461%2C69.654%2C50.461z%20M69.174%2C51.417V70.75H33.548V51.417H69.174z%22%3E%3C/path%3E%3Cpath%20d%3D%22M45.201%2C30.296c6.651%2C0%2C12.233%2C5.351%2C12.551%2C11.977l-3.033-2.638c-0.193-0.165-0.507-0.142-0.675%2C0.048%20%20%20c-0.174%2C0.198-0.153%2C0.501%2C0.045%2C0.676l3.883%2C3.375c0.09%2C0.075%2C0.198%2C0.115%2C0.312%2C0.115c0.141%2C0%2C0.273-0.061%2C0.362-0.166%20%20%20l3.371-3.877c0.173-0.2%2C0.151-0.502-0.047-0.675c-0.194-0.166-0.508-0.144-0.676%2C0.048l-2.592%2C2.979%20%20%20c-0.18-3.417-1.629-6.605-4.099-9.001c-2.538-2.461-5.877-3.817-9.404-3.817c-0.264%2C0-0.479%2C0.215-0.479%2C0.479%20%20%20C44.72%2C30.083%2C44.936%2C30.296%2C45.201%2C30.296z%22%3E%3C/path%3E%3C/g%3E%3C/svg%3E) center/50% 50% no-repeat rgba(244,244,244,1);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-orientation-modal:after{color:#666;content:\"Insert phone into Cardboard holder.\";display:block;position:absolute;text-align:center;top:70%;transform:translateY(-70%);width:100%}.a-orientation-modal button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20100%20100%22%20enable-background%3D%22new%200%200%20100%20100%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M55.209%2C50l17.803-17.803c1.416-1.416%2C1.416-3.713%2C0-5.129c-1.416-1.417-3.713-1.417-5.129%2C0L50.08%2C44.872%20%20L32.278%2C27.069c-1.416-1.417-3.714-1.417-5.129%2C0c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129L44.951%2C50L27.149%2C67.803%20%20c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129c0.708%2C0.708%2C1.636%2C1.062%2C2.564%2C1.062c0.928%2C0%2C1.856-0.354%2C2.564-1.062L50.08%2C55.13l17.803%2C17.802%20%20c0.708%2C0.708%2C1.637%2C1.062%2C2.564%2C1.062s1.856-0.354%2C2.564-1.062c1.416-1.416%2C1.416-3.713%2C0-5.129L55.209%2C50z%22%3E%3C/path%3E%3C/svg%3E) no-repeat;border:none;height:50px;text-indent:-9999px;width:50px}";e("browserify-css").createStyle(i,{href:"src/style/aframe.css"}),t.exports=i},{"browserify-css":1}],106:[function(e,t){var i=".rs-base{background-color:#333;border-radius:0;font:10px monospace;left:5px;line-height:1em;opacity:.85;overflow:hidden;padding:10px;position:fixed;top:5px;width:300px;z-index:10000}.rs-base div.hidden{display:none}.rs-base h1{color:#fff;cursor:pointer;font-size:1.4em;font-weight:300;margin:0 0 5px;padding:0}.rs-group{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column-reverse;flex-direction:column-reverse;margin-bottom:5px}.rs-group:last-child{margin-bottom:0}.rs-counter-base{align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;height:10px;-webkit-justify-content:space-between;justify-content:space-between;margin:2px 0}.rs-counter-id{font-weight:300;-webkit-box-ordinal-group:0;-webkit-order:0;order:0;width:54px}.rs-counter-value{font-weight:300;-webkit-box-ordinal-group:1;-webkit-order:1;order:1;text-align:right;width:35px}.rs-canvas{-webkit-box-ordinal-group:2;-webkit-order:2;order:2}@media (min-width:480px){.rs-base{left:20px;top:20px}}";e("browserify-css").createStyle(i,{href:"src/style/rStats.css"}),t.exports=i},{"browserify-css":1}],107:[function(e,t){function i(e){var t,i=e.camera;i&&(t=e.querySelector("["+n+"]"),t&&e.removeChild(t))}var r=e("../core/system").registerSystem,n="data-aframe-default-camera",o=1.8;t.exports.System=r("camera",{init:function(){this.activeCameraEl=null,this.setupDefaultCamera()},setupDefaultCamera:function(){function e(){var e=r.camera;return e?void r.emit("camera-ready",{cameraEl:e.el}):(t=document.createElement("a-entity"),t.setAttribute("position","0 0 0"),t.setAttribute(n,""),t.setAttribute("camera",{active:!0,userHeight:o}),t.setAttribute("wasd-controls",""),t.setAttribute("look-controls",""),r.appendChild(t),r.addEventListener("enter-vr",i.removeDefaultOffset),r.addEventListener("exit-vr",i.addDefaultOffset),void r.emit("camera-ready",{cameraEl:t}))}var t,i=this,r=this.sceneEl;setTimeout(e)},disableActiveCamera:function(){var e=this.sceneEl.querySelectorAll("[camera]"),t=e[e.length-1];t.setAttribute("camera","active",!0)},setActiveCamera:function(e){var t,r,o=this.sceneEl.querySelectorAll("[camera]"),a=this.sceneEl,s=e.getObject3D("camera"),c=this.activeCameraEl;if(s&&e!==this.activeCameraEl){var u=a.querySelector("["+n+"]"),l=u&&u.querySelector("[camera]");for(e!==l&&i(a),this.activeCameraEl=e,this.activeCameraEl.play(),a.camera=s,c&&c.setAttribute("camera","active",!1),r=0;r<o.length;r++)t=o[r],e!==t&&(t.setAttribute("camera","active",!1),t.pause());a.emit("camera-set-active",{cameraEl:e})}}})},{"../core/system":66}],108:[function(e,t){function i(e){var t=e.primitive,i=a[t]&&a[t].Geometry,r=new i;if(!i)throw new Error("Unknown geometry `"+t+"`");return r.init(e),o(r.geometry,e.buffer)}function r(e,t){e[t]--}function n(e,t){e[t]=void 0===e[t]?1:e[t]+1}function o(e,t){var i;return t?(i=(new c.BufferGeometry).fromGeometry(e),i.metadata={type:e.type,parameters:e.parameters||{}},e.dispose(),i):e}var a=e("../core/geometry").geometries,s=e("../core/system").registerSystem,c=e("../lib/three");t.exports.System=s("geometry",{init:function(){this.cache={},this.cacheCount={}},clearCache:function(){this.cache={},this.cacheCount={}},getOrCreateGeometry:function(e){var t,r,o=this.cache;return e.skipCache?i(e):(r=this.hash(e),t=o[r],n(this.cacheCount,r),t?t:(t=i(e),o[r]=t,t))},unuseGeometry:function(e){var t,i,n=this.cache,o=this.cacheCount;e.skipCache||(i=this.hash(e),n[i]&&(r(o,i),o[i]>0||(t=n[i],t.dispose(),delete n[i],delete o[i])))},hash:function(e){return JSON.stringify(e)}})},{"../core/geometry":58,"../core/system":66,"../lib/three":101}],109:[function(e){e("./camera"),e("./geometry"),e("./light"),e("./material"),e("./tracked-controls")},{"./camera":107,"./geometry":108,"./light":110,"./material":111,"./tracked-controls":112}],110:[function(e,t){var i=e("../core/system").registerSystem,r="data-aframe-default-light";t.exports.System=i("light",{init:function(){this.defaultLightsEnabled=null,this.setupDefaultLights()},registerLight:function(e){var t,i=this.sceneEl;if(this.defaultLightsEnabled&&!e.hasAttribute(r)){t=document.querySelectorAll("["+r+"]");for(var n=0;n<t.length;n++)i.removeChild(t[n]);this.defaultLightsEnabled=!1}},setupDefaultLights:function(){var e=this.sceneEl,t=document.createElement("a-entity"),i=document.createElement("a-entity");t.setAttribute("light",{color:"#BBB",type:"ambient"}),t.setAttribute(r,""),e.appendChild(t),i.setAttribute("light",{color:"#FFF",intensity:.6}),i.setAttribute("position",{x:-.5,y:1,z:1}),i.setAttribute(r,""),e.appendChild(i),this.defaultLightsEnabled=!0}})},{"../core/system":66}],111:[function(e,t){function i(e,t){var i,r,n,o=t.getAttribute("id");if(o)return o;for(r="",n=e||{},i=0;i<t.attributes.length;i++)n[t.attributes[i].name]=t.attributes[i].value;return Object.keys(n).sort().forEach(function(e){r+=e+":"+n[e]+";"}),r}function r(e,t){function i(i){function r(e){n(e,t),e.needsUpdate=!0,i(e)}var o="string"!=typeof e;return o?void r(new c.Texture(e)):void d.load(e,r,function(){},function(e){h("`$s` could not be fetched (Error code: %s; Response: %s)",e.status,e.statusText)})}return new Promise(i)}function n(e,t){var i=t.repeat||"1 1",r=i.split(" ");"1 1"!==i&&2===r.length&&(e.wrapS=c.RepeatWrapping,e.wrapT=c.RepeatWrapping,e.repeat.set(parseFloat(r[0]),parseFloat(r[1])))}function o(e,t,i){var r=document.createElement("video");return r.width=t,r.height=i,r.setAttribute("webkit-playsinline",""),r.autoplay=!0,r.loop=!0,r.crossOrigin="anonymous",r.addEventListener("error",function(){p("`$s` is not a valid video",e)},!0),r.src=e,r}function a(e){return e.autoplay="false"!==e.getAttribute("autoplay"),e.controls="false"!==e.getAttribute("controls"),"false"===e.getAttribute("loop")&&e.removeAttribute("loop"),"false"===e.getAttribute("preload")&&(e.preload="none"),e.crossOrigin=e.crossOrigin||"anonymous",e.setAttribute("webkit-playsinline",""),e}var s=e("../core/system").registerSystem,c=e("../lib/three"),u=e("../utils/"),l=u.debug,h=l("components:texture:error"),d=new c.TextureLoader,p=l("components:texture:warn");t.exports.System=s("material",{init:function(){this.materials={},this.textureCache={}},clearTextureCache:function(){this.textureCache={}},loadTexture:function(e,t,i){function r(e){a.loadImage(e,t,i)}function n(e){a.loadVideo(e,t,i)}function o(e){a.loadCanvas(e,t,i)}var a=this;u.srcLoader.validateSrc(e,r,n,o)},loadImage:function(e,t,i){var n=this.hash(t),o=i,a=this.textureCache;return a[n]?void a[n].then(o):(a[n]=r(e,t),void a[n].then(o))},loadCanvas:function(e,t,i){e.readyState=2,e.HAVE_CURRENT_DATA=2,this.loadVideo(e,t,i)},loadVideo:function(e,t,i){function r(e){e.texture.needsUpdate=!0,i(e.texture,e.videoEl)}var s,u,l,h,d=this.textureCache;if("string"!=typeof e){if(l=e,s=this.hashVideo(t,l),d[s])return void d[s].then(r);a(l)}return l=l||o(e,t.width,t.height),s=this.hashVideo(t,l),d[s]?void d[s].then(r):(u=new c.VideoTexture(l),u.minFilter=c.LinearFilter,n(u,t),h={texture:u,videoEl:l},d[s]=Promise.resolve(h),void r(h))},hash:function(e){return JSON.stringify(e)},hashVideo:function(e,t){return i(e,t)},registerMaterial:function(e){this.materials[e.uuid]=e},unregisterMaterial:function(e){delete this.materials[e.uuid]},updateMaterials:function(){var e=this.materials;Object.keys(e).forEach(function(t){e[t].needsUpdate=!0})}})},{"../core/system":66,"../lib/three":101,"../utils/":117}],112:[function(e,t){var i=e("../core/system").registerSystem;t.exports.System=i("tracked-controls",{init:function(){var e=this;this.controllers=[],navigator.getVRDisplays&&navigator.getVRDisplays().then(function(t){t.length>0&&(e.vrDisplay=t[0])})},tick:function(){var e,t,i=navigator.getGamepads&&navigator.getGamepads(),r=this.controllers=[];if(i)for(t=0;t<i.length;++t)e=i[t],e&&e.pose&&r.push(e)}})},{"../core/system":66}],113:[function(e,t){var i=e("../lib/three"),r=new i.Object3D,n=new i.VRControls(r);t.exports=function(){var e;return n.update(),e=r.quaternion,0!==e._x||0!==e._y||0!==e._z?!0:void 0}},{"../lib/three":101}],114:[function(e,t){function i(e,t){var i,r={};return e&&"object"==typeof e?n(e):"string"!=typeof e||null===e?t:(i=e.trim().replace(/\s+/g," ").split(" "),r.x=i[0]||t&&t.x,r.y=i[1]||t&&t.y,r.z=i[2]||t&&t.z,r.w=i[3]||t&&t.w,n(r))}function r(e){return"object"!=typeof e?e:[e.x,e.y,e.z,e.w].join(" ").trim()}function n(e){return Object.keys(e).forEach(function(t){return void 0===e[t]?void delete e[t]:void(e[t]=parseFloat(e[t],10))}),e}var o=/\s*(-?\d*\.{0,1}\d+)\s+(-?\d*\.{0,1}\d+)\s+(-?\d*\.{0,1}\d+)\s*/;t.exports.regex=o,t.exports.parse=i,t.exports.stringify=r,t.exports.isCoordinate=function(e){return o.test(e)},t.exports.toVector3=function(e){return new THREE.Vector3(e.x,e.y,e.z)}},{}],115:[function(e,t){(function(i){function r(e){var t=e.split(":");return t[t.length-1]}function n(e){var t=r(e),i=c.colors&&c.colors[t];return i||null}function o(){try{return window.localStorage}catch(e){}}var a=e("debug"),s=e("object-assign"),c={colors:{debug:"gray",error:"red",info:"gray",warn:"orange"}},u=function(e){var t=a(e);return t.color=n(e),t};s(u,a);var l=o();u.enable(l&&(parseInt(l.logs,10)||"true"===l.logs)?"*":"*:error,*:info,*:warn"),i.browser&&(window.logs=u),t.exports=u}).call(this,e("_process"))},{_process:2,debug:3,"object-assign":9}],116:[function(e,t){t.exports.getComponentProperty=function(e,t,i){var r;return i=i||".",-1!==t.indexOf(i)?(r=t.split(i),e.getComputedAttribute(r[0])[r[1]]):e.getComputedAttribute(t)},t.exports.setComponentProperty=function(e,t,i,r){var n;return r=r||".",-1!==t.indexOf(r)?(n=t.split(r),void e.setAttribute(n[0],n[1],i)):void e.setAttribute(t,i)}},{}],117:[function(e,t){function i(e,t){var i,r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;if(0===r.length)return e===t;for(i=0;i<r.length;++i)if(e[r[i]]!==t[r[i]])return!1;return!0}var r=e("deep-assign"),n=e("object-assign");t.exports.coordinates=e("./coordinates"),t.exports.checkHeadsetConnected=e("./checkHeadsetConnected"),t.exports.debug=e("./debug"),t.exports.entity=e("./entity"),t.exports.material=e("./material"),t.exports.styleParser=e("./styleParser"),t.exports.fireEvent=function(e,t,i){i=i||{},i.detail=i.detail||{},i.detail.target=i.detail.target||e;var r=new CustomEvent(t,i);r.target=e,e.dispatchEvent(r)},t.exports.extend=n,t.exports.extendDeep=r,t.exports.deepEqual=i,t.exports.diff=function(e,t){var r={},n=Object.keys(e);return Object.keys(t).forEach(function(e){-1===n.indexOf(e)&&n.push(e)}),n.forEach(function(n){var o=e[n],a=t[n],s=o&&a&&o.constructor===Object&&a.constructor===Object;(s&&!i(o,a)||!s&&o!==a)&&(r[n]=a)}),r},t.exports.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),o()&&(e=!0),a()&&(e=!1)}(navigator.userAgent||navigator.vendor||window.opera),e};var o=t.exports.isIOS=function(){return/iPad|iPhone|iPod/.test(navigator.platform)},a=t.exports.isGearVR=function(){return/SamsungBrowser.+Mobile VR/i.test(navigator.userAgent)};t.exports.isLandscape=function(){return 90===window.orientation||-90===window.orientation},t.exports.shouldCaptureKeyEvent=function(e){return e.shiftKey||e.metaKey||e.altKey||e.ctrlKey?!1:document.activeElement===document.body},t.exports.splitString=function(e,t){"undefined"==typeof t&&(t=" ");var i=new RegExp(t,"g");return e=(e||"").replace(i,t),e.split(t)},t.exports.getElData=function(e,t){function i(t){e.hasAttribute(t)&&(r[t]=e.getAttribute(t))}t=t||{};var r={};return Object.keys(t).forEach(i),r},t.exports.getUrlParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),i=t.exec(location.search);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))},t.exports.isIframed=function(){return window.top!==window.self},t.exports.findAllScenes=function(e){for(var t=[],i=e.getElementsByTagName("*"),r=0,n=i.length;n>r;r++)i[r].isScene&&t.push(i[r]);return t},t.exports.srcLoader=e("./src-loader")},{"./checkHeadsetConnected":113,"./coordinates":114,"./debug":115,"./entity":116,"./material":118,"./src-loader":119,"./styleParser":120,"deep-assign":6,"object-assign":9}],118:[function(e,t){function i(e,t){t&&(e.emit("materialtextureloaded",{src:t.image,texture:t}),"VIDEO"===t.image.tagName&&(t.image.addEventListener("loadeddata",function(){e.emit("materialvideoloadeddata",{src:t.image,texture:t})}),t.image.addEventListener("ended",function(){e.emit("materialvideoended",{src:t.image,texture:t})})))}t.exports.updateMap=function(e,t){function r(e){o.map=e,o.needsUpdate=!0,i(n,e)}var n=e.el,o=e.material,a=t.src;if(a){if(a===e.textureSrc)return;return e.textureSrc=a,void n.sceneEl.systems.material.loadTexture(a,{src:a,repeat:t.repeat},r)}o.map&&r(null)},t.exports.handleTextureEvents=i},{}],119:[function(e,t){function i(e,t,i,r){var s,u,l,h,d=n(e);return d?void o(d,function(e){return e?void t(d):void i(d)}):(s=a(e))?(u=s&&"IMG"===s.tagName,l=s&&"VIDEO"===s.tagName,h=s&&"CANVAS"===s.tagName,u?t(s):l?i(s):h?r(s):void c('"%s" does not point to a valid <img>, <video>, or <canvas> element',e)):void 0}function r(e,t){function r(e){l.push(e),6===l.length&&t(l)}var n,o,s,u="",l=[];for(o=0;6>o;o++)u+="url((.+))s*,s*";if(s=e.match(u))for(o=1;7>o;o++)i(s[o],r);else if(n=a(e))return"A-CUBEMAP"===n.tagName&&n.srcs?t(n.srcs):void c('Selector "%s" does not point to <a-cubemap>',e)}function n(e){var t=e.match(/\url\((.+)\)/);if(t)return t[1]}function o(e,t){function i(){t(!0)}function r(){t(!1)}var n=new Image;n.addEventListener("load",i),n.addEventListener("error",r),n.src=e}function a(e){try{var t=document.querySelector(e);return t||c('No element was found matching the selector: "%s"',e),t}catch(i){return void c('"%s" is not a valid selector',e)}}var s=e("./debug"),c=s("utils:src-loader:warn");t.exports={parseUrl:n,validateSrc:i,validateCubemapSrc:r}},{"./debug":115}],120:[function(e,t){function i(e){function t(e){return e[1].toUpperCase()}return e.replace(/-([a-z])/g,t)}function r(e){var t=Object.keys(e),r={};return t.forEach(function(t){var n=i(t);r[n]=e[t]}),r}var n=e("style-attr");t.exports.parse=function(e){var t;return"string"!=typeof e?e:(t=n.parse(e),t[""]?e:r(t))},t.exports.stringify=function(e){return"string"==typeof e?e:n.stringify(e)},t.exports.toCamelCase=i,t.exports.transformKeysToCamelCase=r},{"style-attr":12}],121:[function(){THREE.VRControls=function(e,t){function i(e){for(var i=0;i<e.length;i++)if("VRDisplay"in window&&e[i]instanceof VRDisplay||"PositionSensorVRDevice"in window&&e[i]instanceof PositionSensorVRDevice){r=e[i];break}r||t&&t("VR input not available.")}var r,n=this,o=new THREE.Matrix4;navigator.getVRDisplays?navigator.getVRDisplays().then(i):navigator.getVRDevices&&navigator.getVRDevices().then(i),this.scale=1,this.standing=!1,this.userHeight=1.6,this.update=function(){if(r){if(r.getPose){var t=r.getPose();null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0)}else{var i=r.getState();null!==i.orientation&&e.quaternion.copy(i.orientation),null!==i.position?e.position.copy(i.position):e.position.set(0,0,0)}this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(n.scale)}},this.resetPose=function(){r&&(void 0!==r.resetPose?r.resetPose():void 0!==r.resetSensor?r.resetSensor():void 0!==r.zeroSensor&&r.zeroSensor())},this.resetSensor=function(){console.warn("THREE.VRControls: .resetSensor() is now .resetPose()."),this.resetPose()},this.zeroSensor=function(){console.warn("THREE.VRControls: .zeroSensor() is now .resetPose()."),this.resetPose()},this.dispose=function(){r=null}}},{}],122:[function(){THREE.VREffect=function(e,t){function i(e){for(var i=0;i<e.length;i++){if("VRDisplay"in window&&e[i]instanceof VRDisplay){a=e[i],h=!1;break}if("HMDVRDevice"in window&&e[i]instanceof HMDVRDevice){a=e[i],h=!0;break}}void 0===a&&t&&t("HMD not available")}function r(e){var t=2/(e.leftTan+e.rightTan),i=(e.leftTan-e.rightTan)*t*.5,r=2/(e.upTan+e.downTan),n=(e.upTan-e.downTan)*r*.5;return{scale:[t,r],offset:[i,n]}}function n(e,t,i,n){t=void 0===t?!0:t,i=void 0===i?.01:i,n=void 0===n?1e4:n;var o=t?-1:1,a=new THREE.Matrix4,s=a.elements,c=r(e);return s[0]=c.scale[0],s[1]=0,s[2]=c.offset[0]*o,s[3]=0,s[4]=0,s[5]=c.scale[1],s[6]=-c.offset[1]*o,s[7]=0,s[8]=0,s[9]=0,s[10]=n/(i-n)*-o,s[11]=n*i/(i-n),s[12]=0,s[13]=0,s[14]=o,s[15]=0,a.transpose(),a}function o(e,t,i,r){var o=Math.PI/180,a={upTan:Math.tan(e.upDegrees*o),downTan:Math.tan(e.downDegrees*o),leftTan:Math.tan(e.leftDegrees*o),rightTan:Math.tan(e.rightDegrees*o)};return n(a,t,i,r)}var a,s,c,u,l,h=!1,d=new THREE.Vector3,p=new THREE.Vector3;navigator.getVRDisplays?navigator.getVRDisplays().then(i):navigator.getVRDevices&&navigator.getVRDevices().then(i),this.scale=1;var f=!1,m=e.getSize(),g=e.getPixelRatio();this.setSize=function(t,i){if(m={width:t,height:i},f){var r=a.getEyeParameters("left");e.setPixelRatio(1),h?e.setSize(2*r.renderRect.width,r.renderRect.height,!1):e.setSize(2*r.renderWidth,r.renderHeight,!1)}else e.setPixelRatio(g),e.setSize(t,i)};var v=e.domElement,y=v.mozRequestFullScreen?"mozfullscreenchange":"webkitfullscreenchange";document.addEventListener(y,function(){if(f=void 0!==a&&(a.isPresenting||h&&void 0!==(document.mozFullScreenElement||document.webkitFullscreenElement))){g=e.getPixelRatio(),m=e.getSize();var t,i,r=a.getEyeParameters("left");h?(t=r.renderRect.width,i=r.renderRect.height):(t=r.renderWidth,i=r.renderHeight),e.setPixelRatio(1),e.setSize(2*t,i,!1)}else e.setPixelRatio(g),e.setSize(m.width,m.height)},!1),window.addEventListener("vrdisplaypresentchange",function(){if(f=a&&a.isPresenting){g=e.getPixelRatio(),m=e.getSize();var t=a.getEyeParameters("left");e.setPixelRatio(1),e.setSize(2*t.renderWidth,t.renderHeight,!1)}else e.setPixelRatio(g),e.setSize(m.width,m.height)},!1),this.setFullScreen=function(e){return new Promise(function(t,i){return void 0===a?void i(new Error("No VR hardware found.")):f===e?void t():void(h?v.mozRequestFullScreen?(v.mozRequestFullScreen({ vrDisplay:a}),t()):v.webkitRequestFullscreen?(v.webkitRequestFullscreen({vrDisplay:a}),t()):(console.error("No compatible requestFullscreen method found."),i(new Error("No compatible requestFullscreen method found."))):t(e?a.requestPresent([{source:v}]):a.exitPresent()))})},this.requestPresent=function(){return this.setFullScreen(!0)},this.exitPresent=function(){return this.setFullScreen(!1)};var M=new THREE.PerspectiveCamera;M.layers.enable(1);var A=new THREE.PerspectiveCamera;A.layers.enable(2),this.render=function(t,i){if(a&&f){var r=t.autoUpdate;r&&(t.updateMatrixWorld(),t.autoUpdate=!1);var n=a.getEyeParameters("left"),m=a.getEyeParameters("right");h?(d.copy(n.eyeTranslation),p.copy(m.eyeTranslation),u=n.recommendedFieldOfView,l=m.recommendedFieldOfView):(d.fromArray(n.offset),p.fromArray(m.offset),u=n.fieldOfView,l=m.fieldOfView),Array.isArray(t)&&(console.warn("THREE.VREffect.render() no longer supports arrays. Use object.layers instead."),t=t[0]);var g=e.getSize();s={x:0,y:0,width:g.width/2,height:g.height},c={x:g.width/2,y:0,width:g.width/2,height:g.height},e.setScissorTest(!0),e.clear(),null===i.parent&&i.updateMatrixWorld(),M.projectionMatrix=o(u,!0,i.near,i.far),A.projectionMatrix=o(l,!0,i.near,i.far),i.matrixWorld.decompose(M.position,M.quaternion,M.scale),i.matrixWorld.decompose(A.position,A.quaternion,A.scale);var v=this.scale;return M.translateOnAxis(d,v),A.translateOnAxis(p,v),e.setViewport(s.x,s.y,s.width,s.height),e.setScissor(s.x,s.y,s.width,s.height),e.render(t,M),e.setViewport(c.x,c.y,c.width,c.height),e.setScissor(c.x,c.y,c.width,c.height),e.render(t,A),e.setScissorTest(!1),r&&(t.autoUpdate=!0),void(h||a.submitFrame())}e.render(t,i)}}},{}],123:[function(e,t){window.glStats=function(){function e(e,t){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function t(){o("allcalls").set(a+s),o("drawElements").set(s),o("drawArrays").set(a),o("bindTexture").set(d),o("useProgram").set(c),o("glfaces").set(u),o("glvertices").set(l),o("glpoints").set(h)}function i(){a=0,s=0,c=0,u=0,l=0,h=0,d=0}function r(){}function n(e){o=e}var o=null,a=0,s=0,c=0,u=0,l=0,h=0,d=0;WebGLRenderingContext.prototype.drawArrays=e(WebGLRenderingContext.prototype.drawArrays,function(){a++,arguments[0]==this.POINTS?h+=arguments[2]:l+=arguments[2]}),WebGLRenderingContext.prototype.drawElements=e(WebGLRenderingContext.prototype.drawElements,function(){s++,u+=arguments[1]/3,l+=arguments[1]}),WebGLRenderingContext.prototype.useProgram=e(WebGLRenderingContext.prototype.useProgram,function(){c++}),WebGLRenderingContext.prototype.bindTexture=e(WebGLRenderingContext.prototype.bindTexture,function(){d++});var p={allcalls:{over:3e3,caption:"Calls (hook)"},drawelements:{caption:"drawElements (hook)"},drawarrays:{caption:"drawArrays (hook)"}},f=[{caption:"WebGL",values:["allcalls","drawelements","drawarrays","useprogram","bindtexture","glfaces","glvertices","glpoints"]}],m=[{base:"allcalls",steps:["drawelements","drawarrays"]}];return{update:t,start:i,end:r,attach:n,values:p,groups:f,fractions:m}},window.threeStats=function(e){function t(){o("renderer.info.memory.geometries").set(e.info.memory.geometries),o("renderer.info.programs").set(e.info.programs.length),o("renderer.info.memory.textures").set(e.info.memory.textures),o("renderer.info.render.calls").set(e.info.render.calls),o("renderer.info.render.faces").set(e.info.render.faces),o("renderer.info.render.points").set(e.info.render.points),o("renderer.info.render.vertices").set(e.info.render.vertices)}function i(){}function r(){}function n(e){o=e}var o=null,a={"renderer.info.memory.geometries":{caption:"Geometries"},"renderer.info.memory.textures":{caption:"Textures"},"renderer.info.programs":{caption:"Programs"},"renderer.info.render.calls":{caption:"Calls"},"renderer.info.render.faces":{caption:"Faces",over:1e3},"renderer.info.render.points":{caption:"Points"},"renderer.info.render.vertices":{caption:"Vertices"}},s=[{caption:"Three.js - Memory",values:["renderer.info.memory.geometries","renderer.info.programs","renderer.info.memory.textures"]},{caption:"Three.js - Render",values:["renderer.info.render.calls","renderer.info.render.faces","renderer.info.render.points","renderer.info.render.vertices"]}],c=[];return{update:t,start:i,end:r,attach:n,values:a,groups:s,fractions:c}},window.BrowserStats=function(){function e(e){var t=100,i=Math.floor(Math.log(e)/h);return Math.round(e*t/Math.pow(1024,i))/t}function t(){a=e(performance.memory.usedJSHeapSize),s=e(performance.memory.totalJSHeapSize),o("memory").set(a),o("total").set(s)}function i(){a=0}function r(){}function n(e){o=e}var o=null,a=0,s=0;window.performance&&!performance.memory&&(performance.memory={usedJSHeapSize:0,totalJSHeapSize:0}),0===performance.memory.totalJSHeapSize&&console.warn("totalJSHeapSize === 0... performance.memory is only available in Chrome .");var c={memory:{caption:"Used Memory",average:!0,avgMs:1e3,over:22},total:{caption:"Total Memory"}},u=[{caption:"Browser",values:["memory","total"]}],l=[{base:"total",steps:["memory"]}],h=Math.log(1024);return{update:t,start:i,end:r,attach:n,values:c,groups:u,fractions:l}},"object"==typeof t&&(t.exports={glStats:window.glStats,threeStats:window.threeStats,BrowserStats:window.BrowserStats})},{}],124:[function(e,t){"use strict";!function(){if("undefined"==typeof window.performance&&(window.performance={}),!window.performance.now){var e=Date.now();performance.timing&&performance.timing.navigationStart&&(e=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-e}}window.performance.mark||(window.performance.mark=function(){}),window.performance.measure||(window.performance.measure=function(){})}(),window.rStats=function(e){function t(e,t){for(var i=Object.keys(e),r=0,n=i.length;n>r;r++)t(i[r])}function i(e){var t=document.createElement("link");t.href=e,t.rel="stylesheet",t.type="text/css",document.getElementsByTagName("head")[0].appendChild(t)}function r(e,t,i){function r(){a.width=v,a.height=g,a.style.width=a.width+"px",a.style.height=a.height+"px",a.className="rs-canvas",e.appendChild(a),s.fillStyle="#444444",s.fillRect(0,0,a.width,a.height)}function n(e,t){u+=.1*(e-u),c*=.99,u>c&&(c=u),s.drawImage(a,1,0,a.width-1,a.height,0,0,a.width-1,a.height),t?s.drawImage(p,a.width-1,a.height-u*a.height/c-g):s.drawImage(h,a.width-1,a.height-u*a.height/c-g)}var o=i||{},a=document.createElement("canvas"),s=a.getContext("2d"),c=0,u=0,l=o.color?o.color:"#666666",h=document.createElement("canvas"),d=h.getContext("2d");h.width=1,h.height=2*g,d.fillStyle="#444444",d.fillRect(0,0,1,2*g),d.fillStyle=l,d.fillRect(0,g,1,g),d.fillStyle="#ffffff",d.globalAlpha=.5,d.fillRect(0,g,1,1),d.globalAlpha=1;var p=document.createElement("canvas"),f=p.getContext("2d");return p.width=1,p.height=2*g,f.fillStyle="#444444",f.fillRect(0,0,1,2*g),f.fillStyle="#b70000",f.fillRect(0,g,1,g),f.globalAlpha=.5,f.fillStyle="#ffffff",f.fillRect(0,g,1,1),f.globalAlpha=1,r(),{draw:n}}function n(e,i){function r(){o.width=v,o.height=g*i,o.style.width=o.width+"px",o.style.height=o.height+"px",o.className="rs-canvas",e.appendChild(o),a.fillStyle="#444444",a.fillRect(0,0,o.width,o.height)}function n(e){a.drawImage(o,1,0,o.width-1,o.height,0,0,o.width-1,o.height);var i=0;t(e,function(t){var r=e[t]*o.height;a.fillStyle=l[t],a.fillRect(o.width-1,i,1,r),i+=r})}var o=document.createElement("canvas"),a=o.getContext("2d");return r(),{draw:n}}function o(e,t){function i(e){if(b&&b.average){v+=e,M++;var t=performance.now();t-y>=(b.avgMs||1e3)&&(g=v/M,v=0,y=t,M=0)}}function n(){h=performance.now(),u.userTimingAPI&&performance.mark(d+"-start"),L=!0}function o(){p=performance.now()-h,u.userTimingAPI&&(performance.mark(d+"-end"),L&&performance.measure(d,d+"-start",d+"-end")),i(p)}function a(){o(),n()}function s(){var e=b&&b.average?g:p;E.nodeValue=Math.round(100*e)/100;var t=b&&(b.below&&p<b.below||b.over&&p>b.over);T.draw(p,t),A.style.color=t?"#b70000":"#ffffff"}function c(){var e=performance.now(),t=e-h;f++,t>1e3&&(p=b&&b.interpolate===!1?f:1e3*f/t,f=0,h=e,i(p))}function l(e){p=e,i(p)}var h,d=e,p=0,f=0,g=0,v=0,y=performance.now(),M=0,A=document.createElement("div"),x=document.createElement("span"),w=document.createElement("div"),E=document.createTextNode(""),b=u?u.values[d.toLowerCase()]:null,T=new r(A,d,b),L=!1;return A.className="rs-counter-base",x.className="rs-counter-id",x.textContent=b&&b.caption?b.caption:d,w.className="rs-counter-value",w.appendChild(E),A.appendChild(x),A.appendChild(w),t?t.div.appendChild(A):m.appendChild(A),h=performance.now(),{set:l,start:n,tick:a,end:o,frame:c,value:function(){return p},draw:s}}function a(e){var i=e.toLowerCase();if(void 0===i&&(i="default"),y[i])return y[i];var r=null;u&&u.groups&&t(u.groups,function(e){var t=u.groups[parseInt(e,10)];r||-1===t.values.indexOf(i.toLowerCase())||(r=t)});var n=new o(i,r);return y[i]=n,n}function s(){if(u.plugins){u.values||(u.values={}),u.groups||(u.groups=[]),u.fractions||(u.fractions=[]);for(var e=0;e<u.plugins.length;e++)u.plugins[e].attach(a),t(u.plugins[e].values,function(t){u.values[t]=u.plugins[e].values[t]}),u.groups=u.groups.concat(u.plugins[e].groups),u.fractions=u.fractions.concat(u.plugins[e].fractions)}else u.plugins={};f=document.createElement("div"),f.className="rs-base",m=document.createElement("div"),m.className="rs-container",m.style.height="auto",f.appendChild(m),document.body.appendChild(f),u&&(u.groups&&t(u.groups,function(e){var t=u.groups[parseInt(e,10)],i=document.createElement("div");i.className="rs-group",t.div=i;var r=document.createElement("h1");r.textContent=t.caption,r.addEventListener("click",function(e){this.classList.toggle("hidden"),e.preventDefault()}.bind(i)),m.appendChild(r),m.appendChild(i)}),u.fractions&&t(u.fractions,function(e){var i=u.fractions[parseInt(e,10)],r=document.createElement("div");r.className="rs-fraction";var o=document.createElement("div");o.className="rs-legend";var a=0;t(u.fractions[e].steps,function(t){var i=document.createElement("p");i.textContent=u.fractions[e].steps[t],i.style.color=l[a],o.appendChild(i),a++}),r.appendChild(o),r.style.height=a*g+"px",i.div=r;var s=new n(r,a);i.graph=s,m.appendChild(r)}))}function c(){t(u.plugins,function(e){u.plugins[e].update()}),t(y,function(e){y[e].draw()}),u&&u.fractions&&t(u.fractions,function(e){var i=u.fractions[parseInt(e,10)],r=[],n=y[i.base.toLowerCase()];n&&(n=n.value(),t(u.fractions[e].steps,function(t){var i=u.fractions[e].steps[parseInt(t,10)].toLowerCase(),o=y[i];o&&r.push(o.value()/n)})),i.graph.draw(r)})}var u=e||{},l=u.colours||["#850700","#c74900","#fcb300","#284280","#4c7c0c"],h="path_to_url",d=(u.CSSPath?u.CSSPath:"")+"rStats.css",p=u.css||[h,d];p.forEach(function(e){i(e)}),u.values||(u.values={});var f,m,g=10,v=200,y={};return s(),function(e){return e?a(e):{element:f,update:c}}},"object"==typeof t&&(t.exports=window.rStats)},{}],125:[function(e,t){var i={};i.base64=function(e,t){return"data:"+e+";base64,"+t},i.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},i.isIOS=function(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)},i.isIFrame=function(){try{return window.self!==window.top}catch(e){return!0}},i.appendQueryParameter=function(e,t,i){var r=e.indexOf("?")<0?"?":"&";return e+=r+t+"="+i},i.getQueryParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),i=t.exec(location.search);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))},i.isLandscapeMode=function(){return 90==window.orientation||-90==window.orientation},t.exports=i},{}],126:[function(e,t){function i(){var e=document.createElement("video");e.addEventListener("ended",function(){e.play()}),this.request=function(){e.paused&&(e.src=o.base64("video/webm",your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashbsLpDt/your_sha256_hashyour_sha256_hashAAAAAo+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashAAA2AAAFotKrqAo5aBA+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashsAAANgAABaLSq6gKOWgQu4AKYAQJKcAEqAAANgAABaLSq6gKOWgQ+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashtKrqAo5aBA+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashagAANgAABaLSq6gKOWgQu4AKYAQJKcAEaAAANgAABaLSq6gKOWgQ+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashtKrqAo5aBA+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashNgAANgAABaLSq6gKOWgQu4AKYAQJKcAERgAANgAABaLSq6gKOWgQ+your_sha256_hashyour_sha256_hashyour_sha256_hashyour_sha256_hashDgAADYAAAWi0quoAcU7trAQAAAAAAABG7j7OBALeK94EB8YIBd/CBAw=="),e.play())},this.release=function(){e.pause(),e.src=""}}function r(){var e=null;this.request=function(){e||(e=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){e&&(clearInterval(e),e=null)}}function n(){var e=navigator.userAgent||navigator.vendor||window.opera;return e.match(/iPhone/i)||e.match(/iPod/i)?r:i}var o=e("./util.js");t.exports=n()},{"./util.js":125}]},{},[99])(99)}); ```
Andreas Strüngmann (born 1950) is a German businessman who founded generic drug maker Hexal AG ($1.6 billion sales during 2004) in 1986. It became Germany's second-largest generic drug producer. In February 2005, he and his brother Thomas sold Hexal and their 67.7% of U.S. Eon Labs to Novartis for $7.5 billion, making its subsidiary Sandoz the largest generic-drug company in the world. He currently has residences in Tegernsee and South Africa and is married with two children. At age 56, he accepted an executive position at Sandoz, a generics division of Novartis. See also List of billionaires References External links Forbes World's Richest People Forbes Billionaires Andreas Strungmann biography Strungmann, Andreas Strungmann, Andreas German billionaires 20th-century German businesspeople 21st-century German businesspeople