handlebars-v4.0.5.js 156 KB

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