handlebars.js 175 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210
  1. /**!
  2. @license
  3. handlebars v4.7.7
  4. Copyright (C) 2011-2019 by Yehuda Katz
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. THE SOFTWARE.
  20. */
  21. (function webpackUniversalModuleDefinition(root, factory) {
  22. if(typeof exports === 'object' && typeof module === 'object')
  23. module.exports = factory();
  24. else if(typeof define === 'function' && define.amd)
  25. define([], factory);
  26. else if(typeof exports === 'object')
  27. exports["Handlebars"] = factory();
  28. else
  29. root["Handlebars"] = factory();
  30. })(this, function() {
  31. return /******/ (function(modules) { // webpackBootstrap
  32. /******/ // The module cache
  33. /******/ var installedModules = {};
  34. /******/ // The require function
  35. /******/ function __webpack_require__(moduleId) {
  36. /******/ // Check if module is in cache
  37. /******/ if(installedModules[moduleId])
  38. /******/ return installedModules[moduleId].exports;
  39. /******/ // Create a new module (and put it into the cache)
  40. /******/ var module = installedModules[moduleId] = {
  41. /******/ exports: {},
  42. /******/ id: moduleId,
  43. /******/ loaded: false
  44. /******/ };
  45. /******/ // Execute the module function
  46. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  47. /******/ // Flag the module as loaded
  48. /******/ module.loaded = true;
  49. /******/ // Return the exports of the module
  50. /******/ return module.exports;
  51. /******/ }
  52. /******/ // expose the modules object (__webpack_modules__)
  53. /******/ __webpack_require__.m = modules;
  54. /******/ // expose the module cache
  55. /******/ __webpack_require__.c = installedModules;
  56. /******/ // __webpack_public_path__
  57. /******/ __webpack_require__.p = "";
  58. /******/ // Load entry module and return exports
  59. /******/ return __webpack_require__(0);
  60. /******/ })
  61. /************************************************************************/
  62. /******/ ([
  63. /* 0 */
  64. /***/ (function(module, exports, __webpack_require__) {
  65. 'use strict';
  66. var _interopRequireDefault = __webpack_require__(1)['default'];
  67. exports.__esModule = true;
  68. var _handlebarsRuntime = __webpack_require__(2);
  69. var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
  70. // Compiler imports
  71. var _handlebarsCompilerAst = __webpack_require__(45);
  72. var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
  73. var _handlebarsCompilerBase = __webpack_require__(46);
  74. var _handlebarsCompilerCompiler = __webpack_require__(51);
  75. var _handlebarsCompilerJavascriptCompiler = __webpack_require__(52);
  76. var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
  77. var _handlebarsCompilerVisitor = __webpack_require__(49);
  78. var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
  79. var _handlebarsNoConflict = __webpack_require__(44);
  80. var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
  81. var _create = _handlebarsRuntime2['default'].create;
  82. function create() {
  83. var hb = _create();
  84. hb.compile = function (input, options) {
  85. return _handlebarsCompilerCompiler.compile(input, options, hb);
  86. };
  87. hb.precompile = function (input, options) {
  88. return _handlebarsCompilerCompiler.precompile(input, options, hb);
  89. };
  90. hb.AST = _handlebarsCompilerAst2['default'];
  91. hb.Compiler = _handlebarsCompilerCompiler.Compiler;
  92. hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
  93. hb.Parser = _handlebarsCompilerBase.parser;
  94. hb.parse = _handlebarsCompilerBase.parse;
  95. hb.parseWithoutProcessing = _handlebarsCompilerBase.parseWithoutProcessing;
  96. return hb;
  97. }
  98. var inst = create();
  99. inst.create = create;
  100. _handlebarsNoConflict2['default'](inst);
  101. inst.Visitor = _handlebarsCompilerVisitor2['default'];
  102. inst['default'] = inst;
  103. exports['default'] = inst;
  104. module.exports = exports['default'];
  105. /***/ }),
  106. /* 1 */
  107. /***/ (function(module, exports) {
  108. "use strict";
  109. exports["default"] = function (obj) {
  110. return obj && obj.__esModule ? obj : {
  111. "default": obj
  112. };
  113. };
  114. exports.__esModule = true;
  115. /***/ }),
  116. /* 2 */
  117. /***/ (function(module, exports, __webpack_require__) {
  118. 'use strict';
  119. var _interopRequireWildcard = __webpack_require__(3)['default'];
  120. var _interopRequireDefault = __webpack_require__(1)['default'];
  121. exports.__esModule = true;
  122. var _handlebarsBase = __webpack_require__(4);
  123. var base = _interopRequireWildcard(_handlebarsBase);
  124. // Each of these augment the Handlebars object. No need to setup here.
  125. // (This is done to easily share code between commonjs and browse envs)
  126. var _handlebarsSafeString = __webpack_require__(37);
  127. var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
  128. var _handlebarsException = __webpack_require__(6);
  129. var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
  130. var _handlebarsUtils = __webpack_require__(5);
  131. var Utils = _interopRequireWildcard(_handlebarsUtils);
  132. var _handlebarsRuntime = __webpack_require__(38);
  133. var runtime = _interopRequireWildcard(_handlebarsRuntime);
  134. var _handlebarsNoConflict = __webpack_require__(44);
  135. var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
  136. // For compatibility and usage outside of module systems, make the Handlebars object a namespace
  137. function create() {
  138. var hb = new base.HandlebarsEnvironment();
  139. Utils.extend(hb, base);
  140. hb.SafeString = _handlebarsSafeString2['default'];
  141. hb.Exception = _handlebarsException2['default'];
  142. hb.Utils = Utils;
  143. hb.escapeExpression = Utils.escapeExpression;
  144. hb.VM = runtime;
  145. hb.template = function (spec) {
  146. return runtime.template(spec, hb);
  147. };
  148. return hb;
  149. }
  150. var inst = create();
  151. inst.create = create;
  152. _handlebarsNoConflict2['default'](inst);
  153. inst['default'] = inst;
  154. exports['default'] = inst;
  155. module.exports = exports['default'];
  156. /***/ }),
  157. /* 3 */
  158. /***/ (function(module, exports) {
  159. "use strict";
  160. exports["default"] = function (obj) {
  161. if (obj && obj.__esModule) {
  162. return obj;
  163. } else {
  164. var newObj = {};
  165. if (obj != null) {
  166. for (var key in obj) {
  167. if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
  168. }
  169. }
  170. newObj["default"] = obj;
  171. return newObj;
  172. }
  173. };
  174. exports.__esModule = true;
  175. /***/ }),
  176. /* 4 */
  177. /***/ (function(module, exports, __webpack_require__) {
  178. 'use strict';
  179. var _interopRequireDefault = __webpack_require__(1)['default'];
  180. exports.__esModule = true;
  181. exports.HandlebarsEnvironment = HandlebarsEnvironment;
  182. var _utils = __webpack_require__(5);
  183. var _exception = __webpack_require__(6);
  184. var _exception2 = _interopRequireDefault(_exception);
  185. var _helpers = __webpack_require__(10);
  186. var _decorators = __webpack_require__(30);
  187. var _logger = __webpack_require__(32);
  188. var _logger2 = _interopRequireDefault(_logger);
  189. var _internalProtoAccess = __webpack_require__(33);
  190. var VERSION = '4.7.7';
  191. exports.VERSION = VERSION;
  192. var COMPILER_REVISION = 8;
  193. exports.COMPILER_REVISION = COMPILER_REVISION;
  194. var LAST_COMPATIBLE_COMPILER_REVISION = 7;
  195. exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION;
  196. var REVISION_CHANGES = {
  197. 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
  198. 2: '== 1.0.0-rc.3',
  199. 3: '== 1.0.0-rc.4',
  200. 4: '== 1.x.x',
  201. 5: '== 2.0.0-alpha.x',
  202. 6: '>= 2.0.0-beta.1',
  203. 7: '>= 4.0.0 <4.3.0',
  204. 8: '>= 4.3.0'
  205. };
  206. exports.REVISION_CHANGES = REVISION_CHANGES;
  207. var objectType = '[object Object]';
  208. function HandlebarsEnvironment(helpers, partials, decorators) {
  209. this.helpers = helpers || {};
  210. this.partials = partials || {};
  211. this.decorators = decorators || {};
  212. _helpers.registerDefaultHelpers(this);
  213. _decorators.registerDefaultDecorators(this);
  214. }
  215. HandlebarsEnvironment.prototype = {
  216. constructor: HandlebarsEnvironment,
  217. logger: _logger2['default'],
  218. log: _logger2['default'].log,
  219. registerHelper: function registerHelper(name, fn) {
  220. if (_utils.toString.call(name) === objectType) {
  221. if (fn) {
  222. throw new _exception2['default']('Arg not supported with multiple helpers');
  223. }
  224. _utils.extend(this.helpers, name);
  225. } else {
  226. this.helpers[name] = fn;
  227. }
  228. },
  229. unregisterHelper: function unregisterHelper(name) {
  230. delete this.helpers[name];
  231. },
  232. registerPartial: function registerPartial(name, partial) {
  233. if (_utils.toString.call(name) === objectType) {
  234. _utils.extend(this.partials, name);
  235. } else {
  236. if (typeof partial === 'undefined') {
  237. throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
  238. }
  239. this.partials[name] = partial;
  240. }
  241. },
  242. unregisterPartial: function unregisterPartial(name) {
  243. delete this.partials[name];
  244. },
  245. registerDecorator: function registerDecorator(name, fn) {
  246. if (_utils.toString.call(name) === objectType) {
  247. if (fn) {
  248. throw new _exception2['default']('Arg not supported with multiple decorators');
  249. }
  250. _utils.extend(this.decorators, name);
  251. } else {
  252. this.decorators[name] = fn;
  253. }
  254. },
  255. unregisterDecorator: function unregisterDecorator(name) {
  256. delete this.decorators[name];
  257. },
  258. /**
  259. * Reset the memory of illegal property accesses that have already been logged.
  260. * @deprecated should only be used in handlebars test-cases
  261. */
  262. resetLoggedPropertyAccesses: function resetLoggedPropertyAccesses() {
  263. _internalProtoAccess.resetLoggedProperties();
  264. }
  265. };
  266. var log = _logger2['default'].log;
  267. exports.log = log;
  268. exports.createFrame = _utils.createFrame;
  269. exports.logger = _logger2['default'];
  270. /***/ }),
  271. /* 5 */
  272. /***/ (function(module, exports) {
  273. 'use strict';
  274. exports.__esModule = true;
  275. exports.extend = extend;
  276. exports.indexOf = indexOf;
  277. exports.escapeExpression = escapeExpression;
  278. exports.isEmpty = isEmpty;
  279. exports.createFrame = createFrame;
  280. exports.blockParams = blockParams;
  281. exports.appendContextPath = appendContextPath;
  282. var escape = {
  283. '&': '&amp;',
  284. '<': '&lt;',
  285. '>': '&gt;',
  286. '"': '&quot;',
  287. "'": '&#x27;',
  288. '`': '&#x60;',
  289. '=': '&#x3D;'
  290. };
  291. var badChars = /[&<>"'`=]/g,
  292. possible = /[&<>"'`=]/;
  293. function escapeChar(chr) {
  294. return escape[chr];
  295. }
  296. function extend(obj /* , ...source */) {
  297. for (var i = 1; i < arguments.length; i++) {
  298. for (var key in arguments[i]) {
  299. if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
  300. obj[key] = arguments[i][key];
  301. }
  302. }
  303. }
  304. return obj;
  305. }
  306. var toString = Object.prototype.toString;
  307. exports.toString = toString;
  308. // Sourced from lodash
  309. // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
  310. /* eslint-disable func-style */
  311. var isFunction = function isFunction(value) {
  312. return typeof value === 'function';
  313. };
  314. // fallback for older versions of Chrome and Safari
  315. /* istanbul ignore next */
  316. if (isFunction(/x/)) {
  317. exports.isFunction = isFunction = function (value) {
  318. return typeof value === 'function' && toString.call(value) === '[object Function]';
  319. };
  320. }
  321. exports.isFunction = isFunction;
  322. /* eslint-enable func-style */
  323. /* istanbul ignore next */
  324. var isArray = Array.isArray || function (value) {
  325. return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
  326. };
  327. exports.isArray = isArray;
  328. // Older IE versions do not directly support indexOf so we must implement our own, sadly.
  329. function indexOf(array, value) {
  330. for (var i = 0, len = array.length; i < len; i++) {
  331. if (array[i] === value) {
  332. return i;
  333. }
  334. }
  335. return -1;
  336. }
  337. function escapeExpression(string) {
  338. if (typeof string !== 'string') {
  339. // don't escape SafeStrings, since they're already safe
  340. if (string && string.toHTML) {
  341. return string.toHTML();
  342. } else if (string == null) {
  343. return '';
  344. } else if (!string) {
  345. return string + '';
  346. }
  347. // Force a string conversion as this will be done by the append regardless and
  348. // the regex test will do this transparently behind the scenes, causing issues if
  349. // an object's to string has escaped characters in it.
  350. string = '' + string;
  351. }
  352. if (!possible.test(string)) {
  353. return string;
  354. }
  355. return string.replace(badChars, escapeChar);
  356. }
  357. function isEmpty(value) {
  358. if (!value && value !== 0) {
  359. return true;
  360. } else if (isArray(value) && value.length === 0) {
  361. return true;
  362. } else {
  363. return false;
  364. }
  365. }
  366. function createFrame(object) {
  367. var frame = extend({}, object);
  368. frame._parent = object;
  369. return frame;
  370. }
  371. function blockParams(params, ids) {
  372. params.path = ids;
  373. return params;
  374. }
  375. function appendContextPath(contextPath, id) {
  376. return (contextPath ? contextPath + '.' : '') + id;
  377. }
  378. /***/ }),
  379. /* 6 */
  380. /***/ (function(module, exports, __webpack_require__) {
  381. 'use strict';
  382. var _Object$defineProperty = __webpack_require__(7)['default'];
  383. exports.__esModule = true;
  384. var errorProps = ['description', 'fileName', 'lineNumber', 'endLineNumber', 'message', 'name', 'number', 'stack'];
  385. function Exception(message, node) {
  386. var loc = node && node.loc,
  387. line = undefined,
  388. endLineNumber = undefined,
  389. column = undefined,
  390. endColumn = undefined;
  391. if (loc) {
  392. line = loc.start.line;
  393. endLineNumber = loc.end.line;
  394. column = loc.start.column;
  395. endColumn = loc.end.column;
  396. message += ' - ' + line + ':' + column;
  397. }
  398. var tmp = Error.prototype.constructor.call(this, message);
  399. // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
  400. for (var idx = 0; idx < errorProps.length; idx++) {
  401. this[errorProps[idx]] = tmp[errorProps[idx]];
  402. }
  403. /* istanbul ignore else */
  404. if (Error.captureStackTrace) {
  405. Error.captureStackTrace(this, Exception);
  406. }
  407. try {
  408. if (loc) {
  409. this.lineNumber = line;
  410. this.endLineNumber = endLineNumber;
  411. // Work around issue under safari where we can't directly set the column value
  412. /* istanbul ignore next */
  413. if (_Object$defineProperty) {
  414. Object.defineProperty(this, 'column', {
  415. value: column,
  416. enumerable: true
  417. });
  418. Object.defineProperty(this, 'endColumn', {
  419. value: endColumn,
  420. enumerable: true
  421. });
  422. } else {
  423. this.column = column;
  424. this.endColumn = endColumn;
  425. }
  426. }
  427. } catch (nop) {
  428. /* Ignore if the browser is very particular */
  429. }
  430. }
  431. Exception.prototype = new Error();
  432. exports['default'] = Exception;
  433. module.exports = exports['default'];
  434. /***/ }),
  435. /* 7 */
  436. /***/ (function(module, exports, __webpack_require__) {
  437. module.exports = { "default": __webpack_require__(8), __esModule: true };
  438. /***/ }),
  439. /* 8 */
  440. /***/ (function(module, exports, __webpack_require__) {
  441. var $ = __webpack_require__(9);
  442. module.exports = function defineProperty(it, key, desc){
  443. return $.setDesc(it, key, desc);
  444. };
  445. /***/ }),
  446. /* 9 */
  447. /***/ (function(module, exports) {
  448. var $Object = Object;
  449. module.exports = {
  450. create: $Object.create,
  451. getProto: $Object.getPrototypeOf,
  452. isEnum: {}.propertyIsEnumerable,
  453. getDesc: $Object.getOwnPropertyDescriptor,
  454. setDesc: $Object.defineProperty,
  455. setDescs: $Object.defineProperties,
  456. getKeys: $Object.keys,
  457. getNames: $Object.getOwnPropertyNames,
  458. getSymbols: $Object.getOwnPropertySymbols,
  459. each: [].forEach
  460. };
  461. /***/ }),
  462. /* 10 */
  463. /***/ (function(module, exports, __webpack_require__) {
  464. 'use strict';
  465. var _interopRequireDefault = __webpack_require__(1)['default'];
  466. exports.__esModule = true;
  467. exports.registerDefaultHelpers = registerDefaultHelpers;
  468. exports.moveHelperToHooks = moveHelperToHooks;
  469. var _helpersBlockHelperMissing = __webpack_require__(11);
  470. var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
  471. var _helpersEach = __webpack_require__(12);
  472. var _helpersEach2 = _interopRequireDefault(_helpersEach);
  473. var _helpersHelperMissing = __webpack_require__(25);
  474. var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
  475. var _helpersIf = __webpack_require__(26);
  476. var _helpersIf2 = _interopRequireDefault(_helpersIf);
  477. var _helpersLog = __webpack_require__(27);
  478. var _helpersLog2 = _interopRequireDefault(_helpersLog);
  479. var _helpersLookup = __webpack_require__(28);
  480. var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
  481. var _helpersWith = __webpack_require__(29);
  482. var _helpersWith2 = _interopRequireDefault(_helpersWith);
  483. function registerDefaultHelpers(instance) {
  484. _helpersBlockHelperMissing2['default'](instance);
  485. _helpersEach2['default'](instance);
  486. _helpersHelperMissing2['default'](instance);
  487. _helpersIf2['default'](instance);
  488. _helpersLog2['default'](instance);
  489. _helpersLookup2['default'](instance);
  490. _helpersWith2['default'](instance);
  491. }
  492. function moveHelperToHooks(instance, helperName, keepHelper) {
  493. if (instance.helpers[helperName]) {
  494. instance.hooks[helperName] = instance.helpers[helperName];
  495. if (!keepHelper) {
  496. delete instance.helpers[helperName];
  497. }
  498. }
  499. }
  500. /***/ }),
  501. /* 11 */
  502. /***/ (function(module, exports, __webpack_require__) {
  503. 'use strict';
  504. exports.__esModule = true;
  505. var _utils = __webpack_require__(5);
  506. exports['default'] = function (instance) {
  507. instance.registerHelper('blockHelperMissing', function (context, options) {
  508. var inverse = options.inverse,
  509. fn = options.fn;
  510. if (context === true) {
  511. return fn(this);
  512. } else if (context === false || context == null) {
  513. return inverse(this);
  514. } else if (_utils.isArray(context)) {
  515. if (context.length > 0) {
  516. if (options.ids) {
  517. options.ids = [options.name];
  518. }
  519. return instance.helpers.each(context, options);
  520. } else {
  521. return inverse(this);
  522. }
  523. } else {
  524. if (options.data && options.ids) {
  525. var data = _utils.createFrame(options.data);
  526. data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
  527. options = { data: data };
  528. }
  529. return fn(context, options);
  530. }
  531. });
  532. };
  533. module.exports = exports['default'];
  534. /***/ }),
  535. /* 12 */
  536. /***/ (function(module, exports, __webpack_require__) {
  537. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  538. var _Object$keys = __webpack_require__(13)['default'];
  539. var _interopRequireDefault = __webpack_require__(1)['default'];
  540. exports.__esModule = true;
  541. var _utils = __webpack_require__(5);
  542. var _exception = __webpack_require__(6);
  543. var _exception2 = _interopRequireDefault(_exception);
  544. exports['default'] = function (instance) {
  545. instance.registerHelper('each', function (context, options) {
  546. if (!options) {
  547. throw new _exception2['default']('Must pass iterator to #each');
  548. }
  549. var fn = options.fn,
  550. inverse = options.inverse,
  551. i = 0,
  552. ret = '',
  553. data = undefined,
  554. contextPath = undefined;
  555. if (options.data && options.ids) {
  556. contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
  557. }
  558. if (_utils.isFunction(context)) {
  559. context = context.call(this);
  560. }
  561. if (options.data) {
  562. data = _utils.createFrame(options.data);
  563. }
  564. function execIteration(field, index, last) {
  565. if (data) {
  566. data.key = field;
  567. data.index = index;
  568. data.first = index === 0;
  569. data.last = !!last;
  570. if (contextPath) {
  571. data.contextPath = contextPath + field;
  572. }
  573. }
  574. ret = ret + fn(context[field], {
  575. data: data,
  576. blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
  577. });
  578. }
  579. if (context && typeof context === 'object') {
  580. if (_utils.isArray(context)) {
  581. for (var j = context.length; i < j; i++) {
  582. if (i in context) {
  583. execIteration(i, i, i === context.length - 1);
  584. }
  585. }
  586. } else if (global.Symbol && context[global.Symbol.iterator]) {
  587. var newContext = [];
  588. var iterator = context[global.Symbol.iterator]();
  589. for (var it = iterator.next(); !it.done; it = iterator.next()) {
  590. newContext.push(it.value);
  591. }
  592. context = newContext;
  593. for (var j = context.length; i < j; i++) {
  594. execIteration(i, i, i === context.length - 1);
  595. }
  596. } else {
  597. (function () {
  598. var priorKey = undefined;
  599. _Object$keys(context).forEach(function (key) {
  600. // We're running the iterations one step out of sync so we can detect
  601. // the last iteration without have to scan the object twice and create
  602. // an itermediate keys array.
  603. if (priorKey !== undefined) {
  604. execIteration(priorKey, i - 1);
  605. }
  606. priorKey = key;
  607. i++;
  608. });
  609. if (priorKey !== undefined) {
  610. execIteration(priorKey, i - 1, true);
  611. }
  612. })();
  613. }
  614. }
  615. if (i === 0) {
  616. ret = inverse(this);
  617. }
  618. return ret;
  619. });
  620. };
  621. module.exports = exports['default'];
  622. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  623. /***/ }),
  624. /* 13 */
  625. /***/ (function(module, exports, __webpack_require__) {
  626. module.exports = { "default": __webpack_require__(14), __esModule: true };
  627. /***/ }),
  628. /* 14 */
  629. /***/ (function(module, exports, __webpack_require__) {
  630. __webpack_require__(15);
  631. module.exports = __webpack_require__(21).Object.keys;
  632. /***/ }),
  633. /* 15 */
  634. /***/ (function(module, exports, __webpack_require__) {
  635. // 19.1.2.14 Object.keys(O)
  636. var toObject = __webpack_require__(16);
  637. __webpack_require__(18)('keys', function($keys){
  638. return function keys(it){
  639. return $keys(toObject(it));
  640. };
  641. });
  642. /***/ }),
  643. /* 16 */
  644. /***/ (function(module, exports, __webpack_require__) {
  645. // 7.1.13 ToObject(argument)
  646. var defined = __webpack_require__(17);
  647. module.exports = function(it){
  648. return Object(defined(it));
  649. };
  650. /***/ }),
  651. /* 17 */
  652. /***/ (function(module, exports) {
  653. // 7.2.1 RequireObjectCoercible(argument)
  654. module.exports = function(it){
  655. if(it == undefined)throw TypeError("Can't call method on " + it);
  656. return it;
  657. };
  658. /***/ }),
  659. /* 18 */
  660. /***/ (function(module, exports, __webpack_require__) {
  661. // most Object methods by ES6 should accept primitives
  662. var $export = __webpack_require__(19)
  663. , core = __webpack_require__(21)
  664. , fails = __webpack_require__(24);
  665. module.exports = function(KEY, exec){
  666. var fn = (core.Object || {})[KEY] || Object[KEY]
  667. , exp = {};
  668. exp[KEY] = exec(fn);
  669. $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
  670. };
  671. /***/ }),
  672. /* 19 */
  673. /***/ (function(module, exports, __webpack_require__) {
  674. var global = __webpack_require__(20)
  675. , core = __webpack_require__(21)
  676. , ctx = __webpack_require__(22)
  677. , PROTOTYPE = 'prototype';
  678. var $export = function(type, name, source){
  679. var IS_FORCED = type & $export.F
  680. , IS_GLOBAL = type & $export.G
  681. , IS_STATIC = type & $export.S
  682. , IS_PROTO = type & $export.P
  683. , IS_BIND = type & $export.B
  684. , IS_WRAP = type & $export.W
  685. , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
  686. , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
  687. , key, own, out;
  688. if(IS_GLOBAL)source = name;
  689. for(key in source){
  690. // contains in native
  691. own = !IS_FORCED && target && key in target;
  692. if(own && key in exports)continue;
  693. // export native or passed
  694. out = own ? target[key] : source[key];
  695. // prevent global pollution for namespaces
  696. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  697. // bind timers to global for call from export context
  698. : IS_BIND && own ? ctx(out, global)
  699. // wrap global constructors for prevent change them in library
  700. : IS_WRAP && target[key] == out ? (function(C){
  701. var F = function(param){
  702. return this instanceof C ? new C(param) : C(param);
  703. };
  704. F[PROTOTYPE] = C[PROTOTYPE];
  705. return F;
  706. // make static versions for prototype methods
  707. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  708. if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
  709. }
  710. };
  711. // type bitmap
  712. $export.F = 1; // forced
  713. $export.G = 2; // global
  714. $export.S = 4; // static
  715. $export.P = 8; // proto
  716. $export.B = 16; // bind
  717. $export.W = 32; // wrap
  718. module.exports = $export;
  719. /***/ }),
  720. /* 20 */
  721. /***/ (function(module, exports) {
  722. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  723. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  724. ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
  725. if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
  726. /***/ }),
  727. /* 21 */
  728. /***/ (function(module, exports) {
  729. var core = module.exports = {version: '1.2.6'};
  730. if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
  731. /***/ }),
  732. /* 22 */
  733. /***/ (function(module, exports, __webpack_require__) {
  734. // optional / simple context binding
  735. var aFunction = __webpack_require__(23);
  736. module.exports = function(fn, that, length){
  737. aFunction(fn);
  738. if(that === undefined)return fn;
  739. switch(length){
  740. case 1: return function(a){
  741. return fn.call(that, a);
  742. };
  743. case 2: return function(a, b){
  744. return fn.call(that, a, b);
  745. };
  746. case 3: return function(a, b, c){
  747. return fn.call(that, a, b, c);
  748. };
  749. }
  750. return function(/* ...args */){
  751. return fn.apply(that, arguments);
  752. };
  753. };
  754. /***/ }),
  755. /* 23 */
  756. /***/ (function(module, exports) {
  757. module.exports = function(it){
  758. if(typeof it != 'function')throw TypeError(it + ' is not a function!');
  759. return it;
  760. };
  761. /***/ }),
  762. /* 24 */
  763. /***/ (function(module, exports) {
  764. module.exports = function(exec){
  765. try {
  766. return !!exec();
  767. } catch(e){
  768. return true;
  769. }
  770. };
  771. /***/ }),
  772. /* 25 */
  773. /***/ (function(module, exports, __webpack_require__) {
  774. 'use strict';
  775. var _interopRequireDefault = __webpack_require__(1)['default'];
  776. exports.__esModule = true;
  777. var _exception = __webpack_require__(6);
  778. var _exception2 = _interopRequireDefault(_exception);
  779. exports['default'] = function (instance) {
  780. instance.registerHelper('helperMissing', function () /* [args, ]options */{
  781. if (arguments.length === 1) {
  782. // A missing field in a {{foo}} construct.
  783. return undefined;
  784. } else {
  785. // Someone is actually trying to call something, blow up.
  786. throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
  787. }
  788. });
  789. };
  790. module.exports = exports['default'];
  791. /***/ }),
  792. /* 26 */
  793. /***/ (function(module, exports, __webpack_require__) {
  794. 'use strict';
  795. var _interopRequireDefault = __webpack_require__(1)['default'];
  796. exports.__esModule = true;
  797. var _utils = __webpack_require__(5);
  798. var _exception = __webpack_require__(6);
  799. var _exception2 = _interopRequireDefault(_exception);
  800. exports['default'] = function (instance) {
  801. instance.registerHelper('if', function (conditional, options) {
  802. if (arguments.length != 2) {
  803. throw new _exception2['default']('#if requires exactly one argument');
  804. }
  805. if (_utils.isFunction(conditional)) {
  806. conditional = conditional.call(this);
  807. }
  808. // Default behavior is to render the positive path if the value is truthy and not empty.
  809. // The `includeZero` option may be set to treat the condtional as purely not empty based on the
  810. // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
  811. if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
  812. return options.inverse(this);
  813. } else {
  814. return options.fn(this);
  815. }
  816. });
  817. instance.registerHelper('unless', function (conditional, options) {
  818. if (arguments.length != 2) {
  819. throw new _exception2['default']('#unless requires exactly one argument');
  820. }
  821. return instance.helpers['if'].call(this, conditional, {
  822. fn: options.inverse,
  823. inverse: options.fn,
  824. hash: options.hash
  825. });
  826. });
  827. };
  828. module.exports = exports['default'];
  829. /***/ }),
  830. /* 27 */
  831. /***/ (function(module, exports) {
  832. 'use strict';
  833. exports.__esModule = true;
  834. exports['default'] = function (instance) {
  835. instance.registerHelper('log', function () /* message, options */{
  836. var args = [undefined],
  837. options = arguments[arguments.length - 1];
  838. for (var i = 0; i < arguments.length - 1; i++) {
  839. args.push(arguments[i]);
  840. }
  841. var level = 1;
  842. if (options.hash.level != null) {
  843. level = options.hash.level;
  844. } else if (options.data && options.data.level != null) {
  845. level = options.data.level;
  846. }
  847. args[0] = level;
  848. instance.log.apply(instance, args);
  849. });
  850. };
  851. module.exports = exports['default'];
  852. /***/ }),
  853. /* 28 */
  854. /***/ (function(module, exports) {
  855. 'use strict';
  856. exports.__esModule = true;
  857. exports['default'] = function (instance) {
  858. instance.registerHelper('lookup', function (obj, field, options) {
  859. if (!obj) {
  860. // Note for 5.0: Change to "obj == null" in 5.0
  861. return obj;
  862. }
  863. return options.lookupProperty(obj, field);
  864. });
  865. };
  866. module.exports = exports['default'];
  867. /***/ }),
  868. /* 29 */
  869. /***/ (function(module, exports, __webpack_require__) {
  870. 'use strict';
  871. var _interopRequireDefault = __webpack_require__(1)['default'];
  872. exports.__esModule = true;
  873. var _utils = __webpack_require__(5);
  874. var _exception = __webpack_require__(6);
  875. var _exception2 = _interopRequireDefault(_exception);
  876. exports['default'] = function (instance) {
  877. instance.registerHelper('with', function (context, options) {
  878. if (arguments.length != 2) {
  879. throw new _exception2['default']('#with requires exactly one argument');
  880. }
  881. if (_utils.isFunction(context)) {
  882. context = context.call(this);
  883. }
  884. var fn = options.fn;
  885. if (!_utils.isEmpty(context)) {
  886. var data = options.data;
  887. if (options.data && options.ids) {
  888. data = _utils.createFrame(options.data);
  889. data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
  890. }
  891. return fn(context, {
  892. data: data,
  893. blockParams: _utils.blockParams([context], [data && data.contextPath])
  894. });
  895. } else {
  896. return options.inverse(this);
  897. }
  898. });
  899. };
  900. module.exports = exports['default'];
  901. /***/ }),
  902. /* 30 */
  903. /***/ (function(module, exports, __webpack_require__) {
  904. 'use strict';
  905. var _interopRequireDefault = __webpack_require__(1)['default'];
  906. exports.__esModule = true;
  907. exports.registerDefaultDecorators = registerDefaultDecorators;
  908. var _decoratorsInline = __webpack_require__(31);
  909. var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
  910. function registerDefaultDecorators(instance) {
  911. _decoratorsInline2['default'](instance);
  912. }
  913. /***/ }),
  914. /* 31 */
  915. /***/ (function(module, exports, __webpack_require__) {
  916. 'use strict';
  917. exports.__esModule = true;
  918. var _utils = __webpack_require__(5);
  919. exports['default'] = function (instance) {
  920. instance.registerDecorator('inline', function (fn, props, container, options) {
  921. var ret = fn;
  922. if (!props.partials) {
  923. props.partials = {};
  924. ret = function (context, options) {
  925. // Create a new partials stack frame prior to exec.
  926. var original = container.partials;
  927. container.partials = _utils.extend({}, original, props.partials);
  928. var ret = fn(context, options);
  929. container.partials = original;
  930. return ret;
  931. };
  932. }
  933. props.partials[options.args[0]] = options.fn;
  934. return ret;
  935. });
  936. };
  937. module.exports = exports['default'];
  938. /***/ }),
  939. /* 32 */
  940. /***/ (function(module, exports, __webpack_require__) {
  941. 'use strict';
  942. exports.__esModule = true;
  943. var _utils = __webpack_require__(5);
  944. var logger = {
  945. methodMap: ['debug', 'info', 'warn', 'error'],
  946. level: 'info',
  947. // Maps a given level value to the `methodMap` indexes above.
  948. lookupLevel: function lookupLevel(level) {
  949. if (typeof level === 'string') {
  950. var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
  951. if (levelMap >= 0) {
  952. level = levelMap;
  953. } else {
  954. level = parseInt(level, 10);
  955. }
  956. }
  957. return level;
  958. },
  959. // Can be overridden in the host environment
  960. log: function log(level) {
  961. level = logger.lookupLevel(level);
  962. if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
  963. var method = logger.methodMap[level];
  964. // eslint-disable-next-line no-console
  965. if (!console[method]) {
  966. method = 'log';
  967. }
  968. for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  969. message[_key - 1] = arguments[_key];
  970. }
  971. console[method].apply(console, message); // eslint-disable-line no-console
  972. }
  973. }
  974. };
  975. exports['default'] = logger;
  976. module.exports = exports['default'];
  977. /***/ }),
  978. /* 33 */
  979. /***/ (function(module, exports, __webpack_require__) {
  980. 'use strict';
  981. var _Object$create = __webpack_require__(34)['default'];
  982. var _Object$keys = __webpack_require__(13)['default'];
  983. var _interopRequireWildcard = __webpack_require__(3)['default'];
  984. exports.__esModule = true;
  985. exports.createProtoAccessControl = createProtoAccessControl;
  986. exports.resultIsAllowed = resultIsAllowed;
  987. exports.resetLoggedProperties = resetLoggedProperties;
  988. var _createNewLookupObject = __webpack_require__(36);
  989. var _logger = __webpack_require__(32);
  990. var logger = _interopRequireWildcard(_logger);
  991. var loggedProperties = _Object$create(null);
  992. function createProtoAccessControl(runtimeOptions) {
  993. var defaultMethodWhiteList = _Object$create(null);
  994. defaultMethodWhiteList['constructor'] = false;
  995. defaultMethodWhiteList['__defineGetter__'] = false;
  996. defaultMethodWhiteList['__defineSetter__'] = false;
  997. defaultMethodWhiteList['__lookupGetter__'] = false;
  998. var defaultPropertyWhiteList = _Object$create(null);
  999. // eslint-disable-next-line no-proto
  1000. defaultPropertyWhiteList['__proto__'] = false;
  1001. return {
  1002. properties: {
  1003. whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
  1004. defaultValue: runtimeOptions.allowProtoPropertiesByDefault
  1005. },
  1006. methods: {
  1007. whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
  1008. defaultValue: runtimeOptions.allowProtoMethodsByDefault
  1009. }
  1010. };
  1011. }
  1012. function resultIsAllowed(result, protoAccessControl, propertyName) {
  1013. if (typeof result === 'function') {
  1014. return checkWhiteList(protoAccessControl.methods, propertyName);
  1015. } else {
  1016. return checkWhiteList(protoAccessControl.properties, propertyName);
  1017. }
  1018. }
  1019. function checkWhiteList(protoAccessControlForType, propertyName) {
  1020. if (protoAccessControlForType.whitelist[propertyName] !== undefined) {
  1021. return protoAccessControlForType.whitelist[propertyName] === true;
  1022. }
  1023. if (protoAccessControlForType.defaultValue !== undefined) {
  1024. return protoAccessControlForType.defaultValue;
  1025. }
  1026. logUnexpecedPropertyAccessOnce(propertyName);
  1027. return false;
  1028. }
  1029. function logUnexpecedPropertyAccessOnce(propertyName) {
  1030. if (loggedProperties[propertyName] !== true) {
  1031. loggedProperties[propertyName] = true;
  1032. logger.log('error', 'Handlebars: Access has been denied to resolve the property "' + propertyName + '" because it is not an "own property" of its parent.\n' + 'You can add a runtime option to disable the check or this warning:\n' + 'See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details');
  1033. }
  1034. }
  1035. function resetLoggedProperties() {
  1036. _Object$keys(loggedProperties).forEach(function (propertyName) {
  1037. delete loggedProperties[propertyName];
  1038. });
  1039. }
  1040. /***/ }),
  1041. /* 34 */
  1042. /***/ (function(module, exports, __webpack_require__) {
  1043. module.exports = { "default": __webpack_require__(35), __esModule: true };
  1044. /***/ }),
  1045. /* 35 */
  1046. /***/ (function(module, exports, __webpack_require__) {
  1047. var $ = __webpack_require__(9);
  1048. module.exports = function create(P, D){
  1049. return $.create(P, D);
  1050. };
  1051. /***/ }),
  1052. /* 36 */
  1053. /***/ (function(module, exports, __webpack_require__) {
  1054. 'use strict';
  1055. var _Object$create = __webpack_require__(34)['default'];
  1056. exports.__esModule = true;
  1057. exports.createNewLookupObject = createNewLookupObject;
  1058. var _utils = __webpack_require__(5);
  1059. /**
  1060. * Create a new object with "null"-prototype to avoid truthy results on prototype properties.
  1061. * The resulting object can be used with "object[property]" to check if a property exists
  1062. * @param {...object} sources a varargs parameter of source objects that will be merged
  1063. * @returns {object}
  1064. */
  1065. function createNewLookupObject() {
  1066. for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
  1067. sources[_key] = arguments[_key];
  1068. }
  1069. return _utils.extend.apply(undefined, [_Object$create(null)].concat(sources));
  1070. }
  1071. /***/ }),
  1072. /* 37 */
  1073. /***/ (function(module, exports) {
  1074. // Build out our basic SafeString type
  1075. 'use strict';
  1076. exports.__esModule = true;
  1077. function SafeString(string) {
  1078. this.string = string;
  1079. }
  1080. SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
  1081. return '' + this.string;
  1082. };
  1083. exports['default'] = SafeString;
  1084. module.exports = exports['default'];
  1085. /***/ }),
  1086. /* 38 */
  1087. /***/ (function(module, exports, __webpack_require__) {
  1088. 'use strict';
  1089. var _Object$seal = __webpack_require__(39)['default'];
  1090. var _Object$keys = __webpack_require__(13)['default'];
  1091. var _interopRequireWildcard = __webpack_require__(3)['default'];
  1092. var _interopRequireDefault = __webpack_require__(1)['default'];
  1093. exports.__esModule = true;
  1094. exports.checkRevision = checkRevision;
  1095. exports.template = template;
  1096. exports.wrapProgram = wrapProgram;
  1097. exports.resolvePartial = resolvePartial;
  1098. exports.invokePartial = invokePartial;
  1099. exports.noop = noop;
  1100. var _utils = __webpack_require__(5);
  1101. var Utils = _interopRequireWildcard(_utils);
  1102. var _exception = __webpack_require__(6);
  1103. var _exception2 = _interopRequireDefault(_exception);
  1104. var _base = __webpack_require__(4);
  1105. var _helpers = __webpack_require__(10);
  1106. var _internalWrapHelper = __webpack_require__(43);
  1107. var _internalProtoAccess = __webpack_require__(33);
  1108. function checkRevision(compilerInfo) {
  1109. var compilerRevision = compilerInfo && compilerInfo[0] || 1,
  1110. currentRevision = _base.COMPILER_REVISION;
  1111. if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) {
  1112. return;
  1113. }
  1114. if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) {
  1115. var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
  1116. compilerVersions = _base.REVISION_CHANGES[compilerRevision];
  1117. throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
  1118. } else {
  1119. // Use the embedded version info since the runtime doesn't know about this revision yet
  1120. throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').');
  1121. }
  1122. }
  1123. function template(templateSpec, env) {
  1124. /* istanbul ignore next */
  1125. if (!env) {
  1126. throw new _exception2['default']('No environment passed to template');
  1127. }
  1128. if (!templateSpec || !templateSpec.main) {
  1129. throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
  1130. }
  1131. templateSpec.main.decorator = templateSpec.main_d;
  1132. // Note: Using env.VM references rather than local var references throughout this section to allow
  1133. // for external users to override these as pseudo-supported APIs.
  1134. env.VM.checkRevision(templateSpec.compiler);
  1135. // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0)
  1136. var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7;
  1137. function invokePartialWrapper(partial, context, options) {
  1138. if (options.hash) {
  1139. context = Utils.extend({}, context, options.hash);
  1140. if (options.ids) {
  1141. options.ids[0] = true;
  1142. }
  1143. }
  1144. partial = env.VM.resolvePartial.call(this, partial, context, options);
  1145. var extendedOptions = Utils.extend({}, options, {
  1146. hooks: this.hooks,
  1147. protoAccessControl: this.protoAccessControl
  1148. });
  1149. var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);
  1150. if (result == null && env.compile) {
  1151. options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
  1152. result = options.partials[options.name](context, extendedOptions);
  1153. }
  1154. if (result != null) {
  1155. if (options.indent) {
  1156. var lines = result.split('\n');
  1157. for (var i = 0, l = lines.length; i < l; i++) {
  1158. if (!lines[i] && i + 1 === l) {
  1159. break;
  1160. }
  1161. lines[i] = options.indent + lines[i];
  1162. }
  1163. result = lines.join('\n');
  1164. }
  1165. return result;
  1166. } else {
  1167. throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
  1168. }
  1169. }
  1170. // Just add water
  1171. var container = {
  1172. strict: function strict(obj, name, loc) {
  1173. if (!obj || !(name in obj)) {
  1174. throw new _exception2['default']('"' + name + '" not defined in ' + obj, {
  1175. loc: loc
  1176. });
  1177. }
  1178. return container.lookupProperty(obj, name);
  1179. },
  1180. lookupProperty: function lookupProperty(parent, propertyName) {
  1181. var result = parent[propertyName];
  1182. if (result == null) {
  1183. return result;
  1184. }
  1185. if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
  1186. return result;
  1187. }
  1188. if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
  1189. return result;
  1190. }
  1191. return undefined;
  1192. },
  1193. lookup: function lookup(depths, name) {
  1194. var len = depths.length;
  1195. for (var i = 0; i < len; i++) {
  1196. var result = depths[i] && container.lookupProperty(depths[i], name);
  1197. if (result != null) {
  1198. return depths[i][name];
  1199. }
  1200. }
  1201. },
  1202. lambda: function lambda(current, context) {
  1203. return typeof current === 'function' ? current.call(context) : current;
  1204. },
  1205. escapeExpression: Utils.escapeExpression,
  1206. invokePartial: invokePartialWrapper,
  1207. fn: function fn(i) {
  1208. var ret = templateSpec[i];
  1209. ret.decorator = templateSpec[i + '_d'];
  1210. return ret;
  1211. },
  1212. programs: [],
  1213. program: function program(i, data, declaredBlockParams, blockParams, depths) {
  1214. var programWrapper = this.programs[i],
  1215. fn = this.fn(i);
  1216. if (data || depths || blockParams || declaredBlockParams) {
  1217. programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
  1218. } else if (!programWrapper) {
  1219. programWrapper = this.programs[i] = wrapProgram(this, i, fn);
  1220. }
  1221. return programWrapper;
  1222. },
  1223. data: function data(value, depth) {
  1224. while (value && depth--) {
  1225. value = value._parent;
  1226. }
  1227. return value;
  1228. },
  1229. mergeIfNeeded: function mergeIfNeeded(param, common) {
  1230. var obj = param || common;
  1231. if (param && common && param !== common) {
  1232. obj = Utils.extend({}, common, param);
  1233. }
  1234. return obj;
  1235. },
  1236. // An empty object to use as replacement for null-contexts
  1237. nullContext: _Object$seal({}),
  1238. noop: env.VM.noop,
  1239. compilerInfo: templateSpec.compiler
  1240. };
  1241. function ret(context) {
  1242. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  1243. var data = options.data;
  1244. ret._setup(options);
  1245. if (!options.partial && templateSpec.useData) {
  1246. data = initData(context, data);
  1247. }
  1248. var depths = undefined,
  1249. blockParams = templateSpec.useBlockParams ? [] : undefined;
  1250. if (templateSpec.useDepths) {
  1251. if (options.depths) {
  1252. depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
  1253. } else {
  1254. depths = [context];
  1255. }
  1256. }
  1257. function main(context /*, options*/) {
  1258. return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
  1259. }
  1260. main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
  1261. return main(context, options);
  1262. }
  1263. ret.isTop = true;
  1264. ret._setup = function (options) {
  1265. if (!options.partial) {
  1266. var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
  1267. wrapHelpersToPassLookupProperty(mergedHelpers, container);
  1268. container.helpers = mergedHelpers;
  1269. if (templateSpec.usePartial) {
  1270. // Use mergeIfNeeded here to prevent compiling global partials multiple times
  1271. container.partials = container.mergeIfNeeded(options.partials, env.partials);
  1272. }
  1273. if (templateSpec.usePartial || templateSpec.useDecorators) {
  1274. container.decorators = Utils.extend({}, env.decorators, options.decorators);
  1275. }
  1276. container.hooks = {};
  1277. container.protoAccessControl = _internalProtoAccess.createProtoAccessControl(options);
  1278. var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7;
  1279. _helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers);
  1280. _helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers);
  1281. } else {
  1282. container.protoAccessControl = options.protoAccessControl; // internal option
  1283. container.helpers = options.helpers;
  1284. container.partials = options.partials;
  1285. container.decorators = options.decorators;
  1286. container.hooks = options.hooks;
  1287. }
  1288. };
  1289. ret._child = function (i, data, blockParams, depths) {
  1290. if (templateSpec.useBlockParams && !blockParams) {
  1291. throw new _exception2['default']('must pass block params');
  1292. }
  1293. if (templateSpec.useDepths && !depths) {
  1294. throw new _exception2['default']('must pass parent depths');
  1295. }
  1296. return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
  1297. };
  1298. return ret;
  1299. }
  1300. function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
  1301. function prog(context) {
  1302. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  1303. var currentDepths = depths;
  1304. if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {
  1305. currentDepths = [context].concat(depths);
  1306. }
  1307. return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
  1308. }
  1309. prog = executeDecorators(fn, prog, container, depths, data, blockParams);
  1310. prog.program = i;
  1311. prog.depth = depths ? depths.length : 0;
  1312. prog.blockParams = declaredBlockParams || 0;
  1313. return prog;
  1314. }
  1315. /**
  1316. * This is currently part of the official API, therefore implementation details should not be changed.
  1317. */
  1318. function resolvePartial(partial, context, options) {
  1319. if (!partial) {
  1320. if (options.name === '@partial-block') {
  1321. partial = options.data['partial-block'];
  1322. } else {
  1323. partial = options.partials[options.name];
  1324. }
  1325. } else if (!partial.call && !options.name) {
  1326. // This is a dynamic partial that returned a string
  1327. options.name = partial;
  1328. partial = options.partials[partial];
  1329. }
  1330. return partial;
  1331. }
  1332. function invokePartial(partial, context, options) {
  1333. // Use the current closure context to save the partial-block if this partial
  1334. var currentPartialBlock = options.data && options.data['partial-block'];
  1335. options.partial = true;
  1336. if (options.ids) {
  1337. options.data.contextPath = options.ids[0] || options.data.contextPath;
  1338. }
  1339. var partialBlock = undefined;
  1340. if (options.fn && options.fn !== noop) {
  1341. (function () {
  1342. options.data = _base.createFrame(options.data);
  1343. // Wrapper function to get access to currentPartialBlock from the closure
  1344. var fn = options.fn;
  1345. partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
  1346. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
  1347. // Restore the partial-block from the closure for the execution of the block
  1348. // i.e. the part inside the block of the partial call.
  1349. options.data = _base.createFrame(options.data);
  1350. options.data['partial-block'] = currentPartialBlock;
  1351. return fn(context, options);
  1352. };
  1353. if (fn.partials) {
  1354. options.partials = Utils.extend({}, options.partials, fn.partials);
  1355. }
  1356. })();
  1357. }
  1358. if (partial === undefined && partialBlock) {
  1359. partial = partialBlock;
  1360. }
  1361. if (partial === undefined) {
  1362. throw new _exception2['default']('The partial ' + options.name + ' could not be found');
  1363. } else if (partial instanceof Function) {
  1364. return partial(context, options);
  1365. }
  1366. }
  1367. function noop() {
  1368. return '';
  1369. }
  1370. function initData(context, data) {
  1371. if (!data || !('root' in data)) {
  1372. data = data ? _base.createFrame(data) : {};
  1373. data.root = context;
  1374. }
  1375. return data;
  1376. }
  1377. function executeDecorators(fn, prog, container, depths, data, blockParams) {
  1378. if (fn.decorator) {
  1379. var props = {};
  1380. prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
  1381. Utils.extend(prog, props);
  1382. }
  1383. return prog;
  1384. }
  1385. function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
  1386. _Object$keys(mergedHelpers).forEach(function (helperName) {
  1387. var helper = mergedHelpers[helperName];
  1388. mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
  1389. });
  1390. }
  1391. function passLookupPropertyOption(helper, container) {
  1392. var lookupProperty = container.lookupProperty;
  1393. return _internalWrapHelper.wrapHelper(helper, function (options) {
  1394. return Utils.extend({ lookupProperty: lookupProperty }, options);
  1395. });
  1396. }
  1397. /***/ }),
  1398. /* 39 */
  1399. /***/ (function(module, exports, __webpack_require__) {
  1400. module.exports = { "default": __webpack_require__(40), __esModule: true };
  1401. /***/ }),
  1402. /* 40 */
  1403. /***/ (function(module, exports, __webpack_require__) {
  1404. __webpack_require__(41);
  1405. module.exports = __webpack_require__(21).Object.seal;
  1406. /***/ }),
  1407. /* 41 */
  1408. /***/ (function(module, exports, __webpack_require__) {
  1409. // 19.1.2.17 Object.seal(O)
  1410. var isObject = __webpack_require__(42);
  1411. __webpack_require__(18)('seal', function($seal){
  1412. return function seal(it){
  1413. return $seal && isObject(it) ? $seal(it) : it;
  1414. };
  1415. });
  1416. /***/ }),
  1417. /* 42 */
  1418. /***/ (function(module, exports) {
  1419. module.exports = function(it){
  1420. return typeof it === 'object' ? it !== null : typeof it === 'function';
  1421. };
  1422. /***/ }),
  1423. /* 43 */
  1424. /***/ (function(module, exports) {
  1425. 'use strict';
  1426. exports.__esModule = true;
  1427. exports.wrapHelper = wrapHelper;
  1428. function wrapHelper(helper, transformOptionsFn) {
  1429. if (typeof helper !== 'function') {
  1430. // This should not happen, but apparently it does in https://github.com/wycats/handlebars.js/issues/1639
  1431. // We try to make the wrapper least-invasive by not wrapping it, if the helper is not a function.
  1432. return helper;
  1433. }
  1434. var wrapper = function wrapper() /* dynamic arguments */{
  1435. var options = arguments[arguments.length - 1];
  1436. arguments[arguments.length - 1] = transformOptionsFn(options);
  1437. return helper.apply(this, arguments);
  1438. };
  1439. return wrapper;
  1440. }
  1441. /***/ }),
  1442. /* 44 */
  1443. /***/ (function(module, exports) {
  1444. /* WEBPACK VAR INJECTION */(function(global) {'use strict';
  1445. exports.__esModule = true;
  1446. exports['default'] = function (Handlebars) {
  1447. /* istanbul ignore next */
  1448. var root = typeof global !== 'undefined' ? global : window,
  1449. $Handlebars = root.Handlebars;
  1450. /* istanbul ignore next */
  1451. Handlebars.noConflict = function () {
  1452. if (root.Handlebars === Handlebars) {
  1453. root.Handlebars = $Handlebars;
  1454. }
  1455. return Handlebars;
  1456. };
  1457. };
  1458. module.exports = exports['default'];
  1459. /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
  1460. /***/ }),
  1461. /* 45 */
  1462. /***/ (function(module, exports) {
  1463. 'use strict';
  1464. exports.__esModule = true;
  1465. var AST = {
  1466. // Public API used to evaluate derived attributes regarding AST nodes
  1467. helpers: {
  1468. // a mustache is definitely a helper if:
  1469. // * it is an eligible helper, and
  1470. // * it has at least one parameter or hash segment
  1471. helperExpression: function helperExpression(node) {
  1472. return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash);
  1473. },
  1474. scopedId: function scopedId(path) {
  1475. return (/^\.|this\b/.test(path.original)
  1476. );
  1477. },
  1478. // an ID is simple if it only has one part, and that part is not
  1479. // `..` or `this`.
  1480. simpleId: function simpleId(path) {
  1481. return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
  1482. }
  1483. }
  1484. };
  1485. // Must be exported as an object rather than the root of the module as the jison lexer
  1486. // must modify the object to operate properly.
  1487. exports['default'] = AST;
  1488. module.exports = exports['default'];
  1489. /***/ }),
  1490. /* 46 */
  1491. /***/ (function(module, exports, __webpack_require__) {
  1492. 'use strict';
  1493. var _interopRequireDefault = __webpack_require__(1)['default'];
  1494. var _interopRequireWildcard = __webpack_require__(3)['default'];
  1495. exports.__esModule = true;
  1496. exports.parseWithoutProcessing = parseWithoutProcessing;
  1497. exports.parse = parse;
  1498. var _parser = __webpack_require__(47);
  1499. var _parser2 = _interopRequireDefault(_parser);
  1500. var _whitespaceControl = __webpack_require__(48);
  1501. var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
  1502. var _helpers = __webpack_require__(50);
  1503. var Helpers = _interopRequireWildcard(_helpers);
  1504. var _utils = __webpack_require__(5);
  1505. exports.parser = _parser2['default'];
  1506. var yy = {};
  1507. _utils.extend(yy, Helpers);
  1508. function parseWithoutProcessing(input, options) {
  1509. // Just return if an already-compiled AST was passed in.
  1510. if (input.type === 'Program') {
  1511. return input;
  1512. }
  1513. _parser2['default'].yy = yy;
  1514. // Altering the shared object here, but this is ok as parser is a sync operation
  1515. yy.locInfo = function (locInfo) {
  1516. return new yy.SourceLocation(options && options.srcName, locInfo);
  1517. };
  1518. var ast = _parser2['default'].parse(input);
  1519. return ast;
  1520. }
  1521. function parse(input, options) {
  1522. var ast = parseWithoutProcessing(input, options);
  1523. var strip = new _whitespaceControl2['default'](options);
  1524. return strip.accept(ast);
  1525. }
  1526. /***/ }),
  1527. /* 47 */
  1528. /***/ (function(module, exports) {
  1529. // File ignored in coverage tests via setting in .istanbul.yml
  1530. /* Jison generated parser */
  1531. "use strict";
  1532. exports.__esModule = true;
  1533. var handlebars = (function () {
  1534. var parser = { trace: function trace() {},
  1535. yy: {},
  1536. symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 },
  1537. terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" },
  1538. productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 0], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]],
  1539. performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
  1540. var $0 = $$.length - 1;
  1541. switch (yystate) {
  1542. case 1:
  1543. return $$[$0 - 1];
  1544. break;
  1545. case 2:
  1546. this.$ = yy.prepareProgram($$[$0]);
  1547. break;
  1548. case 3:
  1549. this.$ = $$[$0];
  1550. break;
  1551. case 4:
  1552. this.$ = $$[$0];
  1553. break;
  1554. case 5:
  1555. this.$ = $$[$0];
  1556. break;
  1557. case 6:
  1558. this.$ = $$[$0];
  1559. break;
  1560. case 7:
  1561. this.$ = $$[$0];
  1562. break;
  1563. case 8:
  1564. this.$ = $$[$0];
  1565. break;
  1566. case 9:
  1567. this.$ = {
  1568. type: 'CommentStatement',
  1569. value: yy.stripComment($$[$0]),
  1570. strip: yy.stripFlags($$[$0], $$[$0]),
  1571. loc: yy.locInfo(this._$)
  1572. };
  1573. break;
  1574. case 10:
  1575. this.$ = {
  1576. type: 'ContentStatement',
  1577. original: $$[$0],
  1578. value: $$[$0],
  1579. loc: yy.locInfo(this._$)
  1580. };
  1581. break;
  1582. case 11:
  1583. this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
  1584. break;
  1585. case 12:
  1586. this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
  1587. break;
  1588. case 13:
  1589. this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
  1590. break;
  1591. case 14:
  1592. this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
  1593. break;
  1594. case 15:
  1595. this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
  1596. break;
  1597. case 16:
  1598. this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
  1599. break;
  1600. case 17:
  1601. this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
  1602. break;
  1603. case 18:
  1604. this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
  1605. break;
  1606. case 19:
  1607. var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
  1608. program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
  1609. program.chained = true;
  1610. this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
  1611. break;
  1612. case 20:
  1613. this.$ = $$[$0];
  1614. break;
  1615. case 21:
  1616. this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
  1617. break;
  1618. case 22:
  1619. this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
  1620. break;
  1621. case 23:
  1622. this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
  1623. break;
  1624. case 24:
  1625. this.$ = {
  1626. type: 'PartialStatement',
  1627. name: $$[$0 - 3],
  1628. params: $$[$0 - 2],
  1629. hash: $$[$0 - 1],
  1630. indent: '',
  1631. strip: yy.stripFlags($$[$0 - 4], $$[$0]),
  1632. loc: yy.locInfo(this._$)
  1633. };
  1634. break;
  1635. case 25:
  1636. this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
  1637. break;
  1638. case 26:
  1639. this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
  1640. break;
  1641. case 27:
  1642. this.$ = $$[$0];
  1643. break;
  1644. case 28:
  1645. this.$ = $$[$0];
  1646. break;
  1647. case 29:
  1648. this.$ = {
  1649. type: 'SubExpression',
  1650. path: $$[$0 - 3],
  1651. params: $$[$0 - 2],
  1652. hash: $$[$0 - 1],
  1653. loc: yy.locInfo(this._$)
  1654. };
  1655. break;
  1656. case 30:
  1657. this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
  1658. break;
  1659. case 31:
  1660. this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
  1661. break;
  1662. case 32:
  1663. this.$ = yy.id($$[$0 - 1]);
  1664. break;
  1665. case 33:
  1666. this.$ = $$[$0];
  1667. break;
  1668. case 34:
  1669. this.$ = $$[$0];
  1670. break;
  1671. case 35:
  1672. this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
  1673. break;
  1674. case 36:
  1675. this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
  1676. break;
  1677. case 37:
  1678. this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
  1679. break;
  1680. case 38:
  1681. this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
  1682. break;
  1683. case 39:
  1684. this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
  1685. break;
  1686. case 40:
  1687. this.$ = $$[$0];
  1688. break;
  1689. case 41:
  1690. this.$ = $$[$0];
  1691. break;
  1692. case 42:
  1693. this.$ = yy.preparePath(true, $$[$0], this._$);
  1694. break;
  1695. case 43:
  1696. this.$ = yy.preparePath(false, $$[$0], this._$);
  1697. break;
  1698. case 44:
  1699. $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
  1700. break;
  1701. case 45:
  1702. this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
  1703. break;
  1704. case 46:
  1705. this.$ = [];
  1706. break;
  1707. case 47:
  1708. $$[$0 - 1].push($$[$0]);
  1709. break;
  1710. case 48:
  1711. this.$ = [];
  1712. break;
  1713. case 49:
  1714. $$[$0 - 1].push($$[$0]);
  1715. break;
  1716. case 50:
  1717. this.$ = [];
  1718. break;
  1719. case 51:
  1720. $$[$0 - 1].push($$[$0]);
  1721. break;
  1722. case 58:
  1723. this.$ = [];
  1724. break;
  1725. case 59:
  1726. $$[$0 - 1].push($$[$0]);
  1727. break;
  1728. case 64:
  1729. this.$ = [];
  1730. break;
  1731. case 65:
  1732. $$[$0 - 1].push($$[$0]);
  1733. break;
  1734. case 70:
  1735. this.$ = [];
  1736. break;
  1737. case 71:
  1738. $$[$0 - 1].push($$[$0]);
  1739. break;
  1740. case 78:
  1741. this.$ = [];
  1742. break;
  1743. case 79:
  1744. $$[$0 - 1].push($$[$0]);
  1745. break;
  1746. case 82:
  1747. this.$ = [];
  1748. break;
  1749. case 83:
  1750. $$[$0 - 1].push($$[$0]);
  1751. break;
  1752. case 86:
  1753. this.$ = [];
  1754. break;
  1755. case 87:
  1756. $$[$0 - 1].push($$[$0]);
  1757. break;
  1758. case 90:
  1759. this.$ = [];
  1760. break;
  1761. case 91:
  1762. $$[$0 - 1].push($$[$0]);
  1763. break;
  1764. case 94:
  1765. this.$ = [];
  1766. break;
  1767. case 95:
  1768. $$[$0 - 1].push($$[$0]);
  1769. break;
  1770. case 98:
  1771. this.$ = [$$[$0]];
  1772. break;
  1773. case 99:
  1774. $$[$0 - 1].push($$[$0]);
  1775. break;
  1776. case 100:
  1777. this.$ = [$$[$0]];
  1778. break;
  1779. case 101:
  1780. $$[$0 - 1].push($$[$0]);
  1781. break;
  1782. }
  1783. },
  1784. table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 15: [2, 48], 17: 39, 18: [2, 48] }, { 20: 41, 56: 40, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 44, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 45, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 41, 56: 48, 64: 42, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 49, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 50] }, { 72: [1, 35], 86: 51 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 52, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 53, 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 54, 47: [2, 54] }, { 28: 59, 43: 60, 44: [1, 58], 47: [2, 56] }, { 13: 62, 15: [1, 20], 18: [1, 61] }, { 33: [2, 86], 57: 63, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 64, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 65, 47: [1, 66] }, { 30: 67, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 68, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 69, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 70, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 74, 33: [2, 80], 50: 71, 63: 72, 64: 75, 65: [1, 43], 69: 73, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 79] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 50] }, { 20: 74, 53: 80, 54: [2, 84], 63: 81, 64: 75, 65: [1, 43], 69: 82, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 83, 47: [1, 66] }, { 47: [2, 55] }, { 4: 84, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 85, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 86, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 87, 47: [1, 66] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 74, 33: [2, 88], 58: 88, 63: 89, 64: 75, 65: [1, 43], 69: 90, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 91, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 92, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 31: 93, 33: [2, 60], 63: 94, 64: 75, 65: [1, 43], 69: 95, 70: 76, 71: 77, 72: [1, 78], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 66], 36: 96, 63: 97, 64: 75, 65: [1, 43], 69: 98, 70: 76, 71: 77, 72: [1, 78], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 22: 99, 23: [2, 52], 63: 100, 64: 75, 65: [1, 43], 69: 101, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 74, 33: [2, 92], 62: 102, 63: 103, 64: 75, 65: [1, 43], 69: 104, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 105] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 106, 72: [1, 107], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 108], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 109] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 55, 39: [1, 57], 43: 56, 44: [1, 58], 45: 111, 46: 110, 47: [2, 76] }, { 33: [2, 70], 40: 112, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 113] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 74, 63: 115, 64: 75, 65: [1, 43], 67: 114, 68: [2, 96], 69: 116, 70: 76, 71: 77, 72: [1, 78], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 117] }, { 32: 118, 33: [2, 62], 74: 119, 75: [1, 120] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 121, 74: 122, 75: [1, 120] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 123] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 124] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 108] }, { 20: 74, 63: 125, 64: 75, 65: [1, 43], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 74, 33: [2, 72], 41: 126, 63: 127, 64: 75, 65: [1, 43], 69: 128, 70: 76, 71: 77, 72: [1, 78], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 129] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 130] }, { 33: [2, 63] }, { 72: [1, 132], 76: 131 }, { 33: [1, 133] }, { 33: [2, 69] }, { 15: [2, 12], 18: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 134, 74: 135, 75: [1, 120] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 137], 77: [1, 136] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 138] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }],
  1785. defaultActions: { 4: [2, 1], 54: [2, 55], 56: [2, 20], 60: [2, 57], 73: [2, 81], 82: [2, 85], 86: [2, 18], 90: [2, 89], 101: [2, 53], 104: [2, 93], 110: [2, 19], 111: [2, 77], 116: [2, 97], 119: [2, 63], 122: [2, 69], 135: [2, 75], 136: [2, 32] },
  1786. parseError: function parseError(str, hash) {
  1787. throw new Error(str);
  1788. },
  1789. parse: function parse(input) {
  1790. var self = this,
  1791. stack = [0],
  1792. vstack = [null],
  1793. lstack = [],
  1794. table = this.table,
  1795. yytext = "",
  1796. yylineno = 0,
  1797. yyleng = 0,
  1798. recovering = 0,
  1799. TERROR = 2,
  1800. EOF = 1;
  1801. this.lexer.setInput(input);
  1802. this.lexer.yy = this.yy;
  1803. this.yy.lexer = this.lexer;
  1804. this.yy.parser = this;
  1805. if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
  1806. var yyloc = this.lexer.yylloc;
  1807. lstack.push(yyloc);
  1808. var ranges = this.lexer.options && this.lexer.options.ranges;
  1809. if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
  1810. function popStack(n) {
  1811. stack.length = stack.length - 2 * n;
  1812. vstack.length = vstack.length - n;
  1813. lstack.length = lstack.length - n;
  1814. }
  1815. function lex() {
  1816. var token;
  1817. token = self.lexer.lex() || 1;
  1818. if (typeof token !== "number") {
  1819. token = self.symbols_[token] || token;
  1820. }
  1821. return token;
  1822. }
  1823. var symbol,
  1824. preErrorSymbol,
  1825. state,
  1826. action,
  1827. a,
  1828. r,
  1829. yyval = {},
  1830. p,
  1831. len,
  1832. newState,
  1833. expected;
  1834. while (true) {
  1835. state = stack[stack.length - 1];
  1836. if (this.defaultActions[state]) {
  1837. action = this.defaultActions[state];
  1838. } else {
  1839. if (symbol === null || typeof symbol == "undefined") {
  1840. symbol = lex();
  1841. }
  1842. action = table[state] && table[state][symbol];
  1843. }
  1844. if (typeof action === "undefined" || !action.length || !action[0]) {
  1845. var errStr = "";
  1846. if (!recovering) {
  1847. expected = [];
  1848. for (p in table[state]) if (this.terminals_[p] && p > 2) {
  1849. expected.push("'" + this.terminals_[p] + "'");
  1850. }
  1851. if (this.lexer.showPosition) {
  1852. errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
  1853. } else {
  1854. errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
  1855. }
  1856. this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
  1857. }
  1858. }
  1859. if (action[0] instanceof Array && action.length > 1) {
  1860. throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
  1861. }
  1862. switch (action[0]) {
  1863. case 1:
  1864. stack.push(symbol);
  1865. vstack.push(this.lexer.yytext);
  1866. lstack.push(this.lexer.yylloc);
  1867. stack.push(action[1]);
  1868. symbol = null;
  1869. if (!preErrorSymbol) {
  1870. yyleng = this.lexer.yyleng;
  1871. yytext = this.lexer.yytext;
  1872. yylineno = this.lexer.yylineno;
  1873. yyloc = this.lexer.yylloc;
  1874. if (recovering > 0) recovering--;
  1875. } else {
  1876. symbol = preErrorSymbol;
  1877. preErrorSymbol = null;
  1878. }
  1879. break;
  1880. case 2:
  1881. len = this.productions_[action[1]][1];
  1882. yyval.$ = vstack[vstack.length - len];
  1883. yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column };
  1884. if (ranges) {
  1885. yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
  1886. }
  1887. r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
  1888. if (typeof r !== "undefined") {
  1889. return r;
  1890. }
  1891. if (len) {
  1892. stack = stack.slice(0, -1 * len * 2);
  1893. vstack = vstack.slice(0, -1 * len);
  1894. lstack = lstack.slice(0, -1 * len);
  1895. }
  1896. stack.push(this.productions_[action[1]][0]);
  1897. vstack.push(yyval.$);
  1898. lstack.push(yyval._$);
  1899. newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
  1900. stack.push(newState);
  1901. break;
  1902. case 3:
  1903. return true;
  1904. }
  1905. }
  1906. return true;
  1907. }
  1908. };
  1909. /* Jison generated lexer */
  1910. var lexer = (function () {
  1911. var lexer = { EOF: 1,
  1912. parseError: function parseError(str, hash) {
  1913. if (this.yy.parser) {
  1914. this.yy.parser.parseError(str, hash);
  1915. } else {
  1916. throw new Error(str);
  1917. }
  1918. },
  1919. setInput: function setInput(input) {
  1920. this._input = input;
  1921. this._more = this._less = this.done = false;
  1922. this.yylineno = this.yyleng = 0;
  1923. this.yytext = this.matched = this.match = '';
  1924. this.conditionStack = ['INITIAL'];
  1925. this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
  1926. if (this.options.ranges) this.yylloc.range = [0, 0];
  1927. this.offset = 0;
  1928. return this;
  1929. },
  1930. input: function input() {
  1931. var ch = this._input[0];
  1932. this.yytext += ch;
  1933. this.yyleng++;
  1934. this.offset++;
  1935. this.match += ch;
  1936. this.matched += ch;
  1937. var lines = ch.match(/(?:\r\n?|\n).*/g);
  1938. if (lines) {
  1939. this.yylineno++;
  1940. this.yylloc.last_line++;
  1941. } else {
  1942. this.yylloc.last_column++;
  1943. }
  1944. if (this.options.ranges) this.yylloc.range[1]++;
  1945. this._input = this._input.slice(1);
  1946. return ch;
  1947. },
  1948. unput: function unput(ch) {
  1949. var len = ch.length;
  1950. var lines = ch.split(/(?:\r\n?|\n)/g);
  1951. this._input = ch + this._input;
  1952. this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
  1953. //this.yyleng -= len;
  1954. this.offset -= len;
  1955. var oldLines = this.match.split(/(?:\r\n?|\n)/g);
  1956. this.match = this.match.substr(0, this.match.length - 1);
  1957. this.matched = this.matched.substr(0, this.matched.length - 1);
  1958. if (lines.length - 1) this.yylineno -= lines.length - 1;
  1959. var r = this.yylloc.range;
  1960. this.yylloc = { first_line: this.yylloc.first_line,
  1961. last_line: this.yylineno + 1,
  1962. first_column: this.yylloc.first_column,
  1963. last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
  1964. };
  1965. if (this.options.ranges) {
  1966. this.yylloc.range = [r[0], r[0] + this.yyleng - len];
  1967. }
  1968. return this;
  1969. },
  1970. more: function more() {
  1971. this._more = true;
  1972. return this;
  1973. },
  1974. less: function less(n) {
  1975. this.unput(this.match.slice(n));
  1976. },
  1977. pastInput: function pastInput() {
  1978. var past = this.matched.substr(0, this.matched.length - this.match.length);
  1979. return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
  1980. },
  1981. upcomingInput: function upcomingInput() {
  1982. var next = this.match;
  1983. if (next.length < 20) {
  1984. next += this._input.substr(0, 20 - next.length);
  1985. }
  1986. return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
  1987. },
  1988. showPosition: function showPosition() {
  1989. var pre = this.pastInput();
  1990. var c = new Array(pre.length + 1).join("-");
  1991. return pre + this.upcomingInput() + "\n" + c + "^";
  1992. },
  1993. next: function next() {
  1994. if (this.done) {
  1995. return this.EOF;
  1996. }
  1997. if (!this._input) this.done = true;
  1998. var token, match, tempMatch, index, col, lines;
  1999. if (!this._more) {
  2000. this.yytext = '';
  2001. this.match = '';
  2002. }
  2003. var rules = this._currentRules();
  2004. for (var i = 0; i < rules.length; i++) {
  2005. tempMatch = this._input.match(this.rules[rules[i]]);
  2006. if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
  2007. match = tempMatch;
  2008. index = i;
  2009. if (!this.options.flex) break;
  2010. }
  2011. }
  2012. if (match) {
  2013. lines = match[0].match(/(?:\r\n?|\n).*/g);
  2014. if (lines) this.yylineno += lines.length;
  2015. this.yylloc = { first_line: this.yylloc.last_line,
  2016. last_line: this.yylineno + 1,
  2017. first_column: this.yylloc.last_column,
  2018. last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
  2019. this.yytext += match[0];
  2020. this.match += match[0];
  2021. this.matches = match;
  2022. this.yyleng = this.yytext.length;
  2023. if (this.options.ranges) {
  2024. this.yylloc.range = [this.offset, this.offset += this.yyleng];
  2025. }
  2026. this._more = false;
  2027. this._input = this._input.slice(match[0].length);
  2028. this.matched += match[0];
  2029. token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
  2030. if (this.done && this._input) this.done = false;
  2031. if (token) return token;else return;
  2032. }
  2033. if (this._input === "") {
  2034. return this.EOF;
  2035. } else {
  2036. return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
  2037. }
  2038. },
  2039. lex: function lex() {
  2040. var r = this.next();
  2041. if (typeof r !== 'undefined') {
  2042. return r;
  2043. } else {
  2044. return this.lex();
  2045. }
  2046. },
  2047. begin: function begin(condition) {
  2048. this.conditionStack.push(condition);
  2049. },
  2050. popState: function popState() {
  2051. return this.conditionStack.pop();
  2052. },
  2053. _currentRules: function _currentRules() {
  2054. return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
  2055. },
  2056. topState: function topState() {
  2057. return this.conditionStack[this.conditionStack.length - 2];
  2058. },
  2059. pushState: function begin(condition) {
  2060. this.begin(condition);
  2061. } };
  2062. lexer.options = {};
  2063. lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
  2064. function strip(start, end) {
  2065. return yy_.yytext = yy_.yytext.substring(start, yy_.yyleng - end + start);
  2066. }
  2067. var YYSTATE = YY_START;
  2068. switch ($avoiding_name_collisions) {
  2069. case 0:
  2070. if (yy_.yytext.slice(-2) === "\\\\") {
  2071. strip(0, 1);
  2072. this.begin("mu");
  2073. } else if (yy_.yytext.slice(-1) === "\\") {
  2074. strip(0, 1);
  2075. this.begin("emu");
  2076. } else {
  2077. this.begin("mu");
  2078. }
  2079. if (yy_.yytext) return 15;
  2080. break;
  2081. case 1:
  2082. return 15;
  2083. break;
  2084. case 2:
  2085. this.popState();
  2086. return 15;
  2087. break;
  2088. case 3:
  2089. this.begin('raw');return 15;
  2090. break;
  2091. case 4:
  2092. this.popState();
  2093. // Should be using `this.topState()` below, but it currently
  2094. // returns the second top instead of the first top. Opened an
  2095. // issue about it at https://github.com/zaach/jison/issues/291
  2096. if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
  2097. return 15;
  2098. } else {
  2099. strip(5, 9);
  2100. return 'END_RAW_BLOCK';
  2101. }
  2102. break;
  2103. case 5:
  2104. return 15;
  2105. break;
  2106. case 6:
  2107. this.popState();
  2108. return 14;
  2109. break;
  2110. case 7:
  2111. return 65;
  2112. break;
  2113. case 8:
  2114. return 68;
  2115. break;
  2116. case 9:
  2117. return 19;
  2118. break;
  2119. case 10:
  2120. this.popState();
  2121. this.begin('raw');
  2122. return 23;
  2123. break;
  2124. case 11:
  2125. return 55;
  2126. break;
  2127. case 12:
  2128. return 60;
  2129. break;
  2130. case 13:
  2131. return 29;
  2132. break;
  2133. case 14:
  2134. return 47;
  2135. break;
  2136. case 15:
  2137. this.popState();return 44;
  2138. break;
  2139. case 16:
  2140. this.popState();return 44;
  2141. break;
  2142. case 17:
  2143. return 34;
  2144. break;
  2145. case 18:
  2146. return 39;
  2147. break;
  2148. case 19:
  2149. return 51;
  2150. break;
  2151. case 20:
  2152. return 48;
  2153. break;
  2154. case 21:
  2155. this.unput(yy_.yytext);
  2156. this.popState();
  2157. this.begin('com');
  2158. break;
  2159. case 22:
  2160. this.popState();
  2161. return 14;
  2162. break;
  2163. case 23:
  2164. return 48;
  2165. break;
  2166. case 24:
  2167. return 73;
  2168. break;
  2169. case 25:
  2170. return 72;
  2171. break;
  2172. case 26:
  2173. return 72;
  2174. break;
  2175. case 27:
  2176. return 87;
  2177. break;
  2178. case 28:
  2179. // ignore whitespace
  2180. break;
  2181. case 29:
  2182. this.popState();return 54;
  2183. break;
  2184. case 30:
  2185. this.popState();return 33;
  2186. break;
  2187. case 31:
  2188. yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
  2189. break;
  2190. case 32:
  2191. yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
  2192. break;
  2193. case 33:
  2194. return 85;
  2195. break;
  2196. case 34:
  2197. return 82;
  2198. break;
  2199. case 35:
  2200. return 82;
  2201. break;
  2202. case 36:
  2203. return 83;
  2204. break;
  2205. case 37:
  2206. return 84;
  2207. break;
  2208. case 38:
  2209. return 81;
  2210. break;
  2211. case 39:
  2212. return 75;
  2213. break;
  2214. case 40:
  2215. return 77;
  2216. break;
  2217. case 41:
  2218. return 72;
  2219. break;
  2220. case 42:
  2221. yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
  2222. break;
  2223. case 43:
  2224. return 'INVALID';
  2225. break;
  2226. case 44:
  2227. return 5;
  2228. break;
  2229. }
  2230. };
  2231. lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^\/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
  2232. lexer.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
  2233. return lexer;
  2234. })();
  2235. parser.lexer = lexer;
  2236. function Parser() {
  2237. this.yy = {};
  2238. }Parser.prototype = parser;parser.Parser = Parser;
  2239. return new Parser();
  2240. })();exports["default"] = handlebars;
  2241. module.exports = exports["default"];
  2242. /***/ }),
  2243. /* 48 */
  2244. /***/ (function(module, exports, __webpack_require__) {
  2245. 'use strict';
  2246. var _interopRequireDefault = __webpack_require__(1)['default'];
  2247. exports.__esModule = true;
  2248. var _visitor = __webpack_require__(49);
  2249. var _visitor2 = _interopRequireDefault(_visitor);
  2250. function WhitespaceControl() {
  2251. var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
  2252. this.options = options;
  2253. }
  2254. WhitespaceControl.prototype = new _visitor2['default']();
  2255. WhitespaceControl.prototype.Program = function (program) {
  2256. var doStandalone = !this.options.ignoreStandalone;
  2257. var isRoot = !this.isRootSeen;
  2258. this.isRootSeen = true;
  2259. var body = program.body;
  2260. for (var i = 0, l = body.length; i < l; i++) {
  2261. var current = body[i],
  2262. strip = this.accept(current);
  2263. if (!strip) {
  2264. continue;
  2265. }
  2266. var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
  2267. _isNextWhitespace = isNextWhitespace(body, i, isRoot),
  2268. openStandalone = strip.openStandalone && _isPrevWhitespace,
  2269. closeStandalone = strip.closeStandalone && _isNextWhitespace,
  2270. inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
  2271. if (strip.close) {
  2272. omitRight(body, i, true);
  2273. }
  2274. if (strip.open) {
  2275. omitLeft(body, i, true);
  2276. }
  2277. if (doStandalone && inlineStandalone) {
  2278. omitRight(body, i);
  2279. if (omitLeft(body, i)) {
  2280. // If we are on a standalone node, save the indent info for partials
  2281. if (current.type === 'PartialStatement') {
  2282. // Pull out the whitespace from the final line
  2283. current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
  2284. }
  2285. }
  2286. }
  2287. if (doStandalone && openStandalone) {
  2288. omitRight((current.program || current.inverse).body);
  2289. // Strip out the previous content node if it's whitespace only
  2290. omitLeft(body, i);
  2291. }
  2292. if (doStandalone && closeStandalone) {
  2293. // Always strip the next node
  2294. omitRight(body, i);
  2295. omitLeft((current.inverse || current.program).body);
  2296. }
  2297. }
  2298. return program;
  2299. };
  2300. WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) {
  2301. this.accept(block.program);
  2302. this.accept(block.inverse);
  2303. // Find the inverse program that is involed with whitespace stripping.
  2304. var program = block.program || block.inverse,
  2305. inverse = block.program && block.inverse,
  2306. firstInverse = inverse,
  2307. lastInverse = inverse;
  2308. if (inverse && inverse.chained) {
  2309. firstInverse = inverse.body[0].program;
  2310. // Walk the inverse chain to find the last inverse that is actually in the chain.
  2311. while (lastInverse.chained) {
  2312. lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
  2313. }
  2314. }
  2315. var strip = {
  2316. open: block.openStrip.open,
  2317. close: block.closeStrip.close,
  2318. // Determine the standalone candiacy. Basically flag our content as being possibly standalone
  2319. // so our parent can determine if we actually are standalone
  2320. openStandalone: isNextWhitespace(program.body),
  2321. closeStandalone: isPrevWhitespace((firstInverse || program).body)
  2322. };
  2323. if (block.openStrip.close) {
  2324. omitRight(program.body, null, true);
  2325. }
  2326. if (inverse) {
  2327. var inverseStrip = block.inverseStrip;
  2328. if (inverseStrip.open) {
  2329. omitLeft(program.body, null, true);
  2330. }
  2331. if (inverseStrip.close) {
  2332. omitRight(firstInverse.body, null, true);
  2333. }
  2334. if (block.closeStrip.open) {
  2335. omitLeft(lastInverse.body, null, true);
  2336. }
  2337. // Find standalone else statments
  2338. if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
  2339. omitLeft(program.body);
  2340. omitRight(firstInverse.body);
  2341. }
  2342. } else if (block.closeStrip.open) {
  2343. omitLeft(program.body, null, true);
  2344. }
  2345. return strip;
  2346. };
  2347. WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) {
  2348. return mustache.strip;
  2349. };
  2350. WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
  2351. /* istanbul ignore next */
  2352. var strip = node.strip || {};
  2353. return {
  2354. inlineStandalone: true,
  2355. open: strip.open,
  2356. close: strip.close
  2357. };
  2358. };
  2359. function isPrevWhitespace(body, i, isRoot) {
  2360. if (i === undefined) {
  2361. i = body.length;
  2362. }
  2363. // Nodes that end with newlines are considered whitespace (but are special
  2364. // cased for strip operations)
  2365. var prev = body[i - 1],
  2366. sibling = body[i - 2];
  2367. if (!prev) {
  2368. return isRoot;
  2369. }
  2370. if (prev.type === 'ContentStatement') {
  2371. return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
  2372. }
  2373. }
  2374. function isNextWhitespace(body, i, isRoot) {
  2375. if (i === undefined) {
  2376. i = -1;
  2377. }
  2378. var next = body[i + 1],
  2379. sibling = body[i + 2];
  2380. if (!next) {
  2381. return isRoot;
  2382. }
  2383. if (next.type === 'ContentStatement') {
  2384. return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
  2385. }
  2386. }
  2387. // Marks the node to the right of the position as omitted.
  2388. // I.e. {{foo}}' ' will mark the ' ' node as omitted.
  2389. //
  2390. // If i is undefined, then the first child will be marked as such.
  2391. //
  2392. // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
  2393. // content is met.
  2394. function omitRight(body, i, multiple) {
  2395. var current = body[i == null ? 0 : i + 1];
  2396. if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) {
  2397. return;
  2398. }
  2399. var original = current.value;
  2400. current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
  2401. current.rightStripped = current.value !== original;
  2402. }
  2403. // Marks the node to the left of the position as omitted.
  2404. // I.e. ' '{{foo}} will mark the ' ' node as omitted.
  2405. //
  2406. // If i is undefined then the last child will be marked as such.
  2407. //
  2408. // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
  2409. // content is met.
  2410. function omitLeft(body, i, multiple) {
  2411. var current = body[i == null ? body.length - 1 : i - 1];
  2412. if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) {
  2413. return;
  2414. }
  2415. // We omit the last node if it's whitespace only and not preceded by a non-content node.
  2416. var original = current.value;
  2417. current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
  2418. current.leftStripped = current.value !== original;
  2419. return current.leftStripped;
  2420. }
  2421. exports['default'] = WhitespaceControl;
  2422. module.exports = exports['default'];
  2423. /***/ }),
  2424. /* 49 */
  2425. /***/ (function(module, exports, __webpack_require__) {
  2426. 'use strict';
  2427. var _interopRequireDefault = __webpack_require__(1)['default'];
  2428. exports.__esModule = true;
  2429. var _exception = __webpack_require__(6);
  2430. var _exception2 = _interopRequireDefault(_exception);
  2431. function Visitor() {
  2432. this.parents = [];
  2433. }
  2434. Visitor.prototype = {
  2435. constructor: Visitor,
  2436. mutating: false,
  2437. // Visits a given value. If mutating, will replace the value if necessary.
  2438. acceptKey: function acceptKey(node, name) {
  2439. var value = this.accept(node[name]);
  2440. if (this.mutating) {
  2441. // Hacky sanity check: This may have a few false positives for type for the helper
  2442. // methods but will generally do the right thing without a lot of overhead.
  2443. if (value && !Visitor.prototype[value.type]) {
  2444. throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
  2445. }
  2446. node[name] = value;
  2447. }
  2448. },
  2449. // Performs an accept operation with added sanity check to ensure
  2450. // required keys are not removed.
  2451. acceptRequired: function acceptRequired(node, name) {
  2452. this.acceptKey(node, name);
  2453. if (!node[name]) {
  2454. throw new _exception2['default'](node.type + ' requires ' + name);
  2455. }
  2456. },
  2457. // Traverses a given array. If mutating, empty respnses will be removed
  2458. // for child elements.
  2459. acceptArray: function acceptArray(array) {
  2460. for (var i = 0, l = array.length; i < l; i++) {
  2461. this.acceptKey(array, i);
  2462. if (!array[i]) {
  2463. array.splice(i, 1);
  2464. i--;
  2465. l--;
  2466. }
  2467. }
  2468. },
  2469. accept: function accept(object) {
  2470. if (!object) {
  2471. return;
  2472. }
  2473. /* istanbul ignore next: Sanity code */
  2474. if (!this[object.type]) {
  2475. throw new _exception2['default']('Unknown type: ' + object.type, object);
  2476. }
  2477. if (this.current) {
  2478. this.parents.unshift(this.current);
  2479. }
  2480. this.current = object;
  2481. var ret = this[object.type](object);
  2482. this.current = this.parents.shift();
  2483. if (!this.mutating || ret) {
  2484. return ret;
  2485. } else if (ret !== false) {
  2486. return object;
  2487. }
  2488. },
  2489. Program: function Program(program) {
  2490. this.acceptArray(program.body);
  2491. },
  2492. MustacheStatement: visitSubExpression,
  2493. Decorator: visitSubExpression,
  2494. BlockStatement: visitBlock,
  2495. DecoratorBlock: visitBlock,
  2496. PartialStatement: visitPartial,
  2497. PartialBlockStatement: function PartialBlockStatement(partial) {
  2498. visitPartial.call(this, partial);
  2499. this.acceptKey(partial, 'program');
  2500. },
  2501. ContentStatement: function ContentStatement() /* content */{},
  2502. CommentStatement: function CommentStatement() /* comment */{},
  2503. SubExpression: visitSubExpression,
  2504. PathExpression: function PathExpression() /* path */{},
  2505. StringLiteral: function StringLiteral() /* string */{},
  2506. NumberLiteral: function NumberLiteral() /* number */{},
  2507. BooleanLiteral: function BooleanLiteral() /* bool */{},
  2508. UndefinedLiteral: function UndefinedLiteral() /* literal */{},
  2509. NullLiteral: function NullLiteral() /* literal */{},
  2510. Hash: function Hash(hash) {
  2511. this.acceptArray(hash.pairs);
  2512. },
  2513. HashPair: function HashPair(pair) {
  2514. this.acceptRequired(pair, 'value');
  2515. }
  2516. };
  2517. function visitSubExpression(mustache) {
  2518. this.acceptRequired(mustache, 'path');
  2519. this.acceptArray(mustache.params);
  2520. this.acceptKey(mustache, 'hash');
  2521. }
  2522. function visitBlock(block) {
  2523. visitSubExpression.call(this, block);
  2524. this.acceptKey(block, 'program');
  2525. this.acceptKey(block, 'inverse');
  2526. }
  2527. function visitPartial(partial) {
  2528. this.acceptRequired(partial, 'name');
  2529. this.acceptArray(partial.params);
  2530. this.acceptKey(partial, 'hash');
  2531. }
  2532. exports['default'] = Visitor;
  2533. module.exports = exports['default'];
  2534. /***/ }),
  2535. /* 50 */
  2536. /***/ (function(module, exports, __webpack_require__) {
  2537. 'use strict';
  2538. var _interopRequireDefault = __webpack_require__(1)['default'];
  2539. exports.__esModule = true;
  2540. exports.SourceLocation = SourceLocation;
  2541. exports.id = id;
  2542. exports.stripFlags = stripFlags;
  2543. exports.stripComment = stripComment;
  2544. exports.preparePath = preparePath;
  2545. exports.prepareMustache = prepareMustache;
  2546. exports.prepareRawBlock = prepareRawBlock;
  2547. exports.prepareBlock = prepareBlock;
  2548. exports.prepareProgram = prepareProgram;
  2549. exports.preparePartialBlock = preparePartialBlock;
  2550. var _exception = __webpack_require__(6);
  2551. var _exception2 = _interopRequireDefault(_exception);
  2552. function validateClose(open, close) {
  2553. close = close.path ? close.path.original : close;
  2554. if (open.path.original !== close) {
  2555. var errorNode = { loc: open.path.loc };
  2556. throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
  2557. }
  2558. }
  2559. function SourceLocation(source, locInfo) {
  2560. this.source = source;
  2561. this.start = {
  2562. line: locInfo.first_line,
  2563. column: locInfo.first_column
  2564. };
  2565. this.end = {
  2566. line: locInfo.last_line,
  2567. column: locInfo.last_column
  2568. };
  2569. }
  2570. function id(token) {
  2571. if (/^\[.*\]$/.test(token)) {
  2572. return token.substring(1, token.length - 1);
  2573. } else {
  2574. return token;
  2575. }
  2576. }
  2577. function stripFlags(open, close) {
  2578. return {
  2579. open: open.charAt(2) === '~',
  2580. close: close.charAt(close.length - 3) === '~'
  2581. };
  2582. }
  2583. function stripComment(comment) {
  2584. return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, '');
  2585. }
  2586. function preparePath(data, parts, loc) {
  2587. loc = this.locInfo(loc);
  2588. var original = data ? '@' : '',
  2589. dig = [],
  2590. depth = 0;
  2591. for (var i = 0, l = parts.length; i < l; i++) {
  2592. var part = parts[i].part,
  2593. // If we have [] syntax then we do not treat path references as operators,
  2594. // i.e. foo.[this] resolves to approximately context.foo['this']
  2595. isLiteral = parts[i].original !== part;
  2596. original += (parts[i].separator || '') + part;
  2597. if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
  2598. if (dig.length > 0) {
  2599. throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
  2600. } else if (part === '..') {
  2601. depth++;
  2602. }
  2603. } else {
  2604. dig.push(part);
  2605. }
  2606. }
  2607. return {
  2608. type: 'PathExpression',
  2609. data: data,
  2610. depth: depth,
  2611. parts: dig,
  2612. original: original,
  2613. loc: loc
  2614. };
  2615. }
  2616. function prepareMustache(path, params, hash, open, strip, locInfo) {
  2617. // Must use charAt to support IE pre-10
  2618. var escapeFlag = open.charAt(3) || open.charAt(2),
  2619. escaped = escapeFlag !== '{' && escapeFlag !== '&';
  2620. var decorator = /\*/.test(open);
  2621. return {
  2622. type: decorator ? 'Decorator' : 'MustacheStatement',
  2623. path: path,
  2624. params: params,
  2625. hash: hash,
  2626. escaped: escaped,
  2627. strip: strip,
  2628. loc: this.locInfo(locInfo)
  2629. };
  2630. }
  2631. function prepareRawBlock(openRawBlock, contents, close, locInfo) {
  2632. validateClose(openRawBlock, close);
  2633. locInfo = this.locInfo(locInfo);
  2634. var program = {
  2635. type: 'Program',
  2636. body: contents,
  2637. strip: {},
  2638. loc: locInfo
  2639. };
  2640. return {
  2641. type: 'BlockStatement',
  2642. path: openRawBlock.path,
  2643. params: openRawBlock.params,
  2644. hash: openRawBlock.hash,
  2645. program: program,
  2646. openStrip: {},
  2647. inverseStrip: {},
  2648. closeStrip: {},
  2649. loc: locInfo
  2650. };
  2651. }
  2652. function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
  2653. if (close && close.path) {
  2654. validateClose(openBlock, close);
  2655. }
  2656. var decorator = /\*/.test(openBlock.open);
  2657. program.blockParams = openBlock.blockParams;
  2658. var inverse = undefined,
  2659. inverseStrip = undefined;
  2660. if (inverseAndProgram) {
  2661. if (decorator) {
  2662. throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram);
  2663. }
  2664. if (inverseAndProgram.chain) {
  2665. inverseAndProgram.program.body[0].closeStrip = close.strip;
  2666. }
  2667. inverseStrip = inverseAndProgram.strip;
  2668. inverse = inverseAndProgram.program;
  2669. }
  2670. if (inverted) {
  2671. inverted = inverse;
  2672. inverse = program;
  2673. program = inverted;
  2674. }
  2675. return {
  2676. type: decorator ? 'DecoratorBlock' : 'BlockStatement',
  2677. path: openBlock.path,
  2678. params: openBlock.params,
  2679. hash: openBlock.hash,
  2680. program: program,
  2681. inverse: inverse,
  2682. openStrip: openBlock.strip,
  2683. inverseStrip: inverseStrip,
  2684. closeStrip: close && close.strip,
  2685. loc: this.locInfo(locInfo)
  2686. };
  2687. }
  2688. function prepareProgram(statements, loc) {
  2689. if (!loc && statements.length) {
  2690. var firstLoc = statements[0].loc,
  2691. lastLoc = statements[statements.length - 1].loc;
  2692. /* istanbul ignore else */
  2693. if (firstLoc && lastLoc) {
  2694. loc = {
  2695. source: firstLoc.source,
  2696. start: {
  2697. line: firstLoc.start.line,
  2698. column: firstLoc.start.column
  2699. },
  2700. end: {
  2701. line: lastLoc.end.line,
  2702. column: lastLoc.end.column
  2703. }
  2704. };
  2705. }
  2706. }
  2707. return {
  2708. type: 'Program',
  2709. body: statements,
  2710. strip: {},
  2711. loc: loc
  2712. };
  2713. }
  2714. function preparePartialBlock(open, program, close, locInfo) {
  2715. validateClose(open, close);
  2716. return {
  2717. type: 'PartialBlockStatement',
  2718. name: open.path,
  2719. params: open.params,
  2720. hash: open.hash,
  2721. program: program,
  2722. openStrip: open.strip,
  2723. closeStrip: close && close.strip,
  2724. loc: this.locInfo(locInfo)
  2725. };
  2726. }
  2727. /***/ }),
  2728. /* 51 */
  2729. /***/ (function(module, exports, __webpack_require__) {
  2730. /* eslint-disable new-cap */
  2731. 'use strict';
  2732. var _Object$create = __webpack_require__(34)['default'];
  2733. var _interopRequireDefault = __webpack_require__(1)['default'];
  2734. exports.__esModule = true;
  2735. exports.Compiler = Compiler;
  2736. exports.precompile = precompile;
  2737. exports.compile = compile;
  2738. var _exception = __webpack_require__(6);
  2739. var _exception2 = _interopRequireDefault(_exception);
  2740. var _utils = __webpack_require__(5);
  2741. var _ast = __webpack_require__(45);
  2742. var _ast2 = _interopRequireDefault(_ast);
  2743. var slice = [].slice;
  2744. function Compiler() {}
  2745. // the foundHelper register will disambiguate helper lookup from finding a
  2746. // function in a context. This is necessary for mustache compatibility, which
  2747. // requires that context functions in blocks are evaluated by blockHelperMissing,
  2748. // and then proceed as if the resulting value was provided to blockHelperMissing.
  2749. Compiler.prototype = {
  2750. compiler: Compiler,
  2751. equals: function equals(other) {
  2752. var len = this.opcodes.length;
  2753. if (other.opcodes.length !== len) {
  2754. return false;
  2755. }
  2756. for (var i = 0; i < len; i++) {
  2757. var opcode = this.opcodes[i],
  2758. otherOpcode = other.opcodes[i];
  2759. if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
  2760. return false;
  2761. }
  2762. }
  2763. // We know that length is the same between the two arrays because they are directly tied
  2764. // to the opcode behavior above.
  2765. len = this.children.length;
  2766. for (var i = 0; i < len; i++) {
  2767. if (!this.children[i].equals(other.children[i])) {
  2768. return false;
  2769. }
  2770. }
  2771. return true;
  2772. },
  2773. guid: 0,
  2774. compile: function compile(program, options) {
  2775. this.sourceNode = [];
  2776. this.opcodes = [];
  2777. this.children = [];
  2778. this.options = options;
  2779. this.stringParams = options.stringParams;
  2780. this.trackIds = options.trackIds;
  2781. options.blockParams = options.blockParams || [];
  2782. options.knownHelpers = _utils.extend(_Object$create(null), {
  2783. helperMissing: true,
  2784. blockHelperMissing: true,
  2785. each: true,
  2786. 'if': true,
  2787. unless: true,
  2788. 'with': true,
  2789. log: true,
  2790. lookup: true
  2791. }, options.knownHelpers);
  2792. return this.accept(program);
  2793. },
  2794. compileProgram: function compileProgram(program) {
  2795. var childCompiler = new this.compiler(),
  2796. // eslint-disable-line new-cap
  2797. result = childCompiler.compile(program, this.options),
  2798. guid = this.guid++;
  2799. this.usePartial = this.usePartial || result.usePartial;
  2800. this.children[guid] = result;
  2801. this.useDepths = this.useDepths || result.useDepths;
  2802. return guid;
  2803. },
  2804. accept: function accept(node) {
  2805. /* istanbul ignore next: Sanity code */
  2806. if (!this[node.type]) {
  2807. throw new _exception2['default']('Unknown type: ' + node.type, node);
  2808. }
  2809. this.sourceNode.unshift(node);
  2810. var ret = this[node.type](node);
  2811. this.sourceNode.shift();
  2812. return ret;
  2813. },
  2814. Program: function Program(program) {
  2815. this.options.blockParams.unshift(program.blockParams);
  2816. var body = program.body,
  2817. bodyLength = body.length;
  2818. for (var i = 0; i < bodyLength; i++) {
  2819. this.accept(body[i]);
  2820. }
  2821. this.options.blockParams.shift();
  2822. this.isSimple = bodyLength === 1;
  2823. this.blockParams = program.blockParams ? program.blockParams.length : 0;
  2824. return this;
  2825. },
  2826. BlockStatement: function BlockStatement(block) {
  2827. transformLiteralToPath(block);
  2828. var program = block.program,
  2829. inverse = block.inverse;
  2830. program = program && this.compileProgram(program);
  2831. inverse = inverse && this.compileProgram(inverse);
  2832. var type = this.classifySexpr(block);
  2833. if (type === 'helper') {
  2834. this.helperSexpr(block, program, inverse);
  2835. } else if (type === 'simple') {
  2836. this.simpleSexpr(block);
  2837. // now that the simple mustache is resolved, we need to
  2838. // evaluate it by executing `blockHelperMissing`
  2839. this.opcode('pushProgram', program);
  2840. this.opcode('pushProgram', inverse);
  2841. this.opcode('emptyHash');
  2842. this.opcode('blockValue', block.path.original);
  2843. } else {
  2844. this.ambiguousSexpr(block, program, inverse);
  2845. // now that the simple mustache is resolved, we need to
  2846. // evaluate it by executing `blockHelperMissing`
  2847. this.opcode('pushProgram', program);
  2848. this.opcode('pushProgram', inverse);
  2849. this.opcode('emptyHash');
  2850. this.opcode('ambiguousBlockValue');
  2851. }
  2852. this.opcode('append');
  2853. },
  2854. DecoratorBlock: function DecoratorBlock(decorator) {
  2855. var program = decorator.program && this.compileProgram(decorator.program);
  2856. var params = this.setupFullMustacheParams(decorator, program, undefined),
  2857. path = decorator.path;
  2858. this.useDecorators = true;
  2859. this.opcode('registerDecorator', params.length, path.original);
  2860. },
  2861. PartialStatement: function PartialStatement(partial) {
  2862. this.usePartial = true;
  2863. var program = partial.program;
  2864. if (program) {
  2865. program = this.compileProgram(partial.program);
  2866. }
  2867. var params = partial.params;
  2868. if (params.length > 1) {
  2869. throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
  2870. } else if (!params.length) {
  2871. if (this.options.explicitPartialContext) {
  2872. this.opcode('pushLiteral', 'undefined');
  2873. } else {
  2874. params.push({ type: 'PathExpression', parts: [], depth: 0 });
  2875. }
  2876. }
  2877. var partialName = partial.name.original,
  2878. isDynamic = partial.name.type === 'SubExpression';
  2879. if (isDynamic) {
  2880. this.accept(partial.name);
  2881. }
  2882. this.setupFullMustacheParams(partial, program, undefined, true);
  2883. var indent = partial.indent || '';
  2884. if (this.options.preventIndent && indent) {
  2885. this.opcode('appendContent', indent);
  2886. indent = '';
  2887. }
  2888. this.opcode('invokePartial', isDynamic, partialName, indent);
  2889. this.opcode('append');
  2890. },
  2891. PartialBlockStatement: function PartialBlockStatement(partialBlock) {
  2892. this.PartialStatement(partialBlock);
  2893. },
  2894. MustacheStatement: function MustacheStatement(mustache) {
  2895. this.SubExpression(mustache);
  2896. if (mustache.escaped && !this.options.noEscape) {
  2897. this.opcode('appendEscaped');
  2898. } else {
  2899. this.opcode('append');
  2900. }
  2901. },
  2902. Decorator: function Decorator(decorator) {
  2903. this.DecoratorBlock(decorator);
  2904. },
  2905. ContentStatement: function ContentStatement(content) {
  2906. if (content.value) {
  2907. this.opcode('appendContent', content.value);
  2908. }
  2909. },
  2910. CommentStatement: function CommentStatement() {},
  2911. SubExpression: function SubExpression(sexpr) {
  2912. transformLiteralToPath(sexpr);
  2913. var type = this.classifySexpr(sexpr);
  2914. if (type === 'simple') {
  2915. this.simpleSexpr(sexpr);
  2916. } else if (type === 'helper') {
  2917. this.helperSexpr(sexpr);
  2918. } else {
  2919. this.ambiguousSexpr(sexpr);
  2920. }
  2921. },
  2922. ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
  2923. var path = sexpr.path,
  2924. name = path.parts[0],
  2925. isBlock = program != null || inverse != null;
  2926. this.opcode('getContext', path.depth);
  2927. this.opcode('pushProgram', program);
  2928. this.opcode('pushProgram', inverse);
  2929. path.strict = true;
  2930. this.accept(path);
  2931. this.opcode('invokeAmbiguous', name, isBlock);
  2932. },
  2933. simpleSexpr: function simpleSexpr(sexpr) {
  2934. var path = sexpr.path;
  2935. path.strict = true;
  2936. this.accept(path);
  2937. this.opcode('resolvePossibleLambda');
  2938. },
  2939. helperSexpr: function helperSexpr(sexpr, program, inverse) {
  2940. var params = this.setupFullMustacheParams(sexpr, program, inverse),
  2941. path = sexpr.path,
  2942. name = path.parts[0];
  2943. if (this.options.knownHelpers[name]) {
  2944. this.opcode('invokeKnownHelper', params.length, name);
  2945. } else if (this.options.knownHelpersOnly) {
  2946. throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
  2947. } else {
  2948. path.strict = true;
  2949. path.falsy = true;
  2950. this.accept(path);
  2951. this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
  2952. }
  2953. },
  2954. PathExpression: function PathExpression(path) {
  2955. this.addDepth(path.depth);
  2956. this.opcode('getContext', path.depth);
  2957. var name = path.parts[0],
  2958. scoped = _ast2['default'].helpers.scopedId(path),
  2959. blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
  2960. if (blockParamId) {
  2961. this.opcode('lookupBlockParam', blockParamId, path.parts);
  2962. } else if (!name) {
  2963. // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
  2964. this.opcode('pushContext');
  2965. } else if (path.data) {
  2966. this.options.data = true;
  2967. this.opcode('lookupData', path.depth, path.parts, path.strict);
  2968. } else {
  2969. this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
  2970. }
  2971. },
  2972. StringLiteral: function StringLiteral(string) {
  2973. this.opcode('pushString', string.value);
  2974. },
  2975. NumberLiteral: function NumberLiteral(number) {
  2976. this.opcode('pushLiteral', number.value);
  2977. },
  2978. BooleanLiteral: function BooleanLiteral(bool) {
  2979. this.opcode('pushLiteral', bool.value);
  2980. },
  2981. UndefinedLiteral: function UndefinedLiteral() {
  2982. this.opcode('pushLiteral', 'undefined');
  2983. },
  2984. NullLiteral: function NullLiteral() {
  2985. this.opcode('pushLiteral', 'null');
  2986. },
  2987. Hash: function Hash(hash) {
  2988. var pairs = hash.pairs,
  2989. i = 0,
  2990. l = pairs.length;
  2991. this.opcode('pushHash');
  2992. for (; i < l; i++) {
  2993. this.pushParam(pairs[i].value);
  2994. }
  2995. while (i--) {
  2996. this.opcode('assignToHash', pairs[i].key);
  2997. }
  2998. this.opcode('popHash');
  2999. },
  3000. // HELPERS
  3001. opcode: function opcode(name) {
  3002. this.opcodes.push({
  3003. opcode: name,
  3004. args: slice.call(arguments, 1),
  3005. loc: this.sourceNode[0].loc
  3006. });
  3007. },
  3008. addDepth: function addDepth(depth) {
  3009. if (!depth) {
  3010. return;
  3011. }
  3012. this.useDepths = true;
  3013. },
  3014. classifySexpr: function classifySexpr(sexpr) {
  3015. var isSimple = _ast2['default'].helpers.simpleId(sexpr.path);
  3016. var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
  3017. // a mustache is an eligible helper if:
  3018. // * its id is simple (a single part, not `this` or `..`)
  3019. var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr);
  3020. // if a mustache is an eligible helper but not a definite
  3021. // helper, it is ambiguous, and will be resolved in a later
  3022. // pass or at runtime.
  3023. var isEligible = !isBlockParam && (isHelper || isSimple);
  3024. // if ambiguous, we can possibly resolve the ambiguity now
  3025. // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
  3026. if (isEligible && !isHelper) {
  3027. var _name = sexpr.path.parts[0],
  3028. options = this.options;
  3029. if (options.knownHelpers[_name]) {
  3030. isHelper = true;
  3031. } else if (options.knownHelpersOnly) {
  3032. isEligible = false;
  3033. }
  3034. }
  3035. if (isHelper) {
  3036. return 'helper';
  3037. } else if (isEligible) {
  3038. return 'ambiguous';
  3039. } else {
  3040. return 'simple';
  3041. }
  3042. },
  3043. pushParams: function pushParams(params) {
  3044. for (var i = 0, l = params.length; i < l; i++) {
  3045. this.pushParam(params[i]);
  3046. }
  3047. },
  3048. pushParam: function pushParam(val) {
  3049. var value = val.value != null ? val.value : val.original || '';
  3050. if (this.stringParams) {
  3051. if (value.replace) {
  3052. value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
  3053. }
  3054. if (val.depth) {
  3055. this.addDepth(val.depth);
  3056. }
  3057. this.opcode('getContext', val.depth || 0);
  3058. this.opcode('pushStringParam', value, val.type);
  3059. if (val.type === 'SubExpression') {
  3060. // SubExpressions get evaluated and passed in
  3061. // in string params mode.
  3062. this.accept(val);
  3063. }
  3064. } else {
  3065. if (this.trackIds) {
  3066. var blockParamIndex = undefined;
  3067. if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) {
  3068. blockParamIndex = this.blockParamIndex(val.parts[0]);
  3069. }
  3070. if (blockParamIndex) {
  3071. var blockParamChild = val.parts.slice(1).join('.');
  3072. this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
  3073. } else {
  3074. value = val.original || value;
  3075. if (value.replace) {
  3076. value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
  3077. }
  3078. this.opcode('pushId', val.type, value);
  3079. }
  3080. }
  3081. this.accept(val);
  3082. }
  3083. },
  3084. setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
  3085. var params = sexpr.params;
  3086. this.pushParams(params);
  3087. this.opcode('pushProgram', program);
  3088. this.opcode('pushProgram', inverse);
  3089. if (sexpr.hash) {
  3090. this.accept(sexpr.hash);
  3091. } else {
  3092. this.opcode('emptyHash', omitEmpty);
  3093. }
  3094. return params;
  3095. },
  3096. blockParamIndex: function blockParamIndex(name) {
  3097. for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
  3098. var blockParams = this.options.blockParams[depth],
  3099. param = blockParams && _utils.indexOf(blockParams, name);
  3100. if (blockParams && param >= 0) {
  3101. return [depth, param];
  3102. }
  3103. }
  3104. }
  3105. };
  3106. function precompile(input, options, env) {
  3107. if (input == null || typeof input !== 'string' && input.type !== 'Program') {
  3108. throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
  3109. }
  3110. options = options || {};
  3111. if (!('data' in options)) {
  3112. options.data = true;
  3113. }
  3114. if (options.compat) {
  3115. options.useDepths = true;
  3116. }
  3117. var ast = env.parse(input, options),
  3118. environment = new env.Compiler().compile(ast, options);
  3119. return new env.JavaScriptCompiler().compile(environment, options);
  3120. }
  3121. function compile(input, options, env) {
  3122. if (options === undefined) options = {};
  3123. if (input == null || typeof input !== 'string' && input.type !== 'Program') {
  3124. throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
  3125. }
  3126. options = _utils.extend({}, options);
  3127. if (!('data' in options)) {
  3128. options.data = true;
  3129. }
  3130. if (options.compat) {
  3131. options.useDepths = true;
  3132. }
  3133. var compiled = undefined;
  3134. function compileInput() {
  3135. var ast = env.parse(input, options),
  3136. environment = new env.Compiler().compile(ast, options),
  3137. templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
  3138. return env.template(templateSpec);
  3139. }
  3140. // Template is only compiled on first use and cached after that point.
  3141. function ret(context, execOptions) {
  3142. if (!compiled) {
  3143. compiled = compileInput();
  3144. }
  3145. return compiled.call(this, context, execOptions);
  3146. }
  3147. ret._setup = function (setupOptions) {
  3148. if (!compiled) {
  3149. compiled = compileInput();
  3150. }
  3151. return compiled._setup(setupOptions);
  3152. };
  3153. ret._child = function (i, data, blockParams, depths) {
  3154. if (!compiled) {
  3155. compiled = compileInput();
  3156. }
  3157. return compiled._child(i, data, blockParams, depths);
  3158. };
  3159. return ret;
  3160. }
  3161. function argEquals(a, b) {
  3162. if (a === b) {
  3163. return true;
  3164. }
  3165. if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
  3166. for (var i = 0; i < a.length; i++) {
  3167. if (!argEquals(a[i], b[i])) {
  3168. return false;
  3169. }
  3170. }
  3171. return true;
  3172. }
  3173. }
  3174. function transformLiteralToPath(sexpr) {
  3175. if (!sexpr.path.parts) {
  3176. var literal = sexpr.path;
  3177. // Casting to string here to make false and 0 literal values play nicely with the rest
  3178. // of the system.
  3179. sexpr.path = {
  3180. type: 'PathExpression',
  3181. data: false,
  3182. depth: 0,
  3183. parts: [literal.original + ''],
  3184. original: literal.original + '',
  3185. loc: literal.loc
  3186. };
  3187. }
  3188. }
  3189. /***/ }),
  3190. /* 52 */
  3191. /***/ (function(module, exports, __webpack_require__) {
  3192. 'use strict';
  3193. var _Object$keys = __webpack_require__(13)['default'];
  3194. var _interopRequireDefault = __webpack_require__(1)['default'];
  3195. exports.__esModule = true;
  3196. var _base = __webpack_require__(4);
  3197. var _exception = __webpack_require__(6);
  3198. var _exception2 = _interopRequireDefault(_exception);
  3199. var _utils = __webpack_require__(5);
  3200. var _codeGen = __webpack_require__(53);
  3201. var _codeGen2 = _interopRequireDefault(_codeGen);
  3202. function Literal(value) {
  3203. this.value = value;
  3204. }
  3205. function JavaScriptCompiler() {}
  3206. JavaScriptCompiler.prototype = {
  3207. // PUBLIC API: You can override these methods in a subclass to provide
  3208. // alternative compiled forms for name lookup and buffering semantics
  3209. nameLookup: function nameLookup(parent, name /*, type */) {
  3210. return this.internalNameLookup(parent, name);
  3211. },
  3212. depthedLookup: function depthedLookup(name) {
  3213. return [this.aliasable('container.lookup'), '(depths, ', JSON.stringify(name), ')'];
  3214. },
  3215. compilerInfo: function compilerInfo() {
  3216. var revision = _base.COMPILER_REVISION,
  3217. versions = _base.REVISION_CHANGES[revision];
  3218. return [revision, versions];
  3219. },
  3220. appendToBuffer: function appendToBuffer(source, location, explicit) {
  3221. // Force a source as this simplifies the merge logic.
  3222. if (!_utils.isArray(source)) {
  3223. source = [source];
  3224. }
  3225. source = this.source.wrap(source, location);
  3226. if (this.environment.isSimple) {
  3227. return ['return ', source, ';'];
  3228. } else if (explicit) {
  3229. // This is a case where the buffer operation occurs as a child of another
  3230. // construct, generally braces. We have to explicitly output these buffer
  3231. // operations to ensure that the emitted code goes in the correct location.
  3232. return ['buffer += ', source, ';'];
  3233. } else {
  3234. source.appendToBuffer = true;
  3235. return source;
  3236. }
  3237. },
  3238. initializeBuffer: function initializeBuffer() {
  3239. return this.quotedString('');
  3240. },
  3241. // END PUBLIC API
  3242. internalNameLookup: function internalNameLookup(parent, name) {
  3243. this.lookupPropertyFunctionIsUsed = true;
  3244. return ['lookupProperty(', parent, ',', JSON.stringify(name), ')'];
  3245. },
  3246. lookupPropertyFunctionIsUsed: false,
  3247. compile: function compile(environment, options, context, asObject) {
  3248. this.environment = environment;
  3249. this.options = options;
  3250. this.stringParams = this.options.stringParams;
  3251. this.trackIds = this.options.trackIds;
  3252. this.precompile = !asObject;
  3253. this.name = this.environment.name;
  3254. this.isChild = !!context;
  3255. this.context = context || {
  3256. decorators: [],
  3257. programs: [],
  3258. environments: []
  3259. };
  3260. this.preamble();
  3261. this.stackSlot = 0;
  3262. this.stackVars = [];
  3263. this.aliases = {};
  3264. this.registers = { list: [] };
  3265. this.hashes = [];
  3266. this.compileStack = [];
  3267. this.inlineStack = [];
  3268. this.blockParams = [];
  3269. this.compileChildren(environment, options);
  3270. this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
  3271. this.useBlockParams = this.useBlockParams || environment.useBlockParams;
  3272. var opcodes = environment.opcodes,
  3273. opcode = undefined,
  3274. firstLoc = undefined,
  3275. i = undefined,
  3276. l = undefined;
  3277. for (i = 0, l = opcodes.length; i < l; i++) {
  3278. opcode = opcodes[i];
  3279. this.source.currentLocation = opcode.loc;
  3280. firstLoc = firstLoc || opcode.loc;
  3281. this[opcode.opcode].apply(this, opcode.args);
  3282. }
  3283. // Flush any trailing content that might be pending.
  3284. this.source.currentLocation = firstLoc;
  3285. this.pushSource('');
  3286. /* istanbul ignore next */
  3287. if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
  3288. throw new _exception2['default']('Compile completed with content left on stack');
  3289. }
  3290. if (!this.decorators.isEmpty()) {
  3291. this.useDecorators = true;
  3292. this.decorators.prepend(['var decorators = container.decorators, ', this.lookupPropertyFunctionVarDeclaration(), ';\n']);
  3293. this.decorators.push('return fn;');
  3294. if (asObject) {
  3295. this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
  3296. } else {
  3297. this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
  3298. this.decorators.push('}\n');
  3299. this.decorators = this.decorators.merge();
  3300. }
  3301. } else {
  3302. this.decorators = undefined;
  3303. }
  3304. var fn = this.createFunctionContext(asObject);
  3305. if (!this.isChild) {
  3306. var ret = {
  3307. compiler: this.compilerInfo(),
  3308. main: fn
  3309. };
  3310. if (this.decorators) {
  3311. ret.main_d = this.decorators; // eslint-disable-line camelcase
  3312. ret.useDecorators = true;
  3313. }
  3314. var _context = this.context;
  3315. var programs = _context.programs;
  3316. var decorators = _context.decorators;
  3317. for (i = 0, l = programs.length; i < l; i++) {
  3318. if (programs[i]) {
  3319. ret[i] = programs[i];
  3320. if (decorators[i]) {
  3321. ret[i + '_d'] = decorators[i];
  3322. ret.useDecorators = true;
  3323. }
  3324. }
  3325. }
  3326. if (this.environment.usePartial) {
  3327. ret.usePartial = true;
  3328. }
  3329. if (this.options.data) {
  3330. ret.useData = true;
  3331. }
  3332. if (this.useDepths) {
  3333. ret.useDepths = true;
  3334. }
  3335. if (this.useBlockParams) {
  3336. ret.useBlockParams = true;
  3337. }
  3338. if (this.options.compat) {
  3339. ret.compat = true;
  3340. }
  3341. if (!asObject) {
  3342. ret.compiler = JSON.stringify(ret.compiler);
  3343. this.source.currentLocation = { start: { line: 1, column: 0 } };
  3344. ret = this.objectLiteral(ret);
  3345. if (options.srcName) {
  3346. ret = ret.toStringWithSourceMap({ file: options.destName });
  3347. ret.map = ret.map && ret.map.toString();
  3348. } else {
  3349. ret = ret.toString();
  3350. }
  3351. } else {
  3352. ret.compilerOptions = this.options;
  3353. }
  3354. return ret;
  3355. } else {
  3356. return fn;
  3357. }
  3358. },
  3359. preamble: function preamble() {
  3360. // track the last context pushed into place to allow skipping the
  3361. // getContext opcode when it would be a noop
  3362. this.lastContext = 0;
  3363. this.source = new _codeGen2['default'](this.options.srcName);
  3364. this.decorators = new _codeGen2['default'](this.options.srcName);
  3365. },
  3366. createFunctionContext: function createFunctionContext(asObject) {
  3367. // istanbul ignore next
  3368. var _this = this;
  3369. var varDeclarations = '';
  3370. var locals = this.stackVars.concat(this.registers.list);
  3371. if (locals.length > 0) {
  3372. varDeclarations += ', ' + locals.join(', ');
  3373. }
  3374. // Generate minimizer alias mappings
  3375. //
  3376. // When using true SourceNodes, this will update all references to the given alias
  3377. // as the source nodes are reused in situ. For the non-source node compilation mode,
  3378. // aliases will not be used, but this case is already being run on the client and
  3379. // we aren't concern about minimizing the template size.
  3380. var aliasCount = 0;
  3381. _Object$keys(this.aliases).forEach(function (alias) {
  3382. var node = _this.aliases[alias];
  3383. if (node.children && node.referenceCount > 1) {
  3384. varDeclarations += ', alias' + ++aliasCount + '=' + alias;
  3385. node.children[0] = 'alias' + aliasCount;
  3386. }
  3387. });
  3388. if (this.lookupPropertyFunctionIsUsed) {
  3389. varDeclarations += ', ' + this.lookupPropertyFunctionVarDeclaration();
  3390. }
  3391. var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
  3392. if (this.useBlockParams || this.useDepths) {
  3393. params.push('blockParams');
  3394. }
  3395. if (this.useDepths) {
  3396. params.push('depths');
  3397. }
  3398. // Perform a second pass over the output to merge content when possible
  3399. var source = this.mergeSource(varDeclarations);
  3400. if (asObject) {
  3401. params.push(source);
  3402. return Function.apply(this, params);
  3403. } else {
  3404. return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
  3405. }
  3406. },
  3407. mergeSource: function mergeSource(varDeclarations) {
  3408. var isSimple = this.environment.isSimple,
  3409. appendOnly = !this.forceBuffer,
  3410. appendFirst = undefined,
  3411. sourceSeen = undefined,
  3412. bufferStart = undefined,
  3413. bufferEnd = undefined;
  3414. this.source.each(function (line) {
  3415. if (line.appendToBuffer) {
  3416. if (bufferStart) {
  3417. line.prepend(' + ');
  3418. } else {
  3419. bufferStart = line;
  3420. }
  3421. bufferEnd = line;
  3422. } else {
  3423. if (bufferStart) {
  3424. if (!sourceSeen) {
  3425. appendFirst = true;
  3426. } else {
  3427. bufferStart.prepend('buffer += ');
  3428. }
  3429. bufferEnd.add(';');
  3430. bufferStart = bufferEnd = undefined;
  3431. }
  3432. sourceSeen = true;
  3433. if (!isSimple) {
  3434. appendOnly = false;
  3435. }
  3436. }
  3437. });
  3438. if (appendOnly) {
  3439. if (bufferStart) {
  3440. bufferStart.prepend('return ');
  3441. bufferEnd.add(';');
  3442. } else if (!sourceSeen) {
  3443. this.source.push('return "";');
  3444. }
  3445. } else {
  3446. varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
  3447. if (bufferStart) {
  3448. bufferStart.prepend('return buffer + ');
  3449. bufferEnd.add(';');
  3450. } else {
  3451. this.source.push('return buffer;');
  3452. }
  3453. }
  3454. if (varDeclarations) {
  3455. this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
  3456. }
  3457. return this.source.merge();
  3458. },
  3459. lookupPropertyFunctionVarDeclaration: function lookupPropertyFunctionVarDeclaration() {
  3460. return '\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n '.trim();
  3461. },
  3462. // [blockValue]
  3463. //
  3464. // On stack, before: hash, inverse, program, value
  3465. // On stack, after: return value of blockHelperMissing
  3466. //
  3467. // The purpose of this opcode is to take a block of the form
  3468. // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
  3469. // replace it on the stack with the result of properly
  3470. // invoking blockHelperMissing.
  3471. blockValue: function blockValue(name) {
  3472. var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
  3473. params = [this.contextName(0)];
  3474. this.setupHelperArgs(name, 0, params);
  3475. var blockName = this.popStack();
  3476. params.splice(1, 0, blockName);
  3477. this.push(this.source.functionCall(blockHelperMissing, 'call', params));
  3478. },
  3479. // [ambiguousBlockValue]
  3480. //
  3481. // On stack, before: hash, inverse, program, value
  3482. // Compiler value, before: lastHelper=value of last found helper, if any
  3483. // On stack, after, if no lastHelper: same as [blockValue]
  3484. // On stack, after, if lastHelper: value
  3485. ambiguousBlockValue: function ambiguousBlockValue() {
  3486. // We're being a bit cheeky and reusing the options value from the prior exec
  3487. var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'),
  3488. params = [this.contextName(0)];
  3489. this.setupHelperArgs('', 0, params, true);
  3490. this.flushInline();
  3491. var current = this.topStack();
  3492. params.splice(1, 0, current);
  3493. this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
  3494. },
  3495. // [appendContent]
  3496. //
  3497. // On stack, before: ...
  3498. // On stack, after: ...
  3499. //
  3500. // Appends the string value of `content` to the current buffer
  3501. appendContent: function appendContent(content) {
  3502. if (this.pendingContent) {
  3503. content = this.pendingContent + content;
  3504. } else {
  3505. this.pendingLocation = this.source.currentLocation;
  3506. }
  3507. this.pendingContent = content;
  3508. },
  3509. // [append]
  3510. //
  3511. // On stack, before: value, ...
  3512. // On stack, after: ...
  3513. //
  3514. // Coerces `value` to a String and appends it to the current buffer.
  3515. //
  3516. // If `value` is truthy, or 0, it is coerced into a string and appended
  3517. // Otherwise, the empty string is appended
  3518. append: function append() {
  3519. if (this.isInline()) {
  3520. this.replaceStack(function (current) {
  3521. return [' != null ? ', current, ' : ""'];
  3522. });
  3523. this.pushSource(this.appendToBuffer(this.popStack()));
  3524. } else {
  3525. var local = this.popStack();
  3526. this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
  3527. if (this.environment.isSimple) {
  3528. this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
  3529. }
  3530. }
  3531. },
  3532. // [appendEscaped]
  3533. //
  3534. // On stack, before: value, ...
  3535. // On stack, after: ...
  3536. //
  3537. // Escape `value` and append it to the buffer
  3538. appendEscaped: function appendEscaped() {
  3539. this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
  3540. },
  3541. // [getContext]
  3542. //
  3543. // On stack, before: ...
  3544. // On stack, after: ...
  3545. // Compiler value, after: lastContext=depth
  3546. //
  3547. // Set the value of the `lastContext` compiler value to the depth
  3548. getContext: function getContext(depth) {
  3549. this.lastContext = depth;
  3550. },
  3551. // [pushContext]
  3552. //
  3553. // On stack, before: ...
  3554. // On stack, after: currentContext, ...
  3555. //
  3556. // Pushes the value of the current context onto the stack.
  3557. pushContext: function pushContext() {
  3558. this.pushStackLiteral(this.contextName(this.lastContext));
  3559. },
  3560. // [lookupOnContext]
  3561. //
  3562. // On stack, before: ...
  3563. // On stack, after: currentContext[name], ...
  3564. //
  3565. // Looks up the value of `name` on the current context and pushes
  3566. // it onto the stack.
  3567. lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
  3568. var i = 0;
  3569. if (!scoped && this.options.compat && !this.lastContext) {
  3570. // The depthed query is expected to handle the undefined logic for the root level that
  3571. // is implemented below, so we evaluate that directly in compat mode
  3572. this.push(this.depthedLookup(parts[i++]));
  3573. } else {
  3574. this.pushContext();
  3575. }
  3576. this.resolvePath('context', parts, i, falsy, strict);
  3577. },
  3578. // [lookupBlockParam]
  3579. //
  3580. // On stack, before: ...
  3581. // On stack, after: blockParam[name], ...
  3582. //
  3583. // Looks up the value of `parts` on the given block param and pushes
  3584. // it onto the stack.
  3585. lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
  3586. this.useBlockParams = true;
  3587. this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
  3588. this.resolvePath('context', parts, 1);
  3589. },
  3590. // [lookupData]
  3591. //
  3592. // On stack, before: ...
  3593. // On stack, after: data, ...
  3594. //
  3595. // Push the data lookup operator
  3596. lookupData: function lookupData(depth, parts, strict) {
  3597. if (!depth) {
  3598. this.pushStackLiteral('data');
  3599. } else {
  3600. this.pushStackLiteral('container.data(data, ' + depth + ')');
  3601. }
  3602. this.resolvePath('data', parts, 0, true, strict);
  3603. },
  3604. resolvePath: function resolvePath(type, parts, i, falsy, strict) {
  3605. // istanbul ignore next
  3606. var _this2 = this;
  3607. if (this.options.strict || this.options.assumeObjects) {
  3608. this.push(strictLookup(this.options.strict && strict, this, parts, type));
  3609. return;
  3610. }
  3611. var len = parts.length;
  3612. for (; i < len; i++) {
  3613. /* eslint-disable no-loop-func */
  3614. this.replaceStack(function (current) {
  3615. var lookup = _this2.nameLookup(current, parts[i], type);
  3616. // We want to ensure that zero and false are handled properly if the context (falsy flag)
  3617. // needs to have the special handling for these values.
  3618. if (!falsy) {
  3619. return [' != null ? ', lookup, ' : ', current];
  3620. } else {
  3621. // Otherwise we can use generic falsy handling
  3622. return [' && ', lookup];
  3623. }
  3624. });
  3625. /* eslint-enable no-loop-func */
  3626. }
  3627. },
  3628. // [resolvePossibleLambda]
  3629. //
  3630. // On stack, before: value, ...
  3631. // On stack, after: resolved value, ...
  3632. //
  3633. // If the `value` is a lambda, replace it on the stack by
  3634. // the return value of the lambda
  3635. resolvePossibleLambda: function resolvePossibleLambda() {
  3636. this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
  3637. },
  3638. // [pushStringParam]
  3639. //
  3640. // On stack, before: ...
  3641. // On stack, after: string, currentContext, ...
  3642. //
  3643. // This opcode is designed for use in string mode, which
  3644. // provides the string value of a parameter along with its
  3645. // depth rather than resolving it immediately.
  3646. pushStringParam: function pushStringParam(string, type) {
  3647. this.pushContext();
  3648. this.pushString(type);
  3649. // If it's a subexpression, the string result
  3650. // will be pushed after this opcode.
  3651. if (type !== 'SubExpression') {
  3652. if (typeof string === 'string') {
  3653. this.pushString(string);
  3654. } else {
  3655. this.pushStackLiteral(string);
  3656. }
  3657. }
  3658. },
  3659. emptyHash: function emptyHash(omitEmpty) {
  3660. if (this.trackIds) {
  3661. this.push('{}'); // hashIds
  3662. }
  3663. if (this.stringParams) {
  3664. this.push('{}'); // hashContexts
  3665. this.push('{}'); // hashTypes
  3666. }
  3667. this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
  3668. },
  3669. pushHash: function pushHash() {
  3670. if (this.hash) {
  3671. this.hashes.push(this.hash);
  3672. }
  3673. this.hash = { values: {}, types: [], contexts: [], ids: [] };
  3674. },
  3675. popHash: function popHash() {
  3676. var hash = this.hash;
  3677. this.hash = this.hashes.pop();
  3678. if (this.trackIds) {
  3679. this.push(this.objectLiteral(hash.ids));
  3680. }
  3681. if (this.stringParams) {
  3682. this.push(this.objectLiteral(hash.contexts));
  3683. this.push(this.objectLiteral(hash.types));
  3684. }
  3685. this.push(this.objectLiteral(hash.values));
  3686. },
  3687. // [pushString]
  3688. //
  3689. // On stack, before: ...
  3690. // On stack, after: quotedString(string), ...
  3691. //
  3692. // Push a quoted version of `string` onto the stack
  3693. pushString: function pushString(string) {
  3694. this.pushStackLiteral(this.quotedString(string));
  3695. },
  3696. // [pushLiteral]
  3697. //
  3698. // On stack, before: ...
  3699. // On stack, after: value, ...
  3700. //
  3701. // Pushes a value onto the stack. This operation prevents
  3702. // the compiler from creating a temporary variable to hold
  3703. // it.
  3704. pushLiteral: function pushLiteral(value) {
  3705. this.pushStackLiteral(value);
  3706. },
  3707. // [pushProgram]
  3708. //
  3709. // On stack, before: ...
  3710. // On stack, after: program(guid), ...
  3711. //
  3712. // Push a program expression onto the stack. This takes
  3713. // a compile-time guid and converts it into a runtime-accessible
  3714. // expression.
  3715. pushProgram: function pushProgram(guid) {
  3716. if (guid != null) {
  3717. this.pushStackLiteral(this.programExpression(guid));
  3718. } else {
  3719. this.pushStackLiteral(null);
  3720. }
  3721. },
  3722. // [registerDecorator]
  3723. //
  3724. // On stack, before: hash, program, params..., ...
  3725. // On stack, after: ...
  3726. //
  3727. // Pops off the decorator's parameters, invokes the decorator,
  3728. // and inserts the decorator into the decorators list.
  3729. registerDecorator: function registerDecorator(paramSize, name) {
  3730. var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
  3731. options = this.setupHelperArgs(name, paramSize);
  3732. this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
  3733. },
  3734. // [invokeHelper]
  3735. //
  3736. // On stack, before: hash, inverse, program, params..., ...
  3737. // On stack, after: result of helper invocation
  3738. //
  3739. // Pops off the helper's parameters, invokes the helper,
  3740. // and pushes the helper's return value onto the stack.
  3741. //
  3742. // If the helper is not found, `helperMissing` is called.
  3743. invokeHelper: function invokeHelper(paramSize, name, isSimple) {
  3744. var nonHelper = this.popStack(),
  3745. helper = this.setupHelper(paramSize, name);
  3746. var possibleFunctionCalls = [];
  3747. if (isSimple) {
  3748. // direct call to helper
  3749. possibleFunctionCalls.push(helper.name);
  3750. }
  3751. // call a function from the input object
  3752. possibleFunctionCalls.push(nonHelper);
  3753. if (!this.options.strict) {
  3754. possibleFunctionCalls.push(this.aliasable('container.hooks.helperMissing'));
  3755. }
  3756. var functionLookupCode = ['(', this.itemsSeparatedBy(possibleFunctionCalls, '||'), ')'];
  3757. var functionCall = this.source.functionCall(functionLookupCode, 'call', helper.callParams);
  3758. this.push(functionCall);
  3759. },
  3760. itemsSeparatedBy: function itemsSeparatedBy(items, separator) {
  3761. var result = [];
  3762. result.push(items[0]);
  3763. for (var i = 1; i < items.length; i++) {
  3764. result.push(separator, items[i]);
  3765. }
  3766. return result;
  3767. },
  3768. // [invokeKnownHelper]
  3769. //
  3770. // On stack, before: hash, inverse, program, params..., ...
  3771. // On stack, after: result of helper invocation
  3772. //
  3773. // This operation is used when the helper is known to exist,
  3774. // so a `helperMissing` fallback is not required.
  3775. invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
  3776. var helper = this.setupHelper(paramSize, name);
  3777. this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
  3778. },
  3779. // [invokeAmbiguous]
  3780. //
  3781. // On stack, before: hash, inverse, program, params..., ...
  3782. // On stack, after: result of disambiguation
  3783. //
  3784. // This operation is used when an expression like `{{foo}}`
  3785. // is provided, but we don't know at compile-time whether it
  3786. // is a helper or a path.
  3787. //
  3788. // This operation emits more code than the other options,
  3789. // and can be avoided by passing the `knownHelpers` and
  3790. // `knownHelpersOnly` flags at compile-time.
  3791. invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
  3792. this.useRegister('helper');
  3793. var nonHelper = this.popStack();
  3794. this.emptyHash();
  3795. var helper = this.setupHelper(0, name, helperCall);
  3796. var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
  3797. var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
  3798. if (!this.options.strict) {
  3799. lookup[0] = '(helper = ';
  3800. lookup.push(' != null ? helper : ', this.aliasable('container.hooks.helperMissing'));
  3801. }
  3802. this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
  3803. },
  3804. // [invokePartial]
  3805. //
  3806. // On stack, before: context, ...
  3807. // On stack after: result of partial invocation
  3808. //
  3809. // This operation pops off a context, invokes a partial with that context,
  3810. // and pushes the result of the invocation back.
  3811. invokePartial: function invokePartial(isDynamic, name, indent) {
  3812. var params = [],
  3813. options = this.setupParams(name, 1, params);
  3814. if (isDynamic) {
  3815. name = this.popStack();
  3816. delete options.name;
  3817. }
  3818. if (indent) {
  3819. options.indent = JSON.stringify(indent);
  3820. }
  3821. options.helpers = 'helpers';
  3822. options.partials = 'partials';
  3823. options.decorators = 'container.decorators';
  3824. if (!isDynamic) {
  3825. params.unshift(this.nameLookup('partials', name, 'partial'));
  3826. } else {
  3827. params.unshift(name);
  3828. }
  3829. if (this.options.compat) {
  3830. options.depths = 'depths';
  3831. }
  3832. options = this.objectLiteral(options);
  3833. params.push(options);
  3834. this.push(this.source.functionCall('container.invokePartial', '', params));
  3835. },
  3836. // [assignToHash]
  3837. //
  3838. // On stack, before: value, ..., hash, ...
  3839. // On stack, after: ..., hash, ...
  3840. //
  3841. // Pops a value off the stack and assigns it to the current hash
  3842. assignToHash: function assignToHash(key) {
  3843. var value = this.popStack(),
  3844. context = undefined,
  3845. type = undefined,
  3846. id = undefined;
  3847. if (this.trackIds) {
  3848. id = this.popStack();
  3849. }
  3850. if (this.stringParams) {
  3851. type = this.popStack();
  3852. context = this.popStack();
  3853. }
  3854. var hash = this.hash;
  3855. if (context) {
  3856. hash.contexts[key] = context;
  3857. }
  3858. if (type) {
  3859. hash.types[key] = type;
  3860. }
  3861. if (id) {
  3862. hash.ids[key] = id;
  3863. }
  3864. hash.values[key] = value;
  3865. },
  3866. pushId: function pushId(type, name, child) {
  3867. if (type === 'BlockParam') {
  3868. this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
  3869. } else if (type === 'PathExpression') {
  3870. this.pushString(name);
  3871. } else if (type === 'SubExpression') {
  3872. this.pushStackLiteral('true');
  3873. } else {
  3874. this.pushStackLiteral('null');
  3875. }
  3876. },
  3877. // HELPERS
  3878. compiler: JavaScriptCompiler,
  3879. compileChildren: function compileChildren(environment, options) {
  3880. var children = environment.children,
  3881. child = undefined,
  3882. compiler = undefined;
  3883. for (var i = 0, l = children.length; i < l; i++) {
  3884. child = children[i];
  3885. compiler = new this.compiler(); // eslint-disable-line new-cap
  3886. var existing = this.matchExistingProgram(child);
  3887. if (existing == null) {
  3888. this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
  3889. var index = this.context.programs.length;
  3890. child.index = index;
  3891. child.name = 'program' + index;
  3892. this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
  3893. this.context.decorators[index] = compiler.decorators;
  3894. this.context.environments[index] = child;
  3895. this.useDepths = this.useDepths || compiler.useDepths;
  3896. this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
  3897. child.useDepths = this.useDepths;
  3898. child.useBlockParams = this.useBlockParams;
  3899. } else {
  3900. child.index = existing.index;
  3901. child.name = 'program' + existing.index;
  3902. this.useDepths = this.useDepths || existing.useDepths;
  3903. this.useBlockParams = this.useBlockParams || existing.useBlockParams;
  3904. }
  3905. }
  3906. },
  3907. matchExistingProgram: function matchExistingProgram(child) {
  3908. for (var i = 0, len = this.context.environments.length; i < len; i++) {
  3909. var environment = this.context.environments[i];
  3910. if (environment && environment.equals(child)) {
  3911. return environment;
  3912. }
  3913. }
  3914. },
  3915. programExpression: function programExpression(guid) {
  3916. var child = this.environment.children[guid],
  3917. programParams = [child.index, 'data', child.blockParams];
  3918. if (this.useBlockParams || this.useDepths) {
  3919. programParams.push('blockParams');
  3920. }
  3921. if (this.useDepths) {
  3922. programParams.push('depths');
  3923. }
  3924. return 'container.program(' + programParams.join(', ') + ')';
  3925. },
  3926. useRegister: function useRegister(name) {
  3927. if (!this.registers[name]) {
  3928. this.registers[name] = true;
  3929. this.registers.list.push(name);
  3930. }
  3931. },
  3932. push: function push(expr) {
  3933. if (!(expr instanceof Literal)) {
  3934. expr = this.source.wrap(expr);
  3935. }
  3936. this.inlineStack.push(expr);
  3937. return expr;
  3938. },
  3939. pushStackLiteral: function pushStackLiteral(item) {
  3940. this.push(new Literal(item));
  3941. },
  3942. pushSource: function pushSource(source) {
  3943. if (this.pendingContent) {
  3944. this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
  3945. this.pendingContent = undefined;
  3946. }
  3947. if (source) {
  3948. this.source.push(source);
  3949. }
  3950. },
  3951. replaceStack: function replaceStack(callback) {
  3952. var prefix = ['('],
  3953. stack = undefined,
  3954. createdStack = undefined,
  3955. usedLiteral = undefined;
  3956. /* istanbul ignore next */
  3957. if (!this.isInline()) {
  3958. throw new _exception2['default']('replaceStack on non-inline');
  3959. }
  3960. // We want to merge the inline statement into the replacement statement via ','
  3961. var top = this.popStack(true);
  3962. if (top instanceof Literal) {
  3963. // Literals do not need to be inlined
  3964. stack = [top.value];
  3965. prefix = ['(', stack];
  3966. usedLiteral = true;
  3967. } else {
  3968. // Get or create the current stack name for use by the inline
  3969. createdStack = true;
  3970. var _name = this.incrStack();
  3971. prefix = ['((', this.push(_name), ' = ', top, ')'];
  3972. stack = this.topStack();
  3973. }
  3974. var item = callback.call(this, stack);
  3975. if (!usedLiteral) {
  3976. this.popStack();
  3977. }
  3978. if (createdStack) {
  3979. this.stackSlot--;
  3980. }
  3981. this.push(prefix.concat(item, ')'));
  3982. },
  3983. incrStack: function incrStack() {
  3984. this.stackSlot++;
  3985. if (this.stackSlot > this.stackVars.length) {
  3986. this.stackVars.push('stack' + this.stackSlot);
  3987. }
  3988. return this.topStackName();
  3989. },
  3990. topStackName: function topStackName() {
  3991. return 'stack' + this.stackSlot;
  3992. },
  3993. flushInline: function flushInline() {
  3994. var inlineStack = this.inlineStack;
  3995. this.inlineStack = [];
  3996. for (var i = 0, len = inlineStack.length; i < len; i++) {
  3997. var entry = inlineStack[i];
  3998. /* istanbul ignore if */
  3999. if (entry instanceof Literal) {
  4000. this.compileStack.push(entry);
  4001. } else {
  4002. var stack = this.incrStack();
  4003. this.pushSource([stack, ' = ', entry, ';']);
  4004. this.compileStack.push(stack);
  4005. }
  4006. }
  4007. },
  4008. isInline: function isInline() {
  4009. return this.inlineStack.length;
  4010. },
  4011. popStack: function popStack(wrapped) {
  4012. var inline = this.isInline(),
  4013. item = (inline ? this.inlineStack : this.compileStack).pop();
  4014. if (!wrapped && item instanceof Literal) {
  4015. return item.value;
  4016. } else {
  4017. if (!inline) {
  4018. /* istanbul ignore next */
  4019. if (!this.stackSlot) {
  4020. throw new _exception2['default']('Invalid stack pop');
  4021. }
  4022. this.stackSlot--;
  4023. }
  4024. return item;
  4025. }
  4026. },
  4027. topStack: function topStack() {
  4028. var stack = this.isInline() ? this.inlineStack : this.compileStack,
  4029. item = stack[stack.length - 1];
  4030. /* istanbul ignore if */
  4031. if (item instanceof Literal) {
  4032. return item.value;
  4033. } else {
  4034. return item;
  4035. }
  4036. },
  4037. contextName: function contextName(context) {
  4038. if (this.useDepths && context) {
  4039. return 'depths[' + context + ']';
  4040. } else {
  4041. return 'depth' + context;
  4042. }
  4043. },
  4044. quotedString: function quotedString(str) {
  4045. return this.source.quotedString(str);
  4046. },
  4047. objectLiteral: function objectLiteral(obj) {
  4048. return this.source.objectLiteral(obj);
  4049. },
  4050. aliasable: function aliasable(name) {
  4051. var ret = this.aliases[name];
  4052. if (ret) {
  4053. ret.referenceCount++;
  4054. return ret;
  4055. }
  4056. ret = this.aliases[name] = this.source.wrap(name);
  4057. ret.aliasable = true;
  4058. ret.referenceCount = 1;
  4059. return ret;
  4060. },
  4061. setupHelper: function setupHelper(paramSize, name, blockHelper) {
  4062. var params = [],
  4063. paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
  4064. var foundHelper = this.nameLookup('helpers', name, 'helper'),
  4065. callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})');
  4066. return {
  4067. params: params,
  4068. paramsInit: paramsInit,
  4069. name: foundHelper,
  4070. callParams: [callContext].concat(params)
  4071. };
  4072. },
  4073. setupParams: function setupParams(helper, paramSize, params) {
  4074. var options = {},
  4075. contexts = [],
  4076. types = [],
  4077. ids = [],
  4078. objectArgs = !params,
  4079. param = undefined;
  4080. if (objectArgs) {
  4081. params = [];
  4082. }
  4083. options.name = this.quotedString(helper);
  4084. options.hash = this.popStack();
  4085. if (this.trackIds) {
  4086. options.hashIds = this.popStack();
  4087. }
  4088. if (this.stringParams) {
  4089. options.hashTypes = this.popStack();
  4090. options.hashContexts = this.popStack();
  4091. }
  4092. var inverse = this.popStack(),
  4093. program = this.popStack();
  4094. // Avoid setting fn and inverse if neither are set. This allows
  4095. // helpers to do a check for `if (options.fn)`
  4096. if (program || inverse) {
  4097. options.fn = program || 'container.noop';
  4098. options.inverse = inverse || 'container.noop';
  4099. }
  4100. // The parameters go on to the stack in order (making sure that they are evaluated in order)
  4101. // so we need to pop them off the stack in reverse order
  4102. var i = paramSize;
  4103. while (i--) {
  4104. param = this.popStack();
  4105. params[i] = param;
  4106. if (this.trackIds) {
  4107. ids[i] = this.popStack();
  4108. }
  4109. if (this.stringParams) {
  4110. types[i] = this.popStack();
  4111. contexts[i] = this.popStack();
  4112. }
  4113. }
  4114. if (objectArgs) {
  4115. options.args = this.source.generateArray(params);
  4116. }
  4117. if (this.trackIds) {
  4118. options.ids = this.source.generateArray(ids);
  4119. }
  4120. if (this.stringParams) {
  4121. options.types = this.source.generateArray(types);
  4122. options.contexts = this.source.generateArray(contexts);
  4123. }
  4124. if (this.options.data) {
  4125. options.data = 'data';
  4126. }
  4127. if (this.useBlockParams) {
  4128. options.blockParams = 'blockParams';
  4129. }
  4130. return options;
  4131. },
  4132. setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
  4133. var options = this.setupParams(helper, paramSize, params);
  4134. options.loc = JSON.stringify(this.source.currentLocation);
  4135. options = this.objectLiteral(options);
  4136. if (useRegister) {
  4137. this.useRegister('options');
  4138. params.push('options');
  4139. return ['options=', options];
  4140. } else if (params) {
  4141. params.push(options);
  4142. return '';
  4143. } else {
  4144. return options;
  4145. }
  4146. }
  4147. };
  4148. (function () {
  4149. var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' ');
  4150. var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
  4151. for (var i = 0, l = reservedWords.length; i < l; i++) {
  4152. compilerWords[reservedWords[i]] = true;
  4153. }
  4154. })();
  4155. /**
  4156. * @deprecated May be removed in the next major version
  4157. */
  4158. JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
  4159. return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
  4160. };
  4161. function strictLookup(requireTerminal, compiler, parts, type) {
  4162. var stack = compiler.popStack(),
  4163. i = 0,
  4164. len = parts.length;
  4165. if (requireTerminal) {
  4166. len--;
  4167. }
  4168. for (; i < len; i++) {
  4169. stack = compiler.nameLookup(stack, parts[i], type);
  4170. }
  4171. if (requireTerminal) {
  4172. return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ', ', JSON.stringify(compiler.source.currentLocation), ' )'];
  4173. } else {
  4174. return stack;
  4175. }
  4176. }
  4177. exports['default'] = JavaScriptCompiler;
  4178. module.exports = exports['default'];
  4179. /***/ }),
  4180. /* 53 */
  4181. /***/ (function(module, exports, __webpack_require__) {
  4182. /* global define */
  4183. 'use strict';
  4184. var _Object$keys = __webpack_require__(13)['default'];
  4185. exports.__esModule = true;
  4186. var _utils = __webpack_require__(5);
  4187. var SourceNode = undefined;
  4188. try {
  4189. /* istanbul ignore next */
  4190. if (false) {
  4191. // We don't support this in AMD environments. For these environments, we asusme that
  4192. // they are running on the browser and thus have no need for the source-map library.
  4193. var SourceMap = require('source-map');
  4194. SourceNode = SourceMap.SourceNode;
  4195. }
  4196. } catch (err) {}
  4197. /* NOP */
  4198. /* istanbul ignore if: tested but not covered in istanbul due to dist build */
  4199. if (!SourceNode) {
  4200. SourceNode = function (line, column, srcFile, chunks) {
  4201. this.src = '';
  4202. if (chunks) {
  4203. this.add(chunks);
  4204. }
  4205. };
  4206. /* istanbul ignore next */
  4207. SourceNode.prototype = {
  4208. add: function add(chunks) {
  4209. if (_utils.isArray(chunks)) {
  4210. chunks = chunks.join('');
  4211. }
  4212. this.src += chunks;
  4213. },
  4214. prepend: function prepend(chunks) {
  4215. if (_utils.isArray(chunks)) {
  4216. chunks = chunks.join('');
  4217. }
  4218. this.src = chunks + this.src;
  4219. },
  4220. toStringWithSourceMap: function toStringWithSourceMap() {
  4221. return { code: this.toString() };
  4222. },
  4223. toString: function toString() {
  4224. return this.src;
  4225. }
  4226. };
  4227. }
  4228. function castChunk(chunk, codeGen, loc) {
  4229. if (_utils.isArray(chunk)) {
  4230. var ret = [];
  4231. for (var i = 0, len = chunk.length; i < len; i++) {
  4232. ret.push(codeGen.wrap(chunk[i], loc));
  4233. }
  4234. return ret;
  4235. } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
  4236. // Handle primitives that the SourceNode will throw up on
  4237. return chunk + '';
  4238. }
  4239. return chunk;
  4240. }
  4241. function CodeGen(srcFile) {
  4242. this.srcFile = srcFile;
  4243. this.source = [];
  4244. }
  4245. CodeGen.prototype = {
  4246. isEmpty: function isEmpty() {
  4247. return !this.source.length;
  4248. },
  4249. prepend: function prepend(source, loc) {
  4250. this.source.unshift(this.wrap(source, loc));
  4251. },
  4252. push: function push(source, loc) {
  4253. this.source.push(this.wrap(source, loc));
  4254. },
  4255. merge: function merge() {
  4256. var source = this.empty();
  4257. this.each(function (line) {
  4258. source.add([' ', line, '\n']);
  4259. });
  4260. return source;
  4261. },
  4262. each: function each(iter) {
  4263. for (var i = 0, len = this.source.length; i < len; i++) {
  4264. iter(this.source[i]);
  4265. }
  4266. },
  4267. empty: function empty() {
  4268. var loc = this.currentLocation || { start: {} };
  4269. return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
  4270. },
  4271. wrap: function wrap(chunk) {
  4272. var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
  4273. if (chunk instanceof SourceNode) {
  4274. return chunk;
  4275. }
  4276. chunk = castChunk(chunk, this, loc);
  4277. return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
  4278. },
  4279. functionCall: function functionCall(fn, type, params) {
  4280. params = this.generateList(params);
  4281. return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
  4282. },
  4283. quotedString: function quotedString(str) {
  4284. return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
  4285. .replace(/\u2029/g, '\\u2029') + '"';
  4286. },
  4287. objectLiteral: function objectLiteral(obj) {
  4288. // istanbul ignore next
  4289. var _this = this;
  4290. var pairs = [];
  4291. _Object$keys(obj).forEach(function (key) {
  4292. var value = castChunk(obj[key], _this);
  4293. if (value !== 'undefined') {
  4294. pairs.push([_this.quotedString(key), ':', value]);
  4295. }
  4296. });
  4297. var ret = this.generateList(pairs);
  4298. ret.prepend('{');
  4299. ret.add('}');
  4300. return ret;
  4301. },
  4302. generateList: function generateList(entries) {
  4303. var ret = this.empty();
  4304. for (var i = 0, len = entries.length; i < len; i++) {
  4305. if (i) {
  4306. ret.add(',');
  4307. }
  4308. ret.add(castChunk(entries[i], this));
  4309. }
  4310. return ret;
  4311. },
  4312. generateArray: function generateArray(entries) {
  4313. var ret = this.generateList(entries);
  4314. ret.prepend('[');
  4315. ret.add(']');
  4316. return ret;
  4317. }
  4318. };
  4319. exports['default'] = CodeGen;
  4320. module.exports = exports['default'];
  4321. /***/ })
  4322. /******/ ])
  4323. });
  4324. ;