Dashboard sipadu mbip
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

react-dom-server.browser.development.js 140KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421
  1. /** @license React v16.12.0
  2. * react-dom-server.browser.development.js
  3. *
  4. * Copyright (c) Facebook, Inc. and its affiliates.
  5. *
  6. * This source code is licensed under the MIT license found in the
  7. * LICENSE file in the root directory of this source tree.
  8. */
  9. 'use strict';
  10. (function (global, factory) {
  11. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
  12. typeof define === 'function' && define.amd ? define(['react'], factory) :
  13. (global.ReactDOMServer = factory(global.React));
  14. }(this, (function (React) { 'use strict';
  15. // Do not require this module directly! Use normal `invariant` calls with
  16. // template literal strings. The messages will be replaced with error codes
  17. // during build.
  18. // TODO: this is special because it gets imported during build.
  19. var ReactVersion = '16.12.0';
  20. /**
  21. * Use invariant() to assert state which your program assumes to be true.
  22. *
  23. * Provide sprintf-style format (only %s is supported) and arguments
  24. * to provide information about what broke and what you were
  25. * expecting.
  26. *
  27. * The invariant message will be stripped in production, but the invariant
  28. * will remain to ensure logic does not differ in production.
  29. */
  30. var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
  31. var _assign = ReactInternals.assign;
  32. /**
  33. * Similar to invariant but only logs a warning if the condition is not met.
  34. * This can be used to log issues in development environments in critical
  35. * paths. Removing the logging code for production environments will keep the
  36. * same logic and follow the same code paths.
  37. */
  38. var warningWithoutStack = function () {};
  39. {
  40. warningWithoutStack = function (condition, format) {
  41. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  42. args[_key - 2] = arguments[_key];
  43. }
  44. if (format === undefined) {
  45. throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
  46. }
  47. if (args.length > 8) {
  48. // Check before the condition to catch violations early.
  49. throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
  50. }
  51. if (condition) {
  52. return;
  53. }
  54. if (typeof console !== 'undefined') {
  55. var argsWithFormat = args.map(function (item) {
  56. return '' + item;
  57. });
  58. argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
  59. // breaks IE9: https://github.com/facebook/react/issues/13610
  60. Function.prototype.apply.call(console.error, console, argsWithFormat);
  61. }
  62. try {
  63. // --- Welcome to debugging React ---
  64. // This error was thrown as a convenience so that you can use this stack
  65. // to find the callsite that caused this warning to fire.
  66. var argIndex = 0;
  67. var message = 'Warning: ' + format.replace(/%s/g, function () {
  68. return args[argIndex++];
  69. });
  70. throw new Error(message);
  71. } catch (x) {}
  72. };
  73. }
  74. var warningWithoutStack$1 = warningWithoutStack;
  75. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  76. // nor polyfill, then a plain number is used for performance.
  77. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  78. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  79. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  80. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  81. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  82. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  83. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  84. // (unstable) APIs that have been removed. Can we remove the symbols?
  85. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  86. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  87. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  88. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  89. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  90. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  91. var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
  92. var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
  93. var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
  94. // Current owner and dispatcher used to share the same ref,
  95. // but PR #14548 split them out to better support the react-debug-tools package.
  96. if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
  97. ReactSharedInternals.ReactCurrentDispatcher = {
  98. current: null
  99. };
  100. }
  101. if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
  102. ReactSharedInternals.ReactCurrentBatchConfig = {
  103. suspense: null
  104. };
  105. }
  106. /**
  107. * Similar to invariant but only logs a warning if the condition is not met.
  108. * This can be used to log issues in development environments in critical
  109. * paths. Removing the logging code for production environments will keep the
  110. * same logic and follow the same code paths.
  111. */
  112. var warning = warningWithoutStack$1;
  113. {
  114. warning = function (condition, format) {
  115. if (condition) {
  116. return;
  117. }
  118. var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
  119. var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
  120. for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  121. args[_key - 2] = arguments[_key];
  122. }
  123. warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
  124. };
  125. }
  126. var warning$1 = warning;
  127. var Uninitialized = -1;
  128. var Pending = 0;
  129. var Resolved = 1;
  130. var Rejected = 2;
  131. function refineResolvedLazyComponent(lazyComponent) {
  132. return lazyComponent._status === Resolved ? lazyComponent._result : null;
  133. }
  134. function initializeLazyComponentType(lazyComponent) {
  135. if (lazyComponent._status === Uninitialized) {
  136. lazyComponent._status = Pending;
  137. var ctor = lazyComponent._ctor;
  138. var thenable = ctor();
  139. lazyComponent._result = thenable;
  140. thenable.then(function (moduleObject) {
  141. if (lazyComponent._status === Pending) {
  142. var defaultExport = moduleObject.default;
  143. {
  144. if (defaultExport === undefined) {
  145. warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
  146. }
  147. }
  148. lazyComponent._status = Resolved;
  149. lazyComponent._result = defaultExport;
  150. }
  151. }, function (error) {
  152. if (lazyComponent._status === Pending) {
  153. lazyComponent._status = Rejected;
  154. lazyComponent._result = error;
  155. }
  156. });
  157. }
  158. }
  159. function getWrappedName(outerType, innerType, wrapperName) {
  160. var functionName = innerType.displayName || innerType.name || '';
  161. return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
  162. }
  163. function getComponentName(type) {
  164. if (type == null) {
  165. // Host root, text node or just invalid type.
  166. return null;
  167. }
  168. {
  169. if (typeof type.tag === 'number') {
  170. warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
  171. }
  172. }
  173. if (typeof type === 'function') {
  174. return type.displayName || type.name || null;
  175. }
  176. if (typeof type === 'string') {
  177. return type;
  178. }
  179. switch (type) {
  180. case REACT_FRAGMENT_TYPE:
  181. return 'Fragment';
  182. case REACT_PORTAL_TYPE:
  183. return 'Portal';
  184. case REACT_PROFILER_TYPE:
  185. return "Profiler";
  186. case REACT_STRICT_MODE_TYPE:
  187. return 'StrictMode';
  188. case REACT_SUSPENSE_TYPE:
  189. return 'Suspense';
  190. case REACT_SUSPENSE_LIST_TYPE:
  191. return 'SuspenseList';
  192. }
  193. if (typeof type === 'object') {
  194. switch (type.$$typeof) {
  195. case REACT_CONTEXT_TYPE:
  196. return 'Context.Consumer';
  197. case REACT_PROVIDER_TYPE:
  198. return 'Context.Provider';
  199. case REACT_FORWARD_REF_TYPE:
  200. return getWrappedName(type, type.render, 'ForwardRef');
  201. case REACT_MEMO_TYPE:
  202. return getComponentName(type.type);
  203. case REACT_LAZY_TYPE:
  204. {
  205. var thenable = type;
  206. var resolvedThenable = refineResolvedLazyComponent(thenable);
  207. if (resolvedThenable) {
  208. return getComponentName(resolvedThenable);
  209. }
  210. break;
  211. }
  212. }
  213. }
  214. return null;
  215. }
  216. /**
  217. * Forked from fbjs/warning:
  218. * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
  219. *
  220. * Only change is we use console.warn instead of console.error,
  221. * and do nothing when 'console' is not supported.
  222. * This really simplifies the code.
  223. * ---
  224. * Similar to invariant but only logs a warning if the condition is not met.
  225. * This can be used to log issues in development environments in critical
  226. * paths. Removing the logging code for production environments will keep the
  227. * same logic and follow the same code paths.
  228. */
  229. var lowPriorityWarningWithoutStack = function () {};
  230. {
  231. var printWarning = function (format) {
  232. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  233. args[_key - 1] = arguments[_key];
  234. }
  235. var argIndex = 0;
  236. var message = 'Warning: ' + format.replace(/%s/g, function () {
  237. return args[argIndex++];
  238. });
  239. if (typeof console !== 'undefined') {
  240. console.warn(message);
  241. }
  242. try {
  243. // --- Welcome to debugging React ---
  244. // This error was thrown as a convenience so that you can use this stack
  245. // to find the callsite that caused this warning to fire.
  246. throw new Error(message);
  247. } catch (x) {}
  248. };
  249. lowPriorityWarningWithoutStack = function (condition, format) {
  250. if (format === undefined) {
  251. throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
  252. }
  253. if (!condition) {
  254. for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  255. args[_key2 - 2] = arguments[_key2];
  256. }
  257. printWarning.apply(void 0, [format].concat(args));
  258. }
  259. };
  260. }
  261. var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
  262. var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
  263. var describeComponentFrame = function (name, source, ownerName) {
  264. var sourceInfo = '';
  265. if (source) {
  266. var path = source.fileName;
  267. var fileName = path.replace(BEFORE_SLASH_RE, '');
  268. {
  269. // In DEV, include code for a common special case:
  270. // prefer "folder/index.js" instead of just "index.js".
  271. if (/^index\./.test(fileName)) {
  272. var match = path.match(BEFORE_SLASH_RE);
  273. if (match) {
  274. var pathBeforeSlash = match[1];
  275. if (pathBeforeSlash) {
  276. var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
  277. fileName = folderName + '/' + fileName;
  278. }
  279. }
  280. }
  281. }
  282. sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  283. } else if (ownerName) {
  284. sourceInfo = ' (created by ' + ownerName + ')';
  285. }
  286. return '\n in ' + (name || 'Unknown') + sourceInfo;
  287. };
  288. // Helps identify side effects in render-phase lifecycle hooks and setState
  289. // reducers by double invoking them in Strict Mode.
  290. // To preserve the "Pause on caught exceptions" behavior of the debugger, we
  291. // replay the begin phase of a failed component inside invokeGuardedCallback.
  292. // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
  293. var warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees.
  294. // Trace which interactions trigger each commit.
  295. // SSR experiments
  296. var enableSuspenseServerRenderer = false;
  297. // Only used in www builds.
  298. // Only used in www builds.
  299. // Disable javascript: URL strings in href for XSS protection.
  300. var disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing
  301. // with their related DOM properties
  302. // These APIs will no longer be "unstable" in the upcoming 16.7 release,
  303. // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
  304. // Experimental React Flare event system and event components support.
  305. var enableFlareAPI = false; // Experimental Host Component support.
  306. var enableFundamentalAPI = false; // Experimental Scope support.
  307. var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
  308. // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
  309. // Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
  310. // For tests, we flush suspense fallbacks in an act scope;
  311. // *except* in some of our own tests, where we test incremental loading states.
  312. // Add a callback property to suspense to notify which promises are currently
  313. // in the update queue. This allows reporting and tracing of what is causing
  314. // the user to see a loading state.
  315. // Also allows hydration callbacks to fire when a dehydrated boundary gets
  316. // hydrated or deleted.
  317. // Part of the simplification of React.createElement so we can eventually move
  318. // from React.createElement to React.jsx
  319. // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
  320. var disableLegacyContext = false;
  321. // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
  322. /**
  323. * Copyright (c) 2013-present, Facebook, Inc.
  324. *
  325. * This source code is licensed under the MIT license found in the
  326. * LICENSE file in the root directory of this source tree.
  327. */
  328. var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
  329. var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
  330. /**
  331. * Copyright (c) 2013-present, Facebook, Inc.
  332. *
  333. * This source code is licensed under the MIT license found in the
  334. * LICENSE file in the root directory of this source tree.
  335. */
  336. var printWarning$1 = function() {};
  337. {
  338. var ReactPropTypesSecret = ReactPropTypesSecret_1;
  339. var loggedTypeFailures = {};
  340. var has = Function.call.bind(Object.prototype.hasOwnProperty);
  341. printWarning$1 = function(text) {
  342. var message = 'Warning: ' + text;
  343. if (typeof console !== 'undefined') {
  344. console.error(message);
  345. }
  346. try {
  347. // --- Welcome to debugging React ---
  348. // This error was thrown as a convenience so that you can use this stack
  349. // to find the callsite that caused this warning to fire.
  350. throw new Error(message);
  351. } catch (x) {}
  352. };
  353. }
  354. /**
  355. * Assert that the values match with the type specs.
  356. * Error messages are memorized and will only be shown once.
  357. *
  358. * @param {object} typeSpecs Map of name to a ReactPropType
  359. * @param {object} values Runtime values that need to be type-checked
  360. * @param {string} location e.g. "prop", "context", "child context"
  361. * @param {string} componentName Name of the component for error messages.
  362. * @param {?Function} getStack Returns the component stack.
  363. * @private
  364. */
  365. function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  366. {
  367. for (var typeSpecName in typeSpecs) {
  368. if (has(typeSpecs, typeSpecName)) {
  369. var error;
  370. // Prop type validation may throw. In case they do, we don't want to
  371. // fail the render phase where it didn't fail before. So we log it.
  372. // After these have been cleaned up, we'll let them throw.
  373. try {
  374. // This is intentionally an invariant that gets caught. It's the same
  375. // behavior as without this statement except with a better message.
  376. if (typeof typeSpecs[typeSpecName] !== 'function') {
  377. var err = Error(
  378. (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
  379. 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
  380. );
  381. err.name = 'Invariant Violation';
  382. throw err;
  383. }
  384. error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
  385. } catch (ex) {
  386. error = ex;
  387. }
  388. if (error && !(error instanceof Error)) {
  389. printWarning$1(
  390. (componentName || 'React class') + ': type specification of ' +
  391. location + ' `' + typeSpecName + '` is invalid; the type checker ' +
  392. 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
  393. 'You may have forgotten to pass an argument to the type checker ' +
  394. 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
  395. 'shape all require an argument).'
  396. );
  397. }
  398. if (error instanceof Error && !(error.message in loggedTypeFailures)) {
  399. // Only monitor this failure once because there tends to be a lot of the
  400. // same error.
  401. loggedTypeFailures[error.message] = true;
  402. var stack = getStack ? getStack() : '';
  403. printWarning$1(
  404. 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
  405. );
  406. }
  407. }
  408. }
  409. }
  410. }
  411. /**
  412. * Resets warning cache when testing.
  413. *
  414. * @private
  415. */
  416. checkPropTypes.resetWarningCache = function() {
  417. {
  418. loggedTypeFailures = {};
  419. }
  420. };
  421. var checkPropTypes_1 = checkPropTypes;
  422. var ReactDebugCurrentFrame$1;
  423. var didWarnAboutInvalidateContextType;
  424. {
  425. ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
  426. didWarnAboutInvalidateContextType = new Set();
  427. }
  428. var emptyObject = {};
  429. {
  430. Object.freeze(emptyObject);
  431. }
  432. function maskContext(type, context) {
  433. var contextTypes = type.contextTypes;
  434. if (!contextTypes) {
  435. return emptyObject;
  436. }
  437. var maskedContext = {};
  438. for (var contextName in contextTypes) {
  439. maskedContext[contextName] = context[contextName];
  440. }
  441. return maskedContext;
  442. }
  443. function checkContextTypes(typeSpecs, values, location) {
  444. {
  445. checkPropTypes_1(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame$1.getCurrentStack);
  446. }
  447. }
  448. function validateContextBounds(context, threadID) {
  449. // If we don't have enough slots in this context to store this threadID,
  450. // fill it in without leaving any holes to ensure that the VM optimizes
  451. // this as non-holey index properties.
  452. // (Note: If `react` package is < 16.6, _threadCount is undefined.)
  453. for (var i = context._threadCount | 0; i <= threadID; i++) {
  454. // We assume that this is the same as the defaultValue which might not be
  455. // true if we're rendering inside a secondary renderer but they are
  456. // secondary because these use cases are very rare.
  457. context[i] = context._currentValue2;
  458. context._threadCount = i + 1;
  459. }
  460. }
  461. function processContext(type, context, threadID, isClass) {
  462. if (isClass) {
  463. var contextType = type.contextType;
  464. {
  465. if ('contextType' in type) {
  466. var isValid = // Allow null for conditional declaration
  467. contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>
  468. if (!isValid && !didWarnAboutInvalidateContextType.has(type)) {
  469. didWarnAboutInvalidateContextType.add(type);
  470. var addendum = '';
  471. if (contextType === undefined) {
  472. addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
  473. } else if (typeof contextType !== 'object') {
  474. addendum = ' However, it is set to a ' + typeof contextType + '.';
  475. } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
  476. addendum = ' Did you accidentally pass the Context.Provider instead?';
  477. } else if (contextType._context !== undefined) {
  478. // <Context.Consumer>
  479. addendum = ' Did you accidentally pass the Context.Consumer instead?';
  480. } else {
  481. addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
  482. }
  483. warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum);
  484. }
  485. }
  486. }
  487. if (typeof contextType === 'object' && contextType !== null) {
  488. validateContextBounds(contextType, threadID);
  489. return contextType[threadID];
  490. }
  491. if (disableLegacyContext) {
  492. {
  493. if (type.contextTypes) {
  494. warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', getComponentName(type) || 'Unknown');
  495. }
  496. }
  497. return emptyObject;
  498. } else {
  499. var maskedContext = maskContext(type, context);
  500. {
  501. if (type.contextTypes) {
  502. checkContextTypes(type.contextTypes, maskedContext, 'context');
  503. }
  504. }
  505. return maskedContext;
  506. }
  507. } else {
  508. if (disableLegacyContext) {
  509. {
  510. if (type.contextTypes) {
  511. warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(type) || 'Unknown');
  512. }
  513. }
  514. return undefined;
  515. } else {
  516. var _maskedContext = maskContext(type, context);
  517. {
  518. if (type.contextTypes) {
  519. checkContextTypes(type.contextTypes, _maskedContext, 'context');
  520. }
  521. }
  522. return _maskedContext;
  523. }
  524. }
  525. }
  526. // Allocates a new index for each request. Tries to stay as compact as possible so that these
  527. // indices can be used to reference a tightly packed array. As opposed to being used in a Map.
  528. // The first allocated index is 1.
  529. var nextAvailableThreadIDs = new Uint16Array(16);
  530. for (var i = 0; i < 15; i++) {
  531. nextAvailableThreadIDs[i] = i + 1;
  532. }
  533. nextAvailableThreadIDs[15] = 0;
  534. function growThreadCountAndReturnNextAvailable() {
  535. var oldArray = nextAvailableThreadIDs;
  536. var oldSize = oldArray.length;
  537. var newSize = oldSize * 2;
  538. if (!(newSize <= 0x10000)) {
  539. {
  540. throw Error("Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic.");
  541. }
  542. }
  543. var newArray = new Uint16Array(newSize);
  544. newArray.set(oldArray);
  545. nextAvailableThreadIDs = newArray;
  546. nextAvailableThreadIDs[0] = oldSize + 1;
  547. for (var _i = oldSize; _i < newSize - 1; _i++) {
  548. nextAvailableThreadIDs[_i] = _i + 1;
  549. }
  550. nextAvailableThreadIDs[newSize - 1] = 0;
  551. return oldSize;
  552. }
  553. function allocThreadID() {
  554. var nextID = nextAvailableThreadIDs[0];
  555. if (nextID === 0) {
  556. return growThreadCountAndReturnNextAvailable();
  557. }
  558. nextAvailableThreadIDs[0] = nextAvailableThreadIDs[nextID];
  559. return nextID;
  560. }
  561. function freeThreadID(id) {
  562. nextAvailableThreadIDs[id] = nextAvailableThreadIDs[0];
  563. nextAvailableThreadIDs[0] = id;
  564. }
  565. // A reserved attribute.
  566. // It is handled by React separately and shouldn't be written to the DOM.
  567. var RESERVED = 0; // A simple string attribute.
  568. // Attributes that aren't in the whitelist are presumed to have this type.
  569. var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
  570. // "enumerated" attributes with "true" and "false" as possible values.
  571. // When true, it should be set to a "true" string.
  572. // When false, it should be set to a "false" string.
  573. var BOOLEANISH_STRING = 2; // A real boolean attribute.
  574. // When true, it should be present (set either to an empty string or its name).
  575. // When false, it should be omitted.
  576. var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
  577. // When true, it should be present (set either to an empty string or its name).
  578. // When false, it should be omitted.
  579. // For any other value, should be present with that value.
  580. var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
  581. // When falsy, it should be removed.
  582. var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
  583. // When falsy, it should be removed.
  584. var POSITIVE_NUMERIC = 6;
  585. /* eslint-disable max-len */
  586. var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
  587. /* eslint-enable max-len */
  588. var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
  589. var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
  590. var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
  591. var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  592. var illegalAttributeNameCache = {};
  593. var validatedAttributeNameCache = {};
  594. function isAttributeNameSafe(attributeName) {
  595. if (hasOwnProperty$1.call(validatedAttributeNameCache, attributeName)) {
  596. return true;
  597. }
  598. if (hasOwnProperty$1.call(illegalAttributeNameCache, attributeName)) {
  599. return false;
  600. }
  601. if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
  602. validatedAttributeNameCache[attributeName] = true;
  603. return true;
  604. }
  605. illegalAttributeNameCache[attributeName] = true;
  606. {
  607. warning$1(false, 'Invalid attribute name: `%s`', attributeName);
  608. }
  609. return false;
  610. }
  611. function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
  612. if (propertyInfo !== null) {
  613. return propertyInfo.type === RESERVED;
  614. }
  615. if (isCustomComponentTag) {
  616. return false;
  617. }
  618. if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
  619. return true;
  620. }
  621. return false;
  622. }
  623. function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
  624. if (propertyInfo !== null && propertyInfo.type === RESERVED) {
  625. return false;
  626. }
  627. switch (typeof value) {
  628. case 'function': // $FlowIssue symbol is perfectly valid here
  629. case 'symbol':
  630. // eslint-disable-line
  631. return true;
  632. case 'boolean':
  633. {
  634. if (isCustomComponentTag) {
  635. return false;
  636. }
  637. if (propertyInfo !== null) {
  638. return !propertyInfo.acceptsBooleans;
  639. } else {
  640. var prefix = name.toLowerCase().slice(0, 5);
  641. return prefix !== 'data-' && prefix !== 'aria-';
  642. }
  643. }
  644. default:
  645. return false;
  646. }
  647. }
  648. function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
  649. if (value === null || typeof value === 'undefined') {
  650. return true;
  651. }
  652. if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
  653. return true;
  654. }
  655. if (isCustomComponentTag) {
  656. return false;
  657. }
  658. if (propertyInfo !== null) {
  659. switch (propertyInfo.type) {
  660. case BOOLEAN:
  661. return !value;
  662. case OVERLOADED_BOOLEAN:
  663. return value === false;
  664. case NUMERIC:
  665. return isNaN(value);
  666. case POSITIVE_NUMERIC:
  667. return isNaN(value) || value < 1;
  668. }
  669. }
  670. return false;
  671. }
  672. function getPropertyInfo(name) {
  673. return properties.hasOwnProperty(name) ? properties[name] : null;
  674. }
  675. function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {
  676. this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
  677. this.attributeName = attributeName;
  678. this.attributeNamespace = attributeNamespace;
  679. this.mustUseProperty = mustUseProperty;
  680. this.propertyName = name;
  681. this.type = type;
  682. this.sanitizeURL = sanitizeURL;
  683. } // When adding attributes to this list, be sure to also add them to
  684. // the `possibleStandardNames` module to ensure casing and incorrect
  685. // name warnings.
  686. var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
  687. ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
  688. // elements (not just inputs). Now that ReactDOMInput assigns to the
  689. // defaultValue property -- do we need this?
  690. 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
  691. properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
  692. name, // attributeName
  693. null, // attributeNamespace
  694. false);
  695. }); // A few React string attributes have a different name.
  696. // This is a mapping from React prop names to the attribute names.
  697. [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
  698. var name = _ref[0],
  699. attributeName = _ref[1];
  700. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  701. attributeName, // attributeName
  702. null, // attributeNamespace
  703. false);
  704. }); // These are "enumerated" HTML attributes that accept "true" and "false".
  705. // In React, we let users pass `true` and `false` even though technically
  706. // these aren't boolean attributes (they are coerced to strings).
  707. ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
  708. properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  709. name.toLowerCase(), // attributeName
  710. null, // attributeNamespace
  711. false);
  712. }); // These are "enumerated" SVG attributes that accept "true" and "false".
  713. // In React, we let users pass `true` and `false` even though technically
  714. // these aren't boolean attributes (they are coerced to strings).
  715. // Since these are SVG attributes, their attribute names are case-sensitive.
  716. ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
  717. properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  718. name, // attributeName
  719. null, // attributeNamespace
  720. false);
  721. }); // These are HTML boolean attributes.
  722. ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
  723. // on the client side because the browsers are inconsistent. Instead we call focus().
  724. 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
  725. 'itemScope'].forEach(function (name) {
  726. properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
  727. name.toLowerCase(), // attributeName
  728. null, // attributeNamespace
  729. false);
  730. }); // These are the few React props that we set as DOM properties
  731. // rather than attributes. These are all booleans.
  732. ['checked', // Note: `option.selected` is not updated if `select.multiple` is
  733. // disabled with `removeAttribute`. We have special logic for handling this.
  734. 'multiple', 'muted', 'selected'].forEach(function (name) {
  735. properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
  736. name, // attributeName
  737. null, // attributeNamespace
  738. false);
  739. }); // These are HTML attributes that are "overloaded booleans": they behave like
  740. // booleans, but can also accept a string value.
  741. ['capture', 'download'].forEach(function (name) {
  742. properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
  743. name, // attributeName
  744. null, // attributeNamespace
  745. false);
  746. }); // These are HTML attributes that must be positive numbers.
  747. ['cols', 'rows', 'size', 'span'].forEach(function (name) {
  748. properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
  749. name, // attributeName
  750. null, // attributeNamespace
  751. false);
  752. }); // These are HTML attributes that must be numbers.
  753. ['rowSpan', 'start'].forEach(function (name) {
  754. properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
  755. name.toLowerCase(), // attributeName
  756. null, // attributeNamespace
  757. false);
  758. });
  759. var CAMELIZE = /[\-\:]([a-z])/g;
  760. var capitalize = function (token) {
  761. return token[1].toUpperCase();
  762. }; // This is a list of all SVG attributes that need special casing, namespacing,
  763. // or boolean value assignment. Regular attributes that just accept strings
  764. // and have the same names are omitted, just like in the HTML whitelist.
  765. // Some of these attributes can be hard to find. This list was created by
  766. // scrapping the MDN documentation.
  767. ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
  768. var name = attributeName.replace(CAMELIZE, capitalize);
  769. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  770. attributeName, null, // attributeNamespace
  771. false);
  772. }); // String SVG attributes with the xlink namespace.
  773. ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
  774. var name = attributeName.replace(CAMELIZE, capitalize);
  775. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  776. attributeName, 'http://www.w3.org/1999/xlink', false);
  777. }); // String SVG attributes with the xml namespace.
  778. ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
  779. var name = attributeName.replace(CAMELIZE, capitalize);
  780. properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  781. attributeName, 'http://www.w3.org/XML/1998/namespace', false);
  782. }); // These attribute exists both in HTML and SVG.
  783. // The attribute name is case-sensitive in SVG so we can't just use
  784. // the React name like we do for attributes that exist only in HTML.
  785. ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
  786. properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  787. attributeName.toLowerCase(), // attributeName
  788. null, // attributeNamespace
  789. false);
  790. }); // These attributes accept URLs. These must not allow javascript: URLS.
  791. // These will also need to accept Trusted Types object in the future.
  792. var xlinkHref = 'xlinkHref';
  793. properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
  794. 'xlink:href', 'http://www.w3.org/1999/xlink', true);
  795. ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
  796. properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  797. attributeName.toLowerCase(), // attributeName
  798. null, // attributeNamespace
  799. true);
  800. });
  801. var ReactDebugCurrentFrame$2 = null;
  802. {
  803. ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
  804. } // A javascript: URL can contain leading C0 control or \u0020 SPACE,
  805. // and any newline or tab are filtered out as if they're not part of the URL.
  806. // https://url.spec.whatwg.org/#url-parsing
  807. // Tab or newline are defined as \r\n\t:
  808. // https://infra.spec.whatwg.org/#ascii-tab-or-newline
  809. // A C0 control is a code point in the range \u0000 NULL to \u001F
  810. // INFORMATION SEPARATOR ONE, inclusive:
  811. // https://infra.spec.whatwg.org/#c0-control-or-space
  812. /* eslint-disable max-len */
  813. var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
  814. var didWarn = false;
  815. function sanitizeURL(url) {
  816. if (disableJavaScriptURLs) {
  817. if (!!isJavaScriptProtocol.test(url)) {
  818. {
  819. throw Error("React has blocked a javascript: URL as a security precaution." + (ReactDebugCurrentFrame$2.getStackAddendum()));
  820. }
  821. }
  822. } else if (true && !didWarn && isJavaScriptProtocol.test(url)) {
  823. didWarn = true;
  824. warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
  825. }
  826. }
  827. // code copied and modified from escape-html
  828. /**
  829. * Module variables.
  830. * @private
  831. */
  832. var matchHtmlRegExp = /["'&<>]/;
  833. /**
  834. * Escapes special characters and HTML entities in a given html string.
  835. *
  836. * @param {string} string HTML string to escape for later insertion
  837. * @return {string}
  838. * @public
  839. */
  840. function escapeHtml(string) {
  841. var str = '' + string;
  842. var match = matchHtmlRegExp.exec(str);
  843. if (!match) {
  844. return str;
  845. }
  846. var escape;
  847. var html = '';
  848. var index;
  849. var lastIndex = 0;
  850. for (index = match.index; index < str.length; index++) {
  851. switch (str.charCodeAt(index)) {
  852. case 34:
  853. // "
  854. escape = '&quot;';
  855. break;
  856. case 38:
  857. // &
  858. escape = '&amp;';
  859. break;
  860. case 39:
  861. // '
  862. escape = '&#x27;'; // modified from escape-html; used to be '&#39'
  863. break;
  864. case 60:
  865. // <
  866. escape = '&lt;';
  867. break;
  868. case 62:
  869. // >
  870. escape = '&gt;';
  871. break;
  872. default:
  873. continue;
  874. }
  875. if (lastIndex !== index) {
  876. html += str.substring(lastIndex, index);
  877. }
  878. lastIndex = index + 1;
  879. html += escape;
  880. }
  881. return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
  882. } // end code copied and modified from escape-html
  883. /**
  884. * Escapes text to prevent scripting attacks.
  885. *
  886. * @param {*} text Text value to escape.
  887. * @return {string} An escaped string.
  888. */
  889. function escapeTextForBrowser(text) {
  890. if (typeof text === 'boolean' || typeof text === 'number') {
  891. // this shortcircuit helps perf for types that we know will never have
  892. // special characters, especially given that this function is used often
  893. // for numeric dom ids.
  894. return '' + text;
  895. }
  896. return escapeHtml(text);
  897. }
  898. /**
  899. * Escapes attribute value to prevent scripting attacks.
  900. *
  901. * @param {*} value Value to escape.
  902. * @return {string} An escaped string.
  903. */
  904. function quoteAttributeValueForBrowser(value) {
  905. return '"' + escapeTextForBrowser(value) + '"';
  906. }
  907. /**
  908. * Operations for dealing with DOM properties.
  909. */
  910. /**
  911. * Creates markup for the ID property.
  912. *
  913. * @param {string} id Unescaped ID.
  914. * @return {string} Markup string.
  915. */
  916. function createMarkupForRoot() {
  917. return ROOT_ATTRIBUTE_NAME + '=""';
  918. }
  919. /**
  920. * Creates markup for a property.
  921. *
  922. * @param {string} name
  923. * @param {*} value
  924. * @return {?string} Markup string, or null if the property was invalid.
  925. */
  926. function createMarkupForProperty(name, value) {
  927. var propertyInfo = getPropertyInfo(name);
  928. if (name !== 'style' && shouldIgnoreAttribute(name, propertyInfo, false)) {
  929. return '';
  930. }
  931. if (shouldRemoveAttribute(name, value, propertyInfo, false)) {
  932. return '';
  933. }
  934. if (propertyInfo !== null) {
  935. var attributeName = propertyInfo.attributeName;
  936. var type = propertyInfo.type;
  937. if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) {
  938. return attributeName + '=""';
  939. } else {
  940. if (propertyInfo.sanitizeURL) {
  941. value = '' + value;
  942. sanitizeURL(value);
  943. }
  944. return attributeName + '=' + quoteAttributeValueForBrowser(value);
  945. }
  946. } else if (isAttributeNameSafe(name)) {
  947. return name + '=' + quoteAttributeValueForBrowser(value);
  948. }
  949. return '';
  950. }
  951. /**
  952. * Creates markup for a custom property.
  953. *
  954. * @param {string} name
  955. * @param {*} value
  956. * @return {string} Markup string, or empty string if the property was invalid.
  957. */
  958. function createMarkupForCustomAttribute(name, value) {
  959. if (!isAttributeNameSafe(name) || value == null) {
  960. return '';
  961. }
  962. return name + '=' + quoteAttributeValueForBrowser(value);
  963. }
  964. /**
  965. * inlined Object.is polyfill to avoid requiring consumers ship their own
  966. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  967. */
  968. function is(x, y) {
  969. return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
  970. ;
  971. }
  972. var is$1 = typeof Object.is === 'function' ? Object.is : is;
  973. var currentlyRenderingComponent = null;
  974. var firstWorkInProgressHook = null;
  975. var workInProgressHook = null; // Whether the work-in-progress hook is a re-rendered hook
  976. var isReRender = false; // Whether an update was scheduled during the currently executing render pass.
  977. var didScheduleRenderPhaseUpdate = false; // Lazily created map of render-phase updates
  978. var renderPhaseUpdates = null; // Counter to prevent infinite loops.
  979. var numberOfReRenders = 0;
  980. var RE_RENDER_LIMIT = 25;
  981. var isInHookUserCodeInDev = false; // In DEV, this is the name of the currently executing primitive hook
  982. var currentHookNameInDev;
  983. function resolveCurrentlyRenderingComponent() {
  984. if (!(currentlyRenderingComponent !== null)) {
  985. {
  986. throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
  987. }
  988. }
  989. {
  990. !!isInHookUserCodeInDev ? warning$1(false, 'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks') : void 0;
  991. }
  992. return currentlyRenderingComponent;
  993. }
  994. function areHookInputsEqual(nextDeps, prevDeps) {
  995. if (prevDeps === null) {
  996. {
  997. warning$1(false, '%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
  998. }
  999. return false;
  1000. }
  1001. {
  1002. // Don't bother comparing lengths in prod because these arrays should be
  1003. // passed inline.
  1004. if (nextDeps.length !== prevDeps.length) {
  1005. warning$1(false, 'The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + nextDeps.join(', ') + "]", "[" + prevDeps.join(', ') + "]");
  1006. }
  1007. }
  1008. for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
  1009. if (is$1(nextDeps[i], prevDeps[i])) {
  1010. continue;
  1011. }
  1012. return false;
  1013. }
  1014. return true;
  1015. }
  1016. function createHook() {
  1017. if (numberOfReRenders > 0) {
  1018. {
  1019. {
  1020. throw Error("Rendered more hooks than during the previous render");
  1021. }
  1022. }
  1023. }
  1024. return {
  1025. memoizedState: null,
  1026. queue: null,
  1027. next: null
  1028. };
  1029. }
  1030. function createWorkInProgressHook() {
  1031. if (workInProgressHook === null) {
  1032. // This is the first hook in the list
  1033. if (firstWorkInProgressHook === null) {
  1034. isReRender = false;
  1035. firstWorkInProgressHook = workInProgressHook = createHook();
  1036. } else {
  1037. // There's already a work-in-progress. Reuse it.
  1038. isReRender = true;
  1039. workInProgressHook = firstWorkInProgressHook;
  1040. }
  1041. } else {
  1042. if (workInProgressHook.next === null) {
  1043. isReRender = false; // Append to the end of the list
  1044. workInProgressHook = workInProgressHook.next = createHook();
  1045. } else {
  1046. // There's already a work-in-progress. Reuse it.
  1047. isReRender = true;
  1048. workInProgressHook = workInProgressHook.next;
  1049. }
  1050. }
  1051. return workInProgressHook;
  1052. }
  1053. function prepareToUseHooks(componentIdentity) {
  1054. currentlyRenderingComponent = componentIdentity;
  1055. {
  1056. isInHookUserCodeInDev = false;
  1057. } // The following should have already been reset
  1058. // didScheduleRenderPhaseUpdate = false;
  1059. // firstWorkInProgressHook = null;
  1060. // numberOfReRenders = 0;
  1061. // renderPhaseUpdates = null;
  1062. // workInProgressHook = null;
  1063. }
  1064. function finishHooks(Component, props, children, refOrContext) {
  1065. // This must be called after every function component to prevent hooks from
  1066. // being used in classes.
  1067. while (didScheduleRenderPhaseUpdate) {
  1068. // Updates were scheduled during the render phase. They are stored in
  1069. // the `renderPhaseUpdates` map. Call the component again, reusing the
  1070. // work-in-progress hooks and applying the additional updates on top. Keep
  1071. // restarting until no more updates are scheduled.
  1072. didScheduleRenderPhaseUpdate = false;
  1073. numberOfReRenders += 1; // Start over from the beginning of the list
  1074. workInProgressHook = null;
  1075. children = Component(props, refOrContext);
  1076. }
  1077. currentlyRenderingComponent = null;
  1078. firstWorkInProgressHook = null;
  1079. numberOfReRenders = 0;
  1080. renderPhaseUpdates = null;
  1081. workInProgressHook = null;
  1082. {
  1083. isInHookUserCodeInDev = false;
  1084. } // These were reset above
  1085. // currentlyRenderingComponent = null;
  1086. // didScheduleRenderPhaseUpdate = false;
  1087. // firstWorkInProgressHook = null;
  1088. // numberOfReRenders = 0;
  1089. // renderPhaseUpdates = null;
  1090. // workInProgressHook = null;
  1091. return children;
  1092. }
  1093. function readContext(context, observedBits) {
  1094. var threadID = currentThreadID;
  1095. validateContextBounds(context, threadID);
  1096. {
  1097. !!isInHookUserCodeInDev ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0;
  1098. }
  1099. return context[threadID];
  1100. }
  1101. function useContext(context, observedBits) {
  1102. {
  1103. currentHookNameInDev = 'useContext';
  1104. }
  1105. resolveCurrentlyRenderingComponent();
  1106. var threadID = currentThreadID;
  1107. validateContextBounds(context, threadID);
  1108. return context[threadID];
  1109. }
  1110. function basicStateReducer(state, action) {
  1111. return typeof action === 'function' ? action(state) : action;
  1112. }
  1113. function useState(initialState) {
  1114. {
  1115. currentHookNameInDev = 'useState';
  1116. }
  1117. return useReducer(basicStateReducer, // useReducer has a special case to support lazy useState initializers
  1118. initialState);
  1119. }
  1120. function useReducer(reducer, initialArg, init) {
  1121. {
  1122. if (reducer !== basicStateReducer) {
  1123. currentHookNameInDev = 'useReducer';
  1124. }
  1125. }
  1126. currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
  1127. workInProgressHook = createWorkInProgressHook();
  1128. if (isReRender) {
  1129. // This is a re-render. Apply the new render phase updates to the previous
  1130. // current hook.
  1131. var queue = workInProgressHook.queue;
  1132. var dispatch = queue.dispatch;
  1133. if (renderPhaseUpdates !== null) {
  1134. // Render phase updates are stored in a map of queue -> linked list
  1135. var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
  1136. if (firstRenderPhaseUpdate !== undefined) {
  1137. renderPhaseUpdates.delete(queue);
  1138. var newState = workInProgressHook.memoizedState;
  1139. var update = firstRenderPhaseUpdate;
  1140. do {
  1141. // Process this render phase update. We don't have to check the
  1142. // priority because it will always be the same as the current
  1143. // render's.
  1144. var action = update.action;
  1145. {
  1146. isInHookUserCodeInDev = true;
  1147. }
  1148. newState = reducer(newState, action);
  1149. {
  1150. isInHookUserCodeInDev = false;
  1151. }
  1152. update = update.next;
  1153. } while (update !== null);
  1154. workInProgressHook.memoizedState = newState;
  1155. return [newState, dispatch];
  1156. }
  1157. }
  1158. return [workInProgressHook.memoizedState, dispatch];
  1159. } else {
  1160. {
  1161. isInHookUserCodeInDev = true;
  1162. }
  1163. var initialState;
  1164. if (reducer === basicStateReducer) {
  1165. // Special case for `useState`.
  1166. initialState = typeof initialArg === 'function' ? initialArg() : initialArg;
  1167. } else {
  1168. initialState = init !== undefined ? init(initialArg) : initialArg;
  1169. }
  1170. {
  1171. isInHookUserCodeInDev = false;
  1172. }
  1173. workInProgressHook.memoizedState = initialState;
  1174. var _queue = workInProgressHook.queue = {
  1175. last: null,
  1176. dispatch: null
  1177. };
  1178. var _dispatch = _queue.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue);
  1179. return [workInProgressHook.memoizedState, _dispatch];
  1180. }
  1181. }
  1182. function useMemo(nextCreate, deps) {
  1183. currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
  1184. workInProgressHook = createWorkInProgressHook();
  1185. var nextDeps = deps === undefined ? null : deps;
  1186. if (workInProgressHook !== null) {
  1187. var prevState = workInProgressHook.memoizedState;
  1188. if (prevState !== null) {
  1189. if (nextDeps !== null) {
  1190. var prevDeps = prevState[1];
  1191. if (areHookInputsEqual(nextDeps, prevDeps)) {
  1192. return prevState[0];
  1193. }
  1194. }
  1195. }
  1196. }
  1197. {
  1198. isInHookUserCodeInDev = true;
  1199. }
  1200. var nextValue = nextCreate();
  1201. {
  1202. isInHookUserCodeInDev = false;
  1203. }
  1204. workInProgressHook.memoizedState = [nextValue, nextDeps];
  1205. return nextValue;
  1206. }
  1207. function useRef(initialValue) {
  1208. currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
  1209. workInProgressHook = createWorkInProgressHook();
  1210. var previousRef = workInProgressHook.memoizedState;
  1211. if (previousRef === null) {
  1212. var ref = {
  1213. current: initialValue
  1214. };
  1215. {
  1216. Object.seal(ref);
  1217. }
  1218. workInProgressHook.memoizedState = ref;
  1219. return ref;
  1220. } else {
  1221. return previousRef;
  1222. }
  1223. }
  1224. function useLayoutEffect(create, inputs) {
  1225. {
  1226. currentHookNameInDev = 'useLayoutEffect';
  1227. }
  1228. warning$1(false, 'useLayoutEffect does nothing on the server, because its effect cannot ' + "be encoded into the server renderer's output format. This will lead " + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://fb.me/react-uselayouteffect-ssr for common fixes.');
  1229. }
  1230. function dispatchAction(componentIdentity, queue, action) {
  1231. if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
  1232. {
  1233. throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
  1234. }
  1235. }
  1236. if (componentIdentity === currentlyRenderingComponent) {
  1237. // This is a render phase update. Stash it in a lazily-created map of
  1238. // queue -> linked list of updates. After this render pass, we'll restart
  1239. // and apply the stashed updates on top of the work-in-progress hook.
  1240. didScheduleRenderPhaseUpdate = true;
  1241. var update = {
  1242. action: action,
  1243. next: null
  1244. };
  1245. if (renderPhaseUpdates === null) {
  1246. renderPhaseUpdates = new Map();
  1247. }
  1248. var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
  1249. if (firstRenderPhaseUpdate === undefined) {
  1250. renderPhaseUpdates.set(queue, update);
  1251. } else {
  1252. // Append the update to the end of the list.
  1253. var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
  1254. while (lastRenderPhaseUpdate.next !== null) {
  1255. lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
  1256. }
  1257. lastRenderPhaseUpdate.next = update;
  1258. }
  1259. } else {// This means an update has happened after the function component has
  1260. // returned. On the server this is a no-op. In React Fiber, the update
  1261. // would be scheduled for a future render.
  1262. }
  1263. }
  1264. function useCallback(callback, deps) {
  1265. // Callbacks are passed as they are in the server environment.
  1266. return callback;
  1267. }
  1268. function useResponder(responder, props) {
  1269. return {
  1270. props: props,
  1271. responder: responder
  1272. };
  1273. }
  1274. function useDeferredValue(value, config) {
  1275. resolveCurrentlyRenderingComponent();
  1276. return value;
  1277. }
  1278. function useTransition(config) {
  1279. resolveCurrentlyRenderingComponent();
  1280. var startTransition = function (callback) {
  1281. callback();
  1282. };
  1283. return [startTransition, false];
  1284. }
  1285. function noop() {}
  1286. var currentThreadID = 0;
  1287. function setCurrentThreadID(threadID) {
  1288. currentThreadID = threadID;
  1289. }
  1290. var Dispatcher = {
  1291. readContext: readContext,
  1292. useContext: useContext,
  1293. useMemo: useMemo,
  1294. useReducer: useReducer,
  1295. useRef: useRef,
  1296. useState: useState,
  1297. useLayoutEffect: useLayoutEffect,
  1298. useCallback: useCallback,
  1299. // useImperativeHandle is not run in the server environment
  1300. useImperativeHandle: noop,
  1301. // Effects are not run in the server environment.
  1302. useEffect: noop,
  1303. // Debugging effect
  1304. useDebugValue: noop,
  1305. useResponder: useResponder,
  1306. useDeferredValue: useDeferredValue,
  1307. useTransition: useTransition
  1308. };
  1309. var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
  1310. var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
  1311. var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
  1312. var Namespaces = {
  1313. html: HTML_NAMESPACE,
  1314. mathml: MATH_NAMESPACE,
  1315. svg: SVG_NAMESPACE
  1316. }; // Assumes there is no parent namespace.
  1317. function getIntrinsicNamespace(type) {
  1318. switch (type) {
  1319. case 'svg':
  1320. return SVG_NAMESPACE;
  1321. case 'math':
  1322. return MATH_NAMESPACE;
  1323. default:
  1324. return HTML_NAMESPACE;
  1325. }
  1326. }
  1327. function getChildNamespace(parentNamespace, type) {
  1328. if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
  1329. // No (or default) parent namespace: potential entry point.
  1330. return getIntrinsicNamespace(type);
  1331. }
  1332. if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
  1333. // We're leaving SVG.
  1334. return HTML_NAMESPACE;
  1335. } // By default, pass namespace below.
  1336. return parentNamespace;
  1337. }
  1338. var ReactDebugCurrentFrame$3 = null;
  1339. var ReactControlledValuePropTypes = {
  1340. checkPropTypes: null
  1341. };
  1342. {
  1343. ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
  1344. var hasReadOnlyValue = {
  1345. button: true,
  1346. checkbox: true,
  1347. image: true,
  1348. hidden: true,
  1349. radio: true,
  1350. reset: true,
  1351. submit: true
  1352. };
  1353. var propTypes = {
  1354. value: function (props, propName, componentName) {
  1355. if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
  1356. return null;
  1357. }
  1358. return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
  1359. },
  1360. checked: function (props, propName, componentName) {
  1361. if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
  1362. return null;
  1363. }
  1364. return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
  1365. }
  1366. };
  1367. /**
  1368. * Provide a linked `value` attribute for controlled forms. You should not use
  1369. * this outside of the ReactDOM controlled form components.
  1370. */
  1371. ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
  1372. checkPropTypes_1(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$3.getStackAddendum);
  1373. };
  1374. }
  1375. // For HTML, certain tags should omit their close tag. We keep a whitelist for
  1376. // those special-case tags.
  1377. var omittedCloseTags = {
  1378. area: true,
  1379. base: true,
  1380. br: true,
  1381. col: true,
  1382. embed: true,
  1383. hr: true,
  1384. img: true,
  1385. input: true,
  1386. keygen: true,
  1387. link: true,
  1388. meta: true,
  1389. param: true,
  1390. source: true,
  1391. track: true,
  1392. wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.
  1393. };
  1394. // `omittedCloseTags` except that `menuitem` should still have its closing tag.
  1395. var voidElementTags = _assign({
  1396. menuitem: true
  1397. }, omittedCloseTags);
  1398. // or add stack by default to invariants where possible.
  1399. var HTML = '__html';
  1400. var ReactDebugCurrentFrame$4 = null;
  1401. {
  1402. ReactDebugCurrentFrame$4 = ReactSharedInternals.ReactDebugCurrentFrame;
  1403. }
  1404. function assertValidProps(tag, props) {
  1405. if (!props) {
  1406. return;
  1407. } // Note the use of `==` which checks for null or undefined.
  1408. if (voidElementTags[tag]) {
  1409. if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
  1410. {
  1411. throw Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + (ReactDebugCurrentFrame$4.getStackAddendum()));
  1412. }
  1413. }
  1414. }
  1415. if (props.dangerouslySetInnerHTML != null) {
  1416. if (!(props.children == null)) {
  1417. {
  1418. throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
  1419. }
  1420. }
  1421. if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {
  1422. {
  1423. throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.");
  1424. }
  1425. }
  1426. }
  1427. {
  1428. !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
  1429. }
  1430. if (!(props.style == null || typeof props.style === 'object')) {
  1431. {
  1432. throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + (ReactDebugCurrentFrame$4.getStackAddendum()));
  1433. }
  1434. }
  1435. }
  1436. /**
  1437. * CSS properties which accept numbers but are not in units of "px".
  1438. */
  1439. var isUnitlessNumber = {
  1440. animationIterationCount: true,
  1441. borderImageOutset: true,
  1442. borderImageSlice: true,
  1443. borderImageWidth: true,
  1444. boxFlex: true,
  1445. boxFlexGroup: true,
  1446. boxOrdinalGroup: true,
  1447. columnCount: true,
  1448. columns: true,
  1449. flex: true,
  1450. flexGrow: true,
  1451. flexPositive: true,
  1452. flexShrink: true,
  1453. flexNegative: true,
  1454. flexOrder: true,
  1455. gridArea: true,
  1456. gridRow: true,
  1457. gridRowEnd: true,
  1458. gridRowSpan: true,
  1459. gridRowStart: true,
  1460. gridColumn: true,
  1461. gridColumnEnd: true,
  1462. gridColumnSpan: true,
  1463. gridColumnStart: true,
  1464. fontWeight: true,
  1465. lineClamp: true,
  1466. lineHeight: true,
  1467. opacity: true,
  1468. order: true,
  1469. orphans: true,
  1470. tabSize: true,
  1471. widows: true,
  1472. zIndex: true,
  1473. zoom: true,
  1474. // SVG-related properties
  1475. fillOpacity: true,
  1476. floodOpacity: true,
  1477. stopOpacity: true,
  1478. strokeDasharray: true,
  1479. strokeDashoffset: true,
  1480. strokeMiterlimit: true,
  1481. strokeOpacity: true,
  1482. strokeWidth: true
  1483. };
  1484. /**
  1485. * @param {string} prefix vendor-specific prefix, eg: Webkit
  1486. * @param {string} key style name, eg: transitionDuration
  1487. * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
  1488. * WebkitTransitionDuration
  1489. */
  1490. function prefixKey(prefix, key) {
  1491. return prefix + key.charAt(0).toUpperCase() + key.substring(1);
  1492. }
  1493. /**
  1494. * Support style names that may come passed in prefixed by adding permutations
  1495. * of vendor prefixes.
  1496. */
  1497. var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
  1498. // infinite loop, because it iterates over the newly added props too.
  1499. Object.keys(isUnitlessNumber).forEach(function (prop) {
  1500. prefixes.forEach(function (prefix) {
  1501. isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  1502. });
  1503. });
  1504. /**
  1505. * Convert a value into the proper css writable value. The style name `name`
  1506. * should be logical (no hyphens), as specified
  1507. * in `CSSProperty.isUnitlessNumber`.
  1508. *
  1509. * @param {string} name CSS property name such as `topMargin`.
  1510. * @param {*} value CSS property value such as `10px`.
  1511. * @return {string} Normalized style value with dimensions applied.
  1512. */
  1513. function dangerousStyleValue(name, value, isCustomProperty) {
  1514. // Note that we've removed escapeTextForBrowser() calls here since the
  1515. // whole string will be escaped when the attribute is injected into
  1516. // the markup. If you provide unsafe user data here they can inject
  1517. // arbitrary CSS which may be problematic (I couldn't repro this):
  1518. // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  1519. // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  1520. // This is not an XSS hole but instead a potential CSS injection issue
  1521. // which has lead to a greater discussion about how we're going to
  1522. // trust URLs moving forward. See #2115901
  1523. var isEmpty = value == null || typeof value === 'boolean' || value === '';
  1524. if (isEmpty) {
  1525. return '';
  1526. }
  1527. if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
  1528. return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
  1529. }
  1530. return ('' + value).trim();
  1531. }
  1532. var uppercasePattern = /([A-Z])/g;
  1533. var msPattern = /^ms-/;
  1534. /**
  1535. * Hyphenates a camelcased CSS property name, for example:
  1536. *
  1537. * > hyphenateStyleName('backgroundColor')
  1538. * < "background-color"
  1539. * > hyphenateStyleName('MozTransition')
  1540. * < "-moz-transition"
  1541. * > hyphenateStyleName('msTransition')
  1542. * < "-ms-transition"
  1543. *
  1544. * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
  1545. * is converted to `-ms-`.
  1546. */
  1547. function hyphenateStyleName(name) {
  1548. return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
  1549. }
  1550. function isCustomComponent(tagName, props) {
  1551. if (tagName.indexOf('-') === -1) {
  1552. return typeof props.is === 'string';
  1553. }
  1554. switch (tagName) {
  1555. // These are reserved SVG and MathML elements.
  1556. // We don't mind this whitelist too much because we expect it to never grow.
  1557. // The alternative is to track the namespace in a few places which is convoluted.
  1558. // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
  1559. case 'annotation-xml':
  1560. case 'color-profile':
  1561. case 'font-face':
  1562. case 'font-face-src':
  1563. case 'font-face-uri':
  1564. case 'font-face-format':
  1565. case 'font-face-name':
  1566. case 'missing-glyph':
  1567. return false;
  1568. default:
  1569. return true;
  1570. }
  1571. }
  1572. var warnValidStyle = function () {};
  1573. {
  1574. // 'msTransform' is correct, but the other prefixes should be capitalized
  1575. var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
  1576. var msPattern$1 = /^-ms-/;
  1577. var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon
  1578. var badStyleValueWithSemicolonPattern = /;\s*$/;
  1579. var warnedStyleNames = {};
  1580. var warnedStyleValues = {};
  1581. var warnedForNaNValue = false;
  1582. var warnedForInfinityValue = false;
  1583. var camelize = function (string) {
  1584. return string.replace(hyphenPattern, function (_, character) {
  1585. return character.toUpperCase();
  1586. });
  1587. };
  1588. var warnHyphenatedStyleName = function (name) {
  1589. if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
  1590. return;
  1591. }
  1592. warnedStyleNames[name] = true;
  1593. warning$1(false, 'Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
  1594. // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
  1595. // is converted to lowercase `ms`.
  1596. camelize(name.replace(msPattern$1, 'ms-')));
  1597. };
  1598. var warnBadVendoredStyleName = function (name) {
  1599. if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
  1600. return;
  1601. }
  1602. warnedStyleNames[name] = true;
  1603. warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
  1604. };
  1605. var warnStyleValueWithSemicolon = function (name, value) {
  1606. if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
  1607. return;
  1608. }
  1609. warnedStyleValues[value] = true;
  1610. warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
  1611. };
  1612. var warnStyleValueIsNaN = function (name, value) {
  1613. if (warnedForNaNValue) {
  1614. return;
  1615. }
  1616. warnedForNaNValue = true;
  1617. warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
  1618. };
  1619. var warnStyleValueIsInfinity = function (name, value) {
  1620. if (warnedForInfinityValue) {
  1621. return;
  1622. }
  1623. warnedForInfinityValue = true;
  1624. warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
  1625. };
  1626. warnValidStyle = function (name, value) {
  1627. if (name.indexOf('-') > -1) {
  1628. warnHyphenatedStyleName(name);
  1629. } else if (badVendoredStyleNamePattern.test(name)) {
  1630. warnBadVendoredStyleName(name);
  1631. } else if (badStyleValueWithSemicolonPattern.test(value)) {
  1632. warnStyleValueWithSemicolon(name, value);
  1633. }
  1634. if (typeof value === 'number') {
  1635. if (isNaN(value)) {
  1636. warnStyleValueIsNaN(name, value);
  1637. } else if (!isFinite(value)) {
  1638. warnStyleValueIsInfinity(name, value);
  1639. }
  1640. }
  1641. };
  1642. }
  1643. var warnValidStyle$1 = warnValidStyle;
  1644. var ariaProperties = {
  1645. 'aria-current': 0,
  1646. // state
  1647. 'aria-details': 0,
  1648. 'aria-disabled': 0,
  1649. // state
  1650. 'aria-hidden': 0,
  1651. // state
  1652. 'aria-invalid': 0,
  1653. // state
  1654. 'aria-keyshortcuts': 0,
  1655. 'aria-label': 0,
  1656. 'aria-roledescription': 0,
  1657. // Widget Attributes
  1658. 'aria-autocomplete': 0,
  1659. 'aria-checked': 0,
  1660. 'aria-expanded': 0,
  1661. 'aria-haspopup': 0,
  1662. 'aria-level': 0,
  1663. 'aria-modal': 0,
  1664. 'aria-multiline': 0,
  1665. 'aria-multiselectable': 0,
  1666. 'aria-orientation': 0,
  1667. 'aria-placeholder': 0,
  1668. 'aria-pressed': 0,
  1669. 'aria-readonly': 0,
  1670. 'aria-required': 0,
  1671. 'aria-selected': 0,
  1672. 'aria-sort': 0,
  1673. 'aria-valuemax': 0,
  1674. 'aria-valuemin': 0,
  1675. 'aria-valuenow': 0,
  1676. 'aria-valuetext': 0,
  1677. // Live Region Attributes
  1678. 'aria-atomic': 0,
  1679. 'aria-busy': 0,
  1680. 'aria-live': 0,
  1681. 'aria-relevant': 0,
  1682. // Drag-and-Drop Attributes
  1683. 'aria-dropeffect': 0,
  1684. 'aria-grabbed': 0,
  1685. // Relationship Attributes
  1686. 'aria-activedescendant': 0,
  1687. 'aria-colcount': 0,
  1688. 'aria-colindex': 0,
  1689. 'aria-colspan': 0,
  1690. 'aria-controls': 0,
  1691. 'aria-describedby': 0,
  1692. 'aria-errormessage': 0,
  1693. 'aria-flowto': 0,
  1694. 'aria-labelledby': 0,
  1695. 'aria-owns': 0,
  1696. 'aria-posinset': 0,
  1697. 'aria-rowcount': 0,
  1698. 'aria-rowindex': 0,
  1699. 'aria-rowspan': 0,
  1700. 'aria-setsize': 0
  1701. };
  1702. var warnedProperties = {};
  1703. var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  1704. var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
  1705. var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  1706. function validateProperty(tagName, name) {
  1707. if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) {
  1708. return true;
  1709. }
  1710. if (rARIACamel.test(name)) {
  1711. var ariaName = 'aria-' + name.slice(4).toLowerCase();
  1712. var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM
  1713. // DOM properties, then it is an invalid aria-* attribute.
  1714. if (correctName == null) {
  1715. warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
  1716. warnedProperties[name] = true;
  1717. return true;
  1718. } // aria-* attributes should be lowercase; suggest the lowercase version.
  1719. if (name !== correctName) {
  1720. warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
  1721. warnedProperties[name] = true;
  1722. return true;
  1723. }
  1724. }
  1725. if (rARIA.test(name)) {
  1726. var lowerCasedName = name.toLowerCase();
  1727. var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM
  1728. // DOM properties, then it is an invalid aria-* attribute.
  1729. if (standardName == null) {
  1730. warnedProperties[name] = true;
  1731. return false;
  1732. } // aria-* attributes should be lowercase; suggest the lowercase version.
  1733. if (name !== standardName) {
  1734. warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
  1735. warnedProperties[name] = true;
  1736. return true;
  1737. }
  1738. }
  1739. return true;
  1740. }
  1741. function warnInvalidARIAProps(type, props) {
  1742. var invalidProps = [];
  1743. for (var key in props) {
  1744. var isValid = validateProperty(type, key);
  1745. if (!isValid) {
  1746. invalidProps.push(key);
  1747. }
  1748. }
  1749. var unknownPropString = invalidProps.map(function (prop) {
  1750. return '`' + prop + '`';
  1751. }).join(', ');
  1752. if (invalidProps.length === 1) {
  1753. warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  1754. } else if (invalidProps.length > 1) {
  1755. warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  1756. }
  1757. }
  1758. function validateProperties(type, props) {
  1759. if (isCustomComponent(type, props)) {
  1760. return;
  1761. }
  1762. warnInvalidARIAProps(type, props);
  1763. }
  1764. var didWarnValueNull = false;
  1765. function validateProperties$1(type, props) {
  1766. if (type !== 'input' && type !== 'textarea' && type !== 'select') {
  1767. return;
  1768. }
  1769. if (props != null && props.value === null && !didWarnValueNull) {
  1770. didWarnValueNull = true;
  1771. if (type === 'select' && props.multiple) {
  1772. warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
  1773. } else {
  1774. warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
  1775. }
  1776. }
  1777. }
  1778. /**
  1779. * Registers plugins so that they can extract and dispatch events.
  1780. *
  1781. * @see {EventPluginHub}
  1782. */
  1783. /**
  1784. * Ordered list of injected plugins.
  1785. */
  1786. /**
  1787. * Mapping from event name to dispatch config
  1788. */
  1789. /**
  1790. * Mapping from registration name to plugin module
  1791. */
  1792. var registrationNameModules = {};
  1793. /**
  1794. * Mapping from registration name to event name
  1795. */
  1796. /**
  1797. * Mapping from lowercase registration names to the properly cased version,
  1798. * used to warn in the case of missing event handlers. Available
  1799. * only in true.
  1800. * @type {Object}
  1801. */
  1802. var possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true
  1803. /**
  1804. * Injects an ordering of plugins (by plugin name). This allows the ordering
  1805. * to be decoupled from injection of the actual plugins so that ordering is
  1806. * always deterministic regardless of packaging, on-the-fly injection, etc.
  1807. *
  1808. * @param {array} InjectedEventPluginOrder
  1809. * @internal
  1810. * @see {EventPluginHub.injection.injectEventPluginOrder}
  1811. */
  1812. /**
  1813. * Injects plugins to be used by `EventPluginHub`. The plugin names must be
  1814. * in the ordering injected by `injectEventPluginOrder`.
  1815. *
  1816. * Plugins can be injected as part of page initialization or on-the-fly.
  1817. *
  1818. * @param {object} injectedNamesToPlugins Map from names to plugin modules.
  1819. * @internal
  1820. * @see {EventPluginHub.injection.injectEventPluginsByName}
  1821. */
  1822. // When adding attributes to the HTML or SVG whitelist, be sure to
  1823. // also add them to this module to ensure casing and incorrect name
  1824. // warnings.
  1825. var possibleStandardNames = {
  1826. // HTML
  1827. accept: 'accept',
  1828. acceptcharset: 'acceptCharset',
  1829. 'accept-charset': 'acceptCharset',
  1830. accesskey: 'accessKey',
  1831. action: 'action',
  1832. allowfullscreen: 'allowFullScreen',
  1833. alt: 'alt',
  1834. as: 'as',
  1835. async: 'async',
  1836. autocapitalize: 'autoCapitalize',
  1837. autocomplete: 'autoComplete',
  1838. autocorrect: 'autoCorrect',
  1839. autofocus: 'autoFocus',
  1840. autoplay: 'autoPlay',
  1841. autosave: 'autoSave',
  1842. capture: 'capture',
  1843. cellpadding: 'cellPadding',
  1844. cellspacing: 'cellSpacing',
  1845. challenge: 'challenge',
  1846. charset: 'charSet',
  1847. checked: 'checked',
  1848. children: 'children',
  1849. cite: 'cite',
  1850. class: 'className',
  1851. classid: 'classID',
  1852. classname: 'className',
  1853. cols: 'cols',
  1854. colspan: 'colSpan',
  1855. content: 'content',
  1856. contenteditable: 'contentEditable',
  1857. contextmenu: 'contextMenu',
  1858. controls: 'controls',
  1859. controlslist: 'controlsList',
  1860. coords: 'coords',
  1861. crossorigin: 'crossOrigin',
  1862. dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
  1863. data: 'data',
  1864. datetime: 'dateTime',
  1865. default: 'default',
  1866. defaultchecked: 'defaultChecked',
  1867. defaultvalue: 'defaultValue',
  1868. defer: 'defer',
  1869. dir: 'dir',
  1870. disabled: 'disabled',
  1871. disablepictureinpicture: 'disablePictureInPicture',
  1872. download: 'download',
  1873. draggable: 'draggable',
  1874. enctype: 'encType',
  1875. for: 'htmlFor',
  1876. form: 'form',
  1877. formmethod: 'formMethod',
  1878. formaction: 'formAction',
  1879. formenctype: 'formEncType',
  1880. formnovalidate: 'formNoValidate',
  1881. formtarget: 'formTarget',
  1882. frameborder: 'frameBorder',
  1883. headers: 'headers',
  1884. height: 'height',
  1885. hidden: 'hidden',
  1886. high: 'high',
  1887. href: 'href',
  1888. hreflang: 'hrefLang',
  1889. htmlfor: 'htmlFor',
  1890. httpequiv: 'httpEquiv',
  1891. 'http-equiv': 'httpEquiv',
  1892. icon: 'icon',
  1893. id: 'id',
  1894. innerhtml: 'innerHTML',
  1895. inputmode: 'inputMode',
  1896. integrity: 'integrity',
  1897. is: 'is',
  1898. itemid: 'itemID',
  1899. itemprop: 'itemProp',
  1900. itemref: 'itemRef',
  1901. itemscope: 'itemScope',
  1902. itemtype: 'itemType',
  1903. keyparams: 'keyParams',
  1904. keytype: 'keyType',
  1905. kind: 'kind',
  1906. label: 'label',
  1907. lang: 'lang',
  1908. list: 'list',
  1909. loop: 'loop',
  1910. low: 'low',
  1911. manifest: 'manifest',
  1912. marginwidth: 'marginWidth',
  1913. marginheight: 'marginHeight',
  1914. max: 'max',
  1915. maxlength: 'maxLength',
  1916. media: 'media',
  1917. mediagroup: 'mediaGroup',
  1918. method: 'method',
  1919. min: 'min',
  1920. minlength: 'minLength',
  1921. multiple: 'multiple',
  1922. muted: 'muted',
  1923. name: 'name',
  1924. nomodule: 'noModule',
  1925. nonce: 'nonce',
  1926. novalidate: 'noValidate',
  1927. open: 'open',
  1928. optimum: 'optimum',
  1929. pattern: 'pattern',
  1930. placeholder: 'placeholder',
  1931. playsinline: 'playsInline',
  1932. poster: 'poster',
  1933. preload: 'preload',
  1934. profile: 'profile',
  1935. radiogroup: 'radioGroup',
  1936. readonly: 'readOnly',
  1937. referrerpolicy: 'referrerPolicy',
  1938. rel: 'rel',
  1939. required: 'required',
  1940. reversed: 'reversed',
  1941. role: 'role',
  1942. rows: 'rows',
  1943. rowspan: 'rowSpan',
  1944. sandbox: 'sandbox',
  1945. scope: 'scope',
  1946. scoped: 'scoped',
  1947. scrolling: 'scrolling',
  1948. seamless: 'seamless',
  1949. selected: 'selected',
  1950. shape: 'shape',
  1951. size: 'size',
  1952. sizes: 'sizes',
  1953. span: 'span',
  1954. spellcheck: 'spellCheck',
  1955. src: 'src',
  1956. srcdoc: 'srcDoc',
  1957. srclang: 'srcLang',
  1958. srcset: 'srcSet',
  1959. start: 'start',
  1960. step: 'step',
  1961. style: 'style',
  1962. summary: 'summary',
  1963. tabindex: 'tabIndex',
  1964. target: 'target',
  1965. title: 'title',
  1966. type: 'type',
  1967. usemap: 'useMap',
  1968. value: 'value',
  1969. width: 'width',
  1970. wmode: 'wmode',
  1971. wrap: 'wrap',
  1972. // SVG
  1973. about: 'about',
  1974. accentheight: 'accentHeight',
  1975. 'accent-height': 'accentHeight',
  1976. accumulate: 'accumulate',
  1977. additive: 'additive',
  1978. alignmentbaseline: 'alignmentBaseline',
  1979. 'alignment-baseline': 'alignmentBaseline',
  1980. allowreorder: 'allowReorder',
  1981. alphabetic: 'alphabetic',
  1982. amplitude: 'amplitude',
  1983. arabicform: 'arabicForm',
  1984. 'arabic-form': 'arabicForm',
  1985. ascent: 'ascent',
  1986. attributename: 'attributeName',
  1987. attributetype: 'attributeType',
  1988. autoreverse: 'autoReverse',
  1989. azimuth: 'azimuth',
  1990. basefrequency: 'baseFrequency',
  1991. baselineshift: 'baselineShift',
  1992. 'baseline-shift': 'baselineShift',
  1993. baseprofile: 'baseProfile',
  1994. bbox: 'bbox',
  1995. begin: 'begin',
  1996. bias: 'bias',
  1997. by: 'by',
  1998. calcmode: 'calcMode',
  1999. capheight: 'capHeight',
  2000. 'cap-height': 'capHeight',
  2001. clip: 'clip',
  2002. clippath: 'clipPath',
  2003. 'clip-path': 'clipPath',
  2004. clippathunits: 'clipPathUnits',
  2005. cliprule: 'clipRule',
  2006. 'clip-rule': 'clipRule',
  2007. color: 'color',
  2008. colorinterpolation: 'colorInterpolation',
  2009. 'color-interpolation': 'colorInterpolation',
  2010. colorinterpolationfilters: 'colorInterpolationFilters',
  2011. 'color-interpolation-filters': 'colorInterpolationFilters',
  2012. colorprofile: 'colorProfile',
  2013. 'color-profile': 'colorProfile',
  2014. colorrendering: 'colorRendering',
  2015. 'color-rendering': 'colorRendering',
  2016. contentscripttype: 'contentScriptType',
  2017. contentstyletype: 'contentStyleType',
  2018. cursor: 'cursor',
  2019. cx: 'cx',
  2020. cy: 'cy',
  2021. d: 'd',
  2022. datatype: 'datatype',
  2023. decelerate: 'decelerate',
  2024. descent: 'descent',
  2025. diffuseconstant: 'diffuseConstant',
  2026. direction: 'direction',
  2027. display: 'display',
  2028. divisor: 'divisor',
  2029. dominantbaseline: 'dominantBaseline',
  2030. 'dominant-baseline': 'dominantBaseline',
  2031. dur: 'dur',
  2032. dx: 'dx',
  2033. dy: 'dy',
  2034. edgemode: 'edgeMode',
  2035. elevation: 'elevation',
  2036. enablebackground: 'enableBackground',
  2037. 'enable-background': 'enableBackground',
  2038. end: 'end',
  2039. exponent: 'exponent',
  2040. externalresourcesrequired: 'externalResourcesRequired',
  2041. fill: 'fill',
  2042. fillopacity: 'fillOpacity',
  2043. 'fill-opacity': 'fillOpacity',
  2044. fillrule: 'fillRule',
  2045. 'fill-rule': 'fillRule',
  2046. filter: 'filter',
  2047. filterres: 'filterRes',
  2048. filterunits: 'filterUnits',
  2049. floodopacity: 'floodOpacity',
  2050. 'flood-opacity': 'floodOpacity',
  2051. floodcolor: 'floodColor',
  2052. 'flood-color': 'floodColor',
  2053. focusable: 'focusable',
  2054. fontfamily: 'fontFamily',
  2055. 'font-family': 'fontFamily',
  2056. fontsize: 'fontSize',
  2057. 'font-size': 'fontSize',
  2058. fontsizeadjust: 'fontSizeAdjust',
  2059. 'font-size-adjust': 'fontSizeAdjust',
  2060. fontstretch: 'fontStretch',
  2061. 'font-stretch': 'fontStretch',
  2062. fontstyle: 'fontStyle',
  2063. 'font-style': 'fontStyle',
  2064. fontvariant: 'fontVariant',
  2065. 'font-variant': 'fontVariant',
  2066. fontweight: 'fontWeight',
  2067. 'font-weight': 'fontWeight',
  2068. format: 'format',
  2069. from: 'from',
  2070. fx: 'fx',
  2071. fy: 'fy',
  2072. g1: 'g1',
  2073. g2: 'g2',
  2074. glyphname: 'glyphName',
  2075. 'glyph-name': 'glyphName',
  2076. glyphorientationhorizontal: 'glyphOrientationHorizontal',
  2077. 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
  2078. glyphorientationvertical: 'glyphOrientationVertical',
  2079. 'glyph-orientation-vertical': 'glyphOrientationVertical',
  2080. glyphref: 'glyphRef',
  2081. gradienttransform: 'gradientTransform',
  2082. gradientunits: 'gradientUnits',
  2083. hanging: 'hanging',
  2084. horizadvx: 'horizAdvX',
  2085. 'horiz-adv-x': 'horizAdvX',
  2086. horizoriginx: 'horizOriginX',
  2087. 'horiz-origin-x': 'horizOriginX',
  2088. ideographic: 'ideographic',
  2089. imagerendering: 'imageRendering',
  2090. 'image-rendering': 'imageRendering',
  2091. in2: 'in2',
  2092. in: 'in',
  2093. inlist: 'inlist',
  2094. intercept: 'intercept',
  2095. k1: 'k1',
  2096. k2: 'k2',
  2097. k3: 'k3',
  2098. k4: 'k4',
  2099. k: 'k',
  2100. kernelmatrix: 'kernelMatrix',
  2101. kernelunitlength: 'kernelUnitLength',
  2102. kerning: 'kerning',
  2103. keypoints: 'keyPoints',
  2104. keysplines: 'keySplines',
  2105. keytimes: 'keyTimes',
  2106. lengthadjust: 'lengthAdjust',
  2107. letterspacing: 'letterSpacing',
  2108. 'letter-spacing': 'letterSpacing',
  2109. lightingcolor: 'lightingColor',
  2110. 'lighting-color': 'lightingColor',
  2111. limitingconeangle: 'limitingConeAngle',
  2112. local: 'local',
  2113. markerend: 'markerEnd',
  2114. 'marker-end': 'markerEnd',
  2115. markerheight: 'markerHeight',
  2116. markermid: 'markerMid',
  2117. 'marker-mid': 'markerMid',
  2118. markerstart: 'markerStart',
  2119. 'marker-start': 'markerStart',
  2120. markerunits: 'markerUnits',
  2121. markerwidth: 'markerWidth',
  2122. mask: 'mask',
  2123. maskcontentunits: 'maskContentUnits',
  2124. maskunits: 'maskUnits',
  2125. mathematical: 'mathematical',
  2126. mode: 'mode',
  2127. numoctaves: 'numOctaves',
  2128. offset: 'offset',
  2129. opacity: 'opacity',
  2130. operator: 'operator',
  2131. order: 'order',
  2132. orient: 'orient',
  2133. orientation: 'orientation',
  2134. origin: 'origin',
  2135. overflow: 'overflow',
  2136. overlineposition: 'overlinePosition',
  2137. 'overline-position': 'overlinePosition',
  2138. overlinethickness: 'overlineThickness',
  2139. 'overline-thickness': 'overlineThickness',
  2140. paintorder: 'paintOrder',
  2141. 'paint-order': 'paintOrder',
  2142. panose1: 'panose1',
  2143. 'panose-1': 'panose1',
  2144. pathlength: 'pathLength',
  2145. patterncontentunits: 'patternContentUnits',
  2146. patterntransform: 'patternTransform',
  2147. patternunits: 'patternUnits',
  2148. pointerevents: 'pointerEvents',
  2149. 'pointer-events': 'pointerEvents',
  2150. points: 'points',
  2151. pointsatx: 'pointsAtX',
  2152. pointsaty: 'pointsAtY',
  2153. pointsatz: 'pointsAtZ',
  2154. prefix: 'prefix',
  2155. preservealpha: 'preserveAlpha',
  2156. preserveaspectratio: 'preserveAspectRatio',
  2157. primitiveunits: 'primitiveUnits',
  2158. property: 'property',
  2159. r: 'r',
  2160. radius: 'radius',
  2161. refx: 'refX',
  2162. refy: 'refY',
  2163. renderingintent: 'renderingIntent',
  2164. 'rendering-intent': 'renderingIntent',
  2165. repeatcount: 'repeatCount',
  2166. repeatdur: 'repeatDur',
  2167. requiredextensions: 'requiredExtensions',
  2168. requiredfeatures: 'requiredFeatures',
  2169. resource: 'resource',
  2170. restart: 'restart',
  2171. result: 'result',
  2172. results: 'results',
  2173. rotate: 'rotate',
  2174. rx: 'rx',
  2175. ry: 'ry',
  2176. scale: 'scale',
  2177. security: 'security',
  2178. seed: 'seed',
  2179. shaperendering: 'shapeRendering',
  2180. 'shape-rendering': 'shapeRendering',
  2181. slope: 'slope',
  2182. spacing: 'spacing',
  2183. specularconstant: 'specularConstant',
  2184. specularexponent: 'specularExponent',
  2185. speed: 'speed',
  2186. spreadmethod: 'spreadMethod',
  2187. startoffset: 'startOffset',
  2188. stddeviation: 'stdDeviation',
  2189. stemh: 'stemh',
  2190. stemv: 'stemv',
  2191. stitchtiles: 'stitchTiles',
  2192. stopcolor: 'stopColor',
  2193. 'stop-color': 'stopColor',
  2194. stopopacity: 'stopOpacity',
  2195. 'stop-opacity': 'stopOpacity',
  2196. strikethroughposition: 'strikethroughPosition',
  2197. 'strikethrough-position': 'strikethroughPosition',
  2198. strikethroughthickness: 'strikethroughThickness',
  2199. 'strikethrough-thickness': 'strikethroughThickness',
  2200. string: 'string',
  2201. stroke: 'stroke',
  2202. strokedasharray: 'strokeDasharray',
  2203. 'stroke-dasharray': 'strokeDasharray',
  2204. strokedashoffset: 'strokeDashoffset',
  2205. 'stroke-dashoffset': 'strokeDashoffset',
  2206. strokelinecap: 'strokeLinecap',
  2207. 'stroke-linecap': 'strokeLinecap',
  2208. strokelinejoin: 'strokeLinejoin',
  2209. 'stroke-linejoin': 'strokeLinejoin',
  2210. strokemiterlimit: 'strokeMiterlimit',
  2211. 'stroke-miterlimit': 'strokeMiterlimit',
  2212. strokewidth: 'strokeWidth',
  2213. 'stroke-width': 'strokeWidth',
  2214. strokeopacity: 'strokeOpacity',
  2215. 'stroke-opacity': 'strokeOpacity',
  2216. suppresscontenteditablewarning: 'suppressContentEditableWarning',
  2217. suppresshydrationwarning: 'suppressHydrationWarning',
  2218. surfacescale: 'surfaceScale',
  2219. systemlanguage: 'systemLanguage',
  2220. tablevalues: 'tableValues',
  2221. targetx: 'targetX',
  2222. targety: 'targetY',
  2223. textanchor: 'textAnchor',
  2224. 'text-anchor': 'textAnchor',
  2225. textdecoration: 'textDecoration',
  2226. 'text-decoration': 'textDecoration',
  2227. textlength: 'textLength',
  2228. textrendering: 'textRendering',
  2229. 'text-rendering': 'textRendering',
  2230. to: 'to',
  2231. transform: 'transform',
  2232. typeof: 'typeof',
  2233. u1: 'u1',
  2234. u2: 'u2',
  2235. underlineposition: 'underlinePosition',
  2236. 'underline-position': 'underlinePosition',
  2237. underlinethickness: 'underlineThickness',
  2238. 'underline-thickness': 'underlineThickness',
  2239. unicode: 'unicode',
  2240. unicodebidi: 'unicodeBidi',
  2241. 'unicode-bidi': 'unicodeBidi',
  2242. unicoderange: 'unicodeRange',
  2243. 'unicode-range': 'unicodeRange',
  2244. unitsperem: 'unitsPerEm',
  2245. 'units-per-em': 'unitsPerEm',
  2246. unselectable: 'unselectable',
  2247. valphabetic: 'vAlphabetic',
  2248. 'v-alphabetic': 'vAlphabetic',
  2249. values: 'values',
  2250. vectoreffect: 'vectorEffect',
  2251. 'vector-effect': 'vectorEffect',
  2252. version: 'version',
  2253. vertadvy: 'vertAdvY',
  2254. 'vert-adv-y': 'vertAdvY',
  2255. vertoriginx: 'vertOriginX',
  2256. 'vert-origin-x': 'vertOriginX',
  2257. vertoriginy: 'vertOriginY',
  2258. 'vert-origin-y': 'vertOriginY',
  2259. vhanging: 'vHanging',
  2260. 'v-hanging': 'vHanging',
  2261. videographic: 'vIdeographic',
  2262. 'v-ideographic': 'vIdeographic',
  2263. viewbox: 'viewBox',
  2264. viewtarget: 'viewTarget',
  2265. visibility: 'visibility',
  2266. vmathematical: 'vMathematical',
  2267. 'v-mathematical': 'vMathematical',
  2268. vocab: 'vocab',
  2269. widths: 'widths',
  2270. wordspacing: 'wordSpacing',
  2271. 'word-spacing': 'wordSpacing',
  2272. writingmode: 'writingMode',
  2273. 'writing-mode': 'writingMode',
  2274. x1: 'x1',
  2275. x2: 'x2',
  2276. x: 'x',
  2277. xchannelselector: 'xChannelSelector',
  2278. xheight: 'xHeight',
  2279. 'x-height': 'xHeight',
  2280. xlinkactuate: 'xlinkActuate',
  2281. 'xlink:actuate': 'xlinkActuate',
  2282. xlinkarcrole: 'xlinkArcrole',
  2283. 'xlink:arcrole': 'xlinkArcrole',
  2284. xlinkhref: 'xlinkHref',
  2285. 'xlink:href': 'xlinkHref',
  2286. xlinkrole: 'xlinkRole',
  2287. 'xlink:role': 'xlinkRole',
  2288. xlinkshow: 'xlinkShow',
  2289. 'xlink:show': 'xlinkShow',
  2290. xlinktitle: 'xlinkTitle',
  2291. 'xlink:title': 'xlinkTitle',
  2292. xlinktype: 'xlinkType',
  2293. 'xlink:type': 'xlinkType',
  2294. xmlbase: 'xmlBase',
  2295. 'xml:base': 'xmlBase',
  2296. xmllang: 'xmlLang',
  2297. 'xml:lang': 'xmlLang',
  2298. xmlns: 'xmlns',
  2299. 'xml:space': 'xmlSpace',
  2300. xmlnsxlink: 'xmlnsXlink',
  2301. 'xmlns:xlink': 'xmlnsXlink',
  2302. xmlspace: 'xmlSpace',
  2303. y1: 'y1',
  2304. y2: 'y2',
  2305. y: 'y',
  2306. ychannelselector: 'yChannelSelector',
  2307. z: 'z',
  2308. zoomandpan: 'zoomAndPan'
  2309. };
  2310. var validateProperty$1 = function () {};
  2311. {
  2312. var warnedProperties$1 = {};
  2313. var _hasOwnProperty = Object.prototype.hasOwnProperty;
  2314. var EVENT_NAME_REGEX = /^on./;
  2315. var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
  2316. var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  2317. var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
  2318. validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
  2319. if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
  2320. return true;
  2321. }
  2322. var lowerCasedName = name.toLowerCase();
  2323. if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
  2324. warning$1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
  2325. warnedProperties$1[name] = true;
  2326. return true;
  2327. } // We can't rely on the event system being injected on the server.
  2328. if (canUseEventSystem) {
  2329. if (registrationNameModules.hasOwnProperty(name)) {
  2330. return true;
  2331. }
  2332. var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
  2333. if (registrationName != null) {
  2334. warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
  2335. warnedProperties$1[name] = true;
  2336. return true;
  2337. }
  2338. if (EVENT_NAME_REGEX.test(name)) {
  2339. warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
  2340. warnedProperties$1[name] = true;
  2341. return true;
  2342. }
  2343. } else if (EVENT_NAME_REGEX.test(name)) {
  2344. // If no event plugins have been injected, we are in a server environment.
  2345. // So we can't tell if the event name is correct for sure, but we can filter
  2346. // out known bad ones like `onclick`. We can't suggest a specific replacement though.
  2347. if (INVALID_EVENT_NAME_REGEX.test(name)) {
  2348. warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
  2349. }
  2350. warnedProperties$1[name] = true;
  2351. return true;
  2352. } // Let the ARIA attribute hook validate ARIA attributes
  2353. if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
  2354. return true;
  2355. }
  2356. if (lowerCasedName === 'innerhtml') {
  2357. warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
  2358. warnedProperties$1[name] = true;
  2359. return true;
  2360. }
  2361. if (lowerCasedName === 'aria') {
  2362. warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
  2363. warnedProperties$1[name] = true;
  2364. return true;
  2365. }
  2366. if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
  2367. warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
  2368. warnedProperties$1[name] = true;
  2369. return true;
  2370. }
  2371. if (typeof value === 'number' && isNaN(value)) {
  2372. warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
  2373. warnedProperties$1[name] = true;
  2374. return true;
  2375. }
  2376. var propertyInfo = getPropertyInfo(name);
  2377. var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.
  2378. if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
  2379. var standardName = possibleStandardNames[lowerCasedName];
  2380. if (standardName !== name) {
  2381. warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
  2382. warnedProperties$1[name] = true;
  2383. return true;
  2384. }
  2385. } else if (!isReserved && name !== lowerCasedName) {
  2386. // Unknown attributes should have lowercase casing since that's how they
  2387. // will be cased anyway with server rendering.
  2388. warning$1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
  2389. warnedProperties$1[name] = true;
  2390. return true;
  2391. }
  2392. if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
  2393. if (value) {
  2394. warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
  2395. } else {
  2396. warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
  2397. }
  2398. warnedProperties$1[name] = true;
  2399. return true;
  2400. } // Now that we've validated casing, do not validate
  2401. // data types for reserved props
  2402. if (isReserved) {
  2403. return true;
  2404. } // Warn when a known attribute is a bad type
  2405. if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
  2406. warnedProperties$1[name] = true;
  2407. return false;
  2408. } // Warn when passing the strings 'false' or 'true' into a boolean prop
  2409. if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
  2410. warning$1(false, 'Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
  2411. warnedProperties$1[name] = true;
  2412. return true;
  2413. }
  2414. return true;
  2415. };
  2416. }
  2417. var warnUnknownProperties = function (type, props, canUseEventSystem) {
  2418. var unknownProps = [];
  2419. for (var key in props) {
  2420. var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
  2421. if (!isValid) {
  2422. unknownProps.push(key);
  2423. }
  2424. }
  2425. var unknownPropString = unknownProps.map(function (prop) {
  2426. return '`' + prop + '`';
  2427. }).join(', ');
  2428. if (unknownProps.length === 1) {
  2429. warning$1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  2430. } else if (unknownProps.length > 1) {
  2431. warning$1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  2432. }
  2433. };
  2434. function validateProperties$2(type, props, canUseEventSystem) {
  2435. if (isCustomComponent(type, props)) {
  2436. return;
  2437. }
  2438. warnUnknownProperties(type, props, canUseEventSystem);
  2439. }
  2440. var toArray = React.Children.toArray; // This is only used in DEV.
  2441. // Each entry is `this.stack` from a currently executing renderer instance.
  2442. // (There may be more than one because ReactDOMServer is reentrant).
  2443. // Each stack is an array of frames which may contain nested stacks of elements.
  2444. var currentDebugStacks = [];
  2445. var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
  2446. var ReactDebugCurrentFrame;
  2447. var prevGetCurrentStackImpl = null;
  2448. var getCurrentServerStackImpl = function () {
  2449. return '';
  2450. };
  2451. var describeStackFrame = function (element) {
  2452. return '';
  2453. };
  2454. var validatePropertiesInDevelopment = function (type, props) {};
  2455. var pushCurrentDebugStack = function (stack) {};
  2456. var pushElementToDebugStack = function (element) {};
  2457. var popCurrentDebugStack = function () {};
  2458. var hasWarnedAboutUsingContextAsConsumer = false;
  2459. {
  2460. ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
  2461. validatePropertiesInDevelopment = function (type, props) {
  2462. validateProperties(type, props);
  2463. validateProperties$1(type, props);
  2464. validateProperties$2(type, props,
  2465. /* canUseEventSystem */
  2466. false);
  2467. };
  2468. describeStackFrame = function (element) {
  2469. var source = element._source;
  2470. var type = element.type;
  2471. var name = getComponentName(type);
  2472. var ownerName = null;
  2473. return describeComponentFrame(name, source, ownerName);
  2474. };
  2475. pushCurrentDebugStack = function (stack) {
  2476. currentDebugStacks.push(stack);
  2477. if (currentDebugStacks.length === 1) {
  2478. // We are entering a server renderer.
  2479. // Remember the previous (e.g. client) global stack implementation.
  2480. prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
  2481. ReactDebugCurrentFrame.getCurrentStack = getCurrentServerStackImpl;
  2482. }
  2483. };
  2484. pushElementToDebugStack = function (element) {
  2485. // For the innermost executing ReactDOMServer call,
  2486. var stack = currentDebugStacks[currentDebugStacks.length - 1]; // Take the innermost executing frame (e.g. <Foo>),
  2487. var frame = stack[stack.length - 1]; // and record that it has one more element associated with it.
  2488. frame.debugElementStack.push(element); // We only need this because we tail-optimize single-element
  2489. // children and directly handle them in an inner loop instead of
  2490. // creating separate frames for them.
  2491. };
  2492. popCurrentDebugStack = function () {
  2493. currentDebugStacks.pop();
  2494. if (currentDebugStacks.length === 0) {
  2495. // We are exiting the server renderer.
  2496. // Restore the previous (e.g. client) global stack implementation.
  2497. ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
  2498. prevGetCurrentStackImpl = null;
  2499. }
  2500. };
  2501. getCurrentServerStackImpl = function () {
  2502. if (currentDebugStacks.length === 0) {
  2503. // Nothing is currently rendering.
  2504. return '';
  2505. } // ReactDOMServer is reentrant so there may be multiple calls at the same time.
  2506. // Take the frames from the innermost call which is the last in the array.
  2507. var frames = currentDebugStacks[currentDebugStacks.length - 1];
  2508. var stack = ''; // Go through every frame in the stack from the innermost one.
  2509. for (var i = frames.length - 1; i >= 0; i--) {
  2510. var frame = frames[i]; // Every frame might have more than one debug element stack entry associated with it.
  2511. // This is because single-child nesting doesn't create materialized frames.
  2512. // Instead it would push them through `pushElementToDebugStack()`.
  2513. var debugElementStack = frame.debugElementStack;
  2514. for (var ii = debugElementStack.length - 1; ii >= 0; ii--) {
  2515. stack += describeStackFrame(debugElementStack[ii]);
  2516. }
  2517. }
  2518. return stack;
  2519. };
  2520. }
  2521. var didWarnDefaultInputValue = false;
  2522. var didWarnDefaultChecked = false;
  2523. var didWarnDefaultSelectValue = false;
  2524. var didWarnDefaultTextareaValue = false;
  2525. var didWarnInvalidOptionChildren = false;
  2526. var didWarnAboutNoopUpdateForComponent = {};
  2527. var didWarnAboutBadClass = {};
  2528. var didWarnAboutModulePatternComponent = {};
  2529. var didWarnAboutDeprecatedWillMount = {};
  2530. var didWarnAboutUndefinedDerivedState = {};
  2531. var didWarnAboutUninitializedState = {};
  2532. var valuePropNames = ['value', 'defaultValue'];
  2533. var newlineEatingTags = {
  2534. listing: true,
  2535. pre: true,
  2536. textarea: true
  2537. }; // We accept any tag to be rendered but since this gets injected into arbitrary
  2538. // HTML, we want to make sure that it's a safe tag.
  2539. // http://www.w3.org/TR/REC-xml/#NT-Name
  2540. var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
  2541. var validatedTagCache = {};
  2542. function validateDangerousTag(tag) {
  2543. if (!validatedTagCache.hasOwnProperty(tag)) {
  2544. if (!VALID_TAG_REGEX.test(tag)) {
  2545. {
  2546. throw Error("Invalid tag: " + tag);
  2547. }
  2548. }
  2549. validatedTagCache[tag] = true;
  2550. }
  2551. }
  2552. var styleNameCache = {};
  2553. var processStyleName = function (styleName) {
  2554. if (styleNameCache.hasOwnProperty(styleName)) {
  2555. return styleNameCache[styleName];
  2556. }
  2557. var result = hyphenateStyleName(styleName);
  2558. styleNameCache[styleName] = result;
  2559. return result;
  2560. };
  2561. function createMarkupForStyles(styles) {
  2562. var serialized = '';
  2563. var delimiter = '';
  2564. for (var styleName in styles) {
  2565. if (!styles.hasOwnProperty(styleName)) {
  2566. continue;
  2567. }
  2568. var isCustomProperty = styleName.indexOf('--') === 0;
  2569. var styleValue = styles[styleName];
  2570. {
  2571. if (!isCustomProperty) {
  2572. warnValidStyle$1(styleName, styleValue);
  2573. }
  2574. }
  2575. if (styleValue != null) {
  2576. serialized += delimiter + (isCustomProperty ? styleName : processStyleName(styleName)) + ':';
  2577. serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
  2578. delimiter = ';';
  2579. }
  2580. }
  2581. return serialized || null;
  2582. }
  2583. function warnNoop(publicInstance, callerName) {
  2584. {
  2585. var _constructor = publicInstance.constructor;
  2586. var componentName = _constructor && getComponentName(_constructor) || 'ReactClass';
  2587. var warningKey = componentName + '.' + callerName;
  2588. if (didWarnAboutNoopUpdateForComponent[warningKey]) {
  2589. return;
  2590. }
  2591. warningWithoutStack$1(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName);
  2592. didWarnAboutNoopUpdateForComponent[warningKey] = true;
  2593. }
  2594. }
  2595. function shouldConstruct(Component) {
  2596. return Component.prototype && Component.prototype.isReactComponent;
  2597. }
  2598. function getNonChildrenInnerMarkup(props) {
  2599. var innerHTML = props.dangerouslySetInnerHTML;
  2600. if (innerHTML != null) {
  2601. if (innerHTML.__html != null) {
  2602. return innerHTML.__html;
  2603. }
  2604. } else {
  2605. var content = props.children;
  2606. if (typeof content === 'string' || typeof content === 'number') {
  2607. return escapeTextForBrowser(content);
  2608. }
  2609. }
  2610. return null;
  2611. }
  2612. function flattenTopLevelChildren(children) {
  2613. if (!React.isValidElement(children)) {
  2614. return toArray(children);
  2615. }
  2616. var element = children;
  2617. if (element.type !== REACT_FRAGMENT_TYPE) {
  2618. return [element];
  2619. }
  2620. var fragmentChildren = element.props.children;
  2621. if (!React.isValidElement(fragmentChildren)) {
  2622. return toArray(fragmentChildren);
  2623. }
  2624. var fragmentChildElement = fragmentChildren;
  2625. return [fragmentChildElement];
  2626. }
  2627. function flattenOptionChildren(children) {
  2628. if (children === undefined || children === null) {
  2629. return children;
  2630. }
  2631. var content = ''; // Flatten children and warn if they aren't strings or numbers;
  2632. // invalid types are ignored.
  2633. React.Children.forEach(children, function (child) {
  2634. if (child == null) {
  2635. return;
  2636. }
  2637. content += child;
  2638. {
  2639. if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') {
  2640. didWarnInvalidOptionChildren = true;
  2641. warning$1(false, 'Only strings and numbers are supported as <option> children.');
  2642. }
  2643. }
  2644. });
  2645. return content;
  2646. }
  2647. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2648. var STYLE = 'style';
  2649. var RESERVED_PROPS = {
  2650. children: null,
  2651. dangerouslySetInnerHTML: null,
  2652. suppressContentEditableWarning: null,
  2653. suppressHydrationWarning: null
  2654. };
  2655. function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeStaticMarkup, isRootElement) {
  2656. var ret = '<' + tagVerbatim;
  2657. for (var propKey in props) {
  2658. if (!hasOwnProperty.call(props, propKey)) {
  2659. continue;
  2660. }
  2661. if (enableFlareAPI && propKey === 'listeners') {
  2662. continue;
  2663. }
  2664. var propValue = props[propKey];
  2665. if (propValue == null) {
  2666. continue;
  2667. }
  2668. if (propKey === STYLE) {
  2669. propValue = createMarkupForStyles(propValue);
  2670. }
  2671. var markup = null;
  2672. if (isCustomComponent(tagLowercase, props)) {
  2673. if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
  2674. markup = createMarkupForCustomAttribute(propKey, propValue);
  2675. }
  2676. } else {
  2677. markup = createMarkupForProperty(propKey, propValue);
  2678. }
  2679. if (markup) {
  2680. ret += ' ' + markup;
  2681. }
  2682. } // For static pages, no need to put React ID and checksum. Saves lots of
  2683. // bytes.
  2684. if (makeStaticMarkup) {
  2685. return ret;
  2686. }
  2687. if (isRootElement) {
  2688. ret += ' ' + createMarkupForRoot();
  2689. }
  2690. return ret;
  2691. }
  2692. function validateRenderResult(child, type) {
  2693. if (child === undefined) {
  2694. {
  2695. {
  2696. throw Error((getComponentName(type) || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
  2697. }
  2698. }
  2699. }
  2700. }
  2701. function resolve(child, context, threadID) {
  2702. while (React.isValidElement(child)) {
  2703. // Safe because we just checked it's an element.
  2704. var element = child;
  2705. var Component = element.type;
  2706. {
  2707. pushElementToDebugStack(element);
  2708. }
  2709. if (typeof Component !== 'function') {
  2710. break;
  2711. }
  2712. processChild(element, Component);
  2713. } // Extra closure so queue and replace can be captured properly
  2714. function processChild(element, Component) {
  2715. var isClass = shouldConstruct(Component);
  2716. var publicContext = processContext(Component, context, threadID, isClass);
  2717. var queue = [];
  2718. var replace = false;
  2719. var updater = {
  2720. isMounted: function (publicInstance) {
  2721. return false;
  2722. },
  2723. enqueueForceUpdate: function (publicInstance) {
  2724. if (queue === null) {
  2725. warnNoop(publicInstance, 'forceUpdate');
  2726. return null;
  2727. }
  2728. },
  2729. enqueueReplaceState: function (publicInstance, completeState) {
  2730. replace = true;
  2731. queue = [completeState];
  2732. },
  2733. enqueueSetState: function (publicInstance, currentPartialState) {
  2734. if (queue === null) {
  2735. warnNoop(publicInstance, 'setState');
  2736. return null;
  2737. }
  2738. queue.push(currentPartialState);
  2739. }
  2740. };
  2741. var inst;
  2742. if (isClass) {
  2743. inst = new Component(element.props, publicContext, updater);
  2744. if (typeof Component.getDerivedStateFromProps === 'function') {
  2745. {
  2746. if (inst.state === null || inst.state === undefined) {
  2747. var componentName = getComponentName(Component) || 'Unknown';
  2748. if (!didWarnAboutUninitializedState[componentName]) {
  2749. warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, inst.state === null ? 'null' : 'undefined', componentName);
  2750. didWarnAboutUninitializedState[componentName] = true;
  2751. }
  2752. }
  2753. }
  2754. var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);
  2755. {
  2756. if (partialState === undefined) {
  2757. var _componentName = getComponentName(Component) || 'Unknown';
  2758. if (!didWarnAboutUndefinedDerivedState[_componentName]) {
  2759. warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
  2760. didWarnAboutUndefinedDerivedState[_componentName] = true;
  2761. }
  2762. }
  2763. }
  2764. if (partialState != null) {
  2765. inst.state = _assign({}, inst.state, partialState);
  2766. }
  2767. }
  2768. } else {
  2769. {
  2770. if (Component.prototype && typeof Component.prototype.render === 'function') {
  2771. var _componentName2 = getComponentName(Component) || 'Unknown';
  2772. if (!didWarnAboutBadClass[_componentName2]) {
  2773. warningWithoutStack$1(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);
  2774. didWarnAboutBadClass[_componentName2] = true;
  2775. }
  2776. }
  2777. }
  2778. var componentIdentity = {};
  2779. prepareToUseHooks(componentIdentity);
  2780. inst = Component(element.props, publicContext, updater);
  2781. inst = finishHooks(Component, element.props, inst, publicContext);
  2782. if (inst == null || inst.render == null) {
  2783. child = inst;
  2784. validateRenderResult(child, Component);
  2785. return;
  2786. }
  2787. {
  2788. var _componentName3 = getComponentName(Component) || 'Unknown';
  2789. if (!didWarnAboutModulePatternComponent[_componentName3]) {
  2790. warningWithoutStack$1(false, 'The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName3, _componentName3, _componentName3);
  2791. didWarnAboutModulePatternComponent[_componentName3] = true;
  2792. }
  2793. }
  2794. }
  2795. inst.props = element.props;
  2796. inst.context = publicContext;
  2797. inst.updater = updater;
  2798. var initialState = inst.state;
  2799. if (initialState === undefined) {
  2800. inst.state = initialState = null;
  2801. }
  2802. if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {
  2803. if (typeof inst.componentWillMount === 'function') {
  2804. {
  2805. if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {
  2806. var _componentName4 = getComponentName(Component) || 'Unknown';
  2807. if (!didWarnAboutDeprecatedWillMount[_componentName4]) {
  2808. lowPriorityWarningWithoutStack$1(false, // keep this warning in sync with ReactStrictModeWarning.js
  2809. 'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code from componentWillMount to componentDidMount (preferred in most cases) ' + 'or the constructor.\n' + '\nPlease update the following components: %s', _componentName4);
  2810. didWarnAboutDeprecatedWillMount[_componentName4] = true;
  2811. }
  2812. }
  2813. } // In order to support react-lifecycles-compat polyfilled components,
  2814. // Unsafe lifecycles should not be invoked for any component with the new gDSFP.
  2815. if (typeof Component.getDerivedStateFromProps !== 'function') {
  2816. inst.componentWillMount();
  2817. }
  2818. }
  2819. if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {
  2820. // In order to support react-lifecycles-compat polyfilled components,
  2821. // Unsafe lifecycles should not be invoked for any component with the new gDSFP.
  2822. inst.UNSAFE_componentWillMount();
  2823. }
  2824. if (queue.length) {
  2825. var oldQueue = queue;
  2826. var oldReplace = replace;
  2827. queue = null;
  2828. replace = false;
  2829. if (oldReplace && oldQueue.length === 1) {
  2830. inst.state = oldQueue[0];
  2831. } else {
  2832. var nextState = oldReplace ? oldQueue[0] : inst.state;
  2833. var dontMutate = true;
  2834. for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {
  2835. var partial = oldQueue[i];
  2836. var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;
  2837. if (_partialState != null) {
  2838. if (dontMutate) {
  2839. dontMutate = false;
  2840. nextState = _assign({}, nextState, _partialState);
  2841. } else {
  2842. _assign(nextState, _partialState);
  2843. }
  2844. }
  2845. }
  2846. inst.state = nextState;
  2847. }
  2848. } else {
  2849. queue = null;
  2850. }
  2851. }
  2852. child = inst.render();
  2853. {
  2854. if (child === undefined && inst.render._isMockFunction) {
  2855. // This is probably bad practice. Consider warning here and
  2856. // deprecating this convenience.
  2857. child = null;
  2858. }
  2859. }
  2860. validateRenderResult(child, Component);
  2861. var childContext;
  2862. if (disableLegacyContext) {
  2863. {
  2864. var childContextTypes = Component.childContextTypes;
  2865. if (childContextTypes !== undefined) {
  2866. warningWithoutStack$1(false, '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', getComponentName(Component) || 'Unknown');
  2867. }
  2868. }
  2869. } else {
  2870. if (typeof inst.getChildContext === 'function') {
  2871. var _childContextTypes = Component.childContextTypes;
  2872. if (typeof _childContextTypes === 'object') {
  2873. childContext = inst.getChildContext();
  2874. for (var contextKey in childContext) {
  2875. if (!(contextKey in _childContextTypes)) {
  2876. {
  2877. throw Error((getComponentName(Component) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes.");
  2878. }
  2879. }
  2880. }
  2881. } else {
  2882. warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
  2883. }
  2884. }
  2885. if (childContext) {
  2886. context = _assign({}, context, childContext);
  2887. }
  2888. }
  2889. }
  2890. return {
  2891. child: child,
  2892. context: context
  2893. };
  2894. }
  2895. var ReactDOMServerRenderer =
  2896. /*#__PURE__*/
  2897. function () {
  2898. // TODO: type this more strictly:
  2899. // DEV-only
  2900. function ReactDOMServerRenderer(children, makeStaticMarkup) {
  2901. var flatChildren = flattenTopLevelChildren(children);
  2902. var topFrame = {
  2903. type: null,
  2904. // Assume all trees start in the HTML namespace (not totally true, but
  2905. // this is what we did historically)
  2906. domNamespace: Namespaces.html,
  2907. children: flatChildren,
  2908. childIndex: 0,
  2909. context: emptyObject,
  2910. footer: ''
  2911. };
  2912. {
  2913. topFrame.debugElementStack = [];
  2914. }
  2915. this.threadID = allocThreadID();
  2916. this.stack = [topFrame];
  2917. this.exhausted = false;
  2918. this.currentSelectValue = null;
  2919. this.previousWasTextNode = false;
  2920. this.makeStaticMarkup = makeStaticMarkup;
  2921. this.suspenseDepth = 0; // Context (new API)
  2922. this.contextIndex = -1;
  2923. this.contextStack = [];
  2924. this.contextValueStack = [];
  2925. {
  2926. this.contextProviderStack = [];
  2927. }
  2928. }
  2929. var _proto = ReactDOMServerRenderer.prototype;
  2930. _proto.destroy = function destroy() {
  2931. if (!this.exhausted) {
  2932. this.exhausted = true;
  2933. this.clearProviders();
  2934. freeThreadID(this.threadID);
  2935. }
  2936. }
  2937. /**
  2938. * Note: We use just two stacks regardless of how many context providers you have.
  2939. * Providers are always popped in the reverse order to how they were pushed
  2940. * so we always know on the way down which provider you'll encounter next on the way up.
  2941. * On the way down, we push the current provider, and its context value *before*
  2942. * we mutated it, onto the stacks. Therefore, on the way up, we always know which
  2943. * provider needs to be "restored" to which value.
  2944. * https://github.com/facebook/react/pull/12985#issuecomment-396301248
  2945. */
  2946. ;
  2947. _proto.pushProvider = function pushProvider(provider) {
  2948. var index = ++this.contextIndex;
  2949. var context = provider.type._context;
  2950. var threadID = this.threadID;
  2951. validateContextBounds(context, threadID);
  2952. var previousValue = context[threadID]; // Remember which value to restore this context to on our way up.
  2953. this.contextStack[index] = context;
  2954. this.contextValueStack[index] = previousValue;
  2955. {
  2956. // Only used for push/pop mismatch warnings.
  2957. this.contextProviderStack[index] = provider;
  2958. } // Mutate the current value.
  2959. context[threadID] = provider.props.value;
  2960. };
  2961. _proto.popProvider = function popProvider(provider) {
  2962. var index = this.contextIndex;
  2963. {
  2964. !(index > -1 && provider === this.contextProviderStack[index]) ? warningWithoutStack$1(false, 'Unexpected pop.') : void 0;
  2965. }
  2966. var context = this.contextStack[index];
  2967. var previousValue = this.contextValueStack[index]; // "Hide" these null assignments from Flow by using `any`
  2968. // because conceptually they are deletions--as long as we
  2969. // promise to never access values beyond `this.contextIndex`.
  2970. this.contextStack[index] = null;
  2971. this.contextValueStack[index] = null;
  2972. {
  2973. this.contextProviderStack[index] = null;
  2974. }
  2975. this.contextIndex--; // Restore to the previous value we stored as we were walking down.
  2976. // We've already verified that this context has been expanded to accommodate
  2977. // this thread id, so we don't need to do it again.
  2978. context[this.threadID] = previousValue;
  2979. };
  2980. _proto.clearProviders = function clearProviders() {
  2981. // Restore any remaining providers on the stack to previous values
  2982. for (var index = this.contextIndex; index >= 0; index--) {
  2983. var context = this.contextStack[index];
  2984. var previousValue = this.contextValueStack[index];
  2985. context[this.threadID] = previousValue;
  2986. }
  2987. };
  2988. _proto.read = function read(bytes) {
  2989. if (this.exhausted) {
  2990. return null;
  2991. }
  2992. var prevThreadID = currentThreadID;
  2993. setCurrentThreadID(this.threadID);
  2994. var prevDispatcher = ReactCurrentDispatcher.current;
  2995. ReactCurrentDispatcher.current = Dispatcher;
  2996. try {
  2997. // Markup generated within <Suspense> ends up buffered until we know
  2998. // nothing in that boundary suspended
  2999. var out = [''];
  3000. var suspended = false;
  3001. while (out[0].length < bytes) {
  3002. if (this.stack.length === 0) {
  3003. this.exhausted = true;
  3004. freeThreadID(this.threadID);
  3005. break;
  3006. }
  3007. var frame = this.stack[this.stack.length - 1];
  3008. if (suspended || frame.childIndex >= frame.children.length) {
  3009. var footer = frame.footer;
  3010. if (footer !== '') {
  3011. this.previousWasTextNode = false;
  3012. }
  3013. this.stack.pop();
  3014. if (frame.type === 'select') {
  3015. this.currentSelectValue = null;
  3016. } else if (frame.type != null && frame.type.type != null && frame.type.type.$$typeof === REACT_PROVIDER_TYPE) {
  3017. var provider = frame.type;
  3018. this.popProvider(provider);
  3019. } else if (frame.type === REACT_SUSPENSE_TYPE) {
  3020. this.suspenseDepth--;
  3021. var buffered = out.pop();
  3022. if (suspended) {
  3023. suspended = false; // If rendering was suspended at this boundary, render the fallbackFrame
  3024. var fallbackFrame = frame.fallbackFrame;
  3025. if (!fallbackFrame) {
  3026. {
  3027. throw Error("ReactDOMServer did not find an internal fallback frame for Suspense. This is a bug in React. Please file an issue.");
  3028. }
  3029. }
  3030. this.stack.push(fallbackFrame);
  3031. out[this.suspenseDepth] += '<!--$!-->'; // Skip flushing output since we're switching to the fallback
  3032. continue;
  3033. } else {
  3034. out[this.suspenseDepth] += buffered;
  3035. }
  3036. } // Flush output
  3037. out[this.suspenseDepth] += footer;
  3038. continue;
  3039. }
  3040. var child = frame.children[frame.childIndex++];
  3041. var outBuffer = '';
  3042. {
  3043. pushCurrentDebugStack(this.stack); // We're starting work on this frame, so reset its inner stack.
  3044. frame.debugElementStack.length = 0;
  3045. }
  3046. try {
  3047. outBuffer += this.render(child, frame.context, frame.domNamespace);
  3048. } catch (err) {
  3049. if (err != null && typeof err.then === 'function') {
  3050. if (enableSuspenseServerRenderer) {
  3051. if (!(this.suspenseDepth > 0)) {
  3052. {
  3053. throw Error("A React component suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.");
  3054. }
  3055. }
  3056. suspended = true;
  3057. } else {
  3058. {
  3059. {
  3060. throw Error("ReactDOMServer does not yet support Suspense.");
  3061. }
  3062. }
  3063. }
  3064. } else {
  3065. throw err;
  3066. }
  3067. } finally {
  3068. {
  3069. popCurrentDebugStack();
  3070. }
  3071. }
  3072. if (out.length <= this.suspenseDepth) {
  3073. out.push('');
  3074. }
  3075. out[this.suspenseDepth] += outBuffer;
  3076. }
  3077. return out[0];
  3078. } finally {
  3079. ReactCurrentDispatcher.current = prevDispatcher;
  3080. setCurrentThreadID(prevThreadID);
  3081. }
  3082. };
  3083. _proto.render = function render(child, context, parentNamespace) {
  3084. if (typeof child === 'string' || typeof child === 'number') {
  3085. var text = '' + child;
  3086. if (text === '') {
  3087. return '';
  3088. }
  3089. if (this.makeStaticMarkup) {
  3090. return escapeTextForBrowser(text);
  3091. }
  3092. if (this.previousWasTextNode) {
  3093. return '<!-- -->' + escapeTextForBrowser(text);
  3094. }
  3095. this.previousWasTextNode = true;
  3096. return escapeTextForBrowser(text);
  3097. } else {
  3098. var nextChild;
  3099. var _resolve = resolve(child, context, this.threadID);
  3100. nextChild = _resolve.child;
  3101. context = _resolve.context;
  3102. if (nextChild === null || nextChild === false) {
  3103. return '';
  3104. } else if (!React.isValidElement(nextChild)) {
  3105. if (nextChild != null && nextChild.$$typeof != null) {
  3106. // Catch unexpected special types early.
  3107. var $$typeof = nextChild.$$typeof;
  3108. if (!($$typeof !== REACT_PORTAL_TYPE)) {
  3109. {
  3110. throw Error("Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.");
  3111. }
  3112. } // Catch-all to prevent an infinite loop if React.Children.toArray() supports some new type.
  3113. {
  3114. {
  3115. throw Error("Unknown element-like object type: " + $$typeof.toString() + ". This is likely a bug in React. Please file an issue.");
  3116. }
  3117. }
  3118. }
  3119. var nextChildren = toArray(nextChild);
  3120. var frame = {
  3121. type: null,
  3122. domNamespace: parentNamespace,
  3123. children: nextChildren,
  3124. childIndex: 0,
  3125. context: context,
  3126. footer: ''
  3127. };
  3128. {
  3129. frame.debugElementStack = [];
  3130. }
  3131. this.stack.push(frame);
  3132. return '';
  3133. } // Safe because we just checked it's an element.
  3134. var nextElement = nextChild;
  3135. var elementType = nextElement.type;
  3136. if (typeof elementType === 'string') {
  3137. return this.renderDOM(nextElement, context, parentNamespace);
  3138. }
  3139. switch (elementType) {
  3140. case REACT_STRICT_MODE_TYPE:
  3141. case REACT_CONCURRENT_MODE_TYPE:
  3142. case REACT_PROFILER_TYPE:
  3143. case REACT_SUSPENSE_LIST_TYPE:
  3144. case REACT_FRAGMENT_TYPE:
  3145. {
  3146. var _nextChildren = toArray(nextChild.props.children);
  3147. var _frame = {
  3148. type: null,
  3149. domNamespace: parentNamespace,
  3150. children: _nextChildren,
  3151. childIndex: 0,
  3152. context: context,
  3153. footer: ''
  3154. };
  3155. {
  3156. _frame.debugElementStack = [];
  3157. }
  3158. this.stack.push(_frame);
  3159. return '';
  3160. }
  3161. case REACT_SUSPENSE_TYPE:
  3162. {
  3163. if (enableSuspenseServerRenderer) {
  3164. var fallback = nextChild.props.fallback;
  3165. if (fallback === undefined) {
  3166. // If there is no fallback, then this just behaves as a fragment.
  3167. var _nextChildren3 = toArray(nextChild.props.children);
  3168. var _frame3 = {
  3169. type: null,
  3170. domNamespace: parentNamespace,
  3171. children: _nextChildren3,
  3172. childIndex: 0,
  3173. context: context,
  3174. footer: ''
  3175. };
  3176. {
  3177. _frame3.debugElementStack = [];
  3178. }
  3179. this.stack.push(_frame3);
  3180. return '';
  3181. }
  3182. var fallbackChildren = toArray(fallback);
  3183. var _nextChildren2 = toArray(nextChild.props.children);
  3184. var fallbackFrame = {
  3185. type: null,
  3186. domNamespace: parentNamespace,
  3187. children: fallbackChildren,
  3188. childIndex: 0,
  3189. context: context,
  3190. footer: '<!--/$-->'
  3191. };
  3192. var _frame2 = {
  3193. fallbackFrame: fallbackFrame,
  3194. type: REACT_SUSPENSE_TYPE,
  3195. domNamespace: parentNamespace,
  3196. children: _nextChildren2,
  3197. childIndex: 0,
  3198. context: context,
  3199. footer: '<!--/$-->'
  3200. };
  3201. {
  3202. _frame2.debugElementStack = [];
  3203. fallbackFrame.debugElementStack = [];
  3204. }
  3205. this.stack.push(_frame2);
  3206. this.suspenseDepth++;
  3207. return '<!--$-->';
  3208. } else {
  3209. {
  3210. {
  3211. throw Error("ReactDOMServer does not yet support Suspense.");
  3212. }
  3213. }
  3214. }
  3215. }
  3216. // eslint-disable-next-line-no-fallthrough
  3217. default:
  3218. break;
  3219. }
  3220. if (typeof elementType === 'object' && elementType !== null) {
  3221. switch (elementType.$$typeof) {
  3222. case REACT_FORWARD_REF_TYPE:
  3223. {
  3224. var element = nextChild;
  3225. var _nextChildren4;
  3226. var componentIdentity = {};
  3227. prepareToUseHooks(componentIdentity);
  3228. _nextChildren4 = elementType.render(element.props, element.ref);
  3229. _nextChildren4 = finishHooks(elementType.render, element.props, _nextChildren4, element.ref);
  3230. _nextChildren4 = toArray(_nextChildren4);
  3231. var _frame4 = {
  3232. type: null,
  3233. domNamespace: parentNamespace,
  3234. children: _nextChildren4,
  3235. childIndex: 0,
  3236. context: context,
  3237. footer: ''
  3238. };
  3239. {
  3240. _frame4.debugElementStack = [];
  3241. }
  3242. this.stack.push(_frame4);
  3243. return '';
  3244. }
  3245. case REACT_MEMO_TYPE:
  3246. {
  3247. var _element = nextChild;
  3248. var _nextChildren5 = [React.createElement(elementType.type, _assign({
  3249. ref: _element.ref
  3250. }, _element.props))];
  3251. var _frame5 = {
  3252. type: null,
  3253. domNamespace: parentNamespace,
  3254. children: _nextChildren5,
  3255. childIndex: 0,
  3256. context: context,
  3257. footer: ''
  3258. };
  3259. {
  3260. _frame5.debugElementStack = [];
  3261. }
  3262. this.stack.push(_frame5);
  3263. return '';
  3264. }
  3265. case REACT_PROVIDER_TYPE:
  3266. {
  3267. var provider = nextChild;
  3268. var nextProps = provider.props;
  3269. var _nextChildren6 = toArray(nextProps.children);
  3270. var _frame6 = {
  3271. type: provider,
  3272. domNamespace: parentNamespace,
  3273. children: _nextChildren6,
  3274. childIndex: 0,
  3275. context: context,
  3276. footer: ''
  3277. };
  3278. {
  3279. _frame6.debugElementStack = [];
  3280. }
  3281. this.pushProvider(provider);
  3282. this.stack.push(_frame6);
  3283. return '';
  3284. }
  3285. case REACT_CONTEXT_TYPE:
  3286. {
  3287. var reactContext = nextChild.type; // The logic below for Context differs depending on PROD or DEV mode. In
  3288. // DEV mode, we create a separate object for Context.Consumer that acts
  3289. // like a proxy to Context. This proxy object adds unnecessary code in PROD
  3290. // so we use the old behaviour (Context.Consumer references Context) to
  3291. // reduce size and overhead. The separate object references context via
  3292. // a property called "_context", which also gives us the ability to check
  3293. // in DEV mode if this property exists or not and warn if it does not.
  3294. {
  3295. if (reactContext._context === undefined) {
  3296. // This may be because it's a Context (rather than a Consumer).
  3297. // Or it may be because it's older React where they're the same thing.
  3298. // We only want to warn if we're sure it's a new React.
  3299. if (reactContext !== reactContext.Consumer) {
  3300. if (!hasWarnedAboutUsingContextAsConsumer) {
  3301. hasWarnedAboutUsingContextAsConsumer = true;
  3302. warning$1(false, 'Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
  3303. }
  3304. }
  3305. } else {
  3306. reactContext = reactContext._context;
  3307. }
  3308. }
  3309. var _nextProps = nextChild.props;
  3310. var threadID = this.threadID;
  3311. validateContextBounds(reactContext, threadID);
  3312. var nextValue = reactContext[threadID];
  3313. var _nextChildren7 = toArray(_nextProps.children(nextValue));
  3314. var _frame7 = {
  3315. type: nextChild,
  3316. domNamespace: parentNamespace,
  3317. children: _nextChildren7,
  3318. childIndex: 0,
  3319. context: context,
  3320. footer: ''
  3321. };
  3322. {
  3323. _frame7.debugElementStack = [];
  3324. }
  3325. this.stack.push(_frame7);
  3326. return '';
  3327. }
  3328. // eslint-disable-next-line-no-fallthrough
  3329. case REACT_FUNDAMENTAL_TYPE:
  3330. {
  3331. if (enableFundamentalAPI) {
  3332. var fundamentalImpl = elementType.impl;
  3333. var open = fundamentalImpl.getServerSideString(null, nextElement.props);
  3334. var getServerSideStringClose = fundamentalImpl.getServerSideStringClose;
  3335. var close = getServerSideStringClose !== undefined ? getServerSideStringClose(null, nextElement.props) : '';
  3336. var _nextChildren8 = fundamentalImpl.reconcileChildren !== false ? toArray(nextChild.props.children) : [];
  3337. var _frame8 = {
  3338. type: null,
  3339. domNamespace: parentNamespace,
  3340. children: _nextChildren8,
  3341. childIndex: 0,
  3342. context: context,
  3343. footer: close
  3344. };
  3345. {
  3346. _frame8.debugElementStack = [];
  3347. }
  3348. this.stack.push(_frame8);
  3349. return open;
  3350. }
  3351. {
  3352. {
  3353. throw Error("ReactDOMServer does not yet support the fundamental API.");
  3354. }
  3355. }
  3356. }
  3357. // eslint-disable-next-line-no-fallthrough
  3358. case REACT_LAZY_TYPE:
  3359. {
  3360. var _element2 = nextChild;
  3361. var lazyComponent = nextChild.type; // Attempt to initialize lazy component regardless of whether the
  3362. // suspense server-side renderer is enabled so synchronously
  3363. // resolved constructors are supported.
  3364. initializeLazyComponentType(lazyComponent);
  3365. switch (lazyComponent._status) {
  3366. case Resolved:
  3367. {
  3368. var _nextChildren9 = [React.createElement(lazyComponent._result, _assign({
  3369. ref: _element2.ref
  3370. }, _element2.props))];
  3371. var _frame9 = {
  3372. type: null,
  3373. domNamespace: parentNamespace,
  3374. children: _nextChildren9,
  3375. childIndex: 0,
  3376. context: context,
  3377. footer: ''
  3378. };
  3379. {
  3380. _frame9.debugElementStack = [];
  3381. }
  3382. this.stack.push(_frame9);
  3383. return '';
  3384. }
  3385. case Rejected:
  3386. throw lazyComponent._result;
  3387. case Pending:
  3388. default:
  3389. {
  3390. {
  3391. throw Error("ReactDOMServer does not yet support lazy-loaded components.");
  3392. }
  3393. }
  3394. }
  3395. }
  3396. // eslint-disable-next-line-no-fallthrough
  3397. case REACT_SCOPE_TYPE:
  3398. {
  3399. if (enableScopeAPI) {
  3400. var _nextChildren10 = toArray(nextChild.props.children);
  3401. var _frame10 = {
  3402. type: null,
  3403. domNamespace: parentNamespace,
  3404. children: _nextChildren10,
  3405. childIndex: 0,
  3406. context: context,
  3407. footer: ''
  3408. };
  3409. {
  3410. _frame10.debugElementStack = [];
  3411. }
  3412. this.stack.push(_frame10);
  3413. return '';
  3414. }
  3415. {
  3416. {
  3417. throw Error("ReactDOMServer does not yet support scope components.");
  3418. }
  3419. }
  3420. }
  3421. }
  3422. }
  3423. var info = '';
  3424. {
  3425. var owner = nextElement._owner;
  3426. if (elementType === undefined || typeof elementType === 'object' && elementType !== null && Object.keys(elementType).length === 0) {
  3427. info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
  3428. }
  3429. var ownerName = owner ? getComponentName(owner) : null;
  3430. if (ownerName) {
  3431. info += '\n\nCheck the render method of `' + ownerName + '`.';
  3432. }
  3433. }
  3434. {
  3435. {
  3436. throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (elementType == null ? elementType : typeof elementType) + "." + info);
  3437. }
  3438. }
  3439. }
  3440. };
  3441. _proto.renderDOM = function renderDOM(element, context, parentNamespace) {
  3442. var tag = element.type.toLowerCase();
  3443. var namespace = parentNamespace;
  3444. if (parentNamespace === Namespaces.html) {
  3445. namespace = getIntrinsicNamespace(tag);
  3446. }
  3447. {
  3448. if (namespace === Namespaces.html) {
  3449. // Should this check be gated by parent namespace? Not sure we want to
  3450. // allow <SVG> or <mATH>.
  3451. !(tag === element.type) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type) : void 0;
  3452. }
  3453. }
  3454. validateDangerousTag(tag);
  3455. var props = element.props;
  3456. if (tag === 'input') {
  3457. {
  3458. ReactControlledValuePropTypes.checkPropTypes('input', props);
  3459. if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
  3460. warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
  3461. didWarnDefaultChecked = true;
  3462. }
  3463. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
  3464. warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
  3465. didWarnDefaultInputValue = true;
  3466. }
  3467. }
  3468. props = _assign({
  3469. type: undefined
  3470. }, props, {
  3471. defaultChecked: undefined,
  3472. defaultValue: undefined,
  3473. value: props.value != null ? props.value : props.defaultValue,
  3474. checked: props.checked != null ? props.checked : props.defaultChecked
  3475. });
  3476. } else if (tag === 'textarea') {
  3477. {
  3478. ReactControlledValuePropTypes.checkPropTypes('textarea', props);
  3479. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
  3480. warning$1(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
  3481. didWarnDefaultTextareaValue = true;
  3482. }
  3483. }
  3484. var initialValue = props.value;
  3485. if (initialValue == null) {
  3486. var defaultValue = props.defaultValue; // TODO (yungsters): Remove support for children content in <textarea>.
  3487. var textareaChildren = props.children;
  3488. if (textareaChildren != null) {
  3489. {
  3490. warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
  3491. }
  3492. if (!(defaultValue == null)) {
  3493. {
  3494. throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
  3495. }
  3496. }
  3497. if (Array.isArray(textareaChildren)) {
  3498. if (!(textareaChildren.length <= 1)) {
  3499. {
  3500. throw Error("<textarea> can only have at most one child.");
  3501. }
  3502. }
  3503. textareaChildren = textareaChildren[0];
  3504. }
  3505. defaultValue = '' + textareaChildren;
  3506. }
  3507. if (defaultValue == null) {
  3508. defaultValue = '';
  3509. }
  3510. initialValue = defaultValue;
  3511. }
  3512. props = _assign({}, props, {
  3513. value: undefined,
  3514. children: '' + initialValue
  3515. });
  3516. } else if (tag === 'select') {
  3517. {
  3518. ReactControlledValuePropTypes.checkPropTypes('select', props);
  3519. for (var i = 0; i < valuePropNames.length; i++) {
  3520. var propName = valuePropNames[i];
  3521. if (props[propName] == null) {
  3522. continue;
  3523. }
  3524. var isArray = Array.isArray(props[propName]);
  3525. if (props.multiple && !isArray) {
  3526. warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.', propName);
  3527. } else if (!props.multiple && isArray) {
  3528. warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.', propName);
  3529. }
  3530. }
  3531. if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
  3532. warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
  3533. didWarnDefaultSelectValue = true;
  3534. }
  3535. }
  3536. this.currentSelectValue = props.value != null ? props.value : props.defaultValue;
  3537. props = _assign({}, props, {
  3538. value: undefined
  3539. });
  3540. } else if (tag === 'option') {
  3541. var selected = null;
  3542. var selectValue = this.currentSelectValue;
  3543. var optionChildren = flattenOptionChildren(props.children);
  3544. if (selectValue != null) {
  3545. var value;
  3546. if (props.value != null) {
  3547. value = props.value + '';
  3548. } else {
  3549. value = optionChildren;
  3550. }
  3551. selected = false;
  3552. if (Array.isArray(selectValue)) {
  3553. // multiple
  3554. for (var j = 0; j < selectValue.length; j++) {
  3555. if ('' + selectValue[j] === value) {
  3556. selected = true;
  3557. break;
  3558. }
  3559. }
  3560. } else {
  3561. selected = '' + selectValue === value;
  3562. }
  3563. props = _assign({
  3564. selected: undefined,
  3565. children: undefined
  3566. }, props, {
  3567. selected: selected,
  3568. children: optionChildren
  3569. });
  3570. }
  3571. }
  3572. {
  3573. validatePropertiesInDevelopment(tag, props);
  3574. }
  3575. assertValidProps(tag, props);
  3576. var out = createOpenTagMarkup(element.type, tag, props, namespace, this.makeStaticMarkup, this.stack.length === 1);
  3577. var footer = '';
  3578. if (omittedCloseTags.hasOwnProperty(tag)) {
  3579. out += '/>';
  3580. } else {
  3581. out += '>';
  3582. footer = '</' + element.type + '>';
  3583. }
  3584. var children;
  3585. var innerMarkup = getNonChildrenInnerMarkup(props);
  3586. if (innerMarkup != null) {
  3587. children = [];
  3588. if (newlineEatingTags[tag] && innerMarkup.charAt(0) === '\n') {
  3589. // text/html ignores the first character in these tags if it's a newline
  3590. // Prefer to break application/xml over text/html (for now) by adding
  3591. // a newline specifically to get eaten by the parser. (Alternately for
  3592. // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
  3593. // \r is normalized out by HTMLTextAreaElement#value.)
  3594. // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
  3595. // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
  3596. // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
  3597. // See: Parsing of "textarea" "listing" and "pre" elements
  3598. // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
  3599. out += '\n';
  3600. }
  3601. out += innerMarkup;
  3602. } else {
  3603. children = toArray(props.children);
  3604. }
  3605. var frame = {
  3606. domNamespace: getChildNamespace(parentNamespace, element.type),
  3607. type: tag,
  3608. children: children,
  3609. childIndex: 0,
  3610. context: context,
  3611. footer: footer
  3612. };
  3613. {
  3614. frame.debugElementStack = [];
  3615. }
  3616. this.stack.push(frame);
  3617. this.previousWasTextNode = false;
  3618. return out;
  3619. };
  3620. return ReactDOMServerRenderer;
  3621. }();
  3622. /**
  3623. * Render a ReactElement to its initial HTML. This should only be used on the
  3624. * server.
  3625. * See https://reactjs.org/docs/react-dom-server.html#rendertostring
  3626. */
  3627. function renderToString(element) {
  3628. var renderer = new ReactDOMServerRenderer(element, false);
  3629. try {
  3630. var markup = renderer.read(Infinity);
  3631. return markup;
  3632. } finally {
  3633. renderer.destroy();
  3634. }
  3635. }
  3636. /**
  3637. * Similar to renderToString, except this doesn't create extra DOM attributes
  3638. * such as data-react-id that React uses internally.
  3639. * See https://reactjs.org/docs/react-dom-server.html#rendertostaticmarkup
  3640. */
  3641. function renderToStaticMarkup(element) {
  3642. var renderer = new ReactDOMServerRenderer(element, true);
  3643. try {
  3644. var markup = renderer.read(Infinity);
  3645. return markup;
  3646. } finally {
  3647. renderer.destroy();
  3648. }
  3649. }
  3650. function renderToNodeStream() {
  3651. {
  3652. {
  3653. throw Error("ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead.");
  3654. }
  3655. }
  3656. }
  3657. function renderToStaticNodeStream() {
  3658. {
  3659. {
  3660. throw Error("ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead.");
  3661. }
  3662. }
  3663. } // Note: when changing this, also consider https://github.com/facebook/react/issues/11526
  3664. var ReactDOMServerBrowser = {
  3665. renderToString: renderToString,
  3666. renderToStaticMarkup: renderToStaticMarkup,
  3667. renderToNodeStream: renderToNodeStream,
  3668. renderToStaticNodeStream: renderToStaticNodeStream,
  3669. version: ReactVersion
  3670. };
  3671. var ReactDOMServerBrowser$1 = Object.freeze({
  3672. default: ReactDOMServerBrowser
  3673. });
  3674. var ReactDOMServer = ( ReactDOMServerBrowser$1 && ReactDOMServerBrowser ) || ReactDOMServerBrowser$1;
  3675. // TODO: decide on the top-level export form.
  3676. // This is hacky but makes it work with both Rollup and Jest
  3677. var server_browser = ReactDOMServer.default || ReactDOMServer;
  3678. return server_browser;
  3679. })));