ng-bootstrap.js 458 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240
  1. import { ɵɵdefineInjectable, Injectable, Directive, Input, ContentChildren, Component, ViewEncapsulation, Output, Optional, Host, TemplateRef, EventEmitter, NgModule, ChangeDetectionStrategy, Renderer2, ElementRef, forwardRef, ChangeDetectorRef, Inject, PLATFORM_ID, NgZone, HostListener, LOCALE_ID, ɵɵinject, ViewChild, ViewContainerRef, ComponentFactoryResolver, ContentChild, Injector, ApplicationRef, RendererFactory2, INJECTOR, Attribute, InjectionToken } from '@angular/core';
  2. import { CommonModule, isPlatformBrowser, getLocaleDayNames, FormStyle, TranslationWidth, getLocaleMonthNames, formatDate, DOCUMENT, getLocaleDayPeriods } from '@angular/common';
  3. import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule } from '@angular/forms';
  4. import { __read, __extends, __assign, __values } from 'tslib';
  5. import { combineLatest, timer, NEVER, Subject, BehaviorSubject, fromEvent, merge, race, Observable } from 'rxjs';
  6. import { map, startWith, distinctUntilChanged, switchMap, takeUntil, filter, take, tap, withLatestFrom, delay, share } from 'rxjs/operators';
  7. /**
  8. * @fileoverview added by tsickle
  9. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10. */
  11. /**
  12. * @param {?} value
  13. * @return {?}
  14. */
  15. function toInteger(value) {
  16. return parseInt("" + value, 10);
  17. }
  18. /**
  19. * @param {?} value
  20. * @return {?}
  21. */
  22. function toString(value) {
  23. return (value !== undefined && value !== null) ? "" + value : '';
  24. }
  25. /**
  26. * @param {?} value
  27. * @param {?} max
  28. * @param {?=} min
  29. * @return {?}
  30. */
  31. function getValueInRange(value, max, min) {
  32. if (min === void 0) { min = 0; }
  33. return Math.max(Math.min(value, max), min);
  34. }
  35. /**
  36. * @param {?} value
  37. * @return {?}
  38. */
  39. function isString(value) {
  40. return typeof value === 'string';
  41. }
  42. /**
  43. * @param {?} value
  44. * @return {?}
  45. */
  46. function isNumber(value) {
  47. return !isNaN(toInteger(value));
  48. }
  49. /**
  50. * @param {?} value
  51. * @return {?}
  52. */
  53. function isInteger(value) {
  54. return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
  55. }
  56. /**
  57. * @param {?} value
  58. * @return {?}
  59. */
  60. function isDefined(value) {
  61. return value !== undefined && value !== null;
  62. }
  63. /**
  64. * @param {?} value
  65. * @return {?}
  66. */
  67. function padNumber(value) {
  68. if (isNumber(value)) {
  69. return ("0" + value).slice(-2);
  70. }
  71. else {
  72. return '';
  73. }
  74. }
  75. /**
  76. * @param {?} text
  77. * @return {?}
  78. */
  79. function regExpEscape(text) {
  80. return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
  81. }
  82. /**
  83. * @param {?} element
  84. * @param {?} className
  85. * @return {?}
  86. */
  87. function hasClassName(element, className) {
  88. return element && element.className && element.className.split &&
  89. element.className.split(/\s+/).indexOf(className) >= 0;
  90. }
  91. if (typeof Element !== 'undefined' && !Element.prototype.closest) {
  92. // Polyfill for ie10+
  93. if (!Element.prototype.matches) {
  94. // IE uses the non-standard name: msMatchesSelector
  95. Element.prototype.matches = ((/** @type {?} */ (Element.prototype))).msMatchesSelector || Element.prototype.webkitMatchesSelector;
  96. }
  97. Element.prototype.closest = (/**
  98. * @param {?} s
  99. * @return {?}
  100. */
  101. function (s) {
  102. /** @type {?} */
  103. var el = this;
  104. if (!document.documentElement.contains(el)) {
  105. return null;
  106. }
  107. do {
  108. if (el.matches(s)) {
  109. return el;
  110. }
  111. el = el.parentElement || el.parentNode;
  112. } while (el !== null && el.nodeType === 1);
  113. return null;
  114. });
  115. }
  116. /**
  117. * @param {?} element
  118. * @param {?} selector
  119. * @return {?}
  120. */
  121. function closest(element, selector) {
  122. if (!selector) {
  123. return null;
  124. }
  125. return element.closest(selector);
  126. }
  127. /**
  128. * @fileoverview added by tsickle
  129. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  130. */
  131. /**
  132. * A configuration service for the [NgbAccordion](#/components/accordion/api#NgbAccordion) component.
  133. *
  134. * You can inject this service, typically in your root component, and customize its properties
  135. * to provide default values for all accordions used in the application.
  136. */
  137. var NgbAccordionConfig = /** @class */ (function () {
  138. function NgbAccordionConfig() {
  139. this.closeOthers = false;
  140. }
  141. NgbAccordionConfig.decorators = [
  142. { type: Injectable, args: [{ providedIn: 'root' },] }
  143. ];
  144. /** @nocollapse */ NgbAccordionConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbAccordionConfig_Factory() { return new NgbAccordionConfig(); }, token: NgbAccordionConfig, providedIn: "root" });
  145. return NgbAccordionConfig;
  146. }());
  147. /**
  148. * @fileoverview added by tsickle
  149. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  150. */
  151. /** @type {?} */
  152. var nextId = 0;
  153. /**
  154. * A directive that wraps an accordion panel header with any HTML markup and a toggling button
  155. * marked with [`NgbPanelToggle`](#/components/accordion/api#NgbPanelToggle).
  156. * See the [header customization demo](#/components/accordion/examples#header) for more details.
  157. *
  158. * You can also use [`NgbPanelTitle`](#/components/accordion/api#NgbPanelTitle) to customize only the panel title.
  159. *
  160. * \@since 4.1.0
  161. */
  162. var NgbPanelHeader = /** @class */ (function () {
  163. function NgbPanelHeader(templateRef) {
  164. this.templateRef = templateRef;
  165. }
  166. NgbPanelHeader.decorators = [
  167. { type: Directive, args: [{ selector: 'ng-template[ngbPanelHeader]' },] }
  168. ];
  169. /** @nocollapse */
  170. NgbPanelHeader.ctorParameters = function () { return [
  171. { type: TemplateRef }
  172. ]; };
  173. return NgbPanelHeader;
  174. }());
  175. /**
  176. * A directive that wraps only the panel title with HTML markup inside.
  177. *
  178. * You can also use [`NgbPanelHeader`](#/components/accordion/api#NgbPanelHeader) to customize the full panel header.
  179. */
  180. var NgbPanelTitle = /** @class */ (function () {
  181. function NgbPanelTitle(templateRef) {
  182. this.templateRef = templateRef;
  183. }
  184. NgbPanelTitle.decorators = [
  185. { type: Directive, args: [{ selector: 'ng-template[ngbPanelTitle]' },] }
  186. ];
  187. /** @nocollapse */
  188. NgbPanelTitle.ctorParameters = function () { return [
  189. { type: TemplateRef }
  190. ]; };
  191. return NgbPanelTitle;
  192. }());
  193. /**
  194. * A directive that wraps the accordion panel content.
  195. */
  196. var NgbPanelContent = /** @class */ (function () {
  197. function NgbPanelContent(templateRef) {
  198. this.templateRef = templateRef;
  199. }
  200. NgbPanelContent.decorators = [
  201. { type: Directive, args: [{ selector: 'ng-template[ngbPanelContent]' },] }
  202. ];
  203. /** @nocollapse */
  204. NgbPanelContent.ctorParameters = function () { return [
  205. { type: TemplateRef }
  206. ]; };
  207. return NgbPanelContent;
  208. }());
  209. /**
  210. * A directive that wraps an individual accordion panel with title and collapsible content.
  211. */
  212. var NgbPanel = /** @class */ (function () {
  213. function NgbPanel() {
  214. /**
  215. * If `true`, the panel is disabled an can't be toggled.
  216. */
  217. this.disabled = false;
  218. /**
  219. * An optional id for the panel that must be unique on the page.
  220. *
  221. * If not provided, it will be auto-generated in the `ngb-panel-xxx` format.
  222. */
  223. this.id = "ngb-panel-" + nextId++;
  224. this.isOpen = false;
  225. }
  226. /**
  227. * @return {?}
  228. */
  229. NgbPanel.prototype.ngAfterContentChecked = /**
  230. * @return {?}
  231. */
  232. function () {
  233. // We are using @ContentChildren instead of @ContentChild as in the Angular version being used
  234. // only @ContentChildren allows us to specify the {descendants: false} option.
  235. // Without {descendants: false} we are hitting bugs described in:
  236. // https://github.com/ng-bootstrap/ng-bootstrap/issues/2240
  237. this.titleTpl = this.titleTpls.first;
  238. this.headerTpl = this.headerTpls.first;
  239. this.contentTpl = this.contentTpls.first;
  240. };
  241. NgbPanel.decorators = [
  242. { type: Directive, args: [{ selector: 'ngb-panel' },] }
  243. ];
  244. NgbPanel.propDecorators = {
  245. disabled: [{ type: Input }],
  246. id: [{ type: Input }],
  247. title: [{ type: Input }],
  248. type: [{ type: Input }],
  249. titleTpls: [{ type: ContentChildren, args: [NgbPanelTitle, { descendants: false },] }],
  250. headerTpls: [{ type: ContentChildren, args: [NgbPanelHeader, { descendants: false },] }],
  251. contentTpls: [{ type: ContentChildren, args: [NgbPanelContent, { descendants: false },] }]
  252. };
  253. return NgbPanel;
  254. }());
  255. /**
  256. * Accordion is a collection of collapsible panels (bootstrap cards).
  257. *
  258. * It can ensure only one panel is opened at a time and allows to customize panel
  259. * headers.
  260. */
  261. var NgbAccordion = /** @class */ (function () {
  262. function NgbAccordion(config) {
  263. /**
  264. * An array or comma separated strings of panel ids that should be opened **initially**.
  265. *
  266. * For subsequent changes use methods like `expand()`, `collapse()`, etc. and
  267. * the `(panelChange)` event.
  268. */
  269. this.activeIds = [];
  270. /**
  271. * If `true`, panel content will be detached from DOM and not simply hidden when the panel is collapsed.
  272. */
  273. this.destroyOnHide = true;
  274. /**
  275. * Event emitted right before the panel toggle happens.
  276. *
  277. * See [NgbPanelChangeEvent](#/components/accordion/api#NgbPanelChangeEvent) for payload details.
  278. */
  279. this.panelChange = new EventEmitter();
  280. this.type = config.type;
  281. this.closeOtherPanels = config.closeOthers;
  282. }
  283. /**
  284. * Checks if a panel with a given id is expanded.
  285. */
  286. /**
  287. * Checks if a panel with a given id is expanded.
  288. * @param {?} panelId
  289. * @return {?}
  290. */
  291. NgbAccordion.prototype.isExpanded = /**
  292. * Checks if a panel with a given id is expanded.
  293. * @param {?} panelId
  294. * @return {?}
  295. */
  296. function (panelId) { return this.activeIds.indexOf(panelId) > -1; };
  297. /**
  298. * Expands a panel with a given id.
  299. *
  300. * Has no effect if the panel is already expanded or disabled.
  301. */
  302. /**
  303. * Expands a panel with a given id.
  304. *
  305. * Has no effect if the panel is already expanded or disabled.
  306. * @param {?} panelId
  307. * @return {?}
  308. */
  309. NgbAccordion.prototype.expand = /**
  310. * Expands a panel with a given id.
  311. *
  312. * Has no effect if the panel is already expanded or disabled.
  313. * @param {?} panelId
  314. * @return {?}
  315. */
  316. function (panelId) { this._changeOpenState(this._findPanelById(panelId), true); };
  317. /**
  318. * Expands all panels, if `[closeOthers]` is `false`.
  319. *
  320. * If `[closeOthers]` is `true`, it will expand the first panel, unless there is already a panel opened.
  321. */
  322. /**
  323. * Expands all panels, if `[closeOthers]` is `false`.
  324. *
  325. * If `[closeOthers]` is `true`, it will expand the first panel, unless there is already a panel opened.
  326. * @return {?}
  327. */
  328. NgbAccordion.prototype.expandAll = /**
  329. * Expands all panels, if `[closeOthers]` is `false`.
  330. *
  331. * If `[closeOthers]` is `true`, it will expand the first panel, unless there is already a panel opened.
  332. * @return {?}
  333. */
  334. function () {
  335. var _this = this;
  336. if (this.closeOtherPanels) {
  337. if (this.activeIds.length === 0 && this.panels.length) {
  338. this._changeOpenState(this.panels.first, true);
  339. }
  340. }
  341. else {
  342. this.panels.forEach((/**
  343. * @param {?} panel
  344. * @return {?}
  345. */
  346. function (panel) { return _this._changeOpenState(panel, true); }));
  347. }
  348. };
  349. /**
  350. * Collapses a panel with the given id.
  351. *
  352. * Has no effect if the panel is already collapsed or disabled.
  353. */
  354. /**
  355. * Collapses a panel with the given id.
  356. *
  357. * Has no effect if the panel is already collapsed or disabled.
  358. * @param {?} panelId
  359. * @return {?}
  360. */
  361. NgbAccordion.prototype.collapse = /**
  362. * Collapses a panel with the given id.
  363. *
  364. * Has no effect if the panel is already collapsed or disabled.
  365. * @param {?} panelId
  366. * @return {?}
  367. */
  368. function (panelId) { this._changeOpenState(this._findPanelById(panelId), false); };
  369. /**
  370. * Collapses all opened panels.
  371. */
  372. /**
  373. * Collapses all opened panels.
  374. * @return {?}
  375. */
  376. NgbAccordion.prototype.collapseAll = /**
  377. * Collapses all opened panels.
  378. * @return {?}
  379. */
  380. function () {
  381. var _this = this;
  382. this.panels.forEach((/**
  383. * @param {?} panel
  384. * @return {?}
  385. */
  386. function (panel) { _this._changeOpenState(panel, false); }));
  387. };
  388. /**
  389. * Toggles a panel with the given id.
  390. *
  391. * Has no effect if the panel is disabled.
  392. */
  393. /**
  394. * Toggles a panel with the given id.
  395. *
  396. * Has no effect if the panel is disabled.
  397. * @param {?} panelId
  398. * @return {?}
  399. */
  400. NgbAccordion.prototype.toggle = /**
  401. * Toggles a panel with the given id.
  402. *
  403. * Has no effect if the panel is disabled.
  404. * @param {?} panelId
  405. * @return {?}
  406. */
  407. function (panelId) {
  408. /** @type {?} */
  409. var panel = this._findPanelById(panelId);
  410. if (panel) {
  411. this._changeOpenState(panel, !panel.isOpen);
  412. }
  413. };
  414. /**
  415. * @return {?}
  416. */
  417. NgbAccordion.prototype.ngAfterContentChecked = /**
  418. * @return {?}
  419. */
  420. function () {
  421. var _this = this;
  422. // active id updates
  423. if (isString(this.activeIds)) {
  424. this.activeIds = this.activeIds.split(/\s*,\s*/);
  425. }
  426. // update panels open states
  427. this.panels.forEach((/**
  428. * @param {?} panel
  429. * @return {?}
  430. */
  431. function (panel) { return panel.isOpen = !panel.disabled && _this.activeIds.indexOf(panel.id) > -1; }));
  432. // closeOthers updates
  433. if (this.activeIds.length > 1 && this.closeOtherPanels) {
  434. this._closeOthers(this.activeIds[0]);
  435. this._updateActiveIds();
  436. }
  437. };
  438. /**
  439. * @private
  440. * @param {?} panel
  441. * @param {?} nextState
  442. * @return {?}
  443. */
  444. NgbAccordion.prototype._changeOpenState = /**
  445. * @private
  446. * @param {?} panel
  447. * @param {?} nextState
  448. * @return {?}
  449. */
  450. function (panel, nextState) {
  451. if (panel && !panel.disabled && panel.isOpen !== nextState) {
  452. /** @type {?} */
  453. var defaultPrevented_1 = false;
  454. this.panelChange.emit({ panelId: panel.id, nextState: nextState, preventDefault: (/**
  455. * @return {?}
  456. */
  457. function () { defaultPrevented_1 = true; }) });
  458. if (!defaultPrevented_1) {
  459. panel.isOpen = nextState;
  460. if (nextState && this.closeOtherPanels) {
  461. this._closeOthers(panel.id);
  462. }
  463. this._updateActiveIds();
  464. }
  465. }
  466. };
  467. /**
  468. * @private
  469. * @param {?} panelId
  470. * @return {?}
  471. */
  472. NgbAccordion.prototype._closeOthers = /**
  473. * @private
  474. * @param {?} panelId
  475. * @return {?}
  476. */
  477. function (panelId) {
  478. this.panels.forEach((/**
  479. * @param {?} panel
  480. * @return {?}
  481. */
  482. function (panel) {
  483. if (panel.id !== panelId) {
  484. panel.isOpen = false;
  485. }
  486. }));
  487. };
  488. /**
  489. * @private
  490. * @param {?} panelId
  491. * @return {?}
  492. */
  493. NgbAccordion.prototype._findPanelById = /**
  494. * @private
  495. * @param {?} panelId
  496. * @return {?}
  497. */
  498. function (panelId) { return this.panels.find((/**
  499. * @param {?} p
  500. * @return {?}
  501. */
  502. function (p) { return p.id === panelId; })); };
  503. /**
  504. * @private
  505. * @return {?}
  506. */
  507. NgbAccordion.prototype._updateActiveIds = /**
  508. * @private
  509. * @return {?}
  510. */
  511. function () {
  512. this.activeIds = this.panels.filter((/**
  513. * @param {?} panel
  514. * @return {?}
  515. */
  516. function (panel) { return panel.isOpen && !panel.disabled; })).map((/**
  517. * @param {?} panel
  518. * @return {?}
  519. */
  520. function (panel) { return panel.id; }));
  521. };
  522. NgbAccordion.decorators = [
  523. { type: Component, args: [{
  524. selector: 'ngb-accordion',
  525. exportAs: 'ngbAccordion',
  526. encapsulation: ViewEncapsulation.None,
  527. host: { 'class': 'accordion', 'role': 'tablist', '[attr.aria-multiselectable]': '!closeOtherPanels' },
  528. template: "\n <ng-template #t ngbPanelHeader let-panel>\n <button class=\"btn btn-link\" [ngbPanelToggle]=\"panel\">\n {{panel.title}}<ng-template [ngTemplateOutlet]=\"panel.titleTpl?.templateRef\"></ng-template>\n </button>\n </ng-template>\n <ng-template ngFor let-panel [ngForOf]=\"panels\">\n <div class=\"card\">\n <div role=\"tab\" id=\"{{panel.id}}-header\" [class]=\"'card-header ' + (panel.type ? 'bg-'+panel.type: type ? 'bg-'+type : '')\">\n <ng-template [ngTemplateOutlet]=\"panel.headerTpl?.templateRef || t\"\n [ngTemplateOutletContext]=\"{$implicit: panel, opened: panel.isOpen}\"></ng-template>\n </div>\n <div id=\"{{panel.id}}\" role=\"tabpanel\" [attr.aria-labelledby]=\"panel.id + '-header'\"\n class=\"collapse\" [class.show]=\"panel.isOpen\" *ngIf=\"!destroyOnHide || panel.isOpen\">\n <div class=\"card-body\">\n <ng-template [ngTemplateOutlet]=\"panel.contentTpl?.templateRef\"></ng-template>\n </div>\n </div>\n </div>\n </ng-template>\n "
  529. }] }
  530. ];
  531. /** @nocollapse */
  532. NgbAccordion.ctorParameters = function () { return [
  533. { type: NgbAccordionConfig }
  534. ]; };
  535. NgbAccordion.propDecorators = {
  536. panels: [{ type: ContentChildren, args: [NgbPanel,] }],
  537. activeIds: [{ type: Input }],
  538. closeOtherPanels: [{ type: Input, args: ['closeOthers',] }],
  539. destroyOnHide: [{ type: Input }],
  540. type: [{ type: Input }],
  541. panelChange: [{ type: Output }]
  542. };
  543. return NgbAccordion;
  544. }());
  545. /**
  546. * A directive to put on a button that toggles panel opening and closing.
  547. *
  548. * To be used inside the [`NgbPanelHeader`](#/components/accordion/api#NgbPanelHeader)
  549. *
  550. * \@since 4.1.0
  551. */
  552. var NgbPanelToggle = /** @class */ (function () {
  553. function NgbPanelToggle(accordion, panel) {
  554. this.accordion = accordion;
  555. this.panel = panel;
  556. }
  557. Object.defineProperty(NgbPanelToggle.prototype, "ngbPanelToggle", {
  558. set: /**
  559. * @param {?} panel
  560. * @return {?}
  561. */
  562. function (panel) {
  563. if (panel) {
  564. this.panel = panel;
  565. }
  566. },
  567. enumerable: true,
  568. configurable: true
  569. });
  570. NgbPanelToggle.decorators = [
  571. { type: Directive, args: [{
  572. selector: 'button[ngbPanelToggle]',
  573. host: {
  574. 'type': 'button',
  575. '[disabled]': 'panel.disabled',
  576. '[class.collapsed]': '!panel.isOpen',
  577. '[attr.aria-expanded]': 'panel.isOpen',
  578. '[attr.aria-controls]': 'panel.id',
  579. '(click)': 'accordion.toggle(panel.id)'
  580. }
  581. },] }
  582. ];
  583. /** @nocollapse */
  584. NgbPanelToggle.ctorParameters = function () { return [
  585. { type: NgbAccordion },
  586. { type: NgbPanel, decorators: [{ type: Optional }, { type: Host }] }
  587. ]; };
  588. NgbPanelToggle.propDecorators = {
  589. ngbPanelToggle: [{ type: Input }]
  590. };
  591. return NgbPanelToggle;
  592. }());
  593. /**
  594. * @fileoverview added by tsickle
  595. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  596. */
  597. /** @type {?} */
  598. var NGB_ACCORDION_DIRECTIVES = [NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent, NgbPanelHeader, NgbPanelToggle];
  599. var NgbAccordionModule = /** @class */ (function () {
  600. function NgbAccordionModule() {
  601. }
  602. NgbAccordionModule.decorators = [
  603. { type: NgModule, args: [{ declarations: NGB_ACCORDION_DIRECTIVES, exports: NGB_ACCORDION_DIRECTIVES, imports: [CommonModule] },] }
  604. ];
  605. return NgbAccordionModule;
  606. }());
  607. /**
  608. * @fileoverview added by tsickle
  609. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  610. */
  611. /**
  612. * A configuration service for the [NgbAlert](#/components/alert/api#NgbAlert) component.
  613. *
  614. * You can inject this service, typically in your root component, and customize its properties
  615. * to provide default values for all alerts used in the application.
  616. */
  617. var NgbAlertConfig = /** @class */ (function () {
  618. function NgbAlertConfig() {
  619. this.dismissible = true;
  620. this.type = 'warning';
  621. }
  622. NgbAlertConfig.decorators = [
  623. { type: Injectable, args: [{ providedIn: 'root' },] }
  624. ];
  625. /** @nocollapse */ NgbAlertConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbAlertConfig_Factory() { return new NgbAlertConfig(); }, token: NgbAlertConfig, providedIn: "root" });
  626. return NgbAlertConfig;
  627. }());
  628. /**
  629. * @fileoverview added by tsickle
  630. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  631. */
  632. /**
  633. * Alert is a component to provide contextual feedback messages for user.
  634. *
  635. * It supports several alert types and can be dismissed.
  636. */
  637. var NgbAlert = /** @class */ (function () {
  638. function NgbAlert(config, _renderer, _element) {
  639. this._renderer = _renderer;
  640. this._element = _element;
  641. /**
  642. * An event emitted when the close button is clicked. It has no payload and only relevant for dismissible alerts.
  643. */
  644. this.close = new EventEmitter();
  645. this.dismissible = config.dismissible;
  646. this.type = config.type;
  647. }
  648. /**
  649. * @return {?}
  650. */
  651. NgbAlert.prototype.closeHandler = /**
  652. * @return {?}
  653. */
  654. function () { this.close.emit(null); };
  655. /**
  656. * @param {?} changes
  657. * @return {?}
  658. */
  659. NgbAlert.prototype.ngOnChanges = /**
  660. * @param {?} changes
  661. * @return {?}
  662. */
  663. function (changes) {
  664. /** @type {?} */
  665. var typeChange = changes['type'];
  666. if (typeChange && !typeChange.firstChange) {
  667. this._renderer.removeClass(this._element.nativeElement, "alert-" + typeChange.previousValue);
  668. this._renderer.addClass(this._element.nativeElement, "alert-" + typeChange.currentValue);
  669. }
  670. };
  671. /**
  672. * @return {?}
  673. */
  674. NgbAlert.prototype.ngOnInit = /**
  675. * @return {?}
  676. */
  677. function () { this._renderer.addClass(this._element.nativeElement, "alert-" + this.type); };
  678. NgbAlert.decorators = [
  679. { type: Component, args: [{
  680. selector: 'ngb-alert',
  681. changeDetection: ChangeDetectionStrategy.OnPush,
  682. encapsulation: ViewEncapsulation.None,
  683. host: { 'role': 'alert', 'class': 'alert', '[class.alert-dismissible]': 'dismissible' },
  684. template: "\n <ng-content></ng-content>\n <button *ngIf=\"dismissible\" type=\"button\" class=\"close\" aria-label=\"Close\" i18n-aria-label=\"@@ngb.alert.close\"\n (click)=\"closeHandler()\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n ",
  685. styles: ["ngb-alert{display:block}"]
  686. }] }
  687. ];
  688. /** @nocollapse */
  689. NgbAlert.ctorParameters = function () { return [
  690. { type: NgbAlertConfig },
  691. { type: Renderer2 },
  692. { type: ElementRef }
  693. ]; };
  694. NgbAlert.propDecorators = {
  695. dismissible: [{ type: Input }],
  696. type: [{ type: Input }],
  697. close: [{ type: Output }]
  698. };
  699. return NgbAlert;
  700. }());
  701. /**
  702. * @fileoverview added by tsickle
  703. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  704. */
  705. var NgbAlertModule = /** @class */ (function () {
  706. function NgbAlertModule() {
  707. }
  708. NgbAlertModule.decorators = [
  709. { type: NgModule, args: [{ declarations: [NgbAlert], exports: [NgbAlert], imports: [CommonModule], entryComponents: [NgbAlert] },] }
  710. ];
  711. return NgbAlertModule;
  712. }());
  713. /**
  714. * @fileoverview added by tsickle
  715. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  716. */
  717. var NgbButtonLabel = /** @class */ (function () {
  718. function NgbButtonLabel() {
  719. }
  720. NgbButtonLabel.decorators = [
  721. { type: Directive, args: [{
  722. selector: '[ngbButtonLabel]',
  723. host: { '[class.btn]': 'true', '[class.active]': 'active', '[class.disabled]': 'disabled', '[class.focus]': 'focused' }
  724. },] }
  725. ];
  726. return NgbButtonLabel;
  727. }());
  728. /**
  729. * @fileoverview added by tsickle
  730. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  731. */
  732. /** @type {?} */
  733. var NGB_CHECKBOX_VALUE_ACCESSOR = {
  734. provide: NG_VALUE_ACCESSOR,
  735. useExisting: forwardRef((/**
  736. * @return {?}
  737. */
  738. function () { return NgbCheckBox; })),
  739. multi: true
  740. };
  741. /**
  742. * Allows to easily create Bootstrap-style checkbox buttons.
  743. *
  744. * Integrates with forms, so the value of a checked button is bound to the underlying form control
  745. * either in a reactive or template-driven way.
  746. */
  747. var NgbCheckBox = /** @class */ (function () {
  748. function NgbCheckBox(_label, _cd) {
  749. this._label = _label;
  750. this._cd = _cd;
  751. /**
  752. * If `true`, the checkbox button will be disabled
  753. */
  754. this.disabled = false;
  755. /**
  756. * The form control value when the checkbox is checked.
  757. */
  758. this.valueChecked = true;
  759. /**
  760. * The form control value when the checkbox is unchecked.
  761. */
  762. this.valueUnChecked = false;
  763. this.onChange = (/**
  764. * @param {?} _
  765. * @return {?}
  766. */
  767. function (_) { });
  768. this.onTouched = (/**
  769. * @return {?}
  770. */
  771. function () { });
  772. }
  773. Object.defineProperty(NgbCheckBox.prototype, "focused", {
  774. set: /**
  775. * @param {?} isFocused
  776. * @return {?}
  777. */
  778. function (isFocused) {
  779. this._label.focused = isFocused;
  780. if (!isFocused) {
  781. this.onTouched();
  782. }
  783. },
  784. enumerable: true,
  785. configurable: true
  786. });
  787. /**
  788. * @param {?} $event
  789. * @return {?}
  790. */
  791. NgbCheckBox.prototype.onInputChange = /**
  792. * @param {?} $event
  793. * @return {?}
  794. */
  795. function ($event) {
  796. /** @type {?} */
  797. var modelToPropagate = $event.target.checked ? this.valueChecked : this.valueUnChecked;
  798. this.onChange(modelToPropagate);
  799. this.onTouched();
  800. this.writeValue(modelToPropagate);
  801. };
  802. /**
  803. * @param {?} fn
  804. * @return {?}
  805. */
  806. NgbCheckBox.prototype.registerOnChange = /**
  807. * @param {?} fn
  808. * @return {?}
  809. */
  810. function (fn) { this.onChange = fn; };
  811. /**
  812. * @param {?} fn
  813. * @return {?}
  814. */
  815. NgbCheckBox.prototype.registerOnTouched = /**
  816. * @param {?} fn
  817. * @return {?}
  818. */
  819. function (fn) { this.onTouched = fn; };
  820. /**
  821. * @param {?} isDisabled
  822. * @return {?}
  823. */
  824. NgbCheckBox.prototype.setDisabledState = /**
  825. * @param {?} isDisabled
  826. * @return {?}
  827. */
  828. function (isDisabled) {
  829. this.disabled = isDisabled;
  830. this._label.disabled = isDisabled;
  831. };
  832. /**
  833. * @param {?} value
  834. * @return {?}
  835. */
  836. NgbCheckBox.prototype.writeValue = /**
  837. * @param {?} value
  838. * @return {?}
  839. */
  840. function (value) {
  841. this.checked = value === this.valueChecked;
  842. this._label.active = this.checked;
  843. // label won't be updated, if it is inside the OnPush component when [ngModel] changes
  844. this._cd.markForCheck();
  845. };
  846. NgbCheckBox.decorators = [
  847. { type: Directive, args: [{
  848. selector: '[ngbButton][type=checkbox]',
  849. host: {
  850. '[checked]': 'checked',
  851. '[disabled]': 'disabled',
  852. '(change)': 'onInputChange($event)',
  853. '(focus)': 'focused = true',
  854. '(blur)': 'focused = false'
  855. },
  856. providers: [NGB_CHECKBOX_VALUE_ACCESSOR]
  857. },] }
  858. ];
  859. /** @nocollapse */
  860. NgbCheckBox.ctorParameters = function () { return [
  861. { type: NgbButtonLabel },
  862. { type: ChangeDetectorRef }
  863. ]; };
  864. NgbCheckBox.propDecorators = {
  865. disabled: [{ type: Input }],
  866. valueChecked: [{ type: Input }],
  867. valueUnChecked: [{ type: Input }]
  868. };
  869. return NgbCheckBox;
  870. }());
  871. /**
  872. * @fileoverview added by tsickle
  873. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  874. */
  875. /** @type {?} */
  876. var NGB_RADIO_VALUE_ACCESSOR = {
  877. provide: NG_VALUE_ACCESSOR,
  878. useExisting: forwardRef((/**
  879. * @return {?}
  880. */
  881. function () { return NgbRadioGroup; })),
  882. multi: true
  883. };
  884. /** @type {?} */
  885. var nextId$1 = 0;
  886. /**
  887. * Allows to easily create Bootstrap-style radio buttons.
  888. *
  889. * Integrates with forms, so the value of a checked button is bound to the underlying form control
  890. * either in a reactive or template-driven way.
  891. */
  892. var NgbRadioGroup = /** @class */ (function () {
  893. function NgbRadioGroup() {
  894. this._radios = new Set();
  895. this._value = null;
  896. /**
  897. * Name of the radio group applied to radio input elements.
  898. *
  899. * Will be applied to all radio input elements inside the group,
  900. * unless [`NgbRadio`](#/components/buttons/api#NgbRadio)'s specify names themselves.
  901. *
  902. * If not provided, will be generated in the `ngb-radio-xx` format.
  903. */
  904. this.name = "ngb-radio-" + nextId$1++;
  905. this.onChange = (/**
  906. * @param {?} _
  907. * @return {?}
  908. */
  909. function (_) { });
  910. this.onTouched = (/**
  911. * @return {?}
  912. */
  913. function () { });
  914. }
  915. Object.defineProperty(NgbRadioGroup.prototype, "disabled", {
  916. get: /**
  917. * @return {?}
  918. */
  919. function () { return this._disabled; },
  920. set: /**
  921. * @param {?} isDisabled
  922. * @return {?}
  923. */
  924. function (isDisabled) { this.setDisabledState(isDisabled); },
  925. enumerable: true,
  926. configurable: true
  927. });
  928. /**
  929. * @param {?} radio
  930. * @return {?}
  931. */
  932. NgbRadioGroup.prototype.onRadioChange = /**
  933. * @param {?} radio
  934. * @return {?}
  935. */
  936. function (radio) {
  937. this.writeValue(radio.value);
  938. this.onChange(radio.value);
  939. };
  940. /**
  941. * @return {?}
  942. */
  943. NgbRadioGroup.prototype.onRadioValueUpdate = /**
  944. * @return {?}
  945. */
  946. function () { this._updateRadiosValue(); };
  947. /**
  948. * @param {?} radio
  949. * @return {?}
  950. */
  951. NgbRadioGroup.prototype.register = /**
  952. * @param {?} radio
  953. * @return {?}
  954. */
  955. function (radio) { this._radios.add(radio); };
  956. /**
  957. * @param {?} fn
  958. * @return {?}
  959. */
  960. NgbRadioGroup.prototype.registerOnChange = /**
  961. * @param {?} fn
  962. * @return {?}
  963. */
  964. function (fn) { this.onChange = fn; };
  965. /**
  966. * @param {?} fn
  967. * @return {?}
  968. */
  969. NgbRadioGroup.prototype.registerOnTouched = /**
  970. * @param {?} fn
  971. * @return {?}
  972. */
  973. function (fn) { this.onTouched = fn; };
  974. /**
  975. * @param {?} isDisabled
  976. * @return {?}
  977. */
  978. NgbRadioGroup.prototype.setDisabledState = /**
  979. * @param {?} isDisabled
  980. * @return {?}
  981. */
  982. function (isDisabled) {
  983. this._disabled = isDisabled;
  984. this._updateRadiosDisabled();
  985. };
  986. /**
  987. * @param {?} radio
  988. * @return {?}
  989. */
  990. NgbRadioGroup.prototype.unregister = /**
  991. * @param {?} radio
  992. * @return {?}
  993. */
  994. function (radio) { this._radios.delete(radio); };
  995. /**
  996. * @param {?} value
  997. * @return {?}
  998. */
  999. NgbRadioGroup.prototype.writeValue = /**
  1000. * @param {?} value
  1001. * @return {?}
  1002. */
  1003. function (value) {
  1004. this._value = value;
  1005. this._updateRadiosValue();
  1006. };
  1007. /**
  1008. * @private
  1009. * @return {?}
  1010. */
  1011. NgbRadioGroup.prototype._updateRadiosValue = /**
  1012. * @private
  1013. * @return {?}
  1014. */
  1015. function () {
  1016. var _this = this;
  1017. this._radios.forEach((/**
  1018. * @param {?} radio
  1019. * @return {?}
  1020. */
  1021. function (radio) { return radio.updateValue(_this._value); }));
  1022. };
  1023. /**
  1024. * @private
  1025. * @return {?}
  1026. */
  1027. NgbRadioGroup.prototype._updateRadiosDisabled = /**
  1028. * @private
  1029. * @return {?}
  1030. */
  1031. function () { this._radios.forEach((/**
  1032. * @param {?} radio
  1033. * @return {?}
  1034. */
  1035. function (radio) { return radio.updateDisabled(); })); };
  1036. NgbRadioGroup.decorators = [
  1037. { type: Directive, args: [{ selector: '[ngbRadioGroup]', host: { 'role': 'radiogroup' }, providers: [NGB_RADIO_VALUE_ACCESSOR] },] }
  1038. ];
  1039. NgbRadioGroup.propDecorators = {
  1040. name: [{ type: Input }]
  1041. };
  1042. return NgbRadioGroup;
  1043. }());
  1044. /**
  1045. * A directive that marks an input of type "radio" as a part of the
  1046. * [`NgbRadioGroup`](#/components/buttons/api#NgbRadioGroup).
  1047. */
  1048. var NgbRadio = /** @class */ (function () {
  1049. function NgbRadio(_group, _label, _renderer, _element, _cd) {
  1050. this._group = _group;
  1051. this._label = _label;
  1052. this._renderer = _renderer;
  1053. this._element = _element;
  1054. this._cd = _cd;
  1055. this._value = null;
  1056. this._group.register(this);
  1057. this.updateDisabled();
  1058. }
  1059. Object.defineProperty(NgbRadio.prototype, "value", {
  1060. get: /**
  1061. * @return {?}
  1062. */
  1063. function () { return this._value; },
  1064. /**
  1065. * The form control value when current radio button is checked.
  1066. */
  1067. set: /**
  1068. * The form control value when current radio button is checked.
  1069. * @param {?} value
  1070. * @return {?}
  1071. */
  1072. function (value) {
  1073. this._value = value;
  1074. /** @type {?} */
  1075. var stringValue = value ? value.toString() : '';
  1076. this._renderer.setProperty(this._element.nativeElement, 'value', stringValue);
  1077. this._group.onRadioValueUpdate();
  1078. },
  1079. enumerable: true,
  1080. configurable: true
  1081. });
  1082. Object.defineProperty(NgbRadio.prototype, "disabled", {
  1083. get: /**
  1084. * @return {?}
  1085. */
  1086. function () { return this._group.disabled || this._disabled; },
  1087. /**
  1088. * If `true`, current radio button will be disabled.
  1089. */
  1090. set: /**
  1091. * If `true`, current radio button will be disabled.
  1092. * @param {?} isDisabled
  1093. * @return {?}
  1094. */
  1095. function (isDisabled) {
  1096. this._disabled = isDisabled !== false;
  1097. this.updateDisabled();
  1098. },
  1099. enumerable: true,
  1100. configurable: true
  1101. });
  1102. Object.defineProperty(NgbRadio.prototype, "focused", {
  1103. set: /**
  1104. * @param {?} isFocused
  1105. * @return {?}
  1106. */
  1107. function (isFocused) {
  1108. if (this._label) {
  1109. this._label.focused = isFocused;
  1110. }
  1111. if (!isFocused) {
  1112. this._group.onTouched();
  1113. }
  1114. },
  1115. enumerable: true,
  1116. configurable: true
  1117. });
  1118. Object.defineProperty(NgbRadio.prototype, "checked", {
  1119. get: /**
  1120. * @return {?}
  1121. */
  1122. function () { return this._checked; },
  1123. enumerable: true,
  1124. configurable: true
  1125. });
  1126. Object.defineProperty(NgbRadio.prototype, "nameAttr", {
  1127. get: /**
  1128. * @return {?}
  1129. */
  1130. function () { return this.name || this._group.name; },
  1131. enumerable: true,
  1132. configurable: true
  1133. });
  1134. /**
  1135. * @return {?}
  1136. */
  1137. NgbRadio.prototype.ngOnDestroy = /**
  1138. * @return {?}
  1139. */
  1140. function () { this._group.unregister(this); };
  1141. /**
  1142. * @return {?}
  1143. */
  1144. NgbRadio.prototype.onChange = /**
  1145. * @return {?}
  1146. */
  1147. function () { this._group.onRadioChange(this); };
  1148. /**
  1149. * @param {?} value
  1150. * @return {?}
  1151. */
  1152. NgbRadio.prototype.updateValue = /**
  1153. * @param {?} value
  1154. * @return {?}
  1155. */
  1156. function (value) {
  1157. // label won't be updated, if it is inside the OnPush component when [ngModel] changes
  1158. if (this.value !== value) {
  1159. this._cd.markForCheck();
  1160. }
  1161. this._checked = this.value === value;
  1162. this._label.active = this._checked;
  1163. };
  1164. /**
  1165. * @return {?}
  1166. */
  1167. NgbRadio.prototype.updateDisabled = /**
  1168. * @return {?}
  1169. */
  1170. function () { this._label.disabled = this.disabled; };
  1171. NgbRadio.decorators = [
  1172. { type: Directive, args: [{
  1173. selector: '[ngbButton][type=radio]',
  1174. host: {
  1175. '[checked]': 'checked',
  1176. '[disabled]': 'disabled',
  1177. '[name]': 'nameAttr',
  1178. '(change)': 'onChange()',
  1179. '(focus)': 'focused = true',
  1180. '(blur)': 'focused = false'
  1181. }
  1182. },] }
  1183. ];
  1184. /** @nocollapse */
  1185. NgbRadio.ctorParameters = function () { return [
  1186. { type: NgbRadioGroup },
  1187. { type: NgbButtonLabel },
  1188. { type: Renderer2 },
  1189. { type: ElementRef },
  1190. { type: ChangeDetectorRef }
  1191. ]; };
  1192. NgbRadio.propDecorators = {
  1193. name: [{ type: Input }],
  1194. value: [{ type: Input, args: ['value',] }],
  1195. disabled: [{ type: Input, args: ['disabled',] }]
  1196. };
  1197. return NgbRadio;
  1198. }());
  1199. /**
  1200. * @fileoverview added by tsickle
  1201. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1202. */
  1203. /** @type {?} */
  1204. var NGB_BUTTON_DIRECTIVES = [NgbButtonLabel, NgbCheckBox, NgbRadioGroup, NgbRadio];
  1205. var NgbButtonsModule = /** @class */ (function () {
  1206. function NgbButtonsModule() {
  1207. }
  1208. NgbButtonsModule.decorators = [
  1209. { type: NgModule, args: [{ declarations: NGB_BUTTON_DIRECTIVES, exports: NGB_BUTTON_DIRECTIVES },] }
  1210. ];
  1211. return NgbButtonsModule;
  1212. }());
  1213. /**
  1214. * @fileoverview added by tsickle
  1215. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1216. */
  1217. /**
  1218. * A configuration service for the [NgbCarousel](#/components/carousel/api#NgbCarousel) component.
  1219. *
  1220. * You can inject this service, typically in your root component, and customize its properties
  1221. * to provide default values for all carousels used in the application.
  1222. */
  1223. var NgbCarouselConfig = /** @class */ (function () {
  1224. function NgbCarouselConfig() {
  1225. this.interval = 5000;
  1226. this.wrap = true;
  1227. this.keyboard = true;
  1228. this.pauseOnHover = true;
  1229. this.showNavigationArrows = true;
  1230. this.showNavigationIndicators = true;
  1231. }
  1232. NgbCarouselConfig.decorators = [
  1233. { type: Injectable, args: [{ providedIn: 'root' },] }
  1234. ];
  1235. /** @nocollapse */ NgbCarouselConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbCarouselConfig_Factory() { return new NgbCarouselConfig(); }, token: NgbCarouselConfig, providedIn: "root" });
  1236. return NgbCarouselConfig;
  1237. }());
  1238. /**
  1239. * @fileoverview added by tsickle
  1240. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1241. */
  1242. /** @type {?} */
  1243. var nextId$2 = 0;
  1244. /**
  1245. * A directive that wraps the individual carousel slide.
  1246. */
  1247. var NgbSlide = /** @class */ (function () {
  1248. function NgbSlide(tplRef) {
  1249. this.tplRef = tplRef;
  1250. /**
  1251. * Slide id that must be unique for the entire document.
  1252. *
  1253. * If not provided, will be generated in the `ngb-slide-xx` format.
  1254. */
  1255. this.id = "ngb-slide-" + nextId$2++;
  1256. }
  1257. NgbSlide.decorators = [
  1258. { type: Directive, args: [{ selector: 'ng-template[ngbSlide]' },] }
  1259. ];
  1260. /** @nocollapse */
  1261. NgbSlide.ctorParameters = function () { return [
  1262. { type: TemplateRef }
  1263. ]; };
  1264. NgbSlide.propDecorators = {
  1265. id: [{ type: Input }]
  1266. };
  1267. return NgbSlide;
  1268. }());
  1269. /**
  1270. * Carousel is a component to easily create and control slideshows.
  1271. *
  1272. * Allows to set intervals, change the way user interacts with the slides and provides a programmatic API.
  1273. */
  1274. var NgbCarousel = /** @class */ (function () {
  1275. function NgbCarousel(config, _platformId, _ngZone, _cd) {
  1276. this._platformId = _platformId;
  1277. this._ngZone = _ngZone;
  1278. this._cd = _cd;
  1279. this.NgbSlideEventSource = NgbSlideEventSource;
  1280. this._destroy$ = new Subject();
  1281. this._interval$ = new BehaviorSubject(0);
  1282. this._mouseHover$ = new BehaviorSubject(false);
  1283. this._pauseOnHover$ = new BehaviorSubject(false);
  1284. this._pause$ = new BehaviorSubject(false);
  1285. this._wrap$ = new BehaviorSubject(false);
  1286. /**
  1287. * An event emitted right after the slide transition is completed.
  1288. *
  1289. * See [`NgbSlideEvent`](#/components/carousel/api#NgbSlideEvent) for payload details.
  1290. */
  1291. this.slide = new EventEmitter();
  1292. this.interval = config.interval;
  1293. this.wrap = config.wrap;
  1294. this.keyboard = config.keyboard;
  1295. this.pauseOnHover = config.pauseOnHover;
  1296. this.showNavigationArrows = config.showNavigationArrows;
  1297. this.showNavigationIndicators = config.showNavigationIndicators;
  1298. }
  1299. Object.defineProperty(NgbCarousel.prototype, "interval", {
  1300. get: /**
  1301. * @return {?}
  1302. */
  1303. function () { return this._interval$.value; },
  1304. /**
  1305. * Time in milliseconds before the next slide is shown.
  1306. */
  1307. set: /**
  1308. * Time in milliseconds before the next slide is shown.
  1309. * @param {?} value
  1310. * @return {?}
  1311. */
  1312. function (value) {
  1313. this._interval$.next(value);
  1314. },
  1315. enumerable: true,
  1316. configurable: true
  1317. });
  1318. Object.defineProperty(NgbCarousel.prototype, "wrap", {
  1319. get: /**
  1320. * @return {?}
  1321. */
  1322. function () { return this._wrap$.value; },
  1323. /**
  1324. * If `true`, will 'wrap' the carousel by switching from the last slide back to the first.
  1325. */
  1326. set: /**
  1327. * If `true`, will 'wrap' the carousel by switching from the last slide back to the first.
  1328. * @param {?} value
  1329. * @return {?}
  1330. */
  1331. function (value) {
  1332. this._wrap$.next(value);
  1333. },
  1334. enumerable: true,
  1335. configurable: true
  1336. });
  1337. Object.defineProperty(NgbCarousel.prototype, "pauseOnHover", {
  1338. get: /**
  1339. * @return {?}
  1340. */
  1341. function () { return this._pauseOnHover$.value; },
  1342. /**
  1343. * If `true`, will pause slide switching when mouse cursor hovers the slide.
  1344. *
  1345. * @since 2.2.0
  1346. */
  1347. set: /**
  1348. * If `true`, will pause slide switching when mouse cursor hovers the slide.
  1349. *
  1350. * \@since 2.2.0
  1351. * @param {?} value
  1352. * @return {?}
  1353. */
  1354. function (value) {
  1355. this._pauseOnHover$.next(value);
  1356. },
  1357. enumerable: true,
  1358. configurable: true
  1359. });
  1360. /**
  1361. * @return {?}
  1362. */
  1363. NgbCarousel.prototype.mouseEnter = /**
  1364. * @return {?}
  1365. */
  1366. function () {
  1367. this._mouseHover$.next(true);
  1368. };
  1369. /**
  1370. * @return {?}
  1371. */
  1372. NgbCarousel.prototype.mouseLeave = /**
  1373. * @return {?}
  1374. */
  1375. function () {
  1376. this._mouseHover$.next(false);
  1377. };
  1378. /**
  1379. * @return {?}
  1380. */
  1381. NgbCarousel.prototype.ngAfterContentInit = /**
  1382. * @return {?}
  1383. */
  1384. function () {
  1385. var _this = this;
  1386. // setInterval() doesn't play well with SSR and protractor,
  1387. // so we should run it in the browser and outside Angular
  1388. if (isPlatformBrowser(this._platformId)) {
  1389. this._ngZone.runOutsideAngular((/**
  1390. * @return {?}
  1391. */
  1392. function () {
  1393. /** @type {?} */
  1394. var hasNextSlide$ = combineLatest(_this.slide.pipe(map((/**
  1395. * @param {?} slideEvent
  1396. * @return {?}
  1397. */
  1398. function (slideEvent) { return slideEvent.current; })), startWith(_this.activeId)), _this._wrap$, _this.slides.changes.pipe(startWith(null)))
  1399. .pipe(map((/**
  1400. * @param {?} __0
  1401. * @return {?}
  1402. */
  1403. function (_a) {
  1404. var _b = __read(_a, 2), currentSlideId = _b[0], wrap = _b[1];
  1405. /** @type {?} */
  1406. var slideArr = _this.slides.toArray();
  1407. /** @type {?} */
  1408. var currentSlideIdx = _this._getSlideIdxById(currentSlideId);
  1409. return wrap ? slideArr.length > 1 : currentSlideIdx < slideArr.length - 1;
  1410. })), distinctUntilChanged());
  1411. combineLatest(_this._pause$, _this._pauseOnHover$, _this._mouseHover$, _this._interval$, hasNextSlide$)
  1412. .pipe(map((/**
  1413. * @param {?} __0
  1414. * @return {?}
  1415. */
  1416. function (_a) {
  1417. var _b = __read(_a, 5), pause = _b[0], pauseOnHover = _b[1], mouseHover = _b[2], interval = _b[3], hasNextSlide = _b[4];
  1418. return ((pause || (pauseOnHover && mouseHover) || !hasNextSlide) ? 0 : interval);
  1419. })), distinctUntilChanged(), switchMap((/**
  1420. * @param {?} interval
  1421. * @return {?}
  1422. */
  1423. function (interval) { return interval > 0 ? timer(interval, interval) : NEVER; })), takeUntil(_this._destroy$))
  1424. .subscribe((/**
  1425. * @return {?}
  1426. */
  1427. function () { return _this._ngZone.run((/**
  1428. * @return {?}
  1429. */
  1430. function () { return _this.next(NgbSlideEventSource.TIMER); })); }));
  1431. }));
  1432. }
  1433. this.slides.changes.pipe(takeUntil(this._destroy$)).subscribe((/**
  1434. * @return {?}
  1435. */
  1436. function () { return _this._cd.markForCheck(); }));
  1437. };
  1438. /**
  1439. * @return {?}
  1440. */
  1441. NgbCarousel.prototype.ngAfterContentChecked = /**
  1442. * @return {?}
  1443. */
  1444. function () {
  1445. /** @type {?} */
  1446. var activeSlide = this._getSlideById(this.activeId);
  1447. this.activeId = activeSlide ? activeSlide.id : (this.slides.length ? this.slides.first.id : null);
  1448. };
  1449. /**
  1450. * @return {?}
  1451. */
  1452. NgbCarousel.prototype.ngOnDestroy = /**
  1453. * @return {?}
  1454. */
  1455. function () { this._destroy$.next(); };
  1456. /**
  1457. * Navigates to a slide with the specified identifier.
  1458. */
  1459. /**
  1460. * Navigates to a slide with the specified identifier.
  1461. * @param {?} slideId
  1462. * @param {?=} source
  1463. * @return {?}
  1464. */
  1465. NgbCarousel.prototype.select = /**
  1466. * Navigates to a slide with the specified identifier.
  1467. * @param {?} slideId
  1468. * @param {?=} source
  1469. * @return {?}
  1470. */
  1471. function (slideId, source) {
  1472. this._cycleToSelected(slideId, this._getSlideEventDirection(this.activeId, slideId), source);
  1473. };
  1474. /**
  1475. * Navigates to the previous slide.
  1476. */
  1477. /**
  1478. * Navigates to the previous slide.
  1479. * @param {?=} source
  1480. * @return {?}
  1481. */
  1482. NgbCarousel.prototype.prev = /**
  1483. * Navigates to the previous slide.
  1484. * @param {?=} source
  1485. * @return {?}
  1486. */
  1487. function (source) {
  1488. this._cycleToSelected(this._getPrevSlide(this.activeId), NgbSlideEventDirection.RIGHT, source);
  1489. };
  1490. /**
  1491. * Navigates to the next slide.
  1492. */
  1493. /**
  1494. * Navigates to the next slide.
  1495. * @param {?=} source
  1496. * @return {?}
  1497. */
  1498. NgbCarousel.prototype.next = /**
  1499. * Navigates to the next slide.
  1500. * @param {?=} source
  1501. * @return {?}
  1502. */
  1503. function (source) {
  1504. this._cycleToSelected(this._getNextSlide(this.activeId), NgbSlideEventDirection.LEFT, source);
  1505. };
  1506. /**
  1507. * Pauses cycling through the slides.
  1508. */
  1509. /**
  1510. * Pauses cycling through the slides.
  1511. * @return {?}
  1512. */
  1513. NgbCarousel.prototype.pause = /**
  1514. * Pauses cycling through the slides.
  1515. * @return {?}
  1516. */
  1517. function () { this._pause$.next(true); };
  1518. /**
  1519. * Restarts cycling through the slides from left to right.
  1520. */
  1521. /**
  1522. * Restarts cycling through the slides from left to right.
  1523. * @return {?}
  1524. */
  1525. NgbCarousel.prototype.cycle = /**
  1526. * Restarts cycling through the slides from left to right.
  1527. * @return {?}
  1528. */
  1529. function () { this._pause$.next(false); };
  1530. /**
  1531. * @private
  1532. * @param {?} slideIdx
  1533. * @param {?} direction
  1534. * @param {?=} source
  1535. * @return {?}
  1536. */
  1537. NgbCarousel.prototype._cycleToSelected = /**
  1538. * @private
  1539. * @param {?} slideIdx
  1540. * @param {?} direction
  1541. * @param {?=} source
  1542. * @return {?}
  1543. */
  1544. function (slideIdx, direction, source) {
  1545. /** @type {?} */
  1546. var selectedSlide = this._getSlideById(slideIdx);
  1547. if (selectedSlide && selectedSlide.id !== this.activeId) {
  1548. this.slide.emit({ prev: this.activeId, current: selectedSlide.id, direction: direction, paused: this._pause$.value, source: source });
  1549. this.activeId = selectedSlide.id;
  1550. }
  1551. // we get here after the interval fires or any external API call like next(), prev() or select()
  1552. this._cd.markForCheck();
  1553. };
  1554. /**
  1555. * @private
  1556. * @param {?} currentActiveSlideId
  1557. * @param {?} nextActiveSlideId
  1558. * @return {?}
  1559. */
  1560. NgbCarousel.prototype._getSlideEventDirection = /**
  1561. * @private
  1562. * @param {?} currentActiveSlideId
  1563. * @param {?} nextActiveSlideId
  1564. * @return {?}
  1565. */
  1566. function (currentActiveSlideId, nextActiveSlideId) {
  1567. /** @type {?} */
  1568. var currentActiveSlideIdx = this._getSlideIdxById(currentActiveSlideId);
  1569. /** @type {?} */
  1570. var nextActiveSlideIdx = this._getSlideIdxById(nextActiveSlideId);
  1571. return currentActiveSlideIdx > nextActiveSlideIdx ? NgbSlideEventDirection.RIGHT : NgbSlideEventDirection.LEFT;
  1572. };
  1573. /**
  1574. * @private
  1575. * @param {?} slideId
  1576. * @return {?}
  1577. */
  1578. NgbCarousel.prototype._getSlideById = /**
  1579. * @private
  1580. * @param {?} slideId
  1581. * @return {?}
  1582. */
  1583. function (slideId) { return this.slides.find((/**
  1584. * @param {?} slide
  1585. * @return {?}
  1586. */
  1587. function (slide) { return slide.id === slideId; })); };
  1588. /**
  1589. * @private
  1590. * @param {?} slideId
  1591. * @return {?}
  1592. */
  1593. NgbCarousel.prototype._getSlideIdxById = /**
  1594. * @private
  1595. * @param {?} slideId
  1596. * @return {?}
  1597. */
  1598. function (slideId) {
  1599. return this.slides.toArray().indexOf(this._getSlideById(slideId));
  1600. };
  1601. /**
  1602. * @private
  1603. * @param {?} currentSlideId
  1604. * @return {?}
  1605. */
  1606. NgbCarousel.prototype._getNextSlide = /**
  1607. * @private
  1608. * @param {?} currentSlideId
  1609. * @return {?}
  1610. */
  1611. function (currentSlideId) {
  1612. /** @type {?} */
  1613. var slideArr = this.slides.toArray();
  1614. /** @type {?} */
  1615. var currentSlideIdx = this._getSlideIdxById(currentSlideId);
  1616. /** @type {?} */
  1617. var isLastSlide = currentSlideIdx === slideArr.length - 1;
  1618. return isLastSlide ? (this.wrap ? slideArr[0].id : slideArr[slideArr.length - 1].id) :
  1619. slideArr[currentSlideIdx + 1].id;
  1620. };
  1621. /**
  1622. * @private
  1623. * @param {?} currentSlideId
  1624. * @return {?}
  1625. */
  1626. NgbCarousel.prototype._getPrevSlide = /**
  1627. * @private
  1628. * @param {?} currentSlideId
  1629. * @return {?}
  1630. */
  1631. function (currentSlideId) {
  1632. /** @type {?} */
  1633. var slideArr = this.slides.toArray();
  1634. /** @type {?} */
  1635. var currentSlideIdx = this._getSlideIdxById(currentSlideId);
  1636. /** @type {?} */
  1637. var isFirstSlide = currentSlideIdx === 0;
  1638. return isFirstSlide ? (this.wrap ? slideArr[slideArr.length - 1].id : slideArr[0].id) :
  1639. slideArr[currentSlideIdx - 1].id;
  1640. };
  1641. NgbCarousel.decorators = [
  1642. { type: Component, args: [{
  1643. selector: 'ngb-carousel',
  1644. exportAs: 'ngbCarousel',
  1645. changeDetection: ChangeDetectionStrategy.OnPush,
  1646. encapsulation: ViewEncapsulation.None,
  1647. host: {
  1648. 'class': 'carousel slide',
  1649. '[style.display]': '"block"',
  1650. 'tabIndex': '0',
  1651. '(keydown.arrowLeft)': 'keyboard && prev(NgbSlideEventSource.ARROW_LEFT)',
  1652. '(keydown.arrowRight)': 'keyboard && next(NgbSlideEventSource.ARROW_RIGHT)'
  1653. },
  1654. template: "\n <ol class=\"carousel-indicators\" *ngIf=\"showNavigationIndicators\">\n <li *ngFor=\"let slide of slides\" [id]=\"slide.id\" [class.active]=\"slide.id === activeId\"\n (click)=\"select(slide.id, NgbSlideEventSource.INDICATOR)\"></li>\n </ol>\n <div class=\"carousel-inner\">\n <div *ngFor=\"let slide of slides\" class=\"carousel-item\" [class.active]=\"slide.id === activeId\">\n <ng-template [ngTemplateOutlet]=\"slide.tplRef\"></ng-template>\n </div>\n </div>\n <a class=\"carousel-control-prev\" role=\"button\" (click)=\"prev(NgbSlideEventSource.ARROW_LEFT)\" *ngIf=\"showNavigationArrows\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.carousel.previous\">Previous</span>\n </a>\n <a class=\"carousel-control-next\" role=\"button\" (click)=\"next(NgbSlideEventSource.ARROW_RIGHT)\" *ngIf=\"showNavigationArrows\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.carousel.next\">Next</span>\n </a>\n "
  1655. }] }
  1656. ];
  1657. /** @nocollapse */
  1658. NgbCarousel.ctorParameters = function () { return [
  1659. { type: NgbCarouselConfig },
  1660. { type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
  1661. { type: NgZone },
  1662. { type: ChangeDetectorRef }
  1663. ]; };
  1664. NgbCarousel.propDecorators = {
  1665. slides: [{ type: ContentChildren, args: [NgbSlide,] }],
  1666. activeId: [{ type: Input }],
  1667. interval: [{ type: Input }],
  1668. wrap: [{ type: Input }],
  1669. keyboard: [{ type: Input }],
  1670. pauseOnHover: [{ type: Input }],
  1671. showNavigationArrows: [{ type: Input }],
  1672. showNavigationIndicators: [{ type: Input }],
  1673. slide: [{ type: Output }],
  1674. mouseEnter: [{ type: HostListener, args: ['mouseenter',] }],
  1675. mouseLeave: [{ type: HostListener, args: ['mouseleave',] }]
  1676. };
  1677. return NgbCarousel;
  1678. }());
  1679. /** @enum {string} */
  1680. var NgbSlideEventDirection = {
  1681. LEFT: (/** @type {?} */ ('left')),
  1682. RIGHT: (/** @type {?} */ ('right')),
  1683. };
  1684. /** @enum {string} */
  1685. var NgbSlideEventSource = {
  1686. TIMER: 'timer',
  1687. ARROW_LEFT: 'arrowLeft',
  1688. ARROW_RIGHT: 'arrowRight',
  1689. INDICATOR: 'indicator',
  1690. };
  1691. /** @type {?} */
  1692. var NGB_CAROUSEL_DIRECTIVES = [NgbCarousel, NgbSlide];
  1693. /**
  1694. * @fileoverview added by tsickle
  1695. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1696. */
  1697. var NgbCarouselModule = /** @class */ (function () {
  1698. function NgbCarouselModule() {
  1699. }
  1700. NgbCarouselModule.decorators = [
  1701. { type: NgModule, args: [{ declarations: NGB_CAROUSEL_DIRECTIVES, exports: NGB_CAROUSEL_DIRECTIVES, imports: [CommonModule] },] }
  1702. ];
  1703. return NgbCarouselModule;
  1704. }());
  1705. /**
  1706. * @fileoverview added by tsickle
  1707. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1708. */
  1709. /**
  1710. * A directive to provide a simple way of hiding and showing elements on the page.
  1711. */
  1712. var NgbCollapse = /** @class */ (function () {
  1713. function NgbCollapse() {
  1714. /**
  1715. * If `true`, will collapse the element or show it otherwise.
  1716. */
  1717. this.collapsed = false;
  1718. }
  1719. NgbCollapse.decorators = [
  1720. { type: Directive, args: [{
  1721. selector: '[ngbCollapse]',
  1722. exportAs: 'ngbCollapse',
  1723. host: { '[class.collapse]': 'true', '[class.show]': '!collapsed' }
  1724. },] }
  1725. ];
  1726. NgbCollapse.propDecorators = {
  1727. collapsed: [{ type: Input, args: ['ngbCollapse',] }]
  1728. };
  1729. return NgbCollapse;
  1730. }());
  1731. /**
  1732. * @fileoverview added by tsickle
  1733. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1734. */
  1735. var NgbCollapseModule = /** @class */ (function () {
  1736. function NgbCollapseModule() {
  1737. }
  1738. NgbCollapseModule.decorators = [
  1739. { type: NgModule, args: [{ declarations: [NgbCollapse], exports: [NgbCollapse] },] }
  1740. ];
  1741. return NgbCollapseModule;
  1742. }());
  1743. /**
  1744. * @fileoverview added by tsickle
  1745. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1746. */
  1747. /**
  1748. * A simple class that represents a date that datepicker also uses internally.
  1749. *
  1750. * It is the implementation of the `NgbDateStruct` interface that adds some convenience methods,
  1751. * like `.equals()`, `.before()`, etc.
  1752. *
  1753. * All datepicker APIs consume `NgbDateStruct`, but return `NgbDate`.
  1754. *
  1755. * In many cases it is simpler to manipulate these objects together with
  1756. * [`NgbCalendar`](#/components/datepicker/api#NgbCalendar) than native JS Dates.
  1757. *
  1758. * See the [date format overview](#/components/datepicker/overview#date-model) for more details.
  1759. *
  1760. * \@since 3.0.0
  1761. */
  1762. var /**
  1763. * A simple class that represents a date that datepicker also uses internally.
  1764. *
  1765. * It is the implementation of the `NgbDateStruct` interface that adds some convenience methods,
  1766. * like `.equals()`, `.before()`, etc.
  1767. *
  1768. * All datepicker APIs consume `NgbDateStruct`, but return `NgbDate`.
  1769. *
  1770. * In many cases it is simpler to manipulate these objects together with
  1771. * [`NgbCalendar`](#/components/datepicker/api#NgbCalendar) than native JS Dates.
  1772. *
  1773. * See the [date format overview](#/components/datepicker/overview#date-model) for more details.
  1774. *
  1775. * \@since 3.0.0
  1776. */
  1777. NgbDate = /** @class */ (function () {
  1778. function NgbDate(year, month, day) {
  1779. this.year = isInteger(year) ? year : null;
  1780. this.month = isInteger(month) ? month : null;
  1781. this.day = isInteger(day) ? day : null;
  1782. }
  1783. /**
  1784. * A **static method** that creates a new date object from the `NgbDateStruct`,
  1785. *
  1786. * ex. `NgbDate.from({year: 2000, month: 5, day: 1})`.
  1787. *
  1788. * If the `date` is already of `NgbDate` type, the method will return the same object.
  1789. */
  1790. /**
  1791. * A **static method** that creates a new date object from the `NgbDateStruct`,
  1792. *
  1793. * ex. `NgbDate.from({year: 2000, month: 5, day: 1})`.
  1794. *
  1795. * If the `date` is already of `NgbDate` type, the method will return the same object.
  1796. * @param {?} date
  1797. * @return {?}
  1798. */
  1799. NgbDate.from = /**
  1800. * A **static method** that creates a new date object from the `NgbDateStruct`,
  1801. *
  1802. * ex. `NgbDate.from({year: 2000, month: 5, day: 1})`.
  1803. *
  1804. * If the `date` is already of `NgbDate` type, the method will return the same object.
  1805. * @param {?} date
  1806. * @return {?}
  1807. */
  1808. function (date) {
  1809. if (date instanceof NgbDate) {
  1810. return date;
  1811. }
  1812. return date ? new NgbDate(date.year, date.month, date.day) : null;
  1813. };
  1814. /**
  1815. * Checks if the current date is equal to another date.
  1816. */
  1817. /**
  1818. * Checks if the current date is equal to another date.
  1819. * @param {?} other
  1820. * @return {?}
  1821. */
  1822. NgbDate.prototype.equals = /**
  1823. * Checks if the current date is equal to another date.
  1824. * @param {?} other
  1825. * @return {?}
  1826. */
  1827. function (other) {
  1828. return other && this.year === other.year && this.month === other.month && this.day === other.day;
  1829. };
  1830. /**
  1831. * Checks if the current date is before another date.
  1832. */
  1833. /**
  1834. * Checks if the current date is before another date.
  1835. * @param {?} other
  1836. * @return {?}
  1837. */
  1838. NgbDate.prototype.before = /**
  1839. * Checks if the current date is before another date.
  1840. * @param {?} other
  1841. * @return {?}
  1842. */
  1843. function (other) {
  1844. if (!other) {
  1845. return false;
  1846. }
  1847. if (this.year === other.year) {
  1848. if (this.month === other.month) {
  1849. return this.day === other.day ? false : this.day < other.day;
  1850. }
  1851. else {
  1852. return this.month < other.month;
  1853. }
  1854. }
  1855. else {
  1856. return this.year < other.year;
  1857. }
  1858. };
  1859. /**
  1860. * Checks if the current date is after another date.
  1861. */
  1862. /**
  1863. * Checks if the current date is after another date.
  1864. * @param {?} other
  1865. * @return {?}
  1866. */
  1867. NgbDate.prototype.after = /**
  1868. * Checks if the current date is after another date.
  1869. * @param {?} other
  1870. * @return {?}
  1871. */
  1872. function (other) {
  1873. if (!other) {
  1874. return false;
  1875. }
  1876. if (this.year === other.year) {
  1877. if (this.month === other.month) {
  1878. return this.day === other.day ? false : this.day > other.day;
  1879. }
  1880. else {
  1881. return this.month > other.month;
  1882. }
  1883. }
  1884. else {
  1885. return this.year > other.year;
  1886. }
  1887. };
  1888. return NgbDate;
  1889. }());
  1890. /**
  1891. * @fileoverview added by tsickle
  1892. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1893. */
  1894. /**
  1895. * @param {?} jsDate
  1896. * @return {?}
  1897. */
  1898. function fromJSDate(jsDate) {
  1899. return new NgbDate(jsDate.getFullYear(), jsDate.getMonth() + 1, jsDate.getDate());
  1900. }
  1901. /**
  1902. * @param {?} date
  1903. * @return {?}
  1904. */
  1905. function toJSDate(date) {
  1906. /** @type {?} */
  1907. var jsDate = new Date(date.year, date.month - 1, date.day, 12);
  1908. // this is done avoid 30 -> 1930 conversion
  1909. if (!isNaN(jsDate.getTime())) {
  1910. jsDate.setFullYear(date.year);
  1911. }
  1912. return jsDate;
  1913. }
  1914. /**
  1915. * @return {?}
  1916. */
  1917. function NGB_DATEPICKER_CALENDAR_FACTORY() {
  1918. return new NgbCalendarGregorian();
  1919. }
  1920. /**
  1921. * A service that represents the calendar used by the datepicker.
  1922. *
  1923. * The default implementation uses the Gregorian calendar. You can inject it in your own
  1924. * implementations if necessary to simplify `NgbDate` calculations.
  1925. * @abstract
  1926. */
  1927. var NgbCalendar = /** @class */ (function () {
  1928. function NgbCalendar() {
  1929. }
  1930. NgbCalendar.decorators = [
  1931. { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_DATEPICKER_CALENDAR_FACTORY },] }
  1932. ];
  1933. /** @nocollapse */ NgbCalendar.ngInjectableDef = ɵɵdefineInjectable({ factory: NGB_DATEPICKER_CALENDAR_FACTORY, token: NgbCalendar, providedIn: "root" });
  1934. return NgbCalendar;
  1935. }());
  1936. var NgbCalendarGregorian = /** @class */ (function (_super) {
  1937. __extends(NgbCalendarGregorian, _super);
  1938. function NgbCalendarGregorian() {
  1939. return _super !== null && _super.apply(this, arguments) || this;
  1940. }
  1941. /**
  1942. * @return {?}
  1943. */
  1944. NgbCalendarGregorian.prototype.getDaysPerWeek = /**
  1945. * @return {?}
  1946. */
  1947. function () { return 7; };
  1948. /**
  1949. * @return {?}
  1950. */
  1951. NgbCalendarGregorian.prototype.getMonths = /**
  1952. * @return {?}
  1953. */
  1954. function () { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; };
  1955. /**
  1956. * @return {?}
  1957. */
  1958. NgbCalendarGregorian.prototype.getWeeksPerMonth = /**
  1959. * @return {?}
  1960. */
  1961. function () { return 6; };
  1962. /**
  1963. * @param {?} date
  1964. * @param {?=} period
  1965. * @param {?=} number
  1966. * @return {?}
  1967. */
  1968. NgbCalendarGregorian.prototype.getNext = /**
  1969. * @param {?} date
  1970. * @param {?=} period
  1971. * @param {?=} number
  1972. * @return {?}
  1973. */
  1974. function (date, period, number) {
  1975. if (period === void 0) { period = 'd'; }
  1976. if (number === void 0) { number = 1; }
  1977. /** @type {?} */
  1978. var jsDate = toJSDate(date);
  1979. /** @type {?} */
  1980. var checkMonth = true;
  1981. /** @type {?} */
  1982. var expectedMonth = jsDate.getMonth();
  1983. switch (period) {
  1984. case 'y':
  1985. jsDate.setFullYear(jsDate.getFullYear() + number);
  1986. break;
  1987. case 'm':
  1988. expectedMonth += number;
  1989. jsDate.setMonth(expectedMonth);
  1990. expectedMonth = expectedMonth % 12;
  1991. if (expectedMonth < 0) {
  1992. expectedMonth = expectedMonth + 12;
  1993. }
  1994. break;
  1995. case 'd':
  1996. jsDate.setDate(jsDate.getDate() + number);
  1997. checkMonth = false;
  1998. break;
  1999. default:
  2000. return date;
  2001. }
  2002. if (checkMonth && jsDate.getMonth() !== expectedMonth) {
  2003. // this means the destination month has less days than the initial month
  2004. // let's go back to the end of the previous month:
  2005. jsDate.setDate(0);
  2006. }
  2007. return fromJSDate(jsDate);
  2008. };
  2009. /**
  2010. * @param {?} date
  2011. * @param {?=} period
  2012. * @param {?=} number
  2013. * @return {?}
  2014. */
  2015. NgbCalendarGregorian.prototype.getPrev = /**
  2016. * @param {?} date
  2017. * @param {?=} period
  2018. * @param {?=} number
  2019. * @return {?}
  2020. */
  2021. function (date, period, number) {
  2022. if (period === void 0) { period = 'd'; }
  2023. if (number === void 0) { number = 1; }
  2024. return this.getNext(date, period, -number);
  2025. };
  2026. /**
  2027. * @param {?} date
  2028. * @return {?}
  2029. */
  2030. NgbCalendarGregorian.prototype.getWeekday = /**
  2031. * @param {?} date
  2032. * @return {?}
  2033. */
  2034. function (date) {
  2035. /** @type {?} */
  2036. var jsDate = toJSDate(date);
  2037. /** @type {?} */
  2038. var day = jsDate.getDay();
  2039. // in JS Date Sun=0, in ISO 8601 Sun=7
  2040. return day === 0 ? 7 : day;
  2041. };
  2042. /**
  2043. * @param {?} week
  2044. * @param {?} firstDayOfWeek
  2045. * @return {?}
  2046. */
  2047. NgbCalendarGregorian.prototype.getWeekNumber = /**
  2048. * @param {?} week
  2049. * @param {?} firstDayOfWeek
  2050. * @return {?}
  2051. */
  2052. function (week, firstDayOfWeek) {
  2053. // in JS Date Sun=0, in ISO 8601 Sun=7
  2054. if (firstDayOfWeek === 7) {
  2055. firstDayOfWeek = 0;
  2056. }
  2057. /** @type {?} */
  2058. var thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;
  2059. /** @type {?} */
  2060. var date = week[thursdayIndex];
  2061. /** @type {?} */
  2062. var jsDate = toJSDate(date);
  2063. jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday
  2064. // Thursday
  2065. /** @type {?} */
  2066. var time = jsDate.getTime();
  2067. jsDate.setMonth(0); // Compare with Jan 1
  2068. jsDate.setDate(1);
  2069. return Math.floor(Math.round((time - jsDate.getTime()) / 86400000) / 7) + 1;
  2070. };
  2071. /**
  2072. * @return {?}
  2073. */
  2074. NgbCalendarGregorian.prototype.getToday = /**
  2075. * @return {?}
  2076. */
  2077. function () { return fromJSDate(new Date()); };
  2078. /**
  2079. * @param {?} date
  2080. * @return {?}
  2081. */
  2082. NgbCalendarGregorian.prototype.isValid = /**
  2083. * @param {?} date
  2084. * @return {?}
  2085. */
  2086. function (date) {
  2087. if (!date || !isInteger(date.year) || !isInteger(date.month) || !isInteger(date.day)) {
  2088. return false;
  2089. }
  2090. // year 0 doesn't exist in Gregorian calendar
  2091. if (date.year === 0) {
  2092. return false;
  2093. }
  2094. /** @type {?} */
  2095. var jsDate = toJSDate(date);
  2096. return !isNaN(jsDate.getTime()) && jsDate.getFullYear() === date.year && jsDate.getMonth() + 1 === date.month &&
  2097. jsDate.getDate() === date.day;
  2098. };
  2099. NgbCalendarGregorian.decorators = [
  2100. { type: Injectable }
  2101. ];
  2102. return NgbCalendarGregorian;
  2103. }(NgbCalendar));
  2104. /**
  2105. * @fileoverview added by tsickle
  2106. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2107. */
  2108. /**
  2109. * @param {?} prev
  2110. * @param {?} next
  2111. * @return {?}
  2112. */
  2113. function isChangedDate(prev, next) {
  2114. return !dateComparator(prev, next);
  2115. }
  2116. /**
  2117. * @param {?} prev
  2118. * @param {?} next
  2119. * @return {?}
  2120. */
  2121. function isChangedMonth(prev, next) {
  2122. return !prev && !next ? false : !prev || !next ? true : prev.year !== next.year || prev.month !== next.month;
  2123. }
  2124. /**
  2125. * @param {?} prev
  2126. * @param {?} next
  2127. * @return {?}
  2128. */
  2129. function dateComparator(prev, next) {
  2130. return (!prev && !next) || (!!prev && !!next && prev.equals(next));
  2131. }
  2132. /**
  2133. * @param {?} minDate
  2134. * @param {?} maxDate
  2135. * @return {?}
  2136. */
  2137. function checkMinBeforeMax(minDate, maxDate) {
  2138. if (maxDate && minDate && maxDate.before(minDate)) {
  2139. throw new Error("'maxDate' " + maxDate + " should be greater than 'minDate' " + minDate);
  2140. }
  2141. }
  2142. /**
  2143. * @param {?} date
  2144. * @param {?} minDate
  2145. * @param {?} maxDate
  2146. * @return {?}
  2147. */
  2148. function checkDateInRange(date, minDate, maxDate) {
  2149. if (date && minDate && date.before(minDate)) {
  2150. return minDate;
  2151. }
  2152. if (date && maxDate && date.after(maxDate)) {
  2153. return maxDate;
  2154. }
  2155. return date;
  2156. }
  2157. /**
  2158. * @param {?} date
  2159. * @param {?} state
  2160. * @return {?}
  2161. */
  2162. function isDateSelectable(date, state) {
  2163. var minDate = state.minDate, maxDate = state.maxDate, disabled = state.disabled, markDisabled = state.markDisabled;
  2164. // clang-format off
  2165. return !(!isDefined(date) ||
  2166. disabled ||
  2167. (markDisabled && markDisabled(date, { year: date.year, month: date.month })) ||
  2168. (minDate && date.before(minDate)) ||
  2169. (maxDate && date.after(maxDate)));
  2170. // clang-format on
  2171. }
  2172. /**
  2173. * @param {?} calendar
  2174. * @param {?} date
  2175. * @param {?} minDate
  2176. * @param {?} maxDate
  2177. * @return {?}
  2178. */
  2179. function generateSelectBoxMonths(calendar, date, minDate, maxDate) {
  2180. if (!date) {
  2181. return [];
  2182. }
  2183. /** @type {?} */
  2184. var months = calendar.getMonths(date.year);
  2185. if (minDate && date.year === minDate.year) {
  2186. /** @type {?} */
  2187. var index = months.findIndex((/**
  2188. * @param {?} month
  2189. * @return {?}
  2190. */
  2191. function (month) { return month === minDate.month; }));
  2192. months = months.slice(index);
  2193. }
  2194. if (maxDate && date.year === maxDate.year) {
  2195. /** @type {?} */
  2196. var index = months.findIndex((/**
  2197. * @param {?} month
  2198. * @return {?}
  2199. */
  2200. function (month) { return month === maxDate.month; }));
  2201. months = months.slice(0, index + 1);
  2202. }
  2203. return months;
  2204. }
  2205. /**
  2206. * @param {?} date
  2207. * @param {?} minDate
  2208. * @param {?} maxDate
  2209. * @return {?}
  2210. */
  2211. function generateSelectBoxYears(date, minDate, maxDate) {
  2212. if (!date) {
  2213. return [];
  2214. }
  2215. /** @type {?} */
  2216. var start = minDate ? Math.max(minDate.year, date.year - 500) : date.year - 10;
  2217. /** @type {?} */
  2218. var end = maxDate ? Math.min(maxDate.year, date.year + 500) : date.year + 10;
  2219. /** @type {?} */
  2220. var length = end - start + 1;
  2221. /** @type {?} */
  2222. var numbers = Array(length);
  2223. for (var i = 0; i < length; i++) {
  2224. numbers[i] = start + i;
  2225. }
  2226. return numbers;
  2227. }
  2228. /**
  2229. * @param {?} calendar
  2230. * @param {?} date
  2231. * @param {?} maxDate
  2232. * @return {?}
  2233. */
  2234. function nextMonthDisabled(calendar, date, maxDate) {
  2235. /** @type {?} */
  2236. var nextDate = Object.assign(calendar.getNext(date, 'm'), { day: 1 });
  2237. return maxDate && nextDate.after(maxDate);
  2238. }
  2239. /**
  2240. * @param {?} calendar
  2241. * @param {?} date
  2242. * @param {?} minDate
  2243. * @return {?}
  2244. */
  2245. function prevMonthDisabled(calendar, date, minDate) {
  2246. /** @type {?} */
  2247. var prevDate = Object.assign(calendar.getPrev(date, 'm'), { day: 1 });
  2248. return minDate && (prevDate.year === minDate.year && prevDate.month < minDate.month ||
  2249. prevDate.year < minDate.year && minDate.month === 1);
  2250. }
  2251. /**
  2252. * @param {?} calendar
  2253. * @param {?} date
  2254. * @param {?} state
  2255. * @param {?} i18n
  2256. * @param {?} force
  2257. * @return {?}
  2258. */
  2259. function buildMonths(calendar, date, state, i18n, force) {
  2260. var displayMonths = state.displayMonths, months = state.months;
  2261. // move old months to a temporary array
  2262. /** @type {?} */
  2263. var monthsToReuse = months.splice(0, months.length);
  2264. // generate new first dates, nullify or reuse months
  2265. /** @type {?} */
  2266. var firstDates = Array.from({ length: displayMonths }, (/**
  2267. * @param {?} _
  2268. * @param {?} i
  2269. * @return {?}
  2270. */
  2271. function (_, i) {
  2272. /** @type {?} */
  2273. var firstDate = Object.assign(calendar.getNext(date, 'm', i), { day: 1 });
  2274. months[i] = null;
  2275. if (!force) {
  2276. /** @type {?} */
  2277. var reusedIndex = monthsToReuse.findIndex((/**
  2278. * @param {?} month
  2279. * @return {?}
  2280. */
  2281. function (month) { return month.firstDate.equals(firstDate); }));
  2282. // move reused month back to months
  2283. if (reusedIndex !== -1) {
  2284. months[i] = monthsToReuse.splice(reusedIndex, 1)[0];
  2285. }
  2286. }
  2287. return firstDate;
  2288. }));
  2289. // rebuild nullified months
  2290. firstDates.forEach((/**
  2291. * @param {?} firstDate
  2292. * @param {?} i
  2293. * @return {?}
  2294. */
  2295. function (firstDate, i) {
  2296. if (months[i] === null) {
  2297. months[i] = buildMonth(calendar, firstDate, state, i18n, monthsToReuse.shift() || (/** @type {?} */ ({})));
  2298. }
  2299. }));
  2300. return months;
  2301. }
  2302. /**
  2303. * @param {?} calendar
  2304. * @param {?} date
  2305. * @param {?} state
  2306. * @param {?} i18n
  2307. * @param {?=} month
  2308. * @return {?}
  2309. */
  2310. function buildMonth(calendar, date, state, i18n, month) {
  2311. if (month === void 0) { month = (/** @type {?} */ ({})); }
  2312. var dayTemplateData = state.dayTemplateData, minDate = state.minDate, maxDate = state.maxDate, firstDayOfWeek = state.firstDayOfWeek, markDisabled = state.markDisabled, outsideDays = state.outsideDays;
  2313. /** @type {?} */
  2314. var calendarToday = calendar.getToday();
  2315. month.firstDate = null;
  2316. month.lastDate = null;
  2317. month.number = date.month;
  2318. month.year = date.year;
  2319. month.weeks = month.weeks || [];
  2320. month.weekdays = month.weekdays || [];
  2321. date = getFirstViewDate(calendar, date, firstDayOfWeek);
  2322. // month has weeks
  2323. for (var week = 0; week < calendar.getWeeksPerMonth(); week++) {
  2324. /** @type {?} */
  2325. var weekObject = month.weeks[week];
  2326. if (!weekObject) {
  2327. weekObject = month.weeks[week] = { number: 0, days: [], collapsed: true };
  2328. }
  2329. /** @type {?} */
  2330. var days = weekObject.days;
  2331. // week has days
  2332. for (var day = 0; day < calendar.getDaysPerWeek(); day++) {
  2333. if (week === 0) {
  2334. month.weekdays[day] = calendar.getWeekday(date);
  2335. }
  2336. /** @type {?} */
  2337. var newDate = new NgbDate(date.year, date.month, date.day);
  2338. /** @type {?} */
  2339. var nextDate = calendar.getNext(newDate);
  2340. /** @type {?} */
  2341. var ariaLabel = i18n.getDayAriaLabel(newDate);
  2342. // marking date as disabled
  2343. /** @type {?} */
  2344. var disabled = !!((minDate && newDate.before(minDate)) || (maxDate && newDate.after(maxDate)));
  2345. if (!disabled && markDisabled) {
  2346. disabled = markDisabled(newDate, { month: month.number, year: month.year });
  2347. }
  2348. // today
  2349. /** @type {?} */
  2350. var today = newDate.equals(calendarToday);
  2351. // adding user-provided data to the context
  2352. /** @type {?} */
  2353. var contextUserData = dayTemplateData ? dayTemplateData(newDate, { month: month.number, year: month.year }) : undefined;
  2354. // saving first date of the month
  2355. if (month.firstDate === null && newDate.month === month.number) {
  2356. month.firstDate = newDate;
  2357. }
  2358. // saving last date of the month
  2359. if (newDate.month === month.number && nextDate.month !== month.number) {
  2360. month.lastDate = newDate;
  2361. }
  2362. /** @type {?} */
  2363. var dayObject = days[day];
  2364. if (!dayObject) {
  2365. dayObject = days[day] = (/** @type {?} */ ({}));
  2366. }
  2367. dayObject.date = newDate;
  2368. dayObject.context = Object.assign(dayObject.context || {}, {
  2369. $implicit: newDate,
  2370. date: newDate,
  2371. data: contextUserData,
  2372. currentMonth: month.number,
  2373. currentYear: month.year, disabled: disabled,
  2374. focused: false,
  2375. selected: false, today: today
  2376. });
  2377. dayObject.tabindex = -1;
  2378. dayObject.ariaLabel = ariaLabel;
  2379. dayObject.hidden = false;
  2380. date = nextDate;
  2381. }
  2382. weekObject.number = calendar.getWeekNumber(days.map((/**
  2383. * @param {?} day
  2384. * @return {?}
  2385. */
  2386. function (day) { return day.date; })), firstDayOfWeek);
  2387. // marking week as collapsed
  2388. weekObject.collapsed = outsideDays === 'collapsed' && days[0].date.month !== month.number &&
  2389. days[days.length - 1].date.month !== month.number;
  2390. }
  2391. return month;
  2392. }
  2393. /**
  2394. * @param {?} calendar
  2395. * @param {?} date
  2396. * @param {?} firstDayOfWeek
  2397. * @return {?}
  2398. */
  2399. function getFirstViewDate(calendar, date, firstDayOfWeek) {
  2400. /** @type {?} */
  2401. var daysPerWeek = calendar.getDaysPerWeek();
  2402. /** @type {?} */
  2403. var firstMonthDate = new NgbDate(date.year, date.month, 1);
  2404. /** @type {?} */
  2405. var dayOfWeek = calendar.getWeekday(firstMonthDate) % daysPerWeek;
  2406. return calendar.getPrev(firstMonthDate, 'd', (daysPerWeek + dayOfWeek - firstDayOfWeek) % daysPerWeek);
  2407. }
  2408. /**
  2409. * @fileoverview added by tsickle
  2410. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2411. */
  2412. /**
  2413. * @param {?} locale
  2414. * @return {?}
  2415. */
  2416. function NGB_DATEPICKER_18N_FACTORY(locale) {
  2417. return new NgbDatepickerI18nDefault(locale);
  2418. }
  2419. /**
  2420. * A service supplying i18n data to the datepicker component.
  2421. *
  2422. * The default implementation of this service uses the Angular locale and registered locale data for
  2423. * weekdays and month names (as explained in the Angular i18n guide).
  2424. *
  2425. * It also provides a way to i18n data that depends on calendar calculations, like aria labels, day, week and year
  2426. * numerals. For other static labels the datepicker uses the default Angular i18n.
  2427. *
  2428. * See the [i18n demo](#/components/datepicker/examples#i18n) and
  2429. * [Hebrew calendar demo](#/components/datepicker/calendars#hebrew) on how to extend this class and define
  2430. * a custom provider for i18n.
  2431. * @abstract
  2432. */
  2433. var NgbDatepickerI18n = /** @class */ (function () {
  2434. function NgbDatepickerI18n() {
  2435. }
  2436. /**
  2437. * Returns the textual representation of a day that is rendered in a day cell.
  2438. *
  2439. * @since 3.0.0
  2440. */
  2441. /**
  2442. * Returns the textual representation of a day that is rendered in a day cell.
  2443. *
  2444. * \@since 3.0.0
  2445. * @param {?} date
  2446. * @return {?}
  2447. */
  2448. NgbDatepickerI18n.prototype.getDayNumerals = /**
  2449. * Returns the textual representation of a day that is rendered in a day cell.
  2450. *
  2451. * \@since 3.0.0
  2452. * @param {?} date
  2453. * @return {?}
  2454. */
  2455. function (date) { return "" + date.day; };
  2456. /**
  2457. * Returns the textual representation of a week number rendered by datepicker.
  2458. *
  2459. * @since 3.0.0
  2460. */
  2461. /**
  2462. * Returns the textual representation of a week number rendered by datepicker.
  2463. *
  2464. * \@since 3.0.0
  2465. * @param {?} weekNumber
  2466. * @return {?}
  2467. */
  2468. NgbDatepickerI18n.prototype.getWeekNumerals = /**
  2469. * Returns the textual representation of a week number rendered by datepicker.
  2470. *
  2471. * \@since 3.0.0
  2472. * @param {?} weekNumber
  2473. * @return {?}
  2474. */
  2475. function (weekNumber) { return "" + weekNumber; };
  2476. /**
  2477. * Returns the textual representation of a year that is rendered in the datepicker year select box.
  2478. *
  2479. * @since 3.0.0
  2480. */
  2481. /**
  2482. * Returns the textual representation of a year that is rendered in the datepicker year select box.
  2483. *
  2484. * \@since 3.0.0
  2485. * @param {?} year
  2486. * @return {?}
  2487. */
  2488. NgbDatepickerI18n.prototype.getYearNumerals = /**
  2489. * Returns the textual representation of a year that is rendered in the datepicker year select box.
  2490. *
  2491. * \@since 3.0.0
  2492. * @param {?} year
  2493. * @return {?}
  2494. */
  2495. function (year) { return "" + year; };
  2496. NgbDatepickerI18n.decorators = [
  2497. { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_DATEPICKER_18N_FACTORY, deps: [LOCALE_ID] },] }
  2498. ];
  2499. /** @nocollapse */ NgbDatepickerI18n.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbDatepickerI18n_Factory() { return NGB_DATEPICKER_18N_FACTORY(ɵɵinject(LOCALE_ID)); }, token: NgbDatepickerI18n, providedIn: "root" });
  2500. return NgbDatepickerI18n;
  2501. }());
  2502. var NgbDatepickerI18nDefault = /** @class */ (function (_super) {
  2503. __extends(NgbDatepickerI18nDefault, _super);
  2504. function NgbDatepickerI18nDefault(_locale) {
  2505. var _this = _super.call(this) || this;
  2506. _this._locale = _locale;
  2507. /** @type {?} */
  2508. var weekdaysStartingOnSunday = getLocaleDayNames(_locale, FormStyle.Standalone, TranslationWidth.Short);
  2509. _this._weekdaysShort = weekdaysStartingOnSunday.map((/**
  2510. * @param {?} day
  2511. * @param {?} index
  2512. * @return {?}
  2513. */
  2514. function (day, index) { return weekdaysStartingOnSunday[(index + 1) % 7]; }));
  2515. _this._monthsShort = getLocaleMonthNames(_locale, FormStyle.Standalone, TranslationWidth.Abbreviated);
  2516. _this._monthsFull = getLocaleMonthNames(_locale, FormStyle.Standalone, TranslationWidth.Wide);
  2517. return _this;
  2518. }
  2519. /**
  2520. * @param {?} weekday
  2521. * @return {?}
  2522. */
  2523. NgbDatepickerI18nDefault.prototype.getWeekdayShortName = /**
  2524. * @param {?} weekday
  2525. * @return {?}
  2526. */
  2527. function (weekday) { return this._weekdaysShort[weekday - 1]; };
  2528. /**
  2529. * @param {?} month
  2530. * @return {?}
  2531. */
  2532. NgbDatepickerI18nDefault.prototype.getMonthShortName = /**
  2533. * @param {?} month
  2534. * @return {?}
  2535. */
  2536. function (month) { return this._monthsShort[month - 1]; };
  2537. /**
  2538. * @param {?} month
  2539. * @return {?}
  2540. */
  2541. NgbDatepickerI18nDefault.prototype.getMonthFullName = /**
  2542. * @param {?} month
  2543. * @return {?}
  2544. */
  2545. function (month) { return this._monthsFull[month - 1]; };
  2546. /**
  2547. * @param {?} date
  2548. * @return {?}
  2549. */
  2550. NgbDatepickerI18nDefault.prototype.getDayAriaLabel = /**
  2551. * @param {?} date
  2552. * @return {?}
  2553. */
  2554. function (date) {
  2555. /** @type {?} */
  2556. var jsDate = new Date(date.year, date.month - 1, date.day);
  2557. return formatDate(jsDate, 'fullDate', this._locale);
  2558. };
  2559. NgbDatepickerI18nDefault.decorators = [
  2560. { type: Injectable }
  2561. ];
  2562. /** @nocollapse */
  2563. NgbDatepickerI18nDefault.ctorParameters = function () { return [
  2564. { type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] }
  2565. ]; };
  2566. return NgbDatepickerI18nDefault;
  2567. }(NgbDatepickerI18n));
  2568. /**
  2569. * @fileoverview added by tsickle
  2570. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2571. */
  2572. var NgbDatepickerService = /** @class */ (function () {
  2573. function NgbDatepickerService(_calendar, _i18n) {
  2574. var _this = this;
  2575. this._calendar = _calendar;
  2576. this._i18n = _i18n;
  2577. this._VALIDATORS = {
  2578. dayTemplateData: (/**
  2579. * @param {?} dayTemplateData
  2580. * @return {?}
  2581. */
  2582. function (dayTemplateData) {
  2583. if (_this._state.dayTemplateData !== dayTemplateData) {
  2584. return { dayTemplateData: dayTemplateData };
  2585. }
  2586. }),
  2587. displayMonths: (/**
  2588. * @param {?} displayMonths
  2589. * @return {?}
  2590. */
  2591. function (displayMonths) {
  2592. displayMonths = toInteger(displayMonths);
  2593. if (isInteger(displayMonths) && displayMonths > 0 && _this._state.displayMonths !== displayMonths) {
  2594. return { displayMonths: displayMonths };
  2595. }
  2596. }),
  2597. disabled: (/**
  2598. * @param {?} disabled
  2599. * @return {?}
  2600. */
  2601. function (disabled) {
  2602. if (_this._state.disabled !== disabled) {
  2603. return { disabled: disabled };
  2604. }
  2605. }),
  2606. firstDayOfWeek: (/**
  2607. * @param {?} firstDayOfWeek
  2608. * @return {?}
  2609. */
  2610. function (firstDayOfWeek) {
  2611. firstDayOfWeek = toInteger(firstDayOfWeek);
  2612. if (isInteger(firstDayOfWeek) && firstDayOfWeek >= 0 && _this._state.firstDayOfWeek !== firstDayOfWeek) {
  2613. return { firstDayOfWeek: firstDayOfWeek };
  2614. }
  2615. }),
  2616. focusVisible: (/**
  2617. * @param {?} focusVisible
  2618. * @return {?}
  2619. */
  2620. function (focusVisible) {
  2621. if (_this._state.focusVisible !== focusVisible && !_this._state.disabled) {
  2622. return { focusVisible: focusVisible };
  2623. }
  2624. }),
  2625. markDisabled: (/**
  2626. * @param {?} markDisabled
  2627. * @return {?}
  2628. */
  2629. function (markDisabled) {
  2630. if (_this._state.markDisabled !== markDisabled) {
  2631. return { markDisabled: markDisabled };
  2632. }
  2633. }),
  2634. maxDate: (/**
  2635. * @param {?} date
  2636. * @return {?}
  2637. */
  2638. function (date) {
  2639. /** @type {?} */
  2640. var maxDate = _this.toValidDate(date, null);
  2641. if (isChangedDate(_this._state.maxDate, maxDate)) {
  2642. return { maxDate: maxDate };
  2643. }
  2644. }),
  2645. minDate: (/**
  2646. * @param {?} date
  2647. * @return {?}
  2648. */
  2649. function (date) {
  2650. /** @type {?} */
  2651. var minDate = _this.toValidDate(date, null);
  2652. if (isChangedDate(_this._state.minDate, minDate)) {
  2653. return { minDate: minDate };
  2654. }
  2655. }),
  2656. navigation: (/**
  2657. * @param {?} navigation
  2658. * @return {?}
  2659. */
  2660. function (navigation) {
  2661. if (_this._state.navigation !== navigation) {
  2662. return { navigation: navigation };
  2663. }
  2664. }),
  2665. outsideDays: (/**
  2666. * @param {?} outsideDays
  2667. * @return {?}
  2668. */
  2669. function (outsideDays) {
  2670. if (_this._state.outsideDays !== outsideDays) {
  2671. return { outsideDays: outsideDays };
  2672. }
  2673. })
  2674. };
  2675. this._model$ = new Subject();
  2676. this._dateSelect$ = new Subject();
  2677. this._state = {
  2678. disabled: false,
  2679. displayMonths: 1,
  2680. firstDayOfWeek: 1,
  2681. focusVisible: false,
  2682. months: [],
  2683. navigation: 'select',
  2684. outsideDays: 'visible',
  2685. prevDisabled: false,
  2686. nextDisabled: false,
  2687. selectBoxes: { years: [], months: [] },
  2688. selectedDate: null
  2689. };
  2690. }
  2691. Object.defineProperty(NgbDatepickerService.prototype, "model$", {
  2692. get: /**
  2693. * @return {?}
  2694. */
  2695. function () { return this._model$.pipe(filter((/**
  2696. * @param {?} model
  2697. * @return {?}
  2698. */
  2699. function (model) { return model.months.length > 0; }))); },
  2700. enumerable: true,
  2701. configurable: true
  2702. });
  2703. Object.defineProperty(NgbDatepickerService.prototype, "dateSelect$", {
  2704. get: /**
  2705. * @return {?}
  2706. */
  2707. function () { return this._dateSelect$.pipe(filter((/**
  2708. * @param {?} date
  2709. * @return {?}
  2710. */
  2711. function (date) { return date !== null; }))); },
  2712. enumerable: true,
  2713. configurable: true
  2714. });
  2715. /**
  2716. * @param {?} options
  2717. * @return {?}
  2718. */
  2719. NgbDatepickerService.prototype.set = /**
  2720. * @param {?} options
  2721. * @return {?}
  2722. */
  2723. function (options) {
  2724. var _this = this;
  2725. /** @type {?} */
  2726. var patch = Object.keys(options)
  2727. .map((/**
  2728. * @param {?} key
  2729. * @return {?}
  2730. */
  2731. function (key) { return _this._VALIDATORS[key](options[key]); }))
  2732. .reduce((/**
  2733. * @param {?} obj
  2734. * @param {?} part
  2735. * @return {?}
  2736. */
  2737. function (obj, part) { return (__assign({}, obj, part)); }), {});
  2738. if (Object.keys(patch).length > 0) {
  2739. this._nextState(patch);
  2740. }
  2741. };
  2742. /**
  2743. * @param {?} date
  2744. * @return {?}
  2745. */
  2746. NgbDatepickerService.prototype.focus = /**
  2747. * @param {?} date
  2748. * @return {?}
  2749. */
  2750. function (date) {
  2751. if (!this._state.disabled && this._calendar.isValid(date) && isChangedDate(this._state.focusDate, date)) {
  2752. this._nextState({ focusDate: date });
  2753. }
  2754. };
  2755. /**
  2756. * @return {?}
  2757. */
  2758. NgbDatepickerService.prototype.focusSelect = /**
  2759. * @return {?}
  2760. */
  2761. function () {
  2762. if (isDateSelectable(this._state.focusDate, this._state)) {
  2763. this.select(this._state.focusDate, { emitEvent: true });
  2764. }
  2765. };
  2766. /**
  2767. * @param {?} date
  2768. * @return {?}
  2769. */
  2770. NgbDatepickerService.prototype.open = /**
  2771. * @param {?} date
  2772. * @return {?}
  2773. */
  2774. function (date) {
  2775. /** @type {?} */
  2776. var firstDate = this.toValidDate(date, this._calendar.getToday());
  2777. if (!this._state.disabled && (!this._state.firstDate || isChangedMonth(this._state.firstDate, date))) {
  2778. this._nextState({ firstDate: firstDate });
  2779. }
  2780. };
  2781. /**
  2782. * @param {?} date
  2783. * @param {?=} options
  2784. * @return {?}
  2785. */
  2786. NgbDatepickerService.prototype.select = /**
  2787. * @param {?} date
  2788. * @param {?=} options
  2789. * @return {?}
  2790. */
  2791. function (date, options) {
  2792. if (options === void 0) { options = {}; }
  2793. /** @type {?} */
  2794. var selectedDate = this.toValidDate(date, null);
  2795. if (!this._state.disabled) {
  2796. if (isChangedDate(this._state.selectedDate, selectedDate)) {
  2797. this._nextState({ selectedDate: selectedDate });
  2798. }
  2799. if (options.emitEvent && isDateSelectable(selectedDate, this._state)) {
  2800. this._dateSelect$.next(selectedDate);
  2801. }
  2802. }
  2803. };
  2804. /**
  2805. * @param {?} date
  2806. * @param {?=} defaultValue
  2807. * @return {?}
  2808. */
  2809. NgbDatepickerService.prototype.toValidDate = /**
  2810. * @param {?} date
  2811. * @param {?=} defaultValue
  2812. * @return {?}
  2813. */
  2814. function (date, defaultValue) {
  2815. /** @type {?} */
  2816. var ngbDate = NgbDate.from(date);
  2817. if (defaultValue === undefined) {
  2818. defaultValue = this._calendar.getToday();
  2819. }
  2820. return this._calendar.isValid(ngbDate) ? ngbDate : defaultValue;
  2821. };
  2822. /**
  2823. * @private
  2824. * @param {?} patch
  2825. * @return {?}
  2826. */
  2827. NgbDatepickerService.prototype._nextState = /**
  2828. * @private
  2829. * @param {?} patch
  2830. * @return {?}
  2831. */
  2832. function (patch) {
  2833. /** @type {?} */
  2834. var newState = this._updateState(patch);
  2835. this._patchContexts(newState);
  2836. this._state = newState;
  2837. this._model$.next(this._state);
  2838. };
  2839. /**
  2840. * @private
  2841. * @param {?} state
  2842. * @return {?}
  2843. */
  2844. NgbDatepickerService.prototype._patchContexts = /**
  2845. * @private
  2846. * @param {?} state
  2847. * @return {?}
  2848. */
  2849. function (state) {
  2850. var months = state.months, displayMonths = state.displayMonths, selectedDate = state.selectedDate, focusDate = state.focusDate, focusVisible = state.focusVisible, disabled = state.disabled, outsideDays = state.outsideDays;
  2851. state.months.forEach((/**
  2852. * @param {?} month
  2853. * @return {?}
  2854. */
  2855. function (month) {
  2856. month.weeks.forEach((/**
  2857. * @param {?} week
  2858. * @return {?}
  2859. */
  2860. function (week) {
  2861. week.days.forEach((/**
  2862. * @param {?} day
  2863. * @return {?}
  2864. */
  2865. function (day) {
  2866. // patch focus flag
  2867. if (focusDate) {
  2868. day.context.focused = focusDate.equals(day.date) && focusVisible;
  2869. }
  2870. // calculating tabindex
  2871. day.tabindex = !disabled && day.date.equals(focusDate) && focusDate.month === month.number ? 0 : -1;
  2872. // override context disabled
  2873. if (disabled === true) {
  2874. day.context.disabled = true;
  2875. }
  2876. // patch selection flag
  2877. if (selectedDate !== undefined) {
  2878. day.context.selected = selectedDate !== null && selectedDate.equals(day.date);
  2879. }
  2880. // visibility
  2881. if (month.number !== day.date.month) {
  2882. day.hidden = outsideDays === 'hidden' || outsideDays === 'collapsed' ||
  2883. (displayMonths > 1 && day.date.after(months[0].firstDate) &&
  2884. day.date.before(months[displayMonths - 1].lastDate));
  2885. }
  2886. }));
  2887. }));
  2888. }));
  2889. };
  2890. /**
  2891. * @private
  2892. * @param {?} patch
  2893. * @return {?}
  2894. */
  2895. NgbDatepickerService.prototype._updateState = /**
  2896. * @private
  2897. * @param {?} patch
  2898. * @return {?}
  2899. */
  2900. function (patch) {
  2901. // patching fields
  2902. /** @type {?} */
  2903. var state = Object.assign({}, this._state, patch);
  2904. /** @type {?} */
  2905. var startDate = state.firstDate;
  2906. // min/max dates changed
  2907. if ('minDate' in patch || 'maxDate' in patch) {
  2908. checkMinBeforeMax(state.minDate, state.maxDate);
  2909. state.focusDate = checkDateInRange(state.focusDate, state.minDate, state.maxDate);
  2910. state.firstDate = checkDateInRange(state.firstDate, state.minDate, state.maxDate);
  2911. startDate = state.focusDate;
  2912. }
  2913. // disabled
  2914. if ('disabled' in patch) {
  2915. state.focusVisible = false;
  2916. }
  2917. // initial rebuild via 'select()'
  2918. if ('selectedDate' in patch && this._state.months.length === 0) {
  2919. startDate = state.selectedDate;
  2920. }
  2921. // terminate early if only focus visibility was changed
  2922. if ('focusVisible' in patch) {
  2923. return state;
  2924. }
  2925. // focus date changed
  2926. if ('focusDate' in patch) {
  2927. state.focusDate = checkDateInRange(state.focusDate, state.minDate, state.maxDate);
  2928. startDate = state.focusDate;
  2929. // nothing to rebuild if only focus changed and it is still visible
  2930. if (state.months.length !== 0 && !state.focusDate.before(state.firstDate) &&
  2931. !state.focusDate.after(state.lastDate)) {
  2932. return state;
  2933. }
  2934. }
  2935. // first date changed
  2936. if ('firstDate' in patch) {
  2937. state.firstDate = checkDateInRange(state.firstDate, state.minDate, state.maxDate);
  2938. startDate = state.firstDate;
  2939. }
  2940. // rebuilding months
  2941. if (startDate) {
  2942. /** @type {?} */
  2943. var forceRebuild = 'dayTemplateData' in patch || 'firstDayOfWeek' in patch || 'markDisabled' in patch ||
  2944. 'minDate' in patch || 'maxDate' in patch || 'disabled' in patch || 'outsideDays' in patch;
  2945. /** @type {?} */
  2946. var months = buildMonths(this._calendar, startDate, state, this._i18n, forceRebuild);
  2947. // updating months and boundary dates
  2948. state.months = months;
  2949. state.firstDate = months.length > 0 ? months[0].firstDate : undefined;
  2950. state.lastDate = months.length > 0 ? months[months.length - 1].lastDate : undefined;
  2951. // reset selected date if 'markDisabled' returns true
  2952. if ('selectedDate' in patch && !isDateSelectable(state.selectedDate, state)) {
  2953. state.selectedDate = null;
  2954. }
  2955. // adjusting focus after months were built
  2956. if ('firstDate' in patch) {
  2957. if (state.focusDate === undefined || state.focusDate.before(state.firstDate) ||
  2958. state.focusDate.after(state.lastDate)) {
  2959. state.focusDate = startDate;
  2960. }
  2961. }
  2962. // adjusting months/years for the select box navigation
  2963. /** @type {?} */
  2964. var yearChanged = !this._state.firstDate || this._state.firstDate.year !== state.firstDate.year;
  2965. /** @type {?} */
  2966. var monthChanged = !this._state.firstDate || this._state.firstDate.month !== state.firstDate.month;
  2967. if (state.navigation === 'select') {
  2968. // years -> boundaries (min/max were changed)
  2969. if ('minDate' in patch || 'maxDate' in patch || state.selectBoxes.years.length === 0 || yearChanged) {
  2970. state.selectBoxes.years = generateSelectBoxYears(state.firstDate, state.minDate, state.maxDate);
  2971. }
  2972. // months -> when current year or boundaries change
  2973. if ('minDate' in patch || 'maxDate' in patch || state.selectBoxes.months.length === 0 || yearChanged) {
  2974. state.selectBoxes.months =
  2975. generateSelectBoxMonths(this._calendar, state.firstDate, state.minDate, state.maxDate);
  2976. }
  2977. }
  2978. else {
  2979. state.selectBoxes = { years: [], months: [] };
  2980. }
  2981. // updating navigation arrows -> boundaries change (min/max) or month/year changes
  2982. if ((state.navigation === 'arrows' || state.navigation === 'select') &&
  2983. (monthChanged || yearChanged || 'minDate' in patch || 'maxDate' in patch || 'disabled' in patch)) {
  2984. state.prevDisabled = state.disabled || prevMonthDisabled(this._calendar, state.firstDate, state.minDate);
  2985. state.nextDisabled = state.disabled || nextMonthDisabled(this._calendar, state.lastDate, state.maxDate);
  2986. }
  2987. }
  2988. return state;
  2989. };
  2990. NgbDatepickerService.decorators = [
  2991. { type: Injectable }
  2992. ];
  2993. /** @nocollapse */
  2994. NgbDatepickerService.ctorParameters = function () { return [
  2995. { type: NgbCalendar },
  2996. { type: NgbDatepickerI18n }
  2997. ]; };
  2998. return NgbDatepickerService;
  2999. }());
  3000. /**
  3001. * @fileoverview added by tsickle
  3002. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3003. */
  3004. /** @enum {number} */
  3005. var Key = {
  3006. Tab: 9,
  3007. Enter: 13,
  3008. Escape: 27,
  3009. Space: 32,
  3010. PageUp: 33,
  3011. PageDown: 34,
  3012. End: 35,
  3013. Home: 36,
  3014. ArrowLeft: 37,
  3015. ArrowUp: 38,
  3016. ArrowRight: 39,
  3017. ArrowDown: 40,
  3018. };
  3019. Key[Key.Tab] = 'Tab';
  3020. Key[Key.Enter] = 'Enter';
  3021. Key[Key.Escape] = 'Escape';
  3022. Key[Key.Space] = 'Space';
  3023. Key[Key.PageUp] = 'PageUp';
  3024. Key[Key.PageDown] = 'PageDown';
  3025. Key[Key.End] = 'End';
  3026. Key[Key.Home] = 'Home';
  3027. Key[Key.ArrowLeft] = 'ArrowLeft';
  3028. Key[Key.ArrowUp] = 'ArrowUp';
  3029. Key[Key.ArrowRight] = 'ArrowRight';
  3030. Key[Key.ArrowDown] = 'ArrowDown';
  3031. /**
  3032. * @fileoverview added by tsickle
  3033. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3034. */
  3035. /**
  3036. * A service that represents the keyboard navigation.
  3037. *
  3038. * Default keyboard shortcuts [are documented in the overview](#/components/datepicker/overview#keyboard-shortcuts)
  3039. *
  3040. * \@since 5.2.0
  3041. */
  3042. var NgbDatepickerKeyboardService = /** @class */ (function () {
  3043. function NgbDatepickerKeyboardService() {
  3044. }
  3045. /**
  3046. * Processes a keyboard event.
  3047. */
  3048. /**
  3049. * Processes a keyboard event.
  3050. * @param {?} event
  3051. * @param {?} datepicker
  3052. * @param {?} calendar
  3053. * @return {?}
  3054. */
  3055. NgbDatepickerKeyboardService.prototype.processKey = /**
  3056. * Processes a keyboard event.
  3057. * @param {?} event
  3058. * @param {?} datepicker
  3059. * @param {?} calendar
  3060. * @return {?}
  3061. */
  3062. function (event, datepicker, calendar) {
  3063. /** @type {?} */
  3064. var state = datepicker.state;
  3065. // tslint:disable-next-line:deprecation
  3066. switch (event.which) {
  3067. case Key.PageUp:
  3068. datepicker.focusDate(calendar.getPrev(state.focusedDate, event.shiftKey ? 'y' : 'm', 1));
  3069. break;
  3070. case Key.PageDown:
  3071. datepicker.focusDate(calendar.getNext(state.focusedDate, event.shiftKey ? 'y' : 'm', 1));
  3072. break;
  3073. case Key.End:
  3074. datepicker.focusDate(event.shiftKey ? state.maxDate : state.lastDate);
  3075. break;
  3076. case Key.Home:
  3077. datepicker.focusDate(event.shiftKey ? state.minDate : state.firstDate);
  3078. break;
  3079. case Key.ArrowLeft:
  3080. datepicker.focusDate(calendar.getPrev(state.focusedDate, 'd', 1));
  3081. break;
  3082. case Key.ArrowUp:
  3083. datepicker.focusDate(calendar.getPrev(state.focusedDate, 'd', calendar.getDaysPerWeek()));
  3084. break;
  3085. case Key.ArrowRight:
  3086. datepicker.focusDate(calendar.getNext(state.focusedDate, 'd', 1));
  3087. break;
  3088. case Key.ArrowDown:
  3089. datepicker.focusDate(calendar.getNext(state.focusedDate, 'd', calendar.getDaysPerWeek()));
  3090. break;
  3091. case Key.Enter:
  3092. case Key.Space:
  3093. datepicker.focusSelect();
  3094. break;
  3095. default:
  3096. return;
  3097. }
  3098. event.preventDefault();
  3099. event.stopPropagation();
  3100. };
  3101. NgbDatepickerKeyboardService.decorators = [
  3102. { type: Injectable, args: [{ providedIn: 'root' },] }
  3103. ];
  3104. /** @nocollapse */ NgbDatepickerKeyboardService.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbDatepickerKeyboardService_Factory() { return new NgbDatepickerKeyboardService(); }, token: NgbDatepickerKeyboardService, providedIn: "root" });
  3105. return NgbDatepickerKeyboardService;
  3106. }());
  3107. /**
  3108. * @fileoverview added by tsickle
  3109. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3110. */
  3111. /** @enum {number} */
  3112. var NavigationEvent = {
  3113. PREV: 0,
  3114. NEXT: 1,
  3115. };
  3116. NavigationEvent[NavigationEvent.PREV] = 'PREV';
  3117. NavigationEvent[NavigationEvent.NEXT] = 'NEXT';
  3118. /**
  3119. * @fileoverview added by tsickle
  3120. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3121. */
  3122. /**
  3123. * A configuration service for the [`NgbDatepicker`](#/components/datepicker/api#NgbDatepicker) component.
  3124. *
  3125. * You can inject this service, typically in your root component, and customize the values of its properties in
  3126. * order to provide default values for all the datepickers used in the application.
  3127. */
  3128. var NgbDatepickerConfig = /** @class */ (function () {
  3129. function NgbDatepickerConfig() {
  3130. this.displayMonths = 1;
  3131. this.firstDayOfWeek = 1;
  3132. this.navigation = 'select';
  3133. this.outsideDays = 'visible';
  3134. this.showWeekdays = true;
  3135. this.showWeekNumbers = false;
  3136. }
  3137. NgbDatepickerConfig.decorators = [
  3138. { type: Injectable, args: [{ providedIn: 'root' },] }
  3139. ];
  3140. /** @nocollapse */ NgbDatepickerConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbDatepickerConfig_Factory() { return new NgbDatepickerConfig(); }, token: NgbDatepickerConfig, providedIn: "root" });
  3141. return NgbDatepickerConfig;
  3142. }());
  3143. /**
  3144. * @fileoverview added by tsickle
  3145. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3146. */
  3147. /**
  3148. * @return {?}
  3149. */
  3150. function NGB_DATEPICKER_DATE_ADAPTER_FACTORY() {
  3151. return new NgbDateStructAdapter();
  3152. }
  3153. /**
  3154. * An abstract service that does the conversion between the internal datepicker `NgbDateStruct` model and
  3155. * any provided user date model `D`, ex. a string, a native date, etc.
  3156. *
  3157. * The adapter is used **only** for conversion when binding datepicker to a form control,
  3158. * ex. `[(ngModel)]="userDateModel"`. Here `userDateModel` can be of any type.
  3159. *
  3160. * The default datepicker implementation assumes we use `NgbDateStruct` as a user model.
  3161. *
  3162. * See the [date format overview](#/components/datepicker/overview#date-model) for more details
  3163. * and the [custom adapter demo](#/components/datepicker/examples#adapter) for an example.
  3164. * @abstract
  3165. * @template D
  3166. */
  3167. var NgbDateAdapter = /** @class */ (function () {
  3168. function NgbDateAdapter() {
  3169. }
  3170. NgbDateAdapter.decorators = [
  3171. { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_DATEPICKER_DATE_ADAPTER_FACTORY },] }
  3172. ];
  3173. /** @nocollapse */ NgbDateAdapter.ngInjectableDef = ɵɵdefineInjectable({ factory: NGB_DATEPICKER_DATE_ADAPTER_FACTORY, token: NgbDateAdapter, providedIn: "root" });
  3174. return NgbDateAdapter;
  3175. }());
  3176. var NgbDateStructAdapter = /** @class */ (function (_super) {
  3177. __extends(NgbDateStructAdapter, _super);
  3178. function NgbDateStructAdapter() {
  3179. return _super !== null && _super.apply(this, arguments) || this;
  3180. }
  3181. /**
  3182. * Converts a NgbDateStruct value into NgbDateStruct value
  3183. */
  3184. /**
  3185. * Converts a NgbDateStruct value into NgbDateStruct value
  3186. * @param {?} date
  3187. * @return {?}
  3188. */
  3189. NgbDateStructAdapter.prototype.fromModel = /**
  3190. * Converts a NgbDateStruct value into NgbDateStruct value
  3191. * @param {?} date
  3192. * @return {?}
  3193. */
  3194. function (date) {
  3195. return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?
  3196. { year: date.year, month: date.month, day: date.day } :
  3197. null;
  3198. };
  3199. /**
  3200. * Converts a NgbDateStruct value into NgbDateStruct value
  3201. */
  3202. /**
  3203. * Converts a NgbDateStruct value into NgbDateStruct value
  3204. * @param {?} date
  3205. * @return {?}
  3206. */
  3207. NgbDateStructAdapter.prototype.toModel = /**
  3208. * Converts a NgbDateStruct value into NgbDateStruct value
  3209. * @param {?} date
  3210. * @return {?}
  3211. */
  3212. function (date) {
  3213. return (date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day)) ?
  3214. { year: date.year, month: date.month, day: date.day } :
  3215. null;
  3216. };
  3217. NgbDateStructAdapter.decorators = [
  3218. { type: Injectable }
  3219. ];
  3220. return NgbDateStructAdapter;
  3221. }(NgbDateAdapter));
  3222. /**
  3223. * @fileoverview added by tsickle
  3224. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3225. */
  3226. /** @type {?} */
  3227. var NGB_DATEPICKER_VALUE_ACCESSOR = {
  3228. provide: NG_VALUE_ACCESSOR,
  3229. useExisting: forwardRef((/**
  3230. * @return {?}
  3231. */
  3232. function () { return NgbDatepicker; })),
  3233. multi: true
  3234. };
  3235. /**
  3236. * A highly configurable component that helps you with selecting calendar dates.
  3237. *
  3238. * `NgbDatepicker` is meant to be displayed inline on a page or put inside a popup.
  3239. */
  3240. var NgbDatepicker = /** @class */ (function () {
  3241. function NgbDatepicker(_service, _calendar, i18n, config, _keyboardService, cd, _elementRef, _ngbDateAdapter, _ngZone) {
  3242. var _this = this;
  3243. this._service = _service;
  3244. this._calendar = _calendar;
  3245. this.i18n = i18n;
  3246. this._keyboardService = _keyboardService;
  3247. this._elementRef = _elementRef;
  3248. this._ngbDateAdapter = _ngbDateAdapter;
  3249. this._ngZone = _ngZone;
  3250. this._destroyed$ = new Subject();
  3251. this._publicState = (/** @type {?} */ ({}));
  3252. /**
  3253. * An event emitted right before the navigation happens and displayed month changes.
  3254. *
  3255. * See [`NgbDatepickerNavigateEvent`](#/components/datepicker/api#NgbDatepickerNavigateEvent) for the payload info.
  3256. */
  3257. this.navigate = new EventEmitter();
  3258. /**
  3259. * An event emitted when user selects a date using keyboard or mouse.
  3260. *
  3261. * The payload of the event is currently selected `NgbDate`.
  3262. *
  3263. * \@since 5.2.0
  3264. */
  3265. this.dateSelect = new EventEmitter();
  3266. /**
  3267. * An event emitted when user selects a date using keyboard or mouse.
  3268. *
  3269. * The payload of the event is currently selected `NgbDate`.
  3270. *
  3271. * Please use 'dateSelect' output instead, this will be deprecated in version 6.0 due to collision with native
  3272. * 'select' event.
  3273. */
  3274. this.select = this.dateSelect;
  3275. this.onChange = (/**
  3276. * @param {?} _
  3277. * @return {?}
  3278. */
  3279. function (_) { });
  3280. this.onTouched = (/**
  3281. * @return {?}
  3282. */
  3283. function () { });
  3284. ['dayTemplate', 'dayTemplateData', 'displayMonths', 'firstDayOfWeek', 'footerTemplate', 'markDisabled', 'minDate',
  3285. 'maxDate', 'navigation', 'outsideDays', 'showWeekdays', 'showWeekNumbers', 'startDate']
  3286. .forEach((/**
  3287. * @param {?} input
  3288. * @return {?}
  3289. */
  3290. function (input) { return _this[input] = config[input]; }));
  3291. _service.dateSelect$.pipe(takeUntil(this._destroyed$)).subscribe((/**
  3292. * @param {?} date
  3293. * @return {?}
  3294. */
  3295. function (date) { _this.dateSelect.emit(date); }));
  3296. _service.model$.pipe(takeUntil(this._destroyed$)).subscribe((/**
  3297. * @param {?} model
  3298. * @return {?}
  3299. */
  3300. function (model) {
  3301. /** @type {?} */
  3302. var newDate = model.firstDate;
  3303. /** @type {?} */
  3304. var oldDate = _this.model ? _this.model.firstDate : null;
  3305. // update public state
  3306. _this._publicState = {
  3307. maxDate: model.maxDate,
  3308. minDate: model.minDate,
  3309. firstDate: model.firstDate,
  3310. lastDate: model.lastDate,
  3311. focusedDate: model.focusDate
  3312. };
  3313. /** @type {?} */
  3314. var navigationPrevented = false;
  3315. // emitting navigation event if the first month changes
  3316. if (!newDate.equals(oldDate)) {
  3317. _this.navigate.emit({
  3318. current: oldDate ? { year: oldDate.year, month: oldDate.month } : null,
  3319. next: { year: newDate.year, month: newDate.month },
  3320. preventDefault: (/**
  3321. * @return {?}
  3322. */
  3323. function () { return navigationPrevented = true; })
  3324. });
  3325. // can't prevent the very first navigation
  3326. if (navigationPrevented && oldDate !== null) {
  3327. _this._service.open(oldDate);
  3328. return;
  3329. }
  3330. }
  3331. /** @type {?} */
  3332. var newSelectedDate = model.selectedDate;
  3333. /** @type {?} */
  3334. var newFocusedDate = model.focusDate;
  3335. /** @type {?} */
  3336. var oldFocusedDate = _this.model ? _this.model.focusDate : null;
  3337. _this.model = model;
  3338. // handling selection change
  3339. if (isChangedDate(newSelectedDate, _this._controlValue)) {
  3340. _this._controlValue = newSelectedDate;
  3341. _this.onTouched();
  3342. _this.onChange(_this._ngbDateAdapter.toModel(newSelectedDate));
  3343. }
  3344. // handling focus change
  3345. if (isChangedDate(newFocusedDate, oldFocusedDate) && oldFocusedDate && model.focusVisible) {
  3346. _this.focus();
  3347. }
  3348. cd.markForCheck();
  3349. }));
  3350. }
  3351. Object.defineProperty(NgbDatepicker.prototype, "state", {
  3352. /**
  3353. * Returns the readonly public state of the datepicker
  3354. *
  3355. * @since 5.2.0
  3356. */
  3357. get: /**
  3358. * Returns the readonly public state of the datepicker
  3359. *
  3360. * \@since 5.2.0
  3361. * @return {?}
  3362. */
  3363. function () { return this._publicState; },
  3364. enumerable: true,
  3365. configurable: true
  3366. });
  3367. /**
  3368. * Focuses on given date.
  3369. */
  3370. /**
  3371. * Focuses on given date.
  3372. * @param {?} date
  3373. * @return {?}
  3374. */
  3375. NgbDatepicker.prototype.focusDate = /**
  3376. * Focuses on given date.
  3377. * @param {?} date
  3378. * @return {?}
  3379. */
  3380. function (date) { this._service.focus(NgbDate.from(date)); };
  3381. /**
  3382. * Selects focused date.
  3383. */
  3384. /**
  3385. * Selects focused date.
  3386. * @return {?}
  3387. */
  3388. NgbDatepicker.prototype.focusSelect = /**
  3389. * Selects focused date.
  3390. * @return {?}
  3391. */
  3392. function () { this._service.focusSelect(); };
  3393. /**
  3394. * @return {?}
  3395. */
  3396. NgbDatepicker.prototype.focus = /**
  3397. * @return {?}
  3398. */
  3399. function () {
  3400. var _this = this;
  3401. this._ngZone.onStable.asObservable().pipe(take(1)).subscribe((/**
  3402. * @return {?}
  3403. */
  3404. function () {
  3405. /** @type {?} */
  3406. var elementToFocus = _this._elementRef.nativeElement.querySelector('div.ngb-dp-day[tabindex="0"]');
  3407. if (elementToFocus) {
  3408. elementToFocus.focus();
  3409. }
  3410. }));
  3411. };
  3412. /**
  3413. * Navigates to the provided date.
  3414. *
  3415. * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
  3416. * If nothing or invalid date provided calendar will open current month.
  3417. *
  3418. * Use the `[startDate]` input as an alternative.
  3419. */
  3420. /**
  3421. * Navigates to the provided date.
  3422. *
  3423. * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
  3424. * If nothing or invalid date provided calendar will open current month.
  3425. *
  3426. * Use the `[startDate]` input as an alternative.
  3427. * @param {?=} date
  3428. * @return {?}
  3429. */
  3430. NgbDatepicker.prototype.navigateTo = /**
  3431. * Navigates to the provided date.
  3432. *
  3433. * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
  3434. * If nothing or invalid date provided calendar will open current month.
  3435. *
  3436. * Use the `[startDate]` input as an alternative.
  3437. * @param {?=} date
  3438. * @return {?}
  3439. */
  3440. function (date) {
  3441. this._service.open(NgbDate.from(date ? date.day ? (/** @type {?} */ (date)) : __assign({}, date, { day: 1 }) : null));
  3442. };
  3443. /**
  3444. * @return {?}
  3445. */
  3446. NgbDatepicker.prototype.ngAfterViewInit = /**
  3447. * @return {?}
  3448. */
  3449. function () {
  3450. var _this = this;
  3451. this._ngZone.runOutsideAngular((/**
  3452. * @return {?}
  3453. */
  3454. function () {
  3455. /** @type {?} */
  3456. var focusIns$ = fromEvent(_this._monthsEl.nativeElement, 'focusin');
  3457. /** @type {?} */
  3458. var focusOuts$ = fromEvent(_this._monthsEl.nativeElement, 'focusout');
  3459. var nativeElement = _this._elementRef.nativeElement;
  3460. // we're changing 'focusVisible' only when entering or leaving months view
  3461. // and ignoring all focus events where both 'target' and 'related' target are day cells
  3462. merge(focusIns$, focusOuts$)
  3463. .pipe(filter((/**
  3464. * @param {?} __0
  3465. * @return {?}
  3466. */
  3467. function (_a) {
  3468. var target = _a.target, relatedTarget = _a.relatedTarget;
  3469. return !(hasClassName(target, 'ngb-dp-day') && hasClassName(relatedTarget, 'ngb-dp-day') &&
  3470. nativeElement.contains((/** @type {?} */ (target))) && nativeElement.contains((/** @type {?} */ (relatedTarget))));
  3471. })), takeUntil(_this._destroyed$))
  3472. .subscribe((/**
  3473. * @param {?} __0
  3474. * @return {?}
  3475. */
  3476. function (_a) {
  3477. var type = _a.type;
  3478. return _this._ngZone.run((/**
  3479. * @return {?}
  3480. */
  3481. function () { return _this._service.set({ focusVisible: type === 'focusin' }); }));
  3482. }));
  3483. }));
  3484. };
  3485. /**
  3486. * @return {?}
  3487. */
  3488. NgbDatepicker.prototype.ngOnDestroy = /**
  3489. * @return {?}
  3490. */
  3491. function () { this._destroyed$.next(); };
  3492. /**
  3493. * @return {?}
  3494. */
  3495. NgbDatepicker.prototype.ngOnInit = /**
  3496. * @return {?}
  3497. */
  3498. function () {
  3499. var _this = this;
  3500. if (this.model === undefined) {
  3501. /** @type {?} */
  3502. var inputs_1 = {};
  3503. ['dayTemplateData', 'displayMonths', 'markDisabled', 'firstDayOfWeek', 'navigation', 'minDate', 'maxDate',
  3504. 'outsideDays']
  3505. .forEach((/**
  3506. * @param {?} name
  3507. * @return {?}
  3508. */
  3509. function (name) { return inputs_1[name] = _this[name]; }));
  3510. this._service.set(inputs_1);
  3511. this.navigateTo(this.startDate);
  3512. }
  3513. };
  3514. /**
  3515. * @param {?} changes
  3516. * @return {?}
  3517. */
  3518. NgbDatepicker.prototype.ngOnChanges = /**
  3519. * @param {?} changes
  3520. * @return {?}
  3521. */
  3522. function (changes) {
  3523. var _this = this;
  3524. /** @type {?} */
  3525. var inputs = {};
  3526. ['dayTemplateData', 'displayMonths', 'markDisabled', 'firstDayOfWeek', 'navigation', 'minDate', 'maxDate',
  3527. 'outsideDays']
  3528. .filter((/**
  3529. * @param {?} name
  3530. * @return {?}
  3531. */
  3532. function (name) { return name in changes; }))
  3533. .forEach((/**
  3534. * @param {?} name
  3535. * @return {?}
  3536. */
  3537. function (name) { return inputs[name] = _this[name]; }));
  3538. this._service.set(inputs);
  3539. if ('startDate' in changes) {
  3540. var _a = changes.startDate, currentValue = _a.currentValue, previousValue = _a.previousValue;
  3541. if (isChangedMonth(previousValue, currentValue)) {
  3542. this.navigateTo(this.startDate);
  3543. }
  3544. }
  3545. };
  3546. /**
  3547. * @param {?} date
  3548. * @return {?}
  3549. */
  3550. NgbDatepicker.prototype.onDateSelect = /**
  3551. * @param {?} date
  3552. * @return {?}
  3553. */
  3554. function (date) {
  3555. this._service.focus(date);
  3556. this._service.select(date, { emitEvent: true });
  3557. };
  3558. /**
  3559. * @param {?} event
  3560. * @return {?}
  3561. */
  3562. NgbDatepicker.prototype.onKeyDown = /**
  3563. * @param {?} event
  3564. * @return {?}
  3565. */
  3566. function (event) { this._keyboardService.processKey(event, this, this._calendar); };
  3567. /**
  3568. * @param {?} date
  3569. * @return {?}
  3570. */
  3571. NgbDatepicker.prototype.onNavigateDateSelect = /**
  3572. * @param {?} date
  3573. * @return {?}
  3574. */
  3575. function (date) { this._service.open(date); };
  3576. /**
  3577. * @param {?} event
  3578. * @return {?}
  3579. */
  3580. NgbDatepicker.prototype.onNavigateEvent = /**
  3581. * @param {?} event
  3582. * @return {?}
  3583. */
  3584. function (event) {
  3585. switch (event) {
  3586. case NavigationEvent.PREV:
  3587. this._service.open(this._calendar.getPrev(this.model.firstDate, 'm', 1));
  3588. break;
  3589. case NavigationEvent.NEXT:
  3590. this._service.open(this._calendar.getNext(this.model.firstDate, 'm', 1));
  3591. break;
  3592. }
  3593. };
  3594. /**
  3595. * @param {?} fn
  3596. * @return {?}
  3597. */
  3598. NgbDatepicker.prototype.registerOnChange = /**
  3599. * @param {?} fn
  3600. * @return {?}
  3601. */
  3602. function (fn) { this.onChange = fn; };
  3603. /**
  3604. * @param {?} fn
  3605. * @return {?}
  3606. */
  3607. NgbDatepicker.prototype.registerOnTouched = /**
  3608. * @param {?} fn
  3609. * @return {?}
  3610. */
  3611. function (fn) { this.onTouched = fn; };
  3612. /**
  3613. * @param {?} disabled
  3614. * @return {?}
  3615. */
  3616. NgbDatepicker.prototype.setDisabledState = /**
  3617. * @param {?} disabled
  3618. * @return {?}
  3619. */
  3620. function (disabled) { this._service.set({ disabled: disabled }); };
  3621. /**
  3622. * @param {?} value
  3623. * @return {?}
  3624. */
  3625. NgbDatepicker.prototype.writeValue = /**
  3626. * @param {?} value
  3627. * @return {?}
  3628. */
  3629. function (value) {
  3630. this._controlValue = NgbDate.from(this._ngbDateAdapter.fromModel(value));
  3631. this._service.select(this._controlValue);
  3632. };
  3633. NgbDatepicker.decorators = [
  3634. { type: Component, args: [{
  3635. exportAs: 'ngbDatepicker',
  3636. selector: 'ngb-datepicker',
  3637. changeDetection: ChangeDetectionStrategy.OnPush,
  3638. encapsulation: ViewEncapsulation.None,
  3639. template: "\n <ng-template #dt let-date=\"date\" let-currentMonth=\"currentMonth\" let-selected=\"selected\" let-disabled=\"disabled\" let-focused=\"focused\">\n <div ngbDatepickerDayView\n [date]=\"date\"\n [currentMonth]=\"currentMonth\"\n [selected]=\"selected\"\n [disabled]=\"disabled\"\n [focused]=\"focused\">\n </div>\n </ng-template>\n\n <div class=\"ngb-dp-header\">\n <ngb-datepicker-navigation *ngIf=\"navigation !== 'none'\"\n [date]=\"model.firstDate\"\n [months]=\"model.months\"\n [disabled]=\"model.disabled\"\n [showSelect]=\"model.navigation === 'select'\"\n [prevDisabled]=\"model.prevDisabled\"\n [nextDisabled]=\"model.nextDisabled\"\n [selectBoxes]=\"model.selectBoxes\"\n (navigate)=\"onNavigateEvent($event)\"\n (select)=\"onNavigateDateSelect($event)\">\n </ngb-datepicker-navigation>\n </div>\n\n <div #months class=\"ngb-dp-months\" (keydown)=\"onKeyDown($event)\">\n <ng-template ngFor let-month [ngForOf]=\"model.months\" let-i=\"index\">\n <div class=\"ngb-dp-month\">\n <div *ngIf=\"navigation === 'none' || (displayMonths > 1 && navigation === 'select')\"\n class=\"ngb-dp-month-name\">\n {{ i18n.getMonthFullName(month.number, month.year) }} {{ i18n.getYearNumerals(month.year) }}\n </div>\n <ngb-datepicker-month-view\n [month]=\"month\"\n [dayTemplate]=\"dayTemplate || dt\"\n [showWeekdays]=\"showWeekdays\"\n [showWeekNumbers]=\"showWeekNumbers\"\n (select)=\"onDateSelect($event)\">\n </ngb-datepicker-month-view>\n </div>\n </ng-template>\n </div>\n\n <ng-template [ngTemplateOutlet]=\"footerTemplate\"></ng-template>\n ",
  3640. providers: [NGB_DATEPICKER_VALUE_ACCESSOR, NgbDatepickerService],
  3641. styles: ["ngb-datepicker{border:1px solid #dfdfdf;border-radius:.25rem;display:inline-block}ngb-datepicker-month-view{pointer-events:auto}ngb-datepicker.dropdown-menu{padding:0}.ngb-dp-body{z-index:1050}.ngb-dp-header{border-bottom:0;border-radius:.25rem .25rem 0 0;padding-top:.25rem;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-months{display:-ms-flexbox;display:flex}.ngb-dp-month{pointer-events:none}.ngb-dp-month-name{font-size:larger;height:2rem;line-height:2rem;text-align:center;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-month+.ngb-dp-month .ngb-dp-month-name,.ngb-dp-month+.ngb-dp-month .ngb-dp-week{padding-left:1rem}.ngb-dp-month:last-child .ngb-dp-week{padding-right:.25rem}.ngb-dp-month:first-child .ngb-dp-week{padding-left:.25rem}.ngb-dp-month .ngb-dp-week:last-child{padding-bottom:.25rem}"]
  3642. }] }
  3643. ];
  3644. /** @nocollapse */
  3645. NgbDatepicker.ctorParameters = function () { return [
  3646. { type: NgbDatepickerService },
  3647. { type: NgbCalendar },
  3648. { type: NgbDatepickerI18n },
  3649. { type: NgbDatepickerConfig },
  3650. { type: NgbDatepickerKeyboardService },
  3651. { type: ChangeDetectorRef },
  3652. { type: ElementRef },
  3653. { type: NgbDateAdapter },
  3654. { type: NgZone }
  3655. ]; };
  3656. NgbDatepicker.propDecorators = {
  3657. _monthsEl: [{ type: ViewChild, args: ['months', { static: true },] }],
  3658. dayTemplate: [{ type: Input }],
  3659. dayTemplateData: [{ type: Input }],
  3660. displayMonths: [{ type: Input }],
  3661. firstDayOfWeek: [{ type: Input }],
  3662. footerTemplate: [{ type: Input }],
  3663. markDisabled: [{ type: Input }],
  3664. maxDate: [{ type: Input }],
  3665. minDate: [{ type: Input }],
  3666. navigation: [{ type: Input }],
  3667. outsideDays: [{ type: Input }],
  3668. showWeekdays: [{ type: Input }],
  3669. showWeekNumbers: [{ type: Input }],
  3670. startDate: [{ type: Input }],
  3671. navigate: [{ type: Output }],
  3672. dateSelect: [{ type: Output }],
  3673. select: [{ type: Output }]
  3674. };
  3675. return NgbDatepicker;
  3676. }());
  3677. /**
  3678. * @fileoverview added by tsickle
  3679. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3680. */
  3681. var NgbDatepickerMonthView = /** @class */ (function () {
  3682. function NgbDatepickerMonthView(i18n) {
  3683. this.i18n = i18n;
  3684. this.select = new EventEmitter();
  3685. }
  3686. /**
  3687. * @param {?} day
  3688. * @return {?}
  3689. */
  3690. NgbDatepickerMonthView.prototype.doSelect = /**
  3691. * @param {?} day
  3692. * @return {?}
  3693. */
  3694. function (day) {
  3695. if (!day.context.disabled && !day.hidden) {
  3696. this.select.emit(day.date);
  3697. }
  3698. };
  3699. NgbDatepickerMonthView.decorators = [
  3700. { type: Component, args: [{
  3701. selector: 'ngb-datepicker-month-view',
  3702. host: { 'role': 'grid' },
  3703. encapsulation: ViewEncapsulation.None,
  3704. template: "\n <div *ngIf=\"showWeekdays\" class=\"ngb-dp-week ngb-dp-weekdays\" role=\"row\">\n <div *ngIf=\"showWeekNumbers\" class=\"ngb-dp-weekday ngb-dp-showweek\"></div>\n <div *ngFor=\"let w of month.weekdays\" class=\"ngb-dp-weekday small\" role=\"columnheader\">\n {{ i18n.getWeekdayShortName(w) }}\n </div>\n </div>\n <ng-template ngFor let-week [ngForOf]=\"month.weeks\">\n <div *ngIf=\"!week.collapsed\" class=\"ngb-dp-week\" role=\"row\">\n <div *ngIf=\"showWeekNumbers\" class=\"ngb-dp-week-number small text-muted\">{{ i18n.getWeekNumerals(week.number) }}</div>\n <div *ngFor=\"let day of week.days\" (click)=\"doSelect(day); $event.preventDefault()\" class=\"ngb-dp-day\" role=\"gridcell\"\n [class.disabled]=\"day.context.disabled\"\n [tabindex]=\"day.tabindex\"\n [class.hidden]=\"day.hidden\"\n [class.ngb-dp-today]=\"day.context.today\"\n [attr.aria-label]=\"day.ariaLabel\">\n <ng-template [ngIf]=\"!day.hidden\">\n <ng-template [ngTemplateOutlet]=\"dayTemplate\" [ngTemplateOutletContext]=\"day.context\"></ng-template>\n </ng-template>\n </div>\n </div>\n </ng-template>\n ",
  3705. styles: ["ngb-datepicker-month-view{display:block}.ngb-dp-week-number,.ngb-dp-weekday{line-height:2rem;text-align:center;font-style:italic}.ngb-dp-weekday{color:#5bc0de;color:var(--info)}.ngb-dp-week{border-radius:.25rem;display:-ms-flexbox;display:flex}.ngb-dp-weekdays{border-bottom:1px solid rgba(0,0,0,.125);border-radius:0;background-color:#f8f9fa;background-color:var(--light)}.ngb-dp-day,.ngb-dp-week-number,.ngb-dp-weekday{width:2rem;height:2rem}.ngb-dp-day{cursor:pointer}.ngb-dp-day.disabled,.ngb-dp-day.hidden{cursor:default}.ngb-dp-day[tabindex=\"0\"]{z-index:1}"]
  3706. }] }
  3707. ];
  3708. /** @nocollapse */
  3709. NgbDatepickerMonthView.ctorParameters = function () { return [
  3710. { type: NgbDatepickerI18n }
  3711. ]; };
  3712. NgbDatepickerMonthView.propDecorators = {
  3713. dayTemplate: [{ type: Input }],
  3714. month: [{ type: Input }],
  3715. showWeekdays: [{ type: Input }],
  3716. showWeekNumbers: [{ type: Input }],
  3717. select: [{ type: Output }]
  3718. };
  3719. return NgbDatepickerMonthView;
  3720. }());
  3721. /**
  3722. * @fileoverview added by tsickle
  3723. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3724. */
  3725. var NgbDatepickerNavigation = /** @class */ (function () {
  3726. function NgbDatepickerNavigation(i18n) {
  3727. this.i18n = i18n;
  3728. this.navigation = NavigationEvent;
  3729. this.months = [];
  3730. this.navigate = new EventEmitter();
  3731. this.select = new EventEmitter();
  3732. }
  3733. /**
  3734. * @param {?} event
  3735. * @return {?}
  3736. */
  3737. NgbDatepickerNavigation.prototype.onClickPrev = /**
  3738. * @param {?} event
  3739. * @return {?}
  3740. */
  3741. function (event) {
  3742. ((/** @type {?} */ (event.currentTarget))).focus();
  3743. this.navigate.emit(this.navigation.PREV);
  3744. };
  3745. /**
  3746. * @param {?} event
  3747. * @return {?}
  3748. */
  3749. NgbDatepickerNavigation.prototype.onClickNext = /**
  3750. * @param {?} event
  3751. * @return {?}
  3752. */
  3753. function (event) {
  3754. ((/** @type {?} */ (event.currentTarget))).focus();
  3755. this.navigate.emit(this.navigation.NEXT);
  3756. };
  3757. NgbDatepickerNavigation.decorators = [
  3758. { type: Component, args: [{
  3759. selector: 'ngb-datepicker-navigation',
  3760. changeDetection: ChangeDetectionStrategy.OnPush,
  3761. encapsulation: ViewEncapsulation.None,
  3762. template: "\n <div class=\"ngb-dp-arrow\">\n <button type=\"button\" class=\"btn btn-link ngb-dp-arrow-btn\" (click)=\"onClickPrev($event)\" [disabled]=\"prevDisabled\"\n i18n-aria-label=\"@@ngb.datepicker.previous-month\" aria-label=\"Previous month\"\n i18n-title=\"@@ngb.datepicker.previous-month\" title=\"Previous month\">\n <span class=\"ngb-dp-navigation-chevron\"></span>\n </button>\n </div>\n <ngb-datepicker-navigation-select *ngIf=\"showSelect\" class=\"ngb-dp-navigation-select\"\n [date]=\"date\"\n [disabled] = \"disabled\"\n [months]=\"selectBoxes.months\"\n [years]=\"selectBoxes.years\"\n (select)=\"select.emit($event)\">\n </ngb-datepicker-navigation-select>\n\n <ng-template *ngIf=\"!showSelect\" ngFor let-month [ngForOf]=\"months\" let-i=\"index\">\n <div class=\"ngb-dp-arrow\" *ngIf=\"i > 0\"></div>\n <div class=\"ngb-dp-month-name\">\n {{ i18n.getMonthFullName(month.number, month.year) }} {{ i18n.getYearNumerals(month.year) }}\n </div>\n <div class=\"ngb-dp-arrow\" *ngIf=\"i !== months.length - 1\"></div>\n </ng-template>\n <div class=\"ngb-dp-arrow right\">\n <button type=\"button\" class=\"btn btn-link ngb-dp-arrow-btn\" (click)=\"onClickNext($event)\" [disabled]=\"nextDisabled\"\n i18n-aria-label=\"@@ngb.datepicker.next-month\" aria-label=\"Next month\"\n i18n-title=\"@@ngb.datepicker.next-month\" title=\"Next month\">\n <span class=\"ngb-dp-navigation-chevron\"></span>\n </button>\n </div>\n ",
  3763. styles: ["ngb-datepicker-navigation{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ngb-dp-navigation-chevron{border-style:solid;border-width:.2em .2em 0 0;display:inline-block;width:.75em;height:.75em;margin-left:.25em;margin-right:.15em;-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}.right .ngb-dp-navigation-chevron{-webkit-transform:rotate(45deg);transform:rotate(45deg);margin-left:.15em;margin-right:.25em}.ngb-dp-arrow{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;padding-right:0;padding-left:0;margin:0;width:2rem;height:2rem}.ngb-dp-arrow.right{-ms-flex-pack:end;justify-content:flex-end}.ngb-dp-arrow-btn{padding:0 .25rem;margin:0 .5rem;border:none;background-color:transparent;z-index:1}.ngb-dp-arrow-btn:focus{outline-width:1px;outline-style:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.ngb-dp-arrow-btn:focus{outline-style:solid}}.ngb-dp-month-name{font-size:larger;height:2rem;line-height:2rem;text-align:center}.ngb-dp-navigation-select{display:-ms-flexbox;display:flex;-ms-flex:1 1 9rem;flex:1 1 9rem}"]
  3764. }] }
  3765. ];
  3766. /** @nocollapse */
  3767. NgbDatepickerNavigation.ctorParameters = function () { return [
  3768. { type: NgbDatepickerI18n }
  3769. ]; };
  3770. NgbDatepickerNavigation.propDecorators = {
  3771. date: [{ type: Input }],
  3772. disabled: [{ type: Input }],
  3773. months: [{ type: Input }],
  3774. showSelect: [{ type: Input }],
  3775. prevDisabled: [{ type: Input }],
  3776. nextDisabled: [{ type: Input }],
  3777. selectBoxes: [{ type: Input }],
  3778. navigate: [{ type: Output }],
  3779. select: [{ type: Output }]
  3780. };
  3781. return NgbDatepickerNavigation;
  3782. }());
  3783. /**
  3784. * @fileoverview added by tsickle
  3785. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3786. */
  3787. /** @type {?} */
  3788. var isContainedIn = (/**
  3789. * @param {?} element
  3790. * @param {?=} array
  3791. * @return {?}
  3792. */
  3793. function (element, array) {
  3794. return array ? array.some((/**
  3795. * @param {?} item
  3796. * @return {?}
  3797. */
  3798. function (item) { return item.contains(element); })) : false;
  3799. });
  3800. /** @type {?} */
  3801. var matchesSelectorIfAny = (/**
  3802. * @param {?} element
  3803. * @param {?=} selector
  3804. * @return {?}
  3805. */
  3806. function (element, selector) {
  3807. return !selector || closest(element, selector) != null;
  3808. });
  3809. // we'll have to use 'touch' events instead of 'mouse' events on iOS and add a more significant delay
  3810. // to avoid re-opening when handling (click) on a toggling element
  3811. // TODO: use proper Angular platform detection when NgbAutoClose becomes a service and we can inject PLATFORM_ID
  3812. /** @type {?} */
  3813. var iOS = false;
  3814. if (typeof navigator !== 'undefined') {
  3815. iOS = !!navigator.userAgent && /iPad|iPhone|iPod/.test(navigator.userAgent);
  3816. }
  3817. // setting 'ngbAutoClose' synchronously on iOS results in immediate popup closing
  3818. // when tapping on the triggering element
  3819. /** @type {?} */
  3820. var wrapAsyncForiOS = (/**
  3821. * @param {?} fn
  3822. * @return {?}
  3823. */
  3824. function (fn) { return iOS ? (/**
  3825. * @return {?}
  3826. */
  3827. function () { return setTimeout((/**
  3828. * @return {?}
  3829. */
  3830. function () { return fn(); }), 100); }) : fn; });
  3831. /**
  3832. * @param {?} zone
  3833. * @param {?} document
  3834. * @param {?} type
  3835. * @param {?} close
  3836. * @param {?} closed$
  3837. * @param {?} insideElements
  3838. * @param {?=} ignoreElements
  3839. * @param {?=} insideSelector
  3840. * @return {?}
  3841. */
  3842. function ngbAutoClose(zone, document, type, close, closed$, insideElements, ignoreElements, insideSelector) {
  3843. // closing on ESC and outside clicks
  3844. if (type) {
  3845. zone.runOutsideAngular(wrapAsyncForiOS((/**
  3846. * @return {?}
  3847. */
  3848. function () {
  3849. /** @type {?} */
  3850. var shouldCloseOnClick = (/**
  3851. * @param {?} event
  3852. * @return {?}
  3853. */
  3854. function (event) {
  3855. /** @type {?} */
  3856. var element = (/** @type {?} */ (event.target));
  3857. if (event.button === 2 || isContainedIn(element, ignoreElements)) {
  3858. return false;
  3859. }
  3860. if (type === 'inside') {
  3861. return isContainedIn(element, insideElements) && matchesSelectorIfAny(element, insideSelector);
  3862. }
  3863. else if (type === 'outside') {
  3864. return !isContainedIn(element, insideElements);
  3865. }
  3866. else /* if (type === true) */ {
  3867. return matchesSelectorIfAny(element, insideSelector) || !isContainedIn(element, insideElements);
  3868. }
  3869. });
  3870. /** @type {?} */
  3871. var escapes$ = fromEvent(document, 'keydown')
  3872. .pipe(takeUntil(closed$),
  3873. // tslint:disable-next-line:deprecation
  3874. filter((/**
  3875. * @param {?} e
  3876. * @return {?}
  3877. */
  3878. function (e) { return e.which === Key.Escape; })), tap((/**
  3879. * @param {?} e
  3880. * @return {?}
  3881. */
  3882. function (e) { return e.preventDefault(); })));
  3883. // we have to pre-calculate 'shouldCloseOnClick' on 'mousedown/touchstart',
  3884. // because on 'mouseup/touchend' DOM nodes might be detached
  3885. /** @type {?} */
  3886. var mouseDowns$ = fromEvent(document, 'mousedown').pipe(map(shouldCloseOnClick), takeUntil(closed$));
  3887. /** @type {?} */
  3888. var closeableClicks$ = (/** @type {?} */ (fromEvent(document, 'mouseup')
  3889. .pipe(withLatestFrom(mouseDowns$), filter((/**
  3890. * @param {?} __0
  3891. * @return {?}
  3892. */
  3893. function (_a) {
  3894. var _b = __read(_a, 2), _ = _b[0], shouldClose = _b[1];
  3895. return shouldClose;
  3896. })), delay(0), takeUntil(closed$))));
  3897. race([escapes$, closeableClicks$]).subscribe((/**
  3898. * @return {?}
  3899. */
  3900. function () { return zone.run(close); }));
  3901. })));
  3902. }
  3903. }
  3904. /**
  3905. * @fileoverview added by tsickle
  3906. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3907. */
  3908. /** @type {?} */
  3909. var FOCUSABLE_ELEMENTS_SELECTOR = [
  3910. 'a[href]', 'button:not([disabled])', 'input:not([disabled]):not([type="hidden"])', 'select:not([disabled])',
  3911. 'textarea:not([disabled])', '[contenteditable]', '[tabindex]:not([tabindex="-1"])'
  3912. ].join(', ');
  3913. /**
  3914. * Returns first and last focusable elements inside of a given element based on specific CSS selector
  3915. * @param {?} element
  3916. * @return {?}
  3917. */
  3918. function getFocusableBoundaryElements(element) {
  3919. /** @type {?} */
  3920. var list = Array.from((/** @type {?} */ (element.querySelectorAll(FOCUSABLE_ELEMENTS_SELECTOR))))
  3921. .filter((/**
  3922. * @param {?} el
  3923. * @return {?}
  3924. */
  3925. function (el) { return el.tabIndex !== -1; }));
  3926. return [list[0], list[list.length - 1]];
  3927. }
  3928. /**
  3929. * Function that enforces browser focus to be trapped inside a DOM element.
  3930. *
  3931. * Works only for clicks inside the element and navigation with 'Tab', ignoring clicks outside of the element
  3932. *
  3933. * \@param zone Angular zone
  3934. * \@param element The element around which focus will be trapped inside
  3935. * \@param stopFocusTrap$ The observable stream. When completed the focus trap will clean up listeners
  3936. * and free internal resources
  3937. * \@param refocusOnClick Put the focus back to the last focused element whenever a click occurs on element (default to
  3938. * false)
  3939. * @type {?}
  3940. */
  3941. var ngbFocusTrap = (/**
  3942. * @param {?} zone
  3943. * @param {?} element
  3944. * @param {?} stopFocusTrap$
  3945. * @param {?=} refocusOnClick
  3946. * @return {?}
  3947. */
  3948. function (zone, element, stopFocusTrap$, refocusOnClick) {
  3949. if (refocusOnClick === void 0) { refocusOnClick = false; }
  3950. zone.runOutsideAngular((/**
  3951. * @return {?}
  3952. */
  3953. function () {
  3954. // last focused element
  3955. /** @type {?} */
  3956. var lastFocusedElement$ = fromEvent(element, 'focusin').pipe(takeUntil(stopFocusTrap$), map((/**
  3957. * @param {?} e
  3958. * @return {?}
  3959. */
  3960. function (e) { return e.target; })));
  3961. // 'tab' / 'shift+tab' stream
  3962. fromEvent(element, 'keydown')
  3963. .pipe(takeUntil(stopFocusTrap$),
  3964. // tslint:disable:deprecation
  3965. filter((/**
  3966. * @param {?} e
  3967. * @return {?}
  3968. */
  3969. function (e) { return e.which === Key.Tab; })),
  3970. // tslint:enable:deprecation
  3971. withLatestFrom(lastFocusedElement$))
  3972. .subscribe((/**
  3973. * @param {?} __0
  3974. * @return {?}
  3975. */
  3976. function (_a) {
  3977. var _b = __read(_a, 2), tabEvent = _b[0], focusedElement = _b[1];
  3978. var _c = __read(getFocusableBoundaryElements(element), 2), first = _c[0], last = _c[1];
  3979. if ((focusedElement === first || focusedElement === element) && tabEvent.shiftKey) {
  3980. last.focus();
  3981. tabEvent.preventDefault();
  3982. }
  3983. if (focusedElement === last && !tabEvent.shiftKey) {
  3984. first.focus();
  3985. tabEvent.preventDefault();
  3986. }
  3987. }));
  3988. // inside click
  3989. if (refocusOnClick) {
  3990. fromEvent(element, 'click')
  3991. .pipe(takeUntil(stopFocusTrap$), withLatestFrom(lastFocusedElement$), map((/**
  3992. * @param {?} arr
  3993. * @return {?}
  3994. */
  3995. function (arr) { return (/** @type {?} */ (arr[1])); })))
  3996. .subscribe((/**
  3997. * @param {?} lastFocusedElement
  3998. * @return {?}
  3999. */
  4000. function (lastFocusedElement) { return lastFocusedElement.focus(); }));
  4001. }
  4002. }));
  4003. });
  4004. /**
  4005. * @fileoverview added by tsickle
  4006. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4007. */
  4008. // previous version:
  4009. // https://github.com/angular-ui/bootstrap/blob/07c31d0731f7cb068a1932b8e01d2312b796b4ec/src/position/position.js
  4010. var
  4011. // previous version:
  4012. // https://github.com/angular-ui/bootstrap/blob/07c31d0731f7cb068a1932b8e01d2312b796b4ec/src/position/position.js
  4013. Positioning = /** @class */ (function () {
  4014. function Positioning() {
  4015. }
  4016. /**
  4017. * @private
  4018. * @param {?} element
  4019. * @return {?}
  4020. */
  4021. Positioning.prototype.getAllStyles = /**
  4022. * @private
  4023. * @param {?} element
  4024. * @return {?}
  4025. */
  4026. function (element) { return window.getComputedStyle(element); };
  4027. /**
  4028. * @private
  4029. * @param {?} element
  4030. * @param {?} prop
  4031. * @return {?}
  4032. */
  4033. Positioning.prototype.getStyle = /**
  4034. * @private
  4035. * @param {?} element
  4036. * @param {?} prop
  4037. * @return {?}
  4038. */
  4039. function (element, prop) { return this.getAllStyles(element)[prop]; };
  4040. /**
  4041. * @private
  4042. * @param {?} element
  4043. * @return {?}
  4044. */
  4045. Positioning.prototype.isStaticPositioned = /**
  4046. * @private
  4047. * @param {?} element
  4048. * @return {?}
  4049. */
  4050. function (element) {
  4051. return (this.getStyle(element, 'position') || 'static') === 'static';
  4052. };
  4053. /**
  4054. * @private
  4055. * @param {?} element
  4056. * @return {?}
  4057. */
  4058. Positioning.prototype.offsetParent = /**
  4059. * @private
  4060. * @param {?} element
  4061. * @return {?}
  4062. */
  4063. function (element) {
  4064. /** @type {?} */
  4065. var offsetParentEl = (/** @type {?} */ (element.offsetParent)) || document.documentElement;
  4066. while (offsetParentEl && offsetParentEl !== document.documentElement && this.isStaticPositioned(offsetParentEl)) {
  4067. offsetParentEl = (/** @type {?} */ (offsetParentEl.offsetParent));
  4068. }
  4069. return offsetParentEl || document.documentElement;
  4070. };
  4071. /**
  4072. * @param {?} element
  4073. * @param {?=} round
  4074. * @return {?}
  4075. */
  4076. Positioning.prototype.position = /**
  4077. * @param {?} element
  4078. * @param {?=} round
  4079. * @return {?}
  4080. */
  4081. function (element, round) {
  4082. if (round === void 0) { round = true; }
  4083. /** @type {?} */
  4084. var elPosition;
  4085. /** @type {?} */
  4086. var parentOffset = { width: 0, height: 0, top: 0, bottom: 0, left: 0, right: 0 };
  4087. if (this.getStyle(element, 'position') === 'fixed') {
  4088. elPosition = element.getBoundingClientRect();
  4089. elPosition = {
  4090. top: elPosition.top,
  4091. bottom: elPosition.bottom,
  4092. left: elPosition.left,
  4093. right: elPosition.right,
  4094. height: elPosition.height,
  4095. width: elPosition.width
  4096. };
  4097. }
  4098. else {
  4099. /** @type {?} */
  4100. var offsetParentEl = this.offsetParent(element);
  4101. elPosition = this.offset(element, false);
  4102. if (offsetParentEl !== document.documentElement) {
  4103. parentOffset = this.offset(offsetParentEl, false);
  4104. }
  4105. parentOffset.top += offsetParentEl.clientTop;
  4106. parentOffset.left += offsetParentEl.clientLeft;
  4107. }
  4108. elPosition.top -= parentOffset.top;
  4109. elPosition.bottom -= parentOffset.top;
  4110. elPosition.left -= parentOffset.left;
  4111. elPosition.right -= parentOffset.left;
  4112. if (round) {
  4113. elPosition.top = Math.round(elPosition.top);
  4114. elPosition.bottom = Math.round(elPosition.bottom);
  4115. elPosition.left = Math.round(elPosition.left);
  4116. elPosition.right = Math.round(elPosition.right);
  4117. }
  4118. return elPosition;
  4119. };
  4120. /**
  4121. * @param {?} element
  4122. * @param {?=} round
  4123. * @return {?}
  4124. */
  4125. Positioning.prototype.offset = /**
  4126. * @param {?} element
  4127. * @param {?=} round
  4128. * @return {?}
  4129. */
  4130. function (element, round) {
  4131. if (round === void 0) { round = true; }
  4132. /** @type {?} */
  4133. var elBcr = element.getBoundingClientRect();
  4134. /** @type {?} */
  4135. var viewportOffset = {
  4136. top: window.pageYOffset - document.documentElement.clientTop,
  4137. left: window.pageXOffset - document.documentElement.clientLeft
  4138. };
  4139. /** @type {?} */
  4140. var elOffset = {
  4141. height: elBcr.height || element.offsetHeight,
  4142. width: elBcr.width || element.offsetWidth,
  4143. top: elBcr.top + viewportOffset.top,
  4144. bottom: elBcr.bottom + viewportOffset.top,
  4145. left: elBcr.left + viewportOffset.left,
  4146. right: elBcr.right + viewportOffset.left
  4147. };
  4148. if (round) {
  4149. elOffset.height = Math.round(elOffset.height);
  4150. elOffset.width = Math.round(elOffset.width);
  4151. elOffset.top = Math.round(elOffset.top);
  4152. elOffset.bottom = Math.round(elOffset.bottom);
  4153. elOffset.left = Math.round(elOffset.left);
  4154. elOffset.right = Math.round(elOffset.right);
  4155. }
  4156. return elOffset;
  4157. };
  4158. /*
  4159. Return false if the element to position is outside the viewport
  4160. */
  4161. /*
  4162. Return false if the element to position is outside the viewport
  4163. */
  4164. /**
  4165. * @param {?} hostElement
  4166. * @param {?} targetElement
  4167. * @param {?} placement
  4168. * @param {?=} appendToBody
  4169. * @return {?}
  4170. */
  4171. Positioning.prototype.positionElements = /*
  4172. Return false if the element to position is outside the viewport
  4173. */
  4174. /**
  4175. * @param {?} hostElement
  4176. * @param {?} targetElement
  4177. * @param {?} placement
  4178. * @param {?=} appendToBody
  4179. * @return {?}
  4180. */
  4181. function (hostElement, targetElement, placement, appendToBody) {
  4182. var _a = __read(placement.split('-'), 2), _b = _a[0], placementPrimary = _b === void 0 ? 'top' : _b, _c = _a[1], placementSecondary = _c === void 0 ? 'center' : _c;
  4183. /** @type {?} */
  4184. var hostElPosition = appendToBody ? this.offset(hostElement, false) : this.position(hostElement, false);
  4185. /** @type {?} */
  4186. var targetElStyles = this.getAllStyles(targetElement);
  4187. /** @type {?} */
  4188. var marginTop = parseFloat(targetElStyles.marginTop);
  4189. /** @type {?} */
  4190. var marginBottom = parseFloat(targetElStyles.marginBottom);
  4191. /** @type {?} */
  4192. var marginLeft = parseFloat(targetElStyles.marginLeft);
  4193. /** @type {?} */
  4194. var marginRight = parseFloat(targetElStyles.marginRight);
  4195. /** @type {?} */
  4196. var topPosition = 0;
  4197. /** @type {?} */
  4198. var leftPosition = 0;
  4199. switch (placementPrimary) {
  4200. case 'top':
  4201. topPosition = (hostElPosition.top - (targetElement.offsetHeight + marginTop + marginBottom));
  4202. break;
  4203. case 'bottom':
  4204. topPosition = (hostElPosition.top + hostElPosition.height);
  4205. break;
  4206. case 'left':
  4207. leftPosition = (hostElPosition.left - (targetElement.offsetWidth + marginLeft + marginRight));
  4208. break;
  4209. case 'right':
  4210. leftPosition = (hostElPosition.left + hostElPosition.width);
  4211. break;
  4212. }
  4213. switch (placementSecondary) {
  4214. case 'top':
  4215. topPosition = hostElPosition.top;
  4216. break;
  4217. case 'bottom':
  4218. topPosition = hostElPosition.top + hostElPosition.height - targetElement.offsetHeight;
  4219. break;
  4220. case 'left':
  4221. leftPosition = hostElPosition.left;
  4222. break;
  4223. case 'right':
  4224. leftPosition = hostElPosition.left + hostElPosition.width - targetElement.offsetWidth;
  4225. break;
  4226. case 'center':
  4227. if (placementPrimary === 'top' || placementPrimary === 'bottom') {
  4228. leftPosition = (hostElPosition.left + hostElPosition.width / 2 - targetElement.offsetWidth / 2);
  4229. }
  4230. else {
  4231. topPosition = (hostElPosition.top + hostElPosition.height / 2 - targetElement.offsetHeight / 2);
  4232. }
  4233. break;
  4234. }
  4235. /// The translate3d/gpu acceleration render a blurry text on chrome, the next line is commented until a browser fix
  4236. // targetElement.style.transform = `translate3d(${Math.round(leftPosition)}px, ${Math.floor(topPosition)}px, 0px)`;
  4237. targetElement.style.transform = "translate(" + Math.round(leftPosition) + "px, " + Math.round(topPosition) + "px)";
  4238. // Check if the targetElement is inside the viewport
  4239. /** @type {?} */
  4240. var targetElBCR = targetElement.getBoundingClientRect();
  4241. /** @type {?} */
  4242. var html = document.documentElement;
  4243. /** @type {?} */
  4244. var windowHeight = window.innerHeight || html.clientHeight;
  4245. /** @type {?} */
  4246. var windowWidth = window.innerWidth || html.clientWidth;
  4247. return targetElBCR.left >= 0 && targetElBCR.top >= 0 && targetElBCR.right <= windowWidth &&
  4248. targetElBCR.bottom <= windowHeight;
  4249. };
  4250. return Positioning;
  4251. }());
  4252. /** @type {?} */
  4253. var placementSeparator = /\s+/;
  4254. /** @type {?} */
  4255. var positionService = new Positioning();
  4256. /*
  4257. * Accept the placement array and applies the appropriate placement dependent on the viewport.
  4258. * Returns the applied placement.
  4259. * In case of auto placement, placements are selected in order
  4260. * 'top', 'bottom', 'left', 'right',
  4261. * 'top-left', 'top-right',
  4262. * 'bottom-left', 'bottom-right',
  4263. * 'left-top', 'left-bottom',
  4264. * 'right-top', 'right-bottom'.
  4265. * */
  4266. /**
  4267. * @param {?} hostElement
  4268. * @param {?} targetElement
  4269. * @param {?} placement
  4270. * @param {?=} appendToBody
  4271. * @param {?=} baseClass
  4272. * @return {?}
  4273. */
  4274. function positionElements(hostElement, targetElement, placement, appendToBody, baseClass) {
  4275. var e_1, _a;
  4276. /** @type {?} */
  4277. var placementVals = Array.isArray(placement) ? placement : (/** @type {?} */ (placement.split(placementSeparator)));
  4278. /** @type {?} */
  4279. var allowedPlacements = [
  4280. 'top', 'bottom', 'left', 'right', 'top-left', 'top-right', 'bottom-left', 'bottom-right', 'left-top', 'left-bottom',
  4281. 'right-top', 'right-bottom'
  4282. ];
  4283. /** @type {?} */
  4284. var classList = targetElement.classList;
  4285. /** @type {?} */
  4286. var addClassesToTarget = (/**
  4287. * @param {?} targetPlacement
  4288. * @return {?}
  4289. */
  4290. function (targetPlacement) {
  4291. var _a = __read(targetPlacement.split('-'), 2), primary = _a[0], secondary = _a[1];
  4292. /** @type {?} */
  4293. var classes = [];
  4294. if (baseClass) {
  4295. classes.push(baseClass + "-" + primary);
  4296. if (secondary) {
  4297. classes.push(baseClass + "-" + primary + "-" + secondary);
  4298. }
  4299. classes.forEach((/**
  4300. * @param {?} classname
  4301. * @return {?}
  4302. */
  4303. function (classname) { classList.add(classname); }));
  4304. }
  4305. return classes;
  4306. });
  4307. // Remove old placement classes to avoid issues
  4308. if (baseClass) {
  4309. allowedPlacements.forEach((/**
  4310. * @param {?} placementToRemove
  4311. * @return {?}
  4312. */
  4313. function (placementToRemove) { classList.remove(baseClass + "-" + placementToRemove); }));
  4314. }
  4315. // replace auto placement with other placements
  4316. /** @type {?} */
  4317. var hasAuto = placementVals.findIndex((/**
  4318. * @param {?} val
  4319. * @return {?}
  4320. */
  4321. function (val) { return val === 'auto'; }));
  4322. if (hasAuto >= 0) {
  4323. allowedPlacements.forEach((/**
  4324. * @param {?} obj
  4325. * @return {?}
  4326. */
  4327. function (obj) {
  4328. if (placementVals.find((/**
  4329. * @param {?} val
  4330. * @return {?}
  4331. */
  4332. function (val) { return val.search('^' + obj) !== -1; })) == null) {
  4333. placementVals.splice(hasAuto++, 1, (/** @type {?} */ (obj)));
  4334. }
  4335. }));
  4336. }
  4337. // coordinates where to position
  4338. // Required for transform:
  4339. /** @type {?} */
  4340. var style = targetElement.style;
  4341. style.position = 'absolute';
  4342. style.top = '0';
  4343. style.left = '0';
  4344. style['will-change'] = 'transform';
  4345. /** @type {?} */
  4346. var testPlacement;
  4347. /** @type {?} */
  4348. var isInViewport = false;
  4349. try {
  4350. for (var placementVals_1 = __values(placementVals), placementVals_1_1 = placementVals_1.next(); !placementVals_1_1.done; placementVals_1_1 = placementVals_1.next()) {
  4351. testPlacement = placementVals_1_1.value;
  4352. /** @type {?} */
  4353. var addedClasses = addClassesToTarget(testPlacement);
  4354. if (positionService.positionElements(hostElement, targetElement, testPlacement, appendToBody)) {
  4355. isInViewport = true;
  4356. break;
  4357. }
  4358. // Remove the baseClasses for further calculation
  4359. if (baseClass) {
  4360. addedClasses.forEach((/**
  4361. * @param {?} classname
  4362. * @return {?}
  4363. */
  4364. function (classname) { classList.remove(classname); }));
  4365. }
  4366. }
  4367. }
  4368. catch (e_1_1) { e_1 = { error: e_1_1 }; }
  4369. finally {
  4370. try {
  4371. if (placementVals_1_1 && !placementVals_1_1.done && (_a = placementVals_1.return)) _a.call(placementVals_1);
  4372. }
  4373. finally { if (e_1) throw e_1.error; }
  4374. }
  4375. if (!isInViewport) {
  4376. // If nothing match, the first placement is the default one
  4377. testPlacement = placementVals[0];
  4378. addClassesToTarget(testPlacement);
  4379. positionService.positionElements(hostElement, targetElement, testPlacement, appendToBody);
  4380. }
  4381. return testPlacement;
  4382. }
  4383. /**
  4384. * @fileoverview added by tsickle
  4385. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4386. */
  4387. /**
  4388. * @return {?}
  4389. */
  4390. function NGB_DATEPICKER_PARSER_FORMATTER_FACTORY() {
  4391. return new NgbDateISOParserFormatter();
  4392. }
  4393. /**
  4394. * An abstract service for parsing and formatting dates for the
  4395. * [`NgbInputDatepicker`](#/components/datepicker/api#NgbInputDatepicker) directive.
  4396. * Converts between the internal `NgbDateStruct` model presentation and a `string` that is displayed in the
  4397. * input element.
  4398. *
  4399. * When user types something in the input this service attempts to parse it into a `NgbDateStruct` object.
  4400. * And vice versa, when users selects a date in the calendar with the mouse, it must be displayed as a `string`
  4401. * in the input.
  4402. *
  4403. * Default implementation uses the ISO 8601 format, but you can provide another implementation via DI
  4404. * to use an alternative string format or a custom parsing logic.
  4405. *
  4406. * See the [date format overview](#/components/datepicker/overview#date-model) for more details.
  4407. * @abstract
  4408. */
  4409. var NgbDateParserFormatter = /** @class */ (function () {
  4410. function NgbDateParserFormatter() {
  4411. }
  4412. NgbDateParserFormatter.decorators = [
  4413. { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_DATEPICKER_PARSER_FORMATTER_FACTORY },] }
  4414. ];
  4415. /** @nocollapse */ NgbDateParserFormatter.ngInjectableDef = ɵɵdefineInjectable({ factory: NGB_DATEPICKER_PARSER_FORMATTER_FACTORY, token: NgbDateParserFormatter, providedIn: "root" });
  4416. return NgbDateParserFormatter;
  4417. }());
  4418. var NgbDateISOParserFormatter = /** @class */ (function (_super) {
  4419. __extends(NgbDateISOParserFormatter, _super);
  4420. function NgbDateISOParserFormatter() {
  4421. return _super !== null && _super.apply(this, arguments) || this;
  4422. }
  4423. /**
  4424. * @param {?} value
  4425. * @return {?}
  4426. */
  4427. NgbDateISOParserFormatter.prototype.parse = /**
  4428. * @param {?} value
  4429. * @return {?}
  4430. */
  4431. function (value) {
  4432. if (value) {
  4433. /** @type {?} */
  4434. var dateParts = value.trim().split('-');
  4435. if (dateParts.length === 1 && isNumber(dateParts[0])) {
  4436. return { year: toInteger(dateParts[0]), month: null, day: null };
  4437. }
  4438. else if (dateParts.length === 2 && isNumber(dateParts[0]) && isNumber(dateParts[1])) {
  4439. return { year: toInteger(dateParts[0]), month: toInteger(dateParts[1]), day: null };
  4440. }
  4441. else if (dateParts.length === 3 && isNumber(dateParts[0]) && isNumber(dateParts[1]) && isNumber(dateParts[2])) {
  4442. return { year: toInteger(dateParts[0]), month: toInteger(dateParts[1]), day: toInteger(dateParts[2]) };
  4443. }
  4444. }
  4445. return null;
  4446. };
  4447. /**
  4448. * @param {?} date
  4449. * @return {?}
  4450. */
  4451. NgbDateISOParserFormatter.prototype.format = /**
  4452. * @param {?} date
  4453. * @return {?}
  4454. */
  4455. function (date) {
  4456. return date ?
  4457. date.year + "-" + (isNumber(date.month) ? padNumber(date.month) : '') + "-" + (isNumber(date.day) ? padNumber(date.day) : '') :
  4458. '';
  4459. };
  4460. NgbDateISOParserFormatter.decorators = [
  4461. { type: Injectable }
  4462. ];
  4463. return NgbDateISOParserFormatter;
  4464. }(NgbDateParserFormatter));
  4465. /**
  4466. * @fileoverview added by tsickle
  4467. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4468. */
  4469. /**
  4470. * A configuration service for the [`NgbDatepickerInput`](#/components/datepicker/api#NgbDatepicker) component.
  4471. *
  4472. * You can inject this service, typically in your root component, and customize the values of its properties in
  4473. * order to provide default values for all the datepicker inputs used in the application.
  4474. *
  4475. * \@since 5.2.0
  4476. */
  4477. var NgbInputDatepickerConfig = /** @class */ (function (_super) {
  4478. __extends(NgbInputDatepickerConfig, _super);
  4479. function NgbInputDatepickerConfig() {
  4480. var _this = _super !== null && _super.apply(this, arguments) || this;
  4481. _this.autoClose = true;
  4482. _this.placement = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
  4483. _this.restoreFocus = true;
  4484. return _this;
  4485. }
  4486. NgbInputDatepickerConfig.decorators = [
  4487. { type: Injectable, args: [{ providedIn: 'root' },] }
  4488. ];
  4489. /** @nocollapse */ NgbInputDatepickerConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbInputDatepickerConfig_Factory() { return new NgbInputDatepickerConfig(); }, token: NgbInputDatepickerConfig, providedIn: "root" });
  4490. return NgbInputDatepickerConfig;
  4491. }(NgbDatepickerConfig));
  4492. /**
  4493. * @fileoverview added by tsickle
  4494. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4495. */
  4496. /** @type {?} */
  4497. var NGB_DATEPICKER_VALUE_ACCESSOR$1 = {
  4498. provide: NG_VALUE_ACCESSOR,
  4499. useExisting: forwardRef((/**
  4500. * @return {?}
  4501. */
  4502. function () { return NgbInputDatepicker; })),
  4503. multi: true
  4504. };
  4505. /** @type {?} */
  4506. var NGB_DATEPICKER_VALIDATOR = {
  4507. provide: NG_VALIDATORS,
  4508. useExisting: forwardRef((/**
  4509. * @return {?}
  4510. */
  4511. function () { return NgbInputDatepicker; })),
  4512. multi: true
  4513. };
  4514. /**
  4515. * A directive that allows to stick a datepicker popup to an input field.
  4516. *
  4517. * Manages interaction with the input field itself, does value formatting and provides forms integration.
  4518. */
  4519. var NgbInputDatepicker = /** @class */ (function () {
  4520. function NgbInputDatepicker(_parserFormatter, _elRef, _vcRef, _renderer, _cfr, _ngZone, _calendar, _dateAdapter, _document, _changeDetector, config) {
  4521. var _this = this;
  4522. this._parserFormatter = _parserFormatter;
  4523. this._elRef = _elRef;
  4524. this._vcRef = _vcRef;
  4525. this._renderer = _renderer;
  4526. this._cfr = _cfr;
  4527. this._ngZone = _ngZone;
  4528. this._calendar = _calendar;
  4529. this._dateAdapter = _dateAdapter;
  4530. this._document = _document;
  4531. this._changeDetector = _changeDetector;
  4532. this._cRef = null;
  4533. this._disabled = false;
  4534. this._elWithFocus = null;
  4535. /**
  4536. * An event emitted when user selects a date using keyboard or mouse.
  4537. *
  4538. * The payload of the event is currently selected `NgbDate`.
  4539. *
  4540. * \@since 1.1.1
  4541. */
  4542. this.dateSelect = new EventEmitter();
  4543. /**
  4544. * Event emitted right after the navigation happens and displayed month changes.
  4545. *
  4546. * See [`NgbDatepickerNavigateEvent`](#/components/datepicker/api#NgbDatepickerNavigateEvent) for the payload info.
  4547. */
  4548. this.navigate = new EventEmitter();
  4549. /**
  4550. * An event fired after closing datepicker window.
  4551. *
  4552. * \@since 4.2.0
  4553. */
  4554. this.closed = new EventEmitter();
  4555. this._onChange = (/**
  4556. * @param {?} _
  4557. * @return {?}
  4558. */
  4559. function (_) { });
  4560. this._onTouched = (/**
  4561. * @return {?}
  4562. */
  4563. function () { });
  4564. this._validatorChange = (/**
  4565. * @return {?}
  4566. */
  4567. function () { });
  4568. ['autoClose', 'container', 'positionTarget', 'placement'].forEach((/**
  4569. * @param {?} input
  4570. * @return {?}
  4571. */
  4572. function (input) { return _this[input] = config[input]; }));
  4573. this._zoneSubscription = _ngZone.onStable.subscribe((/**
  4574. * @return {?}
  4575. */
  4576. function () { return _this._updatePopupPosition(); }));
  4577. }
  4578. Object.defineProperty(NgbInputDatepicker.prototype, "disabled", {
  4579. get: /**
  4580. * @return {?}
  4581. */
  4582. function () {
  4583. return this._disabled;
  4584. },
  4585. set: /**
  4586. * @param {?} value
  4587. * @return {?}
  4588. */
  4589. function (value) {
  4590. this._disabled = value === '' || (value && value !== 'false');
  4591. if (this.isOpen()) {
  4592. this._cRef.instance.setDisabledState(this._disabled);
  4593. }
  4594. },
  4595. enumerable: true,
  4596. configurable: true
  4597. });
  4598. /**
  4599. * @param {?} fn
  4600. * @return {?}
  4601. */
  4602. NgbInputDatepicker.prototype.registerOnChange = /**
  4603. * @param {?} fn
  4604. * @return {?}
  4605. */
  4606. function (fn) { this._onChange = fn; };
  4607. /**
  4608. * @param {?} fn
  4609. * @return {?}
  4610. */
  4611. NgbInputDatepicker.prototype.registerOnTouched = /**
  4612. * @param {?} fn
  4613. * @return {?}
  4614. */
  4615. function (fn) { this._onTouched = fn; };
  4616. /**
  4617. * @param {?} fn
  4618. * @return {?}
  4619. */
  4620. NgbInputDatepicker.prototype.registerOnValidatorChange = /**
  4621. * @param {?} fn
  4622. * @return {?}
  4623. */
  4624. function (fn) { this._validatorChange = fn; };
  4625. /**
  4626. * @param {?} isDisabled
  4627. * @return {?}
  4628. */
  4629. NgbInputDatepicker.prototype.setDisabledState = /**
  4630. * @param {?} isDisabled
  4631. * @return {?}
  4632. */
  4633. function (isDisabled) { this.disabled = isDisabled; };
  4634. /**
  4635. * @param {?} c
  4636. * @return {?}
  4637. */
  4638. NgbInputDatepicker.prototype.validate = /**
  4639. * @param {?} c
  4640. * @return {?}
  4641. */
  4642. function (c) {
  4643. /** @type {?} */
  4644. var value = c.value;
  4645. if (value === null || value === undefined) {
  4646. return null;
  4647. }
  4648. /** @type {?} */
  4649. var ngbDate = this._fromDateStruct(this._dateAdapter.fromModel(value));
  4650. if (!this._calendar.isValid(ngbDate)) {
  4651. return { 'ngbDate': { invalid: c.value } };
  4652. }
  4653. if (this.minDate && ngbDate.before(NgbDate.from(this.minDate))) {
  4654. return { 'ngbDate': { requiredBefore: this.minDate } };
  4655. }
  4656. if (this.maxDate && ngbDate.after(NgbDate.from(this.maxDate))) {
  4657. return { 'ngbDate': { requiredAfter: this.maxDate } };
  4658. }
  4659. };
  4660. /**
  4661. * @param {?} value
  4662. * @return {?}
  4663. */
  4664. NgbInputDatepicker.prototype.writeValue = /**
  4665. * @param {?} value
  4666. * @return {?}
  4667. */
  4668. function (value) {
  4669. this._model = this._fromDateStruct(this._dateAdapter.fromModel(value));
  4670. this._writeModelValue(this._model);
  4671. };
  4672. /**
  4673. * @param {?} value
  4674. * @param {?=} updateView
  4675. * @return {?}
  4676. */
  4677. NgbInputDatepicker.prototype.manualDateChange = /**
  4678. * @param {?} value
  4679. * @param {?=} updateView
  4680. * @return {?}
  4681. */
  4682. function (value, updateView) {
  4683. if (updateView === void 0) { updateView = false; }
  4684. /** @type {?} */
  4685. var inputValueChanged = value !== this._inputValue;
  4686. if (inputValueChanged) {
  4687. this._inputValue = value;
  4688. this._model = this._fromDateStruct(this._parserFormatter.parse(value));
  4689. }
  4690. if (inputValueChanged || !updateView) {
  4691. this._onChange(this._model ? this._dateAdapter.toModel(this._model) : (value === '' ? null : value));
  4692. }
  4693. if (updateView && this._model) {
  4694. this._writeModelValue(this._model);
  4695. }
  4696. };
  4697. /**
  4698. * @return {?}
  4699. */
  4700. NgbInputDatepicker.prototype.isOpen = /**
  4701. * @return {?}
  4702. */
  4703. function () { return !!this._cRef; };
  4704. /**
  4705. * Opens the datepicker popup.
  4706. *
  4707. * If the related form control contains a valid date, the corresponding month will be opened.
  4708. */
  4709. /**
  4710. * Opens the datepicker popup.
  4711. *
  4712. * If the related form control contains a valid date, the corresponding month will be opened.
  4713. * @return {?}
  4714. */
  4715. NgbInputDatepicker.prototype.open = /**
  4716. * Opens the datepicker popup.
  4717. *
  4718. * If the related form control contains a valid date, the corresponding month will be opened.
  4719. * @return {?}
  4720. */
  4721. function () {
  4722. var _this = this;
  4723. if (!this.isOpen()) {
  4724. /** @type {?} */
  4725. var cf = this._cfr.resolveComponentFactory(NgbDatepicker);
  4726. this._cRef = this._vcRef.createComponent(cf);
  4727. this._applyPopupStyling(this._cRef.location.nativeElement);
  4728. this._applyDatepickerInputs(this._cRef.instance);
  4729. this._subscribeForDatepickerOutputs(this._cRef.instance);
  4730. this._cRef.instance.ngOnInit();
  4731. this._cRef.instance.writeValue(this._dateAdapter.toModel(this._model));
  4732. // date selection event handling
  4733. this._cRef.instance.registerOnChange((/**
  4734. * @param {?} selectedDate
  4735. * @return {?}
  4736. */
  4737. function (selectedDate) {
  4738. _this.writeValue(selectedDate);
  4739. _this._onChange(selectedDate);
  4740. _this._onTouched();
  4741. }));
  4742. this._cRef.changeDetectorRef.detectChanges();
  4743. this._cRef.instance.setDisabledState(this.disabled);
  4744. if (this.container === 'body') {
  4745. window.document.querySelector(this.container).appendChild(this._cRef.location.nativeElement);
  4746. }
  4747. // focus handling
  4748. this._elWithFocus = this._document.activeElement;
  4749. ngbFocusTrap(this._ngZone, this._cRef.location.nativeElement, this.closed, true);
  4750. this._cRef.instance.focus();
  4751. ngbAutoClose(this._ngZone, this._document, this.autoClose, (/**
  4752. * @return {?}
  4753. */
  4754. function () { return _this.close(); }), this.closed, [], [this._elRef.nativeElement, this._cRef.location.nativeElement]);
  4755. }
  4756. };
  4757. /**
  4758. * Closes the datepicker popup.
  4759. */
  4760. /**
  4761. * Closes the datepicker popup.
  4762. * @return {?}
  4763. */
  4764. NgbInputDatepicker.prototype.close = /**
  4765. * Closes the datepicker popup.
  4766. * @return {?}
  4767. */
  4768. function () {
  4769. if (this.isOpen()) {
  4770. this._vcRef.remove(this._vcRef.indexOf(this._cRef.hostView));
  4771. this._cRef = null;
  4772. this.closed.emit();
  4773. this._changeDetector.markForCheck();
  4774. // restore focus
  4775. /** @type {?} */
  4776. var elementToFocus = this._elWithFocus;
  4777. if (isString(this.restoreFocus)) {
  4778. elementToFocus = this._document.querySelector(this.restoreFocus);
  4779. }
  4780. else if (this.restoreFocus !== undefined) {
  4781. elementToFocus = this.restoreFocus;
  4782. }
  4783. // in IE document.activeElement can contain an object without 'focus()' sometimes
  4784. if (elementToFocus && elementToFocus['focus']) {
  4785. elementToFocus.focus();
  4786. }
  4787. else {
  4788. this._document.body.focus();
  4789. }
  4790. }
  4791. };
  4792. /**
  4793. * Toggles the datepicker popup.
  4794. */
  4795. /**
  4796. * Toggles the datepicker popup.
  4797. * @return {?}
  4798. */
  4799. NgbInputDatepicker.prototype.toggle = /**
  4800. * Toggles the datepicker popup.
  4801. * @return {?}
  4802. */
  4803. function () {
  4804. if (this.isOpen()) {
  4805. this.close();
  4806. }
  4807. else {
  4808. this.open();
  4809. }
  4810. };
  4811. /**
  4812. * Navigates to the provided date.
  4813. *
  4814. * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
  4815. * If nothing or invalid date provided calendar will open current month.
  4816. *
  4817. * Use the `[startDate]` input as an alternative.
  4818. */
  4819. /**
  4820. * Navigates to the provided date.
  4821. *
  4822. * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
  4823. * If nothing or invalid date provided calendar will open current month.
  4824. *
  4825. * Use the `[startDate]` input as an alternative.
  4826. * @param {?=} date
  4827. * @return {?}
  4828. */
  4829. NgbInputDatepicker.prototype.navigateTo = /**
  4830. * Navigates to the provided date.
  4831. *
  4832. * With the default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
  4833. * If nothing or invalid date provided calendar will open current month.
  4834. *
  4835. * Use the `[startDate]` input as an alternative.
  4836. * @param {?=} date
  4837. * @return {?}
  4838. */
  4839. function (date) {
  4840. if (this.isOpen()) {
  4841. this._cRef.instance.navigateTo(date);
  4842. }
  4843. };
  4844. /**
  4845. * @return {?}
  4846. */
  4847. NgbInputDatepicker.prototype.onBlur = /**
  4848. * @return {?}
  4849. */
  4850. function () { this._onTouched(); };
  4851. /**
  4852. * @return {?}
  4853. */
  4854. NgbInputDatepicker.prototype.onFocus = /**
  4855. * @return {?}
  4856. */
  4857. function () { this._elWithFocus = this._elRef.nativeElement; };
  4858. /**
  4859. * @param {?} changes
  4860. * @return {?}
  4861. */
  4862. NgbInputDatepicker.prototype.ngOnChanges = /**
  4863. * @param {?} changes
  4864. * @return {?}
  4865. */
  4866. function (changes) {
  4867. if (changes['minDate'] || changes['maxDate']) {
  4868. this._validatorChange();
  4869. if (this.isOpen()) {
  4870. if (changes['minDate']) {
  4871. this._cRef.instance.minDate = this._dateAdapter.toModel(changes.minDate.currentValue);
  4872. }
  4873. if (changes['maxDate']) {
  4874. this._cRef.instance.maxDate = this._dateAdapter.toModel(changes.maxDate.currentValue);
  4875. }
  4876. this._cRef.instance.ngOnChanges(changes);
  4877. }
  4878. }
  4879. };
  4880. /**
  4881. * @return {?}
  4882. */
  4883. NgbInputDatepicker.prototype.ngOnDestroy = /**
  4884. * @return {?}
  4885. */
  4886. function () {
  4887. this.close();
  4888. this._zoneSubscription.unsubscribe();
  4889. };
  4890. /**
  4891. * @private
  4892. * @param {?} datepickerInstance
  4893. * @return {?}
  4894. */
  4895. NgbInputDatepicker.prototype._applyDatepickerInputs = /**
  4896. * @private
  4897. * @param {?} datepickerInstance
  4898. * @return {?}
  4899. */
  4900. function (datepickerInstance) {
  4901. var _this = this;
  4902. ['dayTemplate', 'dayTemplateData', 'displayMonths', 'firstDayOfWeek', 'footerTemplate', 'markDisabled', 'minDate',
  4903. 'maxDate', 'navigation', 'outsideDays', 'showNavigation', 'showWeekdays', 'showWeekNumbers']
  4904. .forEach((/**
  4905. * @param {?} optionName
  4906. * @return {?}
  4907. */
  4908. function (optionName) {
  4909. if (_this[optionName] !== undefined) {
  4910. datepickerInstance[optionName] = _this[optionName];
  4911. }
  4912. }));
  4913. datepickerInstance.startDate = this.startDate || this._model;
  4914. };
  4915. /**
  4916. * @private
  4917. * @param {?} nativeElement
  4918. * @return {?}
  4919. */
  4920. NgbInputDatepicker.prototype._applyPopupStyling = /**
  4921. * @private
  4922. * @param {?} nativeElement
  4923. * @return {?}
  4924. */
  4925. function (nativeElement) {
  4926. this._renderer.addClass(nativeElement, 'dropdown-menu');
  4927. this._renderer.addClass(nativeElement, 'show');
  4928. if (this.container === 'body') {
  4929. this._renderer.addClass(nativeElement, 'ngb-dp-body');
  4930. }
  4931. };
  4932. /**
  4933. * @private
  4934. * @param {?} datepickerInstance
  4935. * @return {?}
  4936. */
  4937. NgbInputDatepicker.prototype._subscribeForDatepickerOutputs = /**
  4938. * @private
  4939. * @param {?} datepickerInstance
  4940. * @return {?}
  4941. */
  4942. function (datepickerInstance) {
  4943. var _this = this;
  4944. datepickerInstance.navigate.subscribe((/**
  4945. * @param {?} navigateEvent
  4946. * @return {?}
  4947. */
  4948. function (navigateEvent) { return _this.navigate.emit(navigateEvent); }));
  4949. datepickerInstance.dateSelect.subscribe((/**
  4950. * @param {?} date
  4951. * @return {?}
  4952. */
  4953. function (date) {
  4954. _this.dateSelect.emit(date);
  4955. if (_this.autoClose === true || _this.autoClose === 'inside') {
  4956. _this.close();
  4957. }
  4958. }));
  4959. };
  4960. /**
  4961. * @private
  4962. * @param {?} model
  4963. * @return {?}
  4964. */
  4965. NgbInputDatepicker.prototype._writeModelValue = /**
  4966. * @private
  4967. * @param {?} model
  4968. * @return {?}
  4969. */
  4970. function (model) {
  4971. /** @type {?} */
  4972. var value = this._parserFormatter.format(model);
  4973. this._inputValue = value;
  4974. this._renderer.setProperty(this._elRef.nativeElement, 'value', value);
  4975. if (this.isOpen()) {
  4976. this._cRef.instance.writeValue(this._dateAdapter.toModel(model));
  4977. this._onTouched();
  4978. }
  4979. };
  4980. /**
  4981. * @private
  4982. * @param {?} date
  4983. * @return {?}
  4984. */
  4985. NgbInputDatepicker.prototype._fromDateStruct = /**
  4986. * @private
  4987. * @param {?} date
  4988. * @return {?}
  4989. */
  4990. function (date) {
  4991. /** @type {?} */
  4992. var ngbDate = date ? new NgbDate(date.year, date.month, date.day) : null;
  4993. return this._calendar.isValid(ngbDate) ? ngbDate : null;
  4994. };
  4995. /**
  4996. * @private
  4997. * @return {?}
  4998. */
  4999. NgbInputDatepicker.prototype._updatePopupPosition = /**
  5000. * @private
  5001. * @return {?}
  5002. */
  5003. function () {
  5004. if (!this._cRef) {
  5005. return;
  5006. }
  5007. /** @type {?} */
  5008. var hostElement;
  5009. if (isString(this.positionTarget)) {
  5010. hostElement = this._document.querySelector(this.positionTarget);
  5011. }
  5012. else if (this.positionTarget instanceof HTMLElement) {
  5013. hostElement = this.positionTarget;
  5014. }
  5015. else {
  5016. hostElement = this._elRef.nativeElement;
  5017. }
  5018. if (this.positionTarget && !hostElement) {
  5019. throw new Error('ngbDatepicker could not find element declared in [positionTarget] to position against.');
  5020. }
  5021. positionElements(hostElement, this._cRef.location.nativeElement, this.placement, this.container === 'body');
  5022. };
  5023. NgbInputDatepicker.decorators = [
  5024. { type: Directive, args: [{
  5025. selector: 'input[ngbDatepicker]',
  5026. exportAs: 'ngbDatepicker',
  5027. host: {
  5028. '(input)': 'manualDateChange($event.target.value)',
  5029. '(change)': 'manualDateChange($event.target.value, true)',
  5030. '(focus)': 'onFocus()',
  5031. '(blur)': 'onBlur()',
  5032. '[disabled]': 'disabled'
  5033. },
  5034. providers: [
  5035. NGB_DATEPICKER_VALUE_ACCESSOR$1, NGB_DATEPICKER_VALIDATOR,
  5036. { provide: NgbDatepickerConfig, useExisting: NgbInputDatepickerConfig }
  5037. ],
  5038. },] }
  5039. ];
  5040. /** @nocollapse */
  5041. NgbInputDatepicker.ctorParameters = function () { return [
  5042. { type: NgbDateParserFormatter },
  5043. { type: ElementRef },
  5044. { type: ViewContainerRef },
  5045. { type: Renderer2 },
  5046. { type: ComponentFactoryResolver },
  5047. { type: NgZone },
  5048. { type: NgbCalendar },
  5049. { type: NgbDateAdapter },
  5050. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
  5051. { type: ChangeDetectorRef },
  5052. { type: NgbInputDatepickerConfig }
  5053. ]; };
  5054. NgbInputDatepicker.propDecorators = {
  5055. autoClose: [{ type: Input }],
  5056. dayTemplate: [{ type: Input }],
  5057. dayTemplateData: [{ type: Input }],
  5058. displayMonths: [{ type: Input }],
  5059. firstDayOfWeek: [{ type: Input }],
  5060. footerTemplate: [{ type: Input }],
  5061. markDisabled: [{ type: Input }],
  5062. minDate: [{ type: Input }],
  5063. maxDate: [{ type: Input }],
  5064. navigation: [{ type: Input }],
  5065. outsideDays: [{ type: Input }],
  5066. placement: [{ type: Input }],
  5067. restoreFocus: [{ type: Input }],
  5068. showWeekdays: [{ type: Input }],
  5069. showWeekNumbers: [{ type: Input }],
  5070. startDate: [{ type: Input }],
  5071. container: [{ type: Input }],
  5072. positionTarget: [{ type: Input }],
  5073. dateSelect: [{ type: Output }],
  5074. navigate: [{ type: Output }],
  5075. closed: [{ type: Output }],
  5076. disabled: [{ type: Input }]
  5077. };
  5078. return NgbInputDatepicker;
  5079. }());
  5080. /**
  5081. * @fileoverview added by tsickle
  5082. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5083. */
  5084. var NgbDatepickerDayView = /** @class */ (function () {
  5085. function NgbDatepickerDayView(i18n) {
  5086. this.i18n = i18n;
  5087. }
  5088. /**
  5089. * @return {?}
  5090. */
  5091. NgbDatepickerDayView.prototype.isMuted = /**
  5092. * @return {?}
  5093. */
  5094. function () { return !this.selected && (this.date.month !== this.currentMonth || this.disabled); };
  5095. NgbDatepickerDayView.decorators = [
  5096. { type: Component, args: [{
  5097. selector: '[ngbDatepickerDayView]',
  5098. changeDetection: ChangeDetectionStrategy.OnPush,
  5099. encapsulation: ViewEncapsulation.None,
  5100. host: {
  5101. 'class': 'btn-light',
  5102. '[class.bg-primary]': 'selected',
  5103. '[class.text-white]': 'selected',
  5104. '[class.text-muted]': 'isMuted()',
  5105. '[class.outside]': 'isMuted()',
  5106. '[class.active]': 'focused'
  5107. },
  5108. template: "{{ i18n.getDayNumerals(date) }}",
  5109. styles: ["[ngbDatepickerDayView]{text-align:center;width:2rem;height:2rem;line-height:2rem;border-radius:.25rem;background:0 0}[ngbDatepickerDayView].outside{opacity:.5}"]
  5110. }] }
  5111. ];
  5112. /** @nocollapse */
  5113. NgbDatepickerDayView.ctorParameters = function () { return [
  5114. { type: NgbDatepickerI18n }
  5115. ]; };
  5116. NgbDatepickerDayView.propDecorators = {
  5117. currentMonth: [{ type: Input }],
  5118. date: [{ type: Input }],
  5119. disabled: [{ type: Input }],
  5120. focused: [{ type: Input }],
  5121. selected: [{ type: Input }]
  5122. };
  5123. return NgbDatepickerDayView;
  5124. }());
  5125. /**
  5126. * @fileoverview added by tsickle
  5127. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5128. */
  5129. var NgbDatepickerNavigationSelect = /** @class */ (function () {
  5130. function NgbDatepickerNavigationSelect(i18n, _renderer) {
  5131. this.i18n = i18n;
  5132. this._renderer = _renderer;
  5133. this.select = new EventEmitter();
  5134. this._month = -1;
  5135. this._year = -1;
  5136. }
  5137. /**
  5138. * @param {?} month
  5139. * @return {?}
  5140. */
  5141. NgbDatepickerNavigationSelect.prototype.changeMonth = /**
  5142. * @param {?} month
  5143. * @return {?}
  5144. */
  5145. function (month) { this.select.emit(new NgbDate(this.date.year, toInteger(month), 1)); };
  5146. /**
  5147. * @param {?} year
  5148. * @return {?}
  5149. */
  5150. NgbDatepickerNavigationSelect.prototype.changeYear = /**
  5151. * @param {?} year
  5152. * @return {?}
  5153. */
  5154. function (year) { this.select.emit(new NgbDate(toInteger(year), this.date.month, 1)); };
  5155. /**
  5156. * @return {?}
  5157. */
  5158. NgbDatepickerNavigationSelect.prototype.ngAfterViewChecked = /**
  5159. * @return {?}
  5160. */
  5161. function () {
  5162. if (this.date) {
  5163. if (this.date.month !== this._month) {
  5164. this._month = this.date.month;
  5165. this._renderer.setProperty(this.monthSelect.nativeElement, 'value', this._month);
  5166. }
  5167. if (this.date.year !== this._year) {
  5168. this._year = this.date.year;
  5169. this._renderer.setProperty(this.yearSelect.nativeElement, 'value', this._year);
  5170. }
  5171. }
  5172. };
  5173. NgbDatepickerNavigationSelect.decorators = [
  5174. { type: Component, args: [{
  5175. selector: 'ngb-datepicker-navigation-select',
  5176. changeDetection: ChangeDetectionStrategy.OnPush,
  5177. encapsulation: ViewEncapsulation.None,
  5178. template: "\n <select #month\n [disabled]=\"disabled\"\n class=\"custom-select\"\n i18n-aria-label=\"@@ngb.datepicker.select-month\" aria-label=\"Select month\"\n i18n-title=\"@@ngb.datepicker.select-month\" title=\"Select month\"\n (change)=\"changeMonth($event.target.value)\">\n <option *ngFor=\"let m of months\" [attr.aria-label]=\"i18n.getMonthFullName(m, date?.year)\"\n [value]=\"m\">{{ i18n.getMonthShortName(m, date?.year) }}</option>\n </select><select #year\n [disabled]=\"disabled\"\n class=\"custom-select\"\n i18n-aria-label=\"@@ngb.datepicker.select-year\" aria-label=\"Select year\"\n i18n-title=\"@@ngb.datepicker.select-year\" title=\"Select year\"\n (change)=\"changeYear($event.target.value)\">\n <option *ngFor=\"let y of years\" [value]=\"y\">{{ i18n.getYearNumerals(y) }}</option>\n </select>\n ",
  5179. styles: ["ngb-datepicker-navigation-select>.custom-select{-ms-flex:1 1 auto;flex:1 1 auto;padding:0 .5rem;font-size:.875rem;height:1.85rem}ngb-datepicker-navigation-select>.custom-select:focus{z-index:1}ngb-datepicker-navigation-select>.custom-select::-ms-value{background-color:transparent!important}"]
  5180. }] }
  5181. ];
  5182. /** @nocollapse */
  5183. NgbDatepickerNavigationSelect.ctorParameters = function () { return [
  5184. { type: NgbDatepickerI18n },
  5185. { type: Renderer2 }
  5186. ]; };
  5187. NgbDatepickerNavigationSelect.propDecorators = {
  5188. date: [{ type: Input }],
  5189. disabled: [{ type: Input }],
  5190. months: [{ type: Input }],
  5191. years: [{ type: Input }],
  5192. select: [{ type: Output }],
  5193. monthSelect: [{ type: ViewChild, args: ['month', { static: true, read: ElementRef },] }],
  5194. yearSelect: [{ type: ViewChild, args: ['year', { static: true, read: ElementRef },] }]
  5195. };
  5196. return NgbDatepickerNavigationSelect;
  5197. }());
  5198. /**
  5199. * @fileoverview added by tsickle
  5200. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5201. */
  5202. /**
  5203. * @abstract
  5204. */
  5205. var NgbCalendarHijri = /** @class */ (function (_super) {
  5206. __extends(NgbCalendarHijri, _super);
  5207. function NgbCalendarHijri() {
  5208. return _super !== null && _super.apply(this, arguments) || this;
  5209. }
  5210. /**
  5211. * @return {?}
  5212. */
  5213. NgbCalendarHijri.prototype.getDaysPerWeek = /**
  5214. * @return {?}
  5215. */
  5216. function () { return 7; };
  5217. /**
  5218. * @return {?}
  5219. */
  5220. NgbCalendarHijri.prototype.getMonths = /**
  5221. * @return {?}
  5222. */
  5223. function () { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; };
  5224. /**
  5225. * @return {?}
  5226. */
  5227. NgbCalendarHijri.prototype.getWeeksPerMonth = /**
  5228. * @return {?}
  5229. */
  5230. function () { return 6; };
  5231. /**
  5232. * @param {?} date
  5233. * @param {?=} period
  5234. * @param {?=} number
  5235. * @return {?}
  5236. */
  5237. NgbCalendarHijri.prototype.getNext = /**
  5238. * @param {?} date
  5239. * @param {?=} period
  5240. * @param {?=} number
  5241. * @return {?}
  5242. */
  5243. function (date, period, number) {
  5244. if (period === void 0) { period = 'd'; }
  5245. if (number === void 0) { number = 1; }
  5246. date = new NgbDate(date.year, date.month, date.day);
  5247. switch (period) {
  5248. case 'y':
  5249. date = this._setYear(date, date.year + number);
  5250. date.month = 1;
  5251. date.day = 1;
  5252. return date;
  5253. case 'm':
  5254. date = this._setMonth(date, date.month + number);
  5255. date.day = 1;
  5256. return date;
  5257. case 'd':
  5258. return this._setDay(date, date.day + number);
  5259. default:
  5260. return date;
  5261. }
  5262. };
  5263. /**
  5264. * @param {?} date
  5265. * @param {?=} period
  5266. * @param {?=} number
  5267. * @return {?}
  5268. */
  5269. NgbCalendarHijri.prototype.getPrev = /**
  5270. * @param {?} date
  5271. * @param {?=} period
  5272. * @param {?=} number
  5273. * @return {?}
  5274. */
  5275. function (date, period, number) {
  5276. if (period === void 0) { period = 'd'; }
  5277. if (number === void 0) { number = 1; }
  5278. return this.getNext(date, period, -number);
  5279. };
  5280. /**
  5281. * @param {?} date
  5282. * @return {?}
  5283. */
  5284. NgbCalendarHijri.prototype.getWeekday = /**
  5285. * @param {?} date
  5286. * @return {?}
  5287. */
  5288. function (date) {
  5289. /** @type {?} */
  5290. var day = this.toGregorian(date).getDay();
  5291. // in JS Date Sun=0, in ISO 8601 Sun=7
  5292. return day === 0 ? 7 : day;
  5293. };
  5294. /**
  5295. * @param {?} week
  5296. * @param {?} firstDayOfWeek
  5297. * @return {?}
  5298. */
  5299. NgbCalendarHijri.prototype.getWeekNumber = /**
  5300. * @param {?} week
  5301. * @param {?} firstDayOfWeek
  5302. * @return {?}
  5303. */
  5304. function (week, firstDayOfWeek) {
  5305. // in JS Date Sun=0, in ISO 8601 Sun=7
  5306. if (firstDayOfWeek === 7) {
  5307. firstDayOfWeek = 0;
  5308. }
  5309. /** @type {?} */
  5310. var thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;
  5311. /** @type {?} */
  5312. var date = week[thursdayIndex];
  5313. /** @type {?} */
  5314. var jsDate = this.toGregorian(date);
  5315. jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday
  5316. // Thursday
  5317. /** @type {?} */
  5318. var time = jsDate.getTime();
  5319. /** @type {?} */
  5320. var MuhDate = this.toGregorian(new NgbDate(date.year, 1, 1));
  5321. return Math.floor(Math.round((time - MuhDate.getTime()) / 86400000) / 7) + 1;
  5322. };
  5323. /**
  5324. * @return {?}
  5325. */
  5326. NgbCalendarHijri.prototype.getToday = /**
  5327. * @return {?}
  5328. */
  5329. function () { return this.fromGregorian(new Date()); };
  5330. /**
  5331. * @param {?} date
  5332. * @return {?}
  5333. */
  5334. NgbCalendarHijri.prototype.isValid = /**
  5335. * @param {?} date
  5336. * @return {?}
  5337. */
  5338. function (date) {
  5339. return date && isNumber(date.year) && isNumber(date.month) && isNumber(date.day) &&
  5340. !isNaN(this.toGregorian(date).getTime());
  5341. };
  5342. /**
  5343. * @private
  5344. * @param {?} date
  5345. * @param {?} day
  5346. * @return {?}
  5347. */
  5348. NgbCalendarHijri.prototype._setDay = /**
  5349. * @private
  5350. * @param {?} date
  5351. * @param {?} day
  5352. * @return {?}
  5353. */
  5354. function (date, day) {
  5355. day = +day;
  5356. /** @type {?} */
  5357. var mDays = this.getDaysPerMonth(date.month, date.year);
  5358. if (day <= 0) {
  5359. while (day <= 0) {
  5360. date = this._setMonth(date, date.month - 1);
  5361. mDays = this.getDaysPerMonth(date.month, date.year);
  5362. day += mDays;
  5363. }
  5364. }
  5365. else if (day > mDays) {
  5366. while (day > mDays) {
  5367. day -= mDays;
  5368. date = this._setMonth(date, date.month + 1);
  5369. mDays = this.getDaysPerMonth(date.month, date.year);
  5370. }
  5371. }
  5372. date.day = day;
  5373. return date;
  5374. };
  5375. /**
  5376. * @private
  5377. * @param {?} date
  5378. * @param {?} month
  5379. * @return {?}
  5380. */
  5381. NgbCalendarHijri.prototype._setMonth = /**
  5382. * @private
  5383. * @param {?} date
  5384. * @param {?} month
  5385. * @return {?}
  5386. */
  5387. function (date, month) {
  5388. month = +month;
  5389. date.year = date.year + Math.floor((month - 1) / 12);
  5390. date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;
  5391. return date;
  5392. };
  5393. /**
  5394. * @private
  5395. * @param {?} date
  5396. * @param {?} year
  5397. * @return {?}
  5398. */
  5399. NgbCalendarHijri.prototype._setYear = /**
  5400. * @private
  5401. * @param {?} date
  5402. * @param {?} year
  5403. * @return {?}
  5404. */
  5405. function (date, year) {
  5406. date.year = +year;
  5407. return date;
  5408. };
  5409. NgbCalendarHijri.decorators = [
  5410. { type: Injectable }
  5411. ];
  5412. return NgbCalendarHijri;
  5413. }(NgbCalendar));
  5414. /**
  5415. * @fileoverview added by tsickle
  5416. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5417. */
  5418. /**
  5419. * Checks if islamic year is a leap year
  5420. * @param {?} hYear
  5421. * @return {?}
  5422. */
  5423. function isIslamicLeapYear(hYear) {
  5424. return (14 + 11 * hYear) % 30 < 11;
  5425. }
  5426. /**
  5427. * Checks if gregorian years is a leap year
  5428. * @param {?} gDate
  5429. * @return {?}
  5430. */
  5431. function isGregorianLeapYear(gDate) {
  5432. /** @type {?} */
  5433. var year = gDate.getFullYear();
  5434. return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
  5435. }
  5436. /**
  5437. * Returns the start of Hijri Month.
  5438. * `hMonth` is 0 for Muharram, 1 for Safar, etc.
  5439. * `hYear` is any Hijri hYear.
  5440. * @param {?} hYear
  5441. * @param {?} hMonth
  5442. * @return {?}
  5443. */
  5444. function getIslamicMonthStart(hYear, hMonth) {
  5445. return Math.ceil(29.5 * hMonth) + (hYear - 1) * 354 + Math.floor((3 + 11 * hYear) / 30.0);
  5446. }
  5447. /**
  5448. * Returns the start of Hijri year.
  5449. * `year` is any Hijri year.
  5450. * @param {?} year
  5451. * @return {?}
  5452. */
  5453. function getIslamicYearStart(year) {
  5454. return (year - 1) * 354 + Math.floor((3 + 11 * year) / 30.0);
  5455. }
  5456. /**
  5457. * @param {?} a
  5458. * @param {?} b
  5459. * @return {?}
  5460. */
  5461. function mod(a, b) {
  5462. return a - b * Math.floor(a / b);
  5463. }
  5464. /**
  5465. * The civil calendar is one type of Hijri calendars used in islamic countries.
  5466. * Uses a fixed cycle of alternating 29- and 30-day months,
  5467. * with a leap day added to the last month of 11 out of every 30 years.
  5468. * http://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types
  5469. * All the calculations here are based on the equations from "Calendrical Calculations" By Edward M. Reingold, Nachum
  5470. * Dershowitz.
  5471. * @type {?}
  5472. */
  5473. var GREGORIAN_EPOCH = 1721425.5;
  5474. /** @type {?} */
  5475. var ISLAMIC_EPOCH = 1948439.5;
  5476. var NgbCalendarIslamicCivil = /** @class */ (function (_super) {
  5477. __extends(NgbCalendarIslamicCivil, _super);
  5478. function NgbCalendarIslamicCivil() {
  5479. return _super !== null && _super.apply(this, arguments) || this;
  5480. }
  5481. /**
  5482. * Returns the equivalent islamic(civil) date value for a give input Gregorian date.
  5483. * `gDate` is a JS Date to be converted to Hijri.
  5484. */
  5485. /**
  5486. * Returns the equivalent islamic(civil) date value for a give input Gregorian date.
  5487. * `gDate` is a JS Date to be converted to Hijri.
  5488. * @param {?} gDate
  5489. * @return {?}
  5490. */
  5491. NgbCalendarIslamicCivil.prototype.fromGregorian = /**
  5492. * Returns the equivalent islamic(civil) date value for a give input Gregorian date.
  5493. * `gDate` is a JS Date to be converted to Hijri.
  5494. * @param {?} gDate
  5495. * @return {?}
  5496. */
  5497. function (gDate) {
  5498. /** @type {?} */
  5499. var gYear = gDate.getFullYear();
  5500. /** @type {?} */
  5501. var gMonth = gDate.getMonth();
  5502. /** @type {?} */
  5503. var gDay = gDate.getDate();
  5504. /** @type {?} */
  5505. var julianDay = GREGORIAN_EPOCH - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) +
  5506. -Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +
  5507. Math.floor((367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear(gDate) ? -1 : -2) + gDay);
  5508. julianDay = Math.floor(julianDay) + 0.5;
  5509. /** @type {?} */
  5510. var days = julianDay - ISLAMIC_EPOCH;
  5511. /** @type {?} */
  5512. var hYear = Math.floor((30 * days + 10646) / 10631.0);
  5513. /** @type {?} */
  5514. var hMonth = Math.ceil((days - 29 - getIslamicYearStart(hYear)) / 29.5);
  5515. hMonth = Math.min(hMonth, 11);
  5516. /** @type {?} */
  5517. var hDay = Math.ceil(days - getIslamicMonthStart(hYear, hMonth)) + 1;
  5518. return new NgbDate(hYear, hMonth + 1, hDay);
  5519. };
  5520. /**
  5521. * Returns the equivalent JS date value for a give input islamic(civil) date.
  5522. * `hDate` is an islamic(civil) date to be converted to Gregorian.
  5523. */
  5524. /**
  5525. * Returns the equivalent JS date value for a give input islamic(civil) date.
  5526. * `hDate` is an islamic(civil) date to be converted to Gregorian.
  5527. * @param {?} hDate
  5528. * @return {?}
  5529. */
  5530. NgbCalendarIslamicCivil.prototype.toGregorian = /**
  5531. * Returns the equivalent JS date value for a give input islamic(civil) date.
  5532. * `hDate` is an islamic(civil) date to be converted to Gregorian.
  5533. * @param {?} hDate
  5534. * @return {?}
  5535. */
  5536. function (hDate) {
  5537. /** @type {?} */
  5538. var hYear = hDate.year;
  5539. /** @type {?} */
  5540. var hMonth = hDate.month - 1;
  5541. /** @type {?} */
  5542. var hDay = hDate.day;
  5543. /** @type {?} */
  5544. var julianDay = hDay + Math.ceil(29.5 * hMonth) + (hYear - 1) * 354 + Math.floor((3 + 11 * hYear) / 30) + ISLAMIC_EPOCH - 1;
  5545. /** @type {?} */
  5546. var wjd = Math.floor(julianDay - 0.5) + 0.5;
  5547. /** @type {?} */
  5548. var depoch = wjd - GREGORIAN_EPOCH;
  5549. /** @type {?} */
  5550. var quadricent = Math.floor(depoch / 146097);
  5551. /** @type {?} */
  5552. var dqc = mod(depoch, 146097);
  5553. /** @type {?} */
  5554. var cent = Math.floor(dqc / 36524);
  5555. /** @type {?} */
  5556. var dcent = mod(dqc, 36524);
  5557. /** @type {?} */
  5558. var quad = Math.floor(dcent / 1461);
  5559. /** @type {?} */
  5560. var dquad = mod(dcent, 1461);
  5561. /** @type {?} */
  5562. var yindex = Math.floor(dquad / 365);
  5563. /** @type {?} */
  5564. var year = quadricent * 400 + cent * 100 + quad * 4 + yindex;
  5565. if (!(cent === 4 || yindex === 4)) {
  5566. year++;
  5567. }
  5568. /** @type {?} */
  5569. var gYearStart = GREGORIAN_EPOCH + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +
  5570. Math.floor((year - 1) / 400);
  5571. /** @type {?} */
  5572. var yearday = wjd - gYearStart;
  5573. /** @type {?} */
  5574. var tjd = GREGORIAN_EPOCH - 1 + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +
  5575. Math.floor((year - 1) / 400) + Math.floor(739 / 12 + (isGregorianLeapYear(new Date(year, 3, 1)) ? -1 : -2) + 1);
  5576. /** @type {?} */
  5577. var leapadj = wjd < tjd ? 0 : isGregorianLeapYear(new Date(year, 3, 1)) ? 1 : 2;
  5578. /** @type {?} */
  5579. var month = Math.floor(((yearday + leapadj) * 12 + 373) / 367);
  5580. /** @type {?} */
  5581. var tjd2 = GREGORIAN_EPOCH - 1 + 365 * (year - 1) + Math.floor((year - 1) / 4) - Math.floor((year - 1) / 100) +
  5582. Math.floor((year - 1) / 400) +
  5583. Math.floor((367 * month - 362) / 12 + (month <= 2 ? 0 : isGregorianLeapYear(new Date(year, month - 1, 1)) ? -1 : -2) +
  5584. 1);
  5585. /** @type {?} */
  5586. var day = wjd - tjd2 + 1;
  5587. return new Date(year, month - 1, day);
  5588. };
  5589. /**
  5590. * Returns the number of days in a specific Hijri month.
  5591. * `month` is 1 for Muharram, 2 for Safar, etc.
  5592. * `year` is any Hijri year.
  5593. */
  5594. /**
  5595. * Returns the number of days in a specific Hijri month.
  5596. * `month` is 1 for Muharram, 2 for Safar, etc.
  5597. * `year` is any Hijri year.
  5598. * @param {?} month
  5599. * @param {?} year
  5600. * @return {?}
  5601. */
  5602. NgbCalendarIslamicCivil.prototype.getDaysPerMonth = /**
  5603. * Returns the number of days in a specific Hijri month.
  5604. * `month` is 1 for Muharram, 2 for Safar, etc.
  5605. * `year` is any Hijri year.
  5606. * @param {?} month
  5607. * @param {?} year
  5608. * @return {?}
  5609. */
  5610. function (month, year) {
  5611. year = year + Math.floor(month / 13);
  5612. month = ((month - 1) % 12) + 1;
  5613. /** @type {?} */
  5614. var length = 29 + month % 2;
  5615. if (month === 12 && isIslamicLeapYear(year)) {
  5616. length++;
  5617. }
  5618. return length;
  5619. };
  5620. NgbCalendarIslamicCivil.decorators = [
  5621. { type: Injectable }
  5622. ];
  5623. return NgbCalendarIslamicCivil;
  5624. }(NgbCalendarHijri));
  5625. /**
  5626. * @fileoverview added by tsickle
  5627. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5628. */
  5629. /**
  5630. * Umalqura calendar is one type of Hijri calendars used in islamic countries.
  5631. * This Calendar is used by Saudi Arabia for administrative purpose.
  5632. * Unlike tabular calendars, the algorithm involves astronomical calculation, but it's still deterministic.
  5633. * http://cldr.unicode.org/development/development-process/design-proposals/islamic-calendar-types
  5634. * @type {?}
  5635. */
  5636. var GREGORIAN_FIRST_DATE = new Date(1882, 10, 12);
  5637. /** @type {?} */
  5638. var GREGORIAN_LAST_DATE = new Date(2174, 10, 25);
  5639. /** @type {?} */
  5640. var HIJRI_BEGIN = 1300;
  5641. /** @type {?} */
  5642. var HIJRI_END = 1600;
  5643. /** @type {?} */
  5644. var ONE_DAY = 1000 * 60 * 60 * 24;
  5645. /** @type {?} */
  5646. var MONTH_LENGTH = [
  5647. // 1300-1304
  5648. '101010101010', '110101010100', '111011001001', '011011010100', '011011101010',
  5649. // 1305-1309
  5650. '001101101100', '101010101101', '010101010101', '011010101001', '011110010010',
  5651. // 1310-1314
  5652. '101110101001', '010111010100', '101011011010', '010101011100', '110100101101',
  5653. // 1315-1319
  5654. '011010010101', '011101001010', '101101010100', '101101101010', '010110101101',
  5655. // 1320-1324
  5656. '010010101110', '101001001111', '010100010111', '011010001011', '011010100101',
  5657. // 1325-1329
  5658. '101011010101', '001011010110', '100101011011', '010010011101', '101001001101',
  5659. // 1330-1334
  5660. '110100100110', '110110010101', '010110101100', '100110110110', '001010111010',
  5661. // 1335-1339
  5662. '101001011011', '010100101011', '101010010101', '011011001010', '101011101001',
  5663. // 1340-1344
  5664. '001011110100', '100101110110', '001010110110', '100101010110', '101011001010',
  5665. // 1345-1349
  5666. '101110100100', '101111010010', '010111011001', '001011011100', '100101101101',
  5667. // 1350-1354
  5668. '010101001101', '101010100101', '101101010010', '101110100101', '010110110100',
  5669. // 1355-1359
  5670. '100110110110', '010101010111', '001010010111', '010101001011', '011010100011',
  5671. // 1360-1364
  5672. '011101010010', '101101100101', '010101101010', '101010101011', '010100101011',
  5673. // 1365-1369
  5674. '110010010101', '110101001010', '110110100101', '010111001010', '101011010110',
  5675. // 1370-1374
  5676. '100101010111', '010010101011', '100101001011', '101010100101', '101101010010',
  5677. // 1375-1379
  5678. '101101101010', '010101110101', '001001110110', '100010110111', '010001011011',
  5679. // 1380-1384
  5680. '010101010101', '010110101001', '010110110100', '100111011010', '010011011101',
  5681. // 1385-1389
  5682. '001001101110', '100100110110', '101010101010', '110101010100', '110110110010',
  5683. // 1390-1394
  5684. '010111010101', '001011011010', '100101011011', '010010101011', '101001010101',
  5685. // 1395-1399
  5686. '101101001001', '101101100100', '101101110001', '010110110100', '101010110101',
  5687. // 1400-1404
  5688. '101001010101', '110100100101', '111010010010', '111011001001', '011011010100',
  5689. // 1405-1409
  5690. '101011101001', '100101101011', '010010101011', '101010010011', '110101001001',
  5691. // 1410-1414
  5692. '110110100100', '110110110010', '101010111001', '010010111010', '101001011011',
  5693. // 1415-1419
  5694. '010100101011', '101010010101', '101100101010', '101101010101', '010101011100',
  5695. // 1420-1424
  5696. '010010111101', '001000111101', '100100011101', '101010010101', '101101001010',
  5697. // 1425-1429
  5698. '101101011010', '010101101101', '001010110110', '100100111011', '010010011011',
  5699. // 1430-1434
  5700. '011001010101', '011010101001', '011101010100', '101101101010', '010101101100',
  5701. // 1435-1439
  5702. '101010101101', '010101010101', '101100101001', '101110010010', '101110101001',
  5703. // 1440-1444
  5704. '010111010100', '101011011010', '010101011010', '101010101011', '010110010101',
  5705. // 1445-1449
  5706. '011101001001', '011101100100', '101110101010', '010110110101', '001010110110',
  5707. // 1450-1454
  5708. '101001010110', '111001001101', '101100100101', '101101010010', '101101101010',
  5709. // 1455-1459
  5710. '010110101101', '001010101110', '100100101111', '010010010111', '011001001011',
  5711. // 1460-1464
  5712. '011010100101', '011010101100', '101011010110', '010101011101', '010010011101',
  5713. // 1465-1469
  5714. '101001001101', '110100010110', '110110010101', '010110101010', '010110110101',
  5715. // 1470-1474
  5716. '001011011010', '100101011011', '010010101101', '010110010101', '011011001010',
  5717. // 1475-1479
  5718. '011011100100', '101011101010', '010011110101', '001010110110', '100101010110',
  5719. // 1480-1484
  5720. '101010101010', '101101010100', '101111010010', '010111011001', '001011101010',
  5721. // 1485-1489
  5722. '100101101101', '010010101101', '101010010101', '101101001010', '101110100101',
  5723. // 1490-1494
  5724. '010110110010', '100110110101', '010011010110', '101010010111', '010101000111',
  5725. // 1495-1499
  5726. '011010010011', '011101001001', '101101010101', '010101101010', '101001101011',
  5727. // 1500-1504
  5728. '010100101011', '101010001011', '110101000110', '110110100011', '010111001010',
  5729. // 1505-1509
  5730. '101011010110', '010011011011', '001001101011', '100101001011', '101010100101',
  5731. // 1510-1514
  5732. '101101010010', '101101101001', '010101110101', '000101110110', '100010110111',
  5733. // 1515-1519
  5734. '001001011011', '010100101011', '010101100101', '010110110100', '100111011010',
  5735. // 1520-1524
  5736. '010011101101', '000101101101', '100010110110', '101010100110', '110101010010',
  5737. // 1525-1529
  5738. '110110101001', '010111010100', '101011011010', '100101011011', '010010101011',
  5739. // 1530-1534
  5740. '011001010011', '011100101001', '011101100010', '101110101001', '010110110010',
  5741. // 1535-1539
  5742. '101010110101', '010101010101', '101100100101', '110110010010', '111011001001',
  5743. // 1540-1544
  5744. '011011010010', '101011101001', '010101101011', '010010101011', '101001010101',
  5745. // 1545-1549
  5746. '110100101001', '110101010100', '110110101010', '100110110101', '010010111010',
  5747. // 1550-1554
  5748. '101000111011', '010010011011', '101001001101', '101010101010', '101011010101',
  5749. // 1555-1559
  5750. '001011011010', '100101011101', '010001011110', '101000101110', '110010011010',
  5751. // 1560-1564
  5752. '110101010101', '011010110010', '011010111001', '010010111010', '101001011101',
  5753. // 1565-1569
  5754. '010100101101', '101010010101', '101101010010', '101110101000', '101110110100',
  5755. // 1570-1574
  5756. '010110111001', '001011011010', '100101011010', '101101001010', '110110100100',
  5757. // 1575-1579
  5758. '111011010001', '011011101000', '101101101010', '010101101101', '010100110101',
  5759. // 1580-1584
  5760. '011010010101', '110101001010', '110110101000', '110111010100', '011011011010',
  5761. // 1585-1589
  5762. '010101011011', '001010011101', '011000101011', '101100010101', '101101001010',
  5763. // 1590-1594
  5764. '101110010101', '010110101010', '101010101110', '100100101110', '110010001111',
  5765. // 1595-1599
  5766. '010100100111', '011010010101', '011010101010', '101011010110', '010101011101',
  5767. // 1600
  5768. '001010011101'
  5769. ];
  5770. /**
  5771. * @param {?} date1
  5772. * @param {?} date2
  5773. * @return {?}
  5774. */
  5775. function getDaysDiff(date1, date2) {
  5776. // Ignores the time part in date1 and date2:
  5777. /** @type {?} */
  5778. var time1 = Date.UTC(date1.getFullYear(), date1.getMonth(), date1.getDate());
  5779. /** @type {?} */
  5780. var time2 = Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate());
  5781. /** @type {?} */
  5782. var diff = Math.abs(time1 - time2);
  5783. return Math.round(diff / ONE_DAY);
  5784. }
  5785. var NgbCalendarIslamicUmalqura = /** @class */ (function (_super) {
  5786. __extends(NgbCalendarIslamicUmalqura, _super);
  5787. function NgbCalendarIslamicUmalqura() {
  5788. return _super !== null && _super.apply(this, arguments) || this;
  5789. }
  5790. /**
  5791. * Returns the equivalent islamic(Umalqura) date value for a give input Gregorian date.
  5792. * `gdate` is s JS Date to be converted to Hijri.
  5793. */
  5794. /**
  5795. * Returns the equivalent islamic(Umalqura) date value for a give input Gregorian date.
  5796. * `gdate` is s JS Date to be converted to Hijri.
  5797. * @param {?} gDate
  5798. * @return {?}
  5799. */
  5800. NgbCalendarIslamicUmalqura.prototype.fromGregorian = /**
  5801. * Returns the equivalent islamic(Umalqura) date value for a give input Gregorian date.
  5802. * `gdate` is s JS Date to be converted to Hijri.
  5803. * @param {?} gDate
  5804. * @return {?}
  5805. */
  5806. function (gDate) {
  5807. /** @type {?} */
  5808. var hDay = 1;
  5809. /** @type {?} */
  5810. var hMonth = 0;
  5811. /** @type {?} */
  5812. var hYear = 1300;
  5813. /** @type {?} */
  5814. var daysDiff = getDaysDiff(gDate, GREGORIAN_FIRST_DATE);
  5815. if (gDate.getTime() - GREGORIAN_FIRST_DATE.getTime() >= 0 && gDate.getTime() - GREGORIAN_LAST_DATE.getTime() <= 0) {
  5816. /** @type {?} */
  5817. var year = 1300;
  5818. for (var i = 0; i < MONTH_LENGTH.length; i++, year++) {
  5819. for (var j = 0; j < 12; j++) {
  5820. /** @type {?} */
  5821. var numOfDays = +MONTH_LENGTH[i][j] + 29;
  5822. if (daysDiff <= numOfDays) {
  5823. hDay = daysDiff + 1;
  5824. if (hDay > numOfDays) {
  5825. hDay = 1;
  5826. j++;
  5827. }
  5828. if (j > 11) {
  5829. j = 0;
  5830. year++;
  5831. }
  5832. hMonth = j;
  5833. hYear = year;
  5834. return new NgbDate(hYear, hMonth + 1, hDay);
  5835. }
  5836. daysDiff = daysDiff - numOfDays;
  5837. }
  5838. }
  5839. }
  5840. else {
  5841. return _super.prototype.fromGregorian.call(this, gDate);
  5842. }
  5843. };
  5844. /**
  5845. * Converts the current Hijri date to Gregorian.
  5846. */
  5847. /**
  5848. * Converts the current Hijri date to Gregorian.
  5849. * @param {?} hDate
  5850. * @return {?}
  5851. */
  5852. NgbCalendarIslamicUmalqura.prototype.toGregorian = /**
  5853. * Converts the current Hijri date to Gregorian.
  5854. * @param {?} hDate
  5855. * @return {?}
  5856. */
  5857. function (hDate) {
  5858. /** @type {?} */
  5859. var hYear = hDate.year;
  5860. /** @type {?} */
  5861. var hMonth = hDate.month - 1;
  5862. /** @type {?} */
  5863. var hDay = hDate.day;
  5864. /** @type {?} */
  5865. var gDate = new Date(GREGORIAN_FIRST_DATE);
  5866. /** @type {?} */
  5867. var dayDiff = hDay - 1;
  5868. if (hYear >= HIJRI_BEGIN && hYear <= HIJRI_END) {
  5869. for (var y = 0; y < hYear - HIJRI_BEGIN; y++) {
  5870. for (var m = 0; m < 12; m++) {
  5871. dayDiff += +MONTH_LENGTH[y][m] + 29;
  5872. }
  5873. }
  5874. for (var m = 0; m < hMonth; m++) {
  5875. dayDiff += +MONTH_LENGTH[hYear - HIJRI_BEGIN][m] + 29;
  5876. }
  5877. gDate.setDate(GREGORIAN_FIRST_DATE.getDate() + dayDiff);
  5878. }
  5879. else {
  5880. gDate = _super.prototype.toGregorian.call(this, hDate);
  5881. }
  5882. return gDate;
  5883. };
  5884. /**
  5885. * Returns the number of days in a specific Hijri hMonth.
  5886. * `hMonth` is 1 for Muharram, 2 for Safar, etc.
  5887. * `hYear` is any Hijri hYear.
  5888. */
  5889. /**
  5890. * Returns the number of days in a specific Hijri hMonth.
  5891. * `hMonth` is 1 for Muharram, 2 for Safar, etc.
  5892. * `hYear` is any Hijri hYear.
  5893. * @param {?} hMonth
  5894. * @param {?} hYear
  5895. * @return {?}
  5896. */
  5897. NgbCalendarIslamicUmalqura.prototype.getDaysPerMonth = /**
  5898. * Returns the number of days in a specific Hijri hMonth.
  5899. * `hMonth` is 1 for Muharram, 2 for Safar, etc.
  5900. * `hYear` is any Hijri hYear.
  5901. * @param {?} hMonth
  5902. * @param {?} hYear
  5903. * @return {?}
  5904. */
  5905. function (hMonth, hYear) {
  5906. if (hYear >= HIJRI_BEGIN && hYear <= HIJRI_END) {
  5907. /** @type {?} */
  5908. var pos = hYear - HIJRI_BEGIN;
  5909. return +MONTH_LENGTH[pos][hMonth - 1] + 29;
  5910. }
  5911. return _super.prototype.getDaysPerMonth.call(this, hMonth, hYear);
  5912. };
  5913. NgbCalendarIslamicUmalqura.decorators = [
  5914. { type: Injectable }
  5915. ];
  5916. return NgbCalendarIslamicUmalqura;
  5917. }(NgbCalendarIslamicCivil));
  5918. /**
  5919. * @fileoverview added by tsickle
  5920. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5921. */
  5922. /**
  5923. * Returns the equivalent JS date value for a give input Jalali date.
  5924. * `jalaliDate` is an Jalali date to be converted to Gregorian.
  5925. * @param {?} jalaliDate
  5926. * @return {?}
  5927. */
  5928. function toGregorian(jalaliDate) {
  5929. /** @type {?} */
  5930. var jdn = jalaliToJulian(jalaliDate.year, jalaliDate.month, jalaliDate.day);
  5931. /** @type {?} */
  5932. var date = julianToGregorian(jdn);
  5933. date.setHours(6, 30, 3, 200);
  5934. return date;
  5935. }
  5936. /**
  5937. * Returns the equivalent jalali date value for a give input Gregorian date.
  5938. * `gdate` is a JS Date to be converted to jalali.
  5939. * utc to local
  5940. * @param {?} gdate
  5941. * @return {?}
  5942. */
  5943. function fromGregorian(gdate) {
  5944. /** @type {?} */
  5945. var g2d = gregorianToJulian(gdate.getFullYear(), gdate.getMonth() + 1, gdate.getDate());
  5946. return julianToJalali(g2d);
  5947. }
  5948. /**
  5949. * @param {?} date
  5950. * @param {?} yearValue
  5951. * @return {?}
  5952. */
  5953. function setJalaliYear(date, yearValue) {
  5954. date.year = +yearValue;
  5955. return date;
  5956. }
  5957. /**
  5958. * @param {?} date
  5959. * @param {?} month
  5960. * @return {?}
  5961. */
  5962. function setJalaliMonth(date, month) {
  5963. month = +month;
  5964. date.year = date.year + Math.floor((month - 1) / 12);
  5965. date.month = Math.floor(((month - 1) % 12 + 12) % 12) + 1;
  5966. return date;
  5967. }
  5968. /**
  5969. * @param {?} date
  5970. * @param {?} day
  5971. * @return {?}
  5972. */
  5973. function setJalaliDay(date, day) {
  5974. /** @type {?} */
  5975. var mDays = getDaysPerMonth(date.month, date.year);
  5976. if (day <= 0) {
  5977. while (day <= 0) {
  5978. date = setJalaliMonth(date, date.month - 1);
  5979. mDays = getDaysPerMonth(date.month, date.year);
  5980. day += mDays;
  5981. }
  5982. }
  5983. else if (day > mDays) {
  5984. while (day > mDays) {
  5985. day -= mDays;
  5986. date = setJalaliMonth(date, date.month + 1);
  5987. mDays = getDaysPerMonth(date.month, date.year);
  5988. }
  5989. }
  5990. date.day = day;
  5991. return date;
  5992. }
  5993. /**
  5994. * @param {?} a
  5995. * @param {?} b
  5996. * @return {?}
  5997. */
  5998. function mod$1(a, b) {
  5999. return a - b * Math.floor(a / b);
  6000. }
  6001. /**
  6002. * @param {?} a
  6003. * @param {?} b
  6004. * @return {?}
  6005. */
  6006. function div(a, b) {
  6007. return Math.trunc(a / b);
  6008. }
  6009. /*
  6010. This function determines if the Jalali (Persian) year is
  6011. leap (366-day long) or is the common year (365 days), and
  6012. finds the day in March (Gregorian calendar) of the first
  6013. day of the Jalali year (jalaliYear).
  6014. @param jalaliYear Jalali calendar year (-61 to 3177)
  6015. @return
  6016. leap: number of years since the last leap year (0 to 4)
  6017. gYear: Gregorian year of the beginning of Jalali year
  6018. march: the March day of Farvardin the 1st (1st day of jalaliYear)
  6019. @see: http://www.astro.uni.torun.pl/~kb/Papers/EMP/PersianC-EMP.htm
  6020. @see: http://www.fourmilab.ch/documents/calendar/
  6021. */
  6022. /**
  6023. * @param {?} jalaliYear
  6024. * @return {?}
  6025. */
  6026. function jalCal(jalaliYear) {
  6027. // Jalali years starting the 33-year rule.
  6028. /** @type {?} */
  6029. var breaks = [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178];
  6030. /** @type {?} */
  6031. var breaksLength = breaks.length;
  6032. /** @type {?} */
  6033. var gYear = jalaliYear + 621;
  6034. /** @type {?} */
  6035. var leapJ = -14;
  6036. /** @type {?} */
  6037. var jp = breaks[0];
  6038. if (jalaliYear < jp || jalaliYear >= breaks[breaksLength - 1]) {
  6039. throw new Error('Invalid Jalali year ' + jalaliYear);
  6040. }
  6041. // Find the limiting years for the Jalali year jalaliYear.
  6042. /** @type {?} */
  6043. var jump;
  6044. for (var i = 1; i < breaksLength; i += 1) {
  6045. /** @type {?} */
  6046. var jm = breaks[i];
  6047. jump = jm - jp;
  6048. if (jalaliYear < jm) {
  6049. break;
  6050. }
  6051. leapJ = leapJ + div(jump, 33) * 8 + div(mod$1(jump, 33), 4);
  6052. jp = jm;
  6053. }
  6054. /** @type {?} */
  6055. var n = jalaliYear - jp;
  6056. // Find the number of leap years from AD 621 to the beginning
  6057. // of the current Jalali year in the Persian calendar.
  6058. leapJ = leapJ + div(n, 33) * 8 + div(mod$1(n, 33) + 3, 4);
  6059. if (mod$1(jump, 33) === 4 && jump - n === 4) {
  6060. leapJ += 1;
  6061. }
  6062. // And the same in the Gregorian calendar (until the year gYear).
  6063. /** @type {?} */
  6064. var leapG = div(gYear, 4) - div((div(gYear, 100) + 1) * 3, 4) - 150;
  6065. // Determine the Gregorian date of Farvardin the 1st.
  6066. /** @type {?} */
  6067. var march = 20 + leapJ - leapG;
  6068. // Find how many years have passed since the last leap year.
  6069. if (jump - n < 6) {
  6070. n = n - jump + div(jump + 4, 33) * 33;
  6071. }
  6072. /** @type {?} */
  6073. var leap = mod$1(mod$1(n + 1, 33) - 1, 4);
  6074. if (leap === -1) {
  6075. leap = 4;
  6076. }
  6077. return { leap: leap, gy: gYear, march: march };
  6078. }
  6079. /*
  6080. Calculates Gregorian and Julian calendar dates from the Julian Day number
  6081. (jdn) for the period since jdn=-34839655 (i.e. the year -100100 of both
  6082. calendars) to some millions years ahead of the present.
  6083. @param jdn Julian Day number
  6084. @return
  6085. gYear: Calendar year (years BC numbered 0, -1, -2, ...)
  6086. gMonth: Calendar month (1 to 12)
  6087. gDay: Calendar day of the month M (1 to 28/29/30/31)
  6088. */
  6089. /**
  6090. * @param {?} julianDayNumber
  6091. * @return {?}
  6092. */
  6093. function julianToGregorian(julianDayNumber) {
  6094. /** @type {?} */
  6095. var j = 4 * julianDayNumber + 139361631;
  6096. j = j + div(div(4 * julianDayNumber + 183187720, 146097) * 3, 4) * 4 - 3908;
  6097. /** @type {?} */
  6098. var i = div(mod$1(j, 1461), 4) * 5 + 308;
  6099. /** @type {?} */
  6100. var gDay = div(mod$1(i, 153), 5) + 1;
  6101. /** @type {?} */
  6102. var gMonth = mod$1(div(i, 153), 12) + 1;
  6103. /** @type {?} */
  6104. var gYear = div(j, 1461) - 100100 + div(8 - gMonth, 6);
  6105. return new Date(gYear, gMonth - 1, gDay);
  6106. }
  6107. /*
  6108. Converts a date of the Jalali calendar to the Julian Day number.
  6109. @param jy Jalali year (1 to 3100)
  6110. @param jm Jalali month (1 to 12)
  6111. @param jd Jalali day (1 to 29/31)
  6112. @return Julian Day number
  6113. */
  6114. /**
  6115. * @param {?} gy
  6116. * @param {?} gm
  6117. * @param {?} gd
  6118. * @return {?}
  6119. */
  6120. function gregorianToJulian(gy, gm, gd) {
  6121. /** @type {?} */
  6122. var d = div((gy + div(gm - 8, 6) + 100100) * 1461, 4) + div(153 * mod$1(gm + 9, 12) + 2, 5) + gd - 34840408;
  6123. d = d - div(div(gy + 100100 + div(gm - 8, 6), 100) * 3, 4) + 752;
  6124. return d;
  6125. }
  6126. /*
  6127. Converts the Julian Day number to a date in the Jalali calendar.
  6128. @param julianDayNumber Julian Day number
  6129. @return
  6130. jalaliYear: Jalali year (1 to 3100)
  6131. jalaliMonth: Jalali month (1 to 12)
  6132. jalaliDay: Jalali day (1 to 29/31)
  6133. */
  6134. /**
  6135. * @param {?} julianDayNumber
  6136. * @return {?}
  6137. */
  6138. function julianToJalali(julianDayNumber) {
  6139. /** @type {?} */
  6140. var gy = julianToGregorian(julianDayNumber).getFullYear() // Calculate Gregorian year (gy).
  6141. ;
  6142. /** @type {?} */
  6143. var jalaliYear = gy - 621;
  6144. /** @type {?} */
  6145. var r = jalCal(jalaliYear);
  6146. /** @type {?} */
  6147. var gregorianDay = gregorianToJulian(gy, 3, r.march);
  6148. /** @type {?} */
  6149. var jalaliDay;
  6150. /** @type {?} */
  6151. var jalaliMonth;
  6152. /** @type {?} */
  6153. var numberOfDays;
  6154. // Find number of days that passed since 1 Farvardin.
  6155. numberOfDays = julianDayNumber - gregorianDay;
  6156. if (numberOfDays >= 0) {
  6157. if (numberOfDays <= 185) {
  6158. // The first 6 months.
  6159. jalaliMonth = 1 + div(numberOfDays, 31);
  6160. jalaliDay = mod$1(numberOfDays, 31) + 1;
  6161. return new NgbDate(jalaliYear, jalaliMonth, jalaliDay);
  6162. }
  6163. else {
  6164. // The remaining months.
  6165. numberOfDays -= 186;
  6166. }
  6167. }
  6168. else {
  6169. // Previous Jalali year.
  6170. jalaliYear -= 1;
  6171. numberOfDays += 179;
  6172. if (r.leap === 1) {
  6173. numberOfDays += 1;
  6174. }
  6175. }
  6176. jalaliMonth = 7 + div(numberOfDays, 30);
  6177. jalaliDay = mod$1(numberOfDays, 30) + 1;
  6178. return new NgbDate(jalaliYear, jalaliMonth, jalaliDay);
  6179. }
  6180. /*
  6181. Converts a date of the Jalali calendar to the Julian Day number.
  6182. @param jYear Jalali year (1 to 3100)
  6183. @param jMonth Jalali month (1 to 12)
  6184. @param jDay Jalali day (1 to 29/31)
  6185. @return Julian Day number
  6186. */
  6187. /**
  6188. * @param {?} jYear
  6189. * @param {?} jMonth
  6190. * @param {?} jDay
  6191. * @return {?}
  6192. */
  6193. function jalaliToJulian(jYear, jMonth, jDay) {
  6194. /** @type {?} */
  6195. var r = jalCal(jYear);
  6196. return gregorianToJulian(r.gy, 3, r.march) + (jMonth - 1) * 31 - div(jMonth, 7) * (jMonth - 7) + jDay - 1;
  6197. }
  6198. /**
  6199. * Returns the number of days in a specific jalali month.
  6200. * @param {?} month
  6201. * @param {?} year
  6202. * @return {?}
  6203. */
  6204. function getDaysPerMonth(month, year) {
  6205. if (month <= 6) {
  6206. return 31;
  6207. }
  6208. if (month <= 11) {
  6209. return 30;
  6210. }
  6211. if (jalCal(year).leap === 0) {
  6212. return 30;
  6213. }
  6214. return 29;
  6215. }
  6216. /**
  6217. * @fileoverview added by tsickle
  6218. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6219. */
  6220. var NgbCalendarPersian = /** @class */ (function (_super) {
  6221. __extends(NgbCalendarPersian, _super);
  6222. function NgbCalendarPersian() {
  6223. return _super !== null && _super.apply(this, arguments) || this;
  6224. }
  6225. /**
  6226. * @return {?}
  6227. */
  6228. NgbCalendarPersian.prototype.getDaysPerWeek = /**
  6229. * @return {?}
  6230. */
  6231. function () { return 7; };
  6232. /**
  6233. * @return {?}
  6234. */
  6235. NgbCalendarPersian.prototype.getMonths = /**
  6236. * @return {?}
  6237. */
  6238. function () { return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; };
  6239. /**
  6240. * @return {?}
  6241. */
  6242. NgbCalendarPersian.prototype.getWeeksPerMonth = /**
  6243. * @return {?}
  6244. */
  6245. function () { return 6; };
  6246. /**
  6247. * @param {?} date
  6248. * @param {?=} period
  6249. * @param {?=} number
  6250. * @return {?}
  6251. */
  6252. NgbCalendarPersian.prototype.getNext = /**
  6253. * @param {?} date
  6254. * @param {?=} period
  6255. * @param {?=} number
  6256. * @return {?}
  6257. */
  6258. function (date, period, number) {
  6259. if (period === void 0) { period = 'd'; }
  6260. if (number === void 0) { number = 1; }
  6261. date = new NgbDate(date.year, date.month, date.day);
  6262. switch (period) {
  6263. case 'y':
  6264. date = setJalaliYear(date, date.year + number);
  6265. date.month = 1;
  6266. date.day = 1;
  6267. return date;
  6268. case 'm':
  6269. date = setJalaliMonth(date, date.month + number);
  6270. date.day = 1;
  6271. return date;
  6272. case 'd':
  6273. return setJalaliDay(date, date.day + number);
  6274. default:
  6275. return date;
  6276. }
  6277. };
  6278. /**
  6279. * @param {?} date
  6280. * @param {?=} period
  6281. * @param {?=} number
  6282. * @return {?}
  6283. */
  6284. NgbCalendarPersian.prototype.getPrev = /**
  6285. * @param {?} date
  6286. * @param {?=} period
  6287. * @param {?=} number
  6288. * @return {?}
  6289. */
  6290. function (date, period, number) {
  6291. if (period === void 0) { period = 'd'; }
  6292. if (number === void 0) { number = 1; }
  6293. return this.getNext(date, period, -number);
  6294. };
  6295. /**
  6296. * @param {?} date
  6297. * @return {?}
  6298. */
  6299. NgbCalendarPersian.prototype.getWeekday = /**
  6300. * @param {?} date
  6301. * @return {?}
  6302. */
  6303. function (date) {
  6304. /** @type {?} */
  6305. var day = toGregorian(date).getDay();
  6306. // in JS Date Sun=0, in ISO 8601 Sun=7
  6307. return day === 0 ? 7 : day;
  6308. };
  6309. /**
  6310. * @param {?} week
  6311. * @param {?} firstDayOfWeek
  6312. * @return {?}
  6313. */
  6314. NgbCalendarPersian.prototype.getWeekNumber = /**
  6315. * @param {?} week
  6316. * @param {?} firstDayOfWeek
  6317. * @return {?}
  6318. */
  6319. function (week, firstDayOfWeek) {
  6320. // in JS Date Sun=0, in ISO 8601 Sun=7
  6321. if (firstDayOfWeek === 7) {
  6322. firstDayOfWeek = 0;
  6323. }
  6324. /** @type {?} */
  6325. var thursdayIndex = (4 + 7 - firstDayOfWeek) % 7;
  6326. /** @type {?} */
  6327. var date = week[thursdayIndex];
  6328. /** @type {?} */
  6329. var jsDate = toGregorian(date);
  6330. jsDate.setDate(jsDate.getDate() + 4 - (jsDate.getDay() || 7)); // Thursday
  6331. // Thursday
  6332. /** @type {?} */
  6333. var time = jsDate.getTime();
  6334. /** @type {?} */
  6335. var startDate = toGregorian(new NgbDate(date.year, 1, 1));
  6336. return Math.floor(Math.round((time - startDate.getTime()) / 86400000) / 7) + 1;
  6337. };
  6338. /**
  6339. * @return {?}
  6340. */
  6341. NgbCalendarPersian.prototype.getToday = /**
  6342. * @return {?}
  6343. */
  6344. function () { return fromGregorian(new Date()); };
  6345. /**
  6346. * @param {?} date
  6347. * @return {?}
  6348. */
  6349. NgbCalendarPersian.prototype.isValid = /**
  6350. * @param {?} date
  6351. * @return {?}
  6352. */
  6353. function (date) {
  6354. return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) &&
  6355. !isNaN(toGregorian(date).getTime());
  6356. };
  6357. NgbCalendarPersian.decorators = [
  6358. { type: Injectable }
  6359. ];
  6360. return NgbCalendarPersian;
  6361. }(NgbCalendar));
  6362. /**
  6363. * @fileoverview added by tsickle
  6364. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6365. */
  6366. /** @type {?} */
  6367. var PARTS_PER_HOUR = 1080;
  6368. /** @type {?} */
  6369. var PARTS_PER_DAY = 24 * PARTS_PER_HOUR;
  6370. /** @type {?} */
  6371. var PARTS_FRACTIONAL_MONTH = 12 * PARTS_PER_HOUR + 793;
  6372. /** @type {?} */
  6373. var PARTS_PER_MONTH = 29 * PARTS_PER_DAY + PARTS_FRACTIONAL_MONTH;
  6374. /** @type {?} */
  6375. var BAHARAD = 11 * PARTS_PER_HOUR + 204;
  6376. /** @type {?} */
  6377. var HEBREW_DAY_ON_JAN_1_1970 = 2092591;
  6378. /** @type {?} */
  6379. var GREGORIAN_EPOCH$1 = 1721425.5;
  6380. /**
  6381. * @param {?} year
  6382. * @return {?}
  6383. */
  6384. function isGregorianLeapYear$1(year) {
  6385. return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
  6386. }
  6387. /**
  6388. * @param {?} year
  6389. * @return {?}
  6390. */
  6391. function numberOfFirstDayInYear(year) {
  6392. /** @type {?} */
  6393. var monthsBeforeYear = Math.floor((235 * year - 234) / 19);
  6394. /** @type {?} */
  6395. var fractionalMonthsBeforeYear = monthsBeforeYear * PARTS_FRACTIONAL_MONTH + BAHARAD;
  6396. /** @type {?} */
  6397. var dayNumber = monthsBeforeYear * 29 + Math.floor(fractionalMonthsBeforeYear / PARTS_PER_DAY);
  6398. /** @type {?} */
  6399. var timeOfDay = fractionalMonthsBeforeYear % PARTS_PER_DAY;
  6400. /** @type {?} */
  6401. var dayOfWeek = dayNumber % 7;
  6402. if (dayOfWeek === 2 || dayOfWeek === 4 || dayOfWeek === 6) {
  6403. dayNumber++;
  6404. dayOfWeek = dayNumber % 7;
  6405. }
  6406. if (dayOfWeek === 1 && timeOfDay > 15 * PARTS_PER_HOUR + 204 && !isHebrewLeapYear(year)) {
  6407. dayNumber += 2;
  6408. }
  6409. else if (dayOfWeek === 0 && timeOfDay > 21 * PARTS_PER_HOUR + 589 && isHebrewLeapYear(year - 1)) {
  6410. dayNumber++;
  6411. }
  6412. return dayNumber;
  6413. }
  6414. /**
  6415. * @param {?} month
  6416. * @param {?} year
  6417. * @return {?}
  6418. */
  6419. function getDaysInGregorianMonth(month, year) {
  6420. /** @type {?} */
  6421. var days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
  6422. if (isGregorianLeapYear$1(year)) {
  6423. days[1]++;
  6424. }
  6425. return days[month - 1];
  6426. }
  6427. /**
  6428. * @param {?} year
  6429. * @return {?}
  6430. */
  6431. function getHebrewMonths(year) {
  6432. return isHebrewLeapYear(year) ? 13 : 12;
  6433. }
  6434. /**
  6435. * Returns the number of days in a specific Hebrew year.
  6436. * `year` is any Hebrew year.
  6437. * @param {?} year
  6438. * @return {?}
  6439. */
  6440. function getDaysInHebrewYear(year) {
  6441. return numberOfFirstDayInYear(year + 1) - numberOfFirstDayInYear(year);
  6442. }
  6443. /**
  6444. * @param {?} year
  6445. * @return {?}
  6446. */
  6447. function isHebrewLeapYear(year) {
  6448. /** @type {?} */
  6449. var b = (year * 12 + 17) % 19;
  6450. return b >= ((b < 0) ? -7 : 12);
  6451. }
  6452. /**
  6453. * Returns the number of days in a specific Hebrew month.
  6454. * `month` is 1 for Nisan, 2 for Iyar etc. Note: Hebrew leap year contains 13 months.
  6455. * `year` is any Hebrew year.
  6456. * @param {?} month
  6457. * @param {?} year
  6458. * @return {?}
  6459. */
  6460. function getDaysInHebrewMonth(month, year) {
  6461. /** @type {?} */
  6462. var yearLength = numberOfFirstDayInYear(year + 1) - numberOfFirstDayInYear(year);
  6463. /** @type {?} */
  6464. var yearType = (yearLength <= 380 ? yearLength : (yearLength - 30)) - 353;
  6465. /** @type {?} */
  6466. var leapYear = isHebrewLeapYear(year);
  6467. /** @type {?} */
  6468. var daysInMonth = leapYear ? [30, 29, 29, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29] :
  6469. [30, 29, 29, 29, 30, 29, 30, 29, 30, 29, 30, 29];
  6470. if (yearType > 0) {
  6471. daysInMonth[2]++; // Kislev gets an extra day in normal or complete years.
  6472. }
  6473. if (yearType > 1) {
  6474. daysInMonth[1]++; // Heshvan gets an extra day in complete years only.
  6475. }
  6476. return daysInMonth[month - 1];
  6477. }
  6478. /**
  6479. * @param {?} date
  6480. * @return {?}
  6481. */
  6482. function getDayNumberInHebrewYear(date) {
  6483. /** @type {?} */
  6484. var numberOfDay = 0;
  6485. for (var i = 1; i < date.month; i++) {
  6486. numberOfDay += getDaysInHebrewMonth(i, date.year);
  6487. }
  6488. return numberOfDay + date.day;
  6489. }
  6490. /**
  6491. * @param {?} date
  6492. * @param {?} val
  6493. * @return {?}
  6494. */
  6495. function setHebrewMonth(date, val) {
  6496. /** @type {?} */
  6497. var after = val >= 0;
  6498. if (!after) {
  6499. val = -val;
  6500. }
  6501. while (val > 0) {
  6502. if (after) {
  6503. if (val > getHebrewMonths(date.year) - date.month) {
  6504. val -= getHebrewMonths(date.year) - date.month + 1;
  6505. date.year++;
  6506. date.month = 1;
  6507. }
  6508. else {
  6509. date.month += val;
  6510. val = 0;
  6511. }
  6512. }
  6513. else {
  6514. if (val >= date.month) {
  6515. date.year--;
  6516. val -= date.month;
  6517. date.month = getHebrewMonths(date.year);
  6518. }
  6519. else {
  6520. date.month -= val;
  6521. val = 0;
  6522. }
  6523. }
  6524. }
  6525. return date;
  6526. }
  6527. /**
  6528. * @param {?} date
  6529. * @param {?} val
  6530. * @return {?}
  6531. */
  6532. function setHebrewDay(date, val) {
  6533. /** @type {?} */
  6534. var after = val >= 0;
  6535. if (!after) {
  6536. val = -val;
  6537. }
  6538. while (val > 0) {
  6539. if (after) {
  6540. if (val > getDaysInHebrewYear(date.year) - getDayNumberInHebrewYear(date)) {
  6541. val -= getDaysInHebrewYear(date.year) - getDayNumberInHebrewYear(date) + 1;
  6542. date.year++;
  6543. date.month = 1;
  6544. date.day = 1;
  6545. }
  6546. else if (val > getDaysInHebrewMonth(date.month, date.year) - date.day) {
  6547. val -= getDaysInHebrewMonth(date.month, date.year) - date.day + 1;
  6548. date.month++;
  6549. date.day = 1;
  6550. }
  6551. else {
  6552. date.day += val;
  6553. val = 0;
  6554. }
  6555. }
  6556. else {
  6557. if (val >= date.day) {
  6558. val -= date.day;
  6559. date.month--;
  6560. if (date.month === 0) {
  6561. date.year--;
  6562. date.month = getHebrewMonths(date.year);
  6563. }
  6564. date.day = getDaysInHebrewMonth(date.month, date.year);
  6565. }
  6566. else {
  6567. date.day -= val;
  6568. val = 0;
  6569. }
  6570. }
  6571. }
  6572. return date;
  6573. }
  6574. /**
  6575. * Returns the equivalent Hebrew date value for a give input Gregorian date.
  6576. * `gdate` is a JS Date to be converted to Hebrew date.
  6577. * @param {?} gdate
  6578. * @return {?}
  6579. */
  6580. function fromGregorian$1(gdate) {
  6581. /** @type {?} */
  6582. var date = new Date(gdate);
  6583. /** @type {?} */
  6584. var gYear = date.getFullYear();
  6585. /** @type {?} */
  6586. var gMonth = date.getMonth();
  6587. /** @type {?} */
  6588. var gDay = date.getDate();
  6589. /** @type {?} */
  6590. var julianDay = GREGORIAN_EPOCH$1 - 1 + 365 * (gYear - 1) + Math.floor((gYear - 1) / 4) -
  6591. Math.floor((gYear - 1) / 100) + Math.floor((gYear - 1) / 400) +
  6592. Math.floor((367 * (gMonth + 1) - 362) / 12 + (gMonth + 1 <= 2 ? 0 : isGregorianLeapYear$1(gYear) ? -1 : -2) + gDay);
  6593. julianDay = Math.floor(julianDay + 0.5);
  6594. /** @type {?} */
  6595. var daysSinceHebEpoch = julianDay - 347997;
  6596. /** @type {?} */
  6597. var monthsSinceHebEpoch = Math.floor(daysSinceHebEpoch * PARTS_PER_DAY / PARTS_PER_MONTH);
  6598. /** @type {?} */
  6599. var hYear = Math.floor((monthsSinceHebEpoch * 19 + 234) / 235) + 1;
  6600. /** @type {?} */
  6601. var firstDayOfThisYear = numberOfFirstDayInYear(hYear);
  6602. /** @type {?} */
  6603. var dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;
  6604. while (dayOfYear < 1) {
  6605. hYear--;
  6606. firstDayOfThisYear = numberOfFirstDayInYear(hYear);
  6607. dayOfYear = daysSinceHebEpoch - firstDayOfThisYear;
  6608. }
  6609. /** @type {?} */
  6610. var hMonth = 1;
  6611. /** @type {?} */
  6612. var hDay = dayOfYear;
  6613. while (hDay > getDaysInHebrewMonth(hMonth, hYear)) {
  6614. hDay -= getDaysInHebrewMonth(hMonth, hYear);
  6615. hMonth++;
  6616. }
  6617. return new NgbDate(hYear, hMonth, hDay);
  6618. }
  6619. /**
  6620. * Returns the equivalent JS date value for a given Hebrew date.
  6621. * `hebrewDate` is an Hebrew date to be converted to Gregorian.
  6622. * @param {?} hebrewDate
  6623. * @return {?}
  6624. */
  6625. function toGregorian$1(hebrewDate) {
  6626. /** @type {?} */
  6627. var hYear = hebrewDate.year;
  6628. /** @type {?} */
  6629. var hMonth = hebrewDate.month;
  6630. /** @type {?} */
  6631. var hDay = hebrewDate.day;
  6632. /** @type {?} */
  6633. var days = numberOfFirstDayInYear(hYear);
  6634. for (var i = 1; i < hMonth; i++) {
  6635. days += getDaysInHebrewMonth(i, hYear);
  6636. }
  6637. days += hDay;
  6638. /** @type {?} */
  6639. var diffDays = days - HEBREW_DAY_ON_JAN_1_1970;
  6640. /** @type {?} */
  6641. var after = diffDays >= 0;
  6642. if (!after) {
  6643. diffDays = -diffDays;
  6644. }
  6645. /** @type {?} */
  6646. var gYear = 1970;
  6647. /** @type {?} */
  6648. var gMonth = 1;
  6649. /** @type {?} */
  6650. var gDay = 1;
  6651. while (diffDays > 0) {
  6652. if (after) {
  6653. if (diffDays >= (isGregorianLeapYear$1(gYear) ? 366 : 365)) {
  6654. diffDays -= isGregorianLeapYear$1(gYear) ? 366 : 365;
  6655. gYear++;
  6656. }
  6657. else if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {
  6658. diffDays -= getDaysInGregorianMonth(gMonth, gYear);
  6659. gMonth++;
  6660. }
  6661. else {
  6662. gDay += diffDays;
  6663. diffDays = 0;
  6664. }
  6665. }
  6666. else {
  6667. if (diffDays >= (isGregorianLeapYear$1(gYear - 1) ? 366 : 365)) {
  6668. diffDays -= isGregorianLeapYear$1(gYear - 1) ? 366 : 365;
  6669. gYear--;
  6670. }
  6671. else {
  6672. if (gMonth > 1) {
  6673. gMonth--;
  6674. }
  6675. else {
  6676. gMonth = 12;
  6677. gYear--;
  6678. }
  6679. if (diffDays >= getDaysInGregorianMonth(gMonth, gYear)) {
  6680. diffDays -= getDaysInGregorianMonth(gMonth, gYear);
  6681. }
  6682. else {
  6683. gDay = getDaysInGregorianMonth(gMonth, gYear) - diffDays + 1;
  6684. diffDays = 0;
  6685. }
  6686. }
  6687. }
  6688. }
  6689. return new Date(gYear, gMonth - 1, gDay);
  6690. }
  6691. /**
  6692. * @param {?} numerals
  6693. * @return {?}
  6694. */
  6695. function hebrewNumerals(numerals) {
  6696. if (!numerals) {
  6697. return '';
  6698. }
  6699. /** @type {?} */
  6700. var hArray0_9 = ['', '\u05d0', '\u05d1', '\u05d2', '\u05d3', '\u05d4', '\u05d5', '\u05d6', '\u05d7', '\u05d8'];
  6701. /** @type {?} */
  6702. var hArray10_19 = [
  6703. '\u05d9', '\u05d9\u05d0', '\u05d9\u05d1', '\u05d9\u05d2', '\u05d9\u05d3', '\u05d8\u05d5', '\u05d8\u05d6',
  6704. '\u05d9\u05d6', '\u05d9\u05d7', '\u05d9\u05d8'
  6705. ];
  6706. /** @type {?} */
  6707. var hArray20_90 = ['', '', '\u05db', '\u05dc', '\u05de', '\u05e0', '\u05e1', '\u05e2', '\u05e4', '\u05e6'];
  6708. /** @type {?} */
  6709. var hArray100_900 = [
  6710. '', '\u05e7', '\u05e8', '\u05e9', '\u05ea', '\u05ea\u05e7', '\u05ea\u05e8', '\u05ea\u05e9', '\u05ea\u05ea',
  6711. '\u05ea\u05ea\u05e7'
  6712. ];
  6713. /** @type {?} */
  6714. var hArray1000_9000 = [
  6715. '', '\u05d0', '\u05d1', '\u05d1\u05d0', '\u05d1\u05d1', '\u05d4', '\u05d4\u05d0', '\u05d4\u05d1',
  6716. '\u05d4\u05d1\u05d0', '\u05d4\u05d1\u05d1'
  6717. ];
  6718. /** @type {?} */
  6719. var geresh = '\u05f3';
  6720. /** @type {?} */
  6721. var gershaim = '\u05f4';
  6722. /** @type {?} */
  6723. var mem = 0;
  6724. /** @type {?} */
  6725. var result = [];
  6726. /** @type {?} */
  6727. var step = 0;
  6728. while (numerals > 0) {
  6729. /** @type {?} */
  6730. var m = numerals % 10;
  6731. if (step === 0) {
  6732. mem = m;
  6733. }
  6734. else if (step === 1) {
  6735. if (m !== 1) {
  6736. result.unshift(hArray20_90[m], hArray0_9[mem]);
  6737. }
  6738. else {
  6739. result.unshift(hArray10_19[mem]);
  6740. }
  6741. }
  6742. else if (step === 2) {
  6743. result.unshift(hArray100_900[m]);
  6744. }
  6745. else {
  6746. if (m !== 5) {
  6747. result.unshift(hArray1000_9000[m], geresh, ' ');
  6748. }
  6749. break;
  6750. }
  6751. numerals = Math.floor(numerals / 10);
  6752. if (step === 0 && numerals === 0) {
  6753. result.unshift(hArray0_9[m]);
  6754. }
  6755. step++;
  6756. }
  6757. result = result.join('').split('');
  6758. if (result.length === 1) {
  6759. result.push(geresh);
  6760. }
  6761. else if (result.length > 1) {
  6762. result.splice(result.length - 1, 0, gershaim);
  6763. }
  6764. return result.join('');
  6765. }
  6766. /**
  6767. * @fileoverview added by tsickle
  6768. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6769. */
  6770. /**
  6771. * \@since 3.2.0
  6772. */
  6773. var NgbCalendarHebrew = /** @class */ (function (_super) {
  6774. __extends(NgbCalendarHebrew, _super);
  6775. function NgbCalendarHebrew() {
  6776. return _super !== null && _super.apply(this, arguments) || this;
  6777. }
  6778. /**
  6779. * @return {?}
  6780. */
  6781. NgbCalendarHebrew.prototype.getDaysPerWeek = /**
  6782. * @return {?}
  6783. */
  6784. function () { return 7; };
  6785. /**
  6786. * @param {?=} year
  6787. * @return {?}
  6788. */
  6789. NgbCalendarHebrew.prototype.getMonths = /**
  6790. * @param {?=} year
  6791. * @return {?}
  6792. */
  6793. function (year) {
  6794. if (year && isHebrewLeapYear(year)) {
  6795. return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
  6796. }
  6797. else {
  6798. return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
  6799. }
  6800. };
  6801. /**
  6802. * @return {?}
  6803. */
  6804. NgbCalendarHebrew.prototype.getWeeksPerMonth = /**
  6805. * @return {?}
  6806. */
  6807. function () { return 6; };
  6808. /**
  6809. * @param {?} date
  6810. * @return {?}
  6811. */
  6812. NgbCalendarHebrew.prototype.isValid = /**
  6813. * @param {?} date
  6814. * @return {?}
  6815. */
  6816. function (date) {
  6817. /** @type {?} */
  6818. var b = date && isNumber(date.year) && isNumber(date.month) && isNumber(date.day);
  6819. b = b && date.month > 0 && date.month <= (isHebrewLeapYear(date.year) ? 13 : 12);
  6820. b = b && date.day > 0 && date.day <= getDaysInHebrewMonth(date.month, date.year);
  6821. return b && !isNaN(toGregorian$1(date).getTime());
  6822. };
  6823. /**
  6824. * @param {?} date
  6825. * @param {?=} period
  6826. * @param {?=} number
  6827. * @return {?}
  6828. */
  6829. NgbCalendarHebrew.prototype.getNext = /**
  6830. * @param {?} date
  6831. * @param {?=} period
  6832. * @param {?=} number
  6833. * @return {?}
  6834. */
  6835. function (date, period, number) {
  6836. if (period === void 0) { period = 'd'; }
  6837. if (number === void 0) { number = 1; }
  6838. date = new NgbDate(date.year, date.month, date.day);
  6839. switch (period) {
  6840. case 'y':
  6841. date.year += number;
  6842. date.month = 1;
  6843. date.day = 1;
  6844. return date;
  6845. case 'm':
  6846. date = setHebrewMonth(date, number);
  6847. date.day = 1;
  6848. return date;
  6849. case 'd':
  6850. return setHebrewDay(date, number);
  6851. default:
  6852. return date;
  6853. }
  6854. };
  6855. /**
  6856. * @param {?} date
  6857. * @param {?=} period
  6858. * @param {?=} number
  6859. * @return {?}
  6860. */
  6861. NgbCalendarHebrew.prototype.getPrev = /**
  6862. * @param {?} date
  6863. * @param {?=} period
  6864. * @param {?=} number
  6865. * @return {?}
  6866. */
  6867. function (date, period, number) {
  6868. if (period === void 0) { period = 'd'; }
  6869. if (number === void 0) { number = 1; }
  6870. return this.getNext(date, period, -number);
  6871. };
  6872. /**
  6873. * @param {?} date
  6874. * @return {?}
  6875. */
  6876. NgbCalendarHebrew.prototype.getWeekday = /**
  6877. * @param {?} date
  6878. * @return {?}
  6879. */
  6880. function (date) {
  6881. /** @type {?} */
  6882. var day = toGregorian$1(date).getDay();
  6883. // in JS Date Sun=0, in ISO 8601 Sun=7
  6884. return day === 0 ? 7 : day;
  6885. };
  6886. /**
  6887. * @param {?} week
  6888. * @param {?} firstDayOfWeek
  6889. * @return {?}
  6890. */
  6891. NgbCalendarHebrew.prototype.getWeekNumber = /**
  6892. * @param {?} week
  6893. * @param {?} firstDayOfWeek
  6894. * @return {?}
  6895. */
  6896. function (week, firstDayOfWeek) {
  6897. /** @type {?} */
  6898. var date = week[week.length - 1];
  6899. return Math.ceil(getDayNumberInHebrewYear(date) / 7);
  6900. };
  6901. /**
  6902. * @return {?}
  6903. */
  6904. NgbCalendarHebrew.prototype.getToday = /**
  6905. * @return {?}
  6906. */
  6907. function () { return fromGregorian$1(new Date()); };
  6908. /**
  6909. * @since 3.4.0
  6910. */
  6911. /**
  6912. * \@since 3.4.0
  6913. * @param {?} date
  6914. * @return {?}
  6915. */
  6916. NgbCalendarHebrew.prototype.toGregorian = /**
  6917. * \@since 3.4.0
  6918. * @param {?} date
  6919. * @return {?}
  6920. */
  6921. function (date) { return fromJSDate(toGregorian$1(date)); };
  6922. /**
  6923. * @since 3.4.0
  6924. */
  6925. /**
  6926. * \@since 3.4.0
  6927. * @param {?} date
  6928. * @return {?}
  6929. */
  6930. NgbCalendarHebrew.prototype.fromGregorian = /**
  6931. * \@since 3.4.0
  6932. * @param {?} date
  6933. * @return {?}
  6934. */
  6935. function (date) { return fromGregorian$1(toJSDate(date)); };
  6936. NgbCalendarHebrew.decorators = [
  6937. { type: Injectable }
  6938. ];
  6939. return NgbCalendarHebrew;
  6940. }(NgbCalendar));
  6941. /**
  6942. * @fileoverview added by tsickle
  6943. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6944. */
  6945. /** @type {?} */
  6946. var WEEKDAYS = ['שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת', 'ראשון'];
  6947. /** @type {?} */
  6948. var MONTHS = ['תשרי', 'חשון', 'כסלו', 'טבת', 'שבט', 'אדר', 'ניסן', 'אייר', 'סיון', 'תמוז', 'אב', 'אלול'];
  6949. /** @type {?} */
  6950. var MONTHS_LEAP = ['תשרי', 'חשון', 'כסלו', 'טבת', 'שבט', 'אדר א׳', 'אדר ב׳', 'ניסן', 'אייר', 'סיון', 'תמוז', 'אב', 'אלול'];
  6951. /**
  6952. * \@since 3.2.0
  6953. */
  6954. var NgbDatepickerI18nHebrew = /** @class */ (function (_super) {
  6955. __extends(NgbDatepickerI18nHebrew, _super);
  6956. function NgbDatepickerI18nHebrew() {
  6957. return _super !== null && _super.apply(this, arguments) || this;
  6958. }
  6959. /**
  6960. * @param {?} month
  6961. * @param {?=} year
  6962. * @return {?}
  6963. */
  6964. NgbDatepickerI18nHebrew.prototype.getMonthShortName = /**
  6965. * @param {?} month
  6966. * @param {?=} year
  6967. * @return {?}
  6968. */
  6969. function (month, year) { return this.getMonthFullName(month, year); };
  6970. /**
  6971. * @param {?} month
  6972. * @param {?=} year
  6973. * @return {?}
  6974. */
  6975. NgbDatepickerI18nHebrew.prototype.getMonthFullName = /**
  6976. * @param {?} month
  6977. * @param {?=} year
  6978. * @return {?}
  6979. */
  6980. function (month, year) {
  6981. return isHebrewLeapYear(year) ? MONTHS_LEAP[month - 1] : MONTHS[month - 1];
  6982. };
  6983. /**
  6984. * @param {?} weekday
  6985. * @return {?}
  6986. */
  6987. NgbDatepickerI18nHebrew.prototype.getWeekdayShortName = /**
  6988. * @param {?} weekday
  6989. * @return {?}
  6990. */
  6991. function (weekday) { return WEEKDAYS[weekday - 1]; };
  6992. /**
  6993. * @param {?} date
  6994. * @return {?}
  6995. */
  6996. NgbDatepickerI18nHebrew.prototype.getDayAriaLabel = /**
  6997. * @param {?} date
  6998. * @return {?}
  6999. */
  7000. function (date) {
  7001. return hebrewNumerals(date.day) + " " + this.getMonthFullName(date.month, date.year) + " " + hebrewNumerals(date.year);
  7002. };
  7003. /**
  7004. * @param {?} date
  7005. * @return {?}
  7006. */
  7007. NgbDatepickerI18nHebrew.prototype.getDayNumerals = /**
  7008. * @param {?} date
  7009. * @return {?}
  7010. */
  7011. function (date) { return hebrewNumerals(date.day); };
  7012. /**
  7013. * @param {?} weekNumber
  7014. * @return {?}
  7015. */
  7016. NgbDatepickerI18nHebrew.prototype.getWeekNumerals = /**
  7017. * @param {?} weekNumber
  7018. * @return {?}
  7019. */
  7020. function (weekNumber) { return hebrewNumerals(weekNumber); };
  7021. /**
  7022. * @param {?} year
  7023. * @return {?}
  7024. */
  7025. NgbDatepickerI18nHebrew.prototype.getYearNumerals = /**
  7026. * @param {?} year
  7027. * @return {?}
  7028. */
  7029. function (year) { return hebrewNumerals(year); };
  7030. NgbDatepickerI18nHebrew.decorators = [
  7031. { type: Injectable }
  7032. ];
  7033. return NgbDatepickerI18nHebrew;
  7034. }(NgbDatepickerI18n));
  7035. /**
  7036. * @fileoverview added by tsickle
  7037. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7038. */
  7039. /**
  7040. * [`NgbDateAdapter`](#/components/datepicker/api#NgbDateAdapter) implementation that uses
  7041. * native javascript dates as a user date model.
  7042. */
  7043. var NgbDateNativeAdapter = /** @class */ (function (_super) {
  7044. __extends(NgbDateNativeAdapter, _super);
  7045. function NgbDateNativeAdapter() {
  7046. return _super !== null && _super.apply(this, arguments) || this;
  7047. }
  7048. /**
  7049. * Converts a native `Date` to a `NgbDateStruct`.
  7050. */
  7051. /**
  7052. * Converts a native `Date` to a `NgbDateStruct`.
  7053. * @param {?} date
  7054. * @return {?}
  7055. */
  7056. NgbDateNativeAdapter.prototype.fromModel = /**
  7057. * Converts a native `Date` to a `NgbDateStruct`.
  7058. * @param {?} date
  7059. * @return {?}
  7060. */
  7061. function (date) {
  7062. return (date instanceof Date && !isNaN(date.getTime())) ? this._fromNativeDate(date) : null;
  7063. };
  7064. /**
  7065. * Converts a `NgbDateStruct` to a native `Date`.
  7066. */
  7067. /**
  7068. * Converts a `NgbDateStruct` to a native `Date`.
  7069. * @param {?} date
  7070. * @return {?}
  7071. */
  7072. NgbDateNativeAdapter.prototype.toModel = /**
  7073. * Converts a `NgbDateStruct` to a native `Date`.
  7074. * @param {?} date
  7075. * @return {?}
  7076. */
  7077. function (date) {
  7078. return date && isInteger(date.year) && isInteger(date.month) && isInteger(date.day) ? this._toNativeDate(date) :
  7079. null;
  7080. };
  7081. /**
  7082. * @protected
  7083. * @param {?} date
  7084. * @return {?}
  7085. */
  7086. NgbDateNativeAdapter.prototype._fromNativeDate = /**
  7087. * @protected
  7088. * @param {?} date
  7089. * @return {?}
  7090. */
  7091. function (date) {
  7092. return { year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate() };
  7093. };
  7094. /**
  7095. * @protected
  7096. * @param {?} date
  7097. * @return {?}
  7098. */
  7099. NgbDateNativeAdapter.prototype._toNativeDate = /**
  7100. * @protected
  7101. * @param {?} date
  7102. * @return {?}
  7103. */
  7104. function (date) {
  7105. /** @type {?} */
  7106. var jsDate = new Date(date.year, date.month - 1, date.day, 12);
  7107. // avoid 30 -> 1930 conversion
  7108. jsDate.setFullYear(date.year);
  7109. return jsDate;
  7110. };
  7111. NgbDateNativeAdapter.decorators = [
  7112. { type: Injectable }
  7113. ];
  7114. return NgbDateNativeAdapter;
  7115. }(NgbDateAdapter));
  7116. /**
  7117. * @fileoverview added by tsickle
  7118. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7119. */
  7120. /**
  7121. * Same as [`NgbDateNativeAdapter`](#/components/datepicker/api#NgbDateNativeAdapter), but with UTC dates.
  7122. *
  7123. * \@since 3.2.0
  7124. */
  7125. var NgbDateNativeUTCAdapter = /** @class */ (function (_super) {
  7126. __extends(NgbDateNativeUTCAdapter, _super);
  7127. function NgbDateNativeUTCAdapter() {
  7128. return _super !== null && _super.apply(this, arguments) || this;
  7129. }
  7130. /**
  7131. * @protected
  7132. * @param {?} date
  7133. * @return {?}
  7134. */
  7135. NgbDateNativeUTCAdapter.prototype._fromNativeDate = /**
  7136. * @protected
  7137. * @param {?} date
  7138. * @return {?}
  7139. */
  7140. function (date) {
  7141. return { year: date.getUTCFullYear(), month: date.getUTCMonth() + 1, day: date.getUTCDate() };
  7142. };
  7143. /**
  7144. * @protected
  7145. * @param {?} date
  7146. * @return {?}
  7147. */
  7148. NgbDateNativeUTCAdapter.prototype._toNativeDate = /**
  7149. * @protected
  7150. * @param {?} date
  7151. * @return {?}
  7152. */
  7153. function (date) {
  7154. /** @type {?} */
  7155. var jsDate = new Date(Date.UTC(date.year, date.month - 1, date.day));
  7156. // avoid 30 -> 1930 conversion
  7157. jsDate.setUTCFullYear(date.year);
  7158. return jsDate;
  7159. };
  7160. NgbDateNativeUTCAdapter.decorators = [
  7161. { type: Injectable }
  7162. ];
  7163. return NgbDateNativeUTCAdapter;
  7164. }(NgbDateNativeAdapter));
  7165. /**
  7166. * @fileoverview added by tsickle
  7167. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7168. */
  7169. var NgbDatepickerModule = /** @class */ (function () {
  7170. function NgbDatepickerModule() {
  7171. }
  7172. NgbDatepickerModule.decorators = [
  7173. { type: NgModule, args: [{
  7174. declarations: [
  7175. NgbDatepicker, NgbDatepickerMonthView, NgbDatepickerNavigation, NgbDatepickerNavigationSelect, NgbDatepickerDayView,
  7176. NgbInputDatepicker
  7177. ],
  7178. exports: [NgbDatepicker, NgbInputDatepicker],
  7179. imports: [CommonModule, FormsModule],
  7180. entryComponents: [NgbDatepicker]
  7181. },] }
  7182. ];
  7183. return NgbDatepickerModule;
  7184. }());
  7185. /**
  7186. * @fileoverview added by tsickle
  7187. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7188. */
  7189. /**
  7190. * A configuration service for the [`NgbDropdown`](#/components/dropdown/api#NgbDropdown) component.
  7191. *
  7192. * You can inject this service, typically in your root component, and customize the values of its properties in
  7193. * order to provide default values for all the dropdowns used in the application.
  7194. */
  7195. var NgbDropdownConfig = /** @class */ (function () {
  7196. function NgbDropdownConfig() {
  7197. this.autoClose = true;
  7198. this.placement = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
  7199. }
  7200. NgbDropdownConfig.decorators = [
  7201. { type: Injectable, args: [{ providedIn: 'root' },] }
  7202. ];
  7203. /** @nocollapse */ NgbDropdownConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbDropdownConfig_Factory() { return new NgbDropdownConfig(); }, token: NgbDropdownConfig, providedIn: "root" });
  7204. return NgbDropdownConfig;
  7205. }());
  7206. /**
  7207. * @fileoverview added by tsickle
  7208. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7209. */
  7210. var NgbNavbar = /** @class */ (function () {
  7211. function NgbNavbar() {
  7212. }
  7213. NgbNavbar.decorators = [
  7214. { type: Directive, args: [{ selector: '.navbar' },] }
  7215. ];
  7216. return NgbNavbar;
  7217. }());
  7218. /**
  7219. * A directive you should put on a dropdown item to enable keyboard navigation.
  7220. * Arrow keys will move focus between items marked with this directive.
  7221. *
  7222. * \@since 4.1.0
  7223. */
  7224. var NgbDropdownItem = /** @class */ (function () {
  7225. function NgbDropdownItem(elementRef) {
  7226. this.elementRef = elementRef;
  7227. this._disabled = false;
  7228. }
  7229. Object.defineProperty(NgbDropdownItem.prototype, "disabled", {
  7230. get: /**
  7231. * @return {?}
  7232. */
  7233. function () { return this._disabled; },
  7234. set: /**
  7235. * @param {?} value
  7236. * @return {?}
  7237. */
  7238. function (value) {
  7239. this._disabled = (/** @type {?} */ (value)) === '' || value === true; // accept an empty attribute as true
  7240. },
  7241. enumerable: true,
  7242. configurable: true
  7243. });
  7244. NgbDropdownItem.decorators = [
  7245. { type: Directive, args: [{ selector: '[ngbDropdownItem]', host: { 'class': 'dropdown-item', '[class.disabled]': 'disabled' } },] }
  7246. ];
  7247. /** @nocollapse */
  7248. NgbDropdownItem.ctorParameters = function () { return [
  7249. { type: ElementRef }
  7250. ]; };
  7251. NgbDropdownItem.propDecorators = {
  7252. disabled: [{ type: Input }]
  7253. };
  7254. return NgbDropdownItem;
  7255. }());
  7256. /**
  7257. * A directive that wraps dropdown menu content and dropdown items.
  7258. */
  7259. var NgbDropdownMenu = /** @class */ (function () {
  7260. function NgbDropdownMenu(dropdown) {
  7261. this.dropdown = dropdown;
  7262. this.placement = 'bottom';
  7263. this.isOpen = false;
  7264. }
  7265. NgbDropdownMenu.decorators = [
  7266. { type: Directive, args: [{
  7267. selector: '[ngbDropdownMenu]',
  7268. host: {
  7269. '[class.dropdown-menu]': 'true',
  7270. '[class.show]': 'dropdown.isOpen()',
  7271. '[attr.x-placement]': 'placement',
  7272. '(keydown.ArrowUp)': 'dropdown.onKeyDown($event)',
  7273. '(keydown.ArrowDown)': 'dropdown.onKeyDown($event)',
  7274. '(keydown.Home)': 'dropdown.onKeyDown($event)',
  7275. '(keydown.End)': 'dropdown.onKeyDown($event)',
  7276. '(keydown.Enter)': 'dropdown.onKeyDown($event)',
  7277. '(keydown.Space)': 'dropdown.onKeyDown($event)'
  7278. }
  7279. },] }
  7280. ];
  7281. /** @nocollapse */
  7282. NgbDropdownMenu.ctorParameters = function () { return [
  7283. { type: undefined, decorators: [{ type: Inject, args: [forwardRef((/**
  7284. * @return {?}
  7285. */
  7286. function () { return NgbDropdown; })),] }] }
  7287. ]; };
  7288. NgbDropdownMenu.propDecorators = {
  7289. menuItems: [{ type: ContentChildren, args: [NgbDropdownItem,] }]
  7290. };
  7291. return NgbDropdownMenu;
  7292. }());
  7293. /**
  7294. * A directive to mark an element to which dropdown menu will be anchored.
  7295. *
  7296. * This is a simple version of the `NgbDropdownToggle` directive.
  7297. * It plays the same role, but doesn't listen to click events to toggle dropdown menu thus enabling support
  7298. * for events other than click.
  7299. *
  7300. * \@since 1.1.0
  7301. */
  7302. var NgbDropdownAnchor = /** @class */ (function () {
  7303. function NgbDropdownAnchor(dropdown, _elementRef) {
  7304. this.dropdown = dropdown;
  7305. this._elementRef = _elementRef;
  7306. this.anchorEl = _elementRef.nativeElement;
  7307. }
  7308. /**
  7309. * @return {?}
  7310. */
  7311. NgbDropdownAnchor.prototype.getNativeElement = /**
  7312. * @return {?}
  7313. */
  7314. function () { return this._elementRef.nativeElement; };
  7315. NgbDropdownAnchor.decorators = [
  7316. { type: Directive, args: [{
  7317. selector: '[ngbDropdownAnchor]',
  7318. host: { 'class': 'dropdown-toggle', 'aria-haspopup': 'true', '[attr.aria-expanded]': 'dropdown.isOpen()' }
  7319. },] }
  7320. ];
  7321. /** @nocollapse */
  7322. NgbDropdownAnchor.ctorParameters = function () { return [
  7323. { type: undefined, decorators: [{ type: Inject, args: [forwardRef((/**
  7324. * @return {?}
  7325. */
  7326. function () { return NgbDropdown; })),] }] },
  7327. { type: ElementRef }
  7328. ]; };
  7329. return NgbDropdownAnchor;
  7330. }());
  7331. /**
  7332. * A directive to mark an element that will toggle dropdown via the `click` event.
  7333. *
  7334. * You can also use `NgbDropdownAnchor` as an alternative.
  7335. */
  7336. var NgbDropdownToggle = /** @class */ (function (_super) {
  7337. __extends(NgbDropdownToggle, _super);
  7338. function NgbDropdownToggle(dropdown, elementRef) {
  7339. return _super.call(this, dropdown, elementRef) || this;
  7340. }
  7341. NgbDropdownToggle.decorators = [
  7342. { type: Directive, args: [{
  7343. selector: '[ngbDropdownToggle]',
  7344. host: {
  7345. 'class': 'dropdown-toggle',
  7346. 'aria-haspopup': 'true',
  7347. '[attr.aria-expanded]': 'dropdown.isOpen()',
  7348. '(click)': 'dropdown.toggle()',
  7349. '(keydown.ArrowUp)': 'dropdown.onKeyDown($event)',
  7350. '(keydown.ArrowDown)': 'dropdown.onKeyDown($event)',
  7351. '(keydown.Home)': 'dropdown.onKeyDown($event)',
  7352. '(keydown.End)': 'dropdown.onKeyDown($event)'
  7353. },
  7354. providers: [{ provide: NgbDropdownAnchor, useExisting: forwardRef((/**
  7355. * @return {?}
  7356. */
  7357. function () { return NgbDropdownToggle; })) }]
  7358. },] }
  7359. ];
  7360. /** @nocollapse */
  7361. NgbDropdownToggle.ctorParameters = function () { return [
  7362. { type: undefined, decorators: [{ type: Inject, args: [forwardRef((/**
  7363. * @return {?}
  7364. */
  7365. function () { return NgbDropdown; })),] }] },
  7366. { type: ElementRef }
  7367. ]; };
  7368. return NgbDropdownToggle;
  7369. }(NgbDropdownAnchor));
  7370. /**
  7371. * A directive that provides contextual overlays for displaying lists of links and more.
  7372. */
  7373. var NgbDropdown = /** @class */ (function () {
  7374. function NgbDropdown(_changeDetector, config, _document, _ngZone, _elementRef, _renderer, ngbNavbar) {
  7375. var _this = this;
  7376. this._changeDetector = _changeDetector;
  7377. this._document = _document;
  7378. this._ngZone = _ngZone;
  7379. this._elementRef = _elementRef;
  7380. this._renderer = _renderer;
  7381. this._closed$ = new Subject();
  7382. /**
  7383. * Defines whether or not the dropdown menu is opened initially.
  7384. */
  7385. this._open = false;
  7386. /**
  7387. * An event fired when the dropdown is opened or closed.
  7388. *
  7389. * The event payload is a `boolean`:
  7390. * * `true` - the dropdown was opened
  7391. * * `false` - the dropdown was closed
  7392. */
  7393. this.openChange = new EventEmitter();
  7394. this.placement = config.placement;
  7395. this.container = config.container;
  7396. this.autoClose = config.autoClose;
  7397. this.display = ngbNavbar ? 'static' : 'dynamic';
  7398. this._zoneSubscription = _ngZone.onStable.subscribe((/**
  7399. * @return {?}
  7400. */
  7401. function () { _this._positionMenu(); }));
  7402. }
  7403. /**
  7404. * @return {?}
  7405. */
  7406. NgbDropdown.prototype.ngAfterContentInit = /**
  7407. * @return {?}
  7408. */
  7409. function () {
  7410. var _this = this;
  7411. this._ngZone.onStable.pipe(take(1)).subscribe((/**
  7412. * @return {?}
  7413. */
  7414. function () {
  7415. _this._applyPlacementClasses();
  7416. if (_this._open) {
  7417. _this._setCloseHandlers();
  7418. }
  7419. }));
  7420. };
  7421. /**
  7422. * @param {?} changes
  7423. * @return {?}
  7424. */
  7425. NgbDropdown.prototype.ngOnChanges = /**
  7426. * @param {?} changes
  7427. * @return {?}
  7428. */
  7429. function (changes) {
  7430. if (changes.container && this._open) {
  7431. this._applyContainer(this.container);
  7432. }
  7433. if (changes.placement && !changes.placement.isFirstChange) {
  7434. this._applyPlacementClasses();
  7435. }
  7436. };
  7437. /**
  7438. * Checks if the dropdown menu is open.
  7439. */
  7440. /**
  7441. * Checks if the dropdown menu is open.
  7442. * @return {?}
  7443. */
  7444. NgbDropdown.prototype.isOpen = /**
  7445. * Checks if the dropdown menu is open.
  7446. * @return {?}
  7447. */
  7448. function () { return this._open; };
  7449. /**
  7450. * Opens the dropdown menu.
  7451. */
  7452. /**
  7453. * Opens the dropdown menu.
  7454. * @return {?}
  7455. */
  7456. NgbDropdown.prototype.open = /**
  7457. * Opens the dropdown menu.
  7458. * @return {?}
  7459. */
  7460. function () {
  7461. if (!this._open) {
  7462. this._open = true;
  7463. this._applyContainer(this.container);
  7464. this.openChange.emit(true);
  7465. this._setCloseHandlers();
  7466. }
  7467. };
  7468. /**
  7469. * @private
  7470. * @return {?}
  7471. */
  7472. NgbDropdown.prototype._setCloseHandlers = /**
  7473. * @private
  7474. * @return {?}
  7475. */
  7476. function () {
  7477. var _this = this;
  7478. /** @type {?} */
  7479. var anchor = this._anchor;
  7480. ngbAutoClose(this._ngZone, this._document, this.autoClose, (/**
  7481. * @return {?}
  7482. */
  7483. function () { return _this.close(); }), this._closed$, this._menu ? [this._menuElement.nativeElement] : [], anchor ? [anchor.getNativeElement()] : [], '.dropdown-item,.dropdown-divider');
  7484. };
  7485. /**
  7486. * Closes the dropdown menu.
  7487. */
  7488. /**
  7489. * Closes the dropdown menu.
  7490. * @return {?}
  7491. */
  7492. NgbDropdown.prototype.close = /**
  7493. * Closes the dropdown menu.
  7494. * @return {?}
  7495. */
  7496. function () {
  7497. if (this._open) {
  7498. this._open = false;
  7499. this._resetContainer();
  7500. this._closed$.next();
  7501. this.openChange.emit(false);
  7502. this._changeDetector.markForCheck();
  7503. }
  7504. };
  7505. /**
  7506. * Toggles the dropdown menu.
  7507. */
  7508. /**
  7509. * Toggles the dropdown menu.
  7510. * @return {?}
  7511. */
  7512. NgbDropdown.prototype.toggle = /**
  7513. * Toggles the dropdown menu.
  7514. * @return {?}
  7515. */
  7516. function () {
  7517. if (this.isOpen()) {
  7518. this.close();
  7519. }
  7520. else {
  7521. this.open();
  7522. }
  7523. };
  7524. /**
  7525. * @return {?}
  7526. */
  7527. NgbDropdown.prototype.ngOnDestroy = /**
  7528. * @return {?}
  7529. */
  7530. function () {
  7531. this._resetContainer();
  7532. this._closed$.next();
  7533. this._zoneSubscription.unsubscribe();
  7534. };
  7535. /**
  7536. * @param {?} event
  7537. * @return {?}
  7538. */
  7539. NgbDropdown.prototype.onKeyDown = /**
  7540. * @param {?} event
  7541. * @return {?}
  7542. */
  7543. function (event) {
  7544. var _this = this;
  7545. // tslint:disable-next-line:deprecation
  7546. /** @type {?} */
  7547. var key = event.which;
  7548. /** @type {?} */
  7549. var itemElements = this._getMenuElements();
  7550. /** @type {?} */
  7551. var position = -1;
  7552. /** @type {?} */
  7553. var isEventFromItems = false;
  7554. /** @type {?} */
  7555. var itemElement = null;
  7556. /** @type {?} */
  7557. var isEventFromToggle = this._isEventFromToggle(event);
  7558. if (!isEventFromToggle && itemElements.length) {
  7559. itemElements.forEach((/**
  7560. * @param {?} item
  7561. * @param {?} index
  7562. * @return {?}
  7563. */
  7564. function (item, index) {
  7565. if (item.contains((/** @type {?} */ (event.target)))) {
  7566. isEventFromItems = true;
  7567. itemElement = item;
  7568. }
  7569. if (item === _this._document.activeElement) {
  7570. position = index;
  7571. }
  7572. }));
  7573. }
  7574. // closing on Enter / Space
  7575. if (key === Key.Space || key === Key.Enter) {
  7576. if (isEventFromItems && (this.autoClose === true || this.autoClose === 'inside')) {
  7577. // Item is either a button or a link, so click will be triggered by the browser on Enter or Space.
  7578. // So we have to register a one-time click handler that will fire after any user defined click handlers
  7579. // to close the dropdown
  7580. fromEvent(itemElement, 'click').pipe(take(1)).subscribe((/**
  7581. * @return {?}
  7582. */
  7583. function () { return _this.close(); }));
  7584. }
  7585. return;
  7586. }
  7587. // opening / navigating
  7588. if (isEventFromToggle || isEventFromItems) {
  7589. this.open();
  7590. if (itemElements.length) {
  7591. switch (key) {
  7592. case Key.ArrowDown:
  7593. position = Math.min(position + 1, itemElements.length - 1);
  7594. break;
  7595. case Key.ArrowUp:
  7596. if (this._isDropup() && position === -1) {
  7597. position = itemElements.length - 1;
  7598. break;
  7599. }
  7600. position = Math.max(position - 1, 0);
  7601. break;
  7602. case Key.Home:
  7603. position = 0;
  7604. break;
  7605. case Key.End:
  7606. position = itemElements.length - 1;
  7607. break;
  7608. }
  7609. itemElements[position].focus();
  7610. }
  7611. event.preventDefault();
  7612. }
  7613. };
  7614. /**
  7615. * @private
  7616. * @return {?}
  7617. */
  7618. NgbDropdown.prototype._isDropup = /**
  7619. * @private
  7620. * @return {?}
  7621. */
  7622. function () { return this._elementRef.nativeElement.classList.contains('dropup'); };
  7623. /**
  7624. * @private
  7625. * @param {?} event
  7626. * @return {?}
  7627. */
  7628. NgbDropdown.prototype._isEventFromToggle = /**
  7629. * @private
  7630. * @param {?} event
  7631. * @return {?}
  7632. */
  7633. function (event) {
  7634. return this._anchor.getNativeElement().contains((/** @type {?} */ (event.target)));
  7635. };
  7636. /**
  7637. * @private
  7638. * @return {?}
  7639. */
  7640. NgbDropdown.prototype._getMenuElements = /**
  7641. * @private
  7642. * @return {?}
  7643. */
  7644. function () {
  7645. /** @type {?} */
  7646. var menu = this._menu;
  7647. if (menu == null) {
  7648. return [];
  7649. }
  7650. return menu.menuItems.filter((/**
  7651. * @param {?} item
  7652. * @return {?}
  7653. */
  7654. function (item) { return !item.disabled; })).map((/**
  7655. * @param {?} item
  7656. * @return {?}
  7657. */
  7658. function (item) { return item.elementRef.nativeElement; }));
  7659. };
  7660. /**
  7661. * @private
  7662. * @return {?}
  7663. */
  7664. NgbDropdown.prototype._positionMenu = /**
  7665. * @private
  7666. * @return {?}
  7667. */
  7668. function () {
  7669. /** @type {?} */
  7670. var menu = this._menu;
  7671. if (this.isOpen() && menu) {
  7672. this._applyPlacementClasses(this.display === 'dynamic' ?
  7673. positionElements(this._anchor.anchorEl, this._bodyContainer || this._menuElement.nativeElement, this.placement, this.container === 'body') :
  7674. this._getFirstPlacement(this.placement));
  7675. }
  7676. };
  7677. /**
  7678. * @private
  7679. * @param {?} placement
  7680. * @return {?}
  7681. */
  7682. NgbDropdown.prototype._getFirstPlacement = /**
  7683. * @private
  7684. * @param {?} placement
  7685. * @return {?}
  7686. */
  7687. function (placement) {
  7688. return Array.isArray(placement) ? placement[0] : (/** @type {?} */ (placement.split(' ')[0]));
  7689. };
  7690. /**
  7691. * @private
  7692. * @return {?}
  7693. */
  7694. NgbDropdown.prototype._resetContainer = /**
  7695. * @private
  7696. * @return {?}
  7697. */
  7698. function () {
  7699. /** @type {?} */
  7700. var renderer = this._renderer;
  7701. /** @type {?} */
  7702. var menuElement = this._menuElement;
  7703. if (menuElement) {
  7704. /** @type {?} */
  7705. var dropdownElement = this._elementRef.nativeElement;
  7706. /** @type {?} */
  7707. var dropdownMenuElement = menuElement.nativeElement;
  7708. renderer.appendChild(dropdownElement, dropdownMenuElement);
  7709. renderer.removeStyle(dropdownMenuElement, 'position');
  7710. renderer.removeStyle(dropdownMenuElement, 'transform');
  7711. }
  7712. if (this._bodyContainer) {
  7713. renderer.removeChild(this._document.body, this._bodyContainer);
  7714. this._bodyContainer = null;
  7715. }
  7716. };
  7717. /**
  7718. * @private
  7719. * @param {?=} container
  7720. * @return {?}
  7721. */
  7722. NgbDropdown.prototype._applyContainer = /**
  7723. * @private
  7724. * @param {?=} container
  7725. * @return {?}
  7726. */
  7727. function (container) {
  7728. if (container === void 0) { container = null; }
  7729. this._resetContainer();
  7730. if (container === 'body') {
  7731. /** @type {?} */
  7732. var renderer = this._renderer;
  7733. /** @type {?} */
  7734. var dropdownMenuElement = this._menuElement.nativeElement;
  7735. /** @type {?} */
  7736. var bodyContainer = this._bodyContainer = this._bodyContainer || renderer.createElement('div');
  7737. // Override some styles to have the positionning working
  7738. renderer.setStyle(bodyContainer, 'position', 'absolute');
  7739. renderer.setStyle(dropdownMenuElement, 'position', 'static');
  7740. renderer.setStyle(bodyContainer, 'z-index', '1050');
  7741. renderer.appendChild(bodyContainer, dropdownMenuElement);
  7742. renderer.appendChild(this._document.body, bodyContainer);
  7743. }
  7744. };
  7745. /**
  7746. * @private
  7747. * @param {?=} placement
  7748. * @return {?}
  7749. */
  7750. NgbDropdown.prototype._applyPlacementClasses = /**
  7751. * @private
  7752. * @param {?=} placement
  7753. * @return {?}
  7754. */
  7755. function (placement) {
  7756. /** @type {?} */
  7757. var menu = this._menu;
  7758. if (menu) {
  7759. if (!placement) {
  7760. placement = this._getFirstPlacement(this.placement);
  7761. }
  7762. /** @type {?} */
  7763. var renderer = this._renderer;
  7764. /** @type {?} */
  7765. var dropdownElement = this._elementRef.nativeElement;
  7766. // remove the current placement classes
  7767. renderer.removeClass(dropdownElement, 'dropup');
  7768. renderer.removeClass(dropdownElement, 'dropdown');
  7769. menu.placement = this.display === 'static' ? null : placement;
  7770. /*
  7771. * apply the new placement
  7772. * in case of top use up-arrow or down-arrow otherwise
  7773. */
  7774. /** @type {?} */
  7775. var dropdownClass = placement.search('^top') !== -1 ? 'dropup' : 'dropdown';
  7776. renderer.addClass(dropdownElement, dropdownClass);
  7777. /** @type {?} */
  7778. var bodyContainer = this._bodyContainer;
  7779. if (bodyContainer) {
  7780. renderer.removeClass(bodyContainer, 'dropup');
  7781. renderer.removeClass(bodyContainer, 'dropdown');
  7782. renderer.addClass(bodyContainer, dropdownClass);
  7783. }
  7784. }
  7785. };
  7786. NgbDropdown.decorators = [
  7787. { type: Directive, args: [{ selector: '[ngbDropdown]', exportAs: 'ngbDropdown', host: { '[class.show]': 'isOpen()' } },] }
  7788. ];
  7789. /** @nocollapse */
  7790. NgbDropdown.ctorParameters = function () { return [
  7791. { type: ChangeDetectorRef },
  7792. { type: NgbDropdownConfig },
  7793. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
  7794. { type: NgZone },
  7795. { type: ElementRef },
  7796. { type: Renderer2 },
  7797. { type: NgbNavbar, decorators: [{ type: Optional }] }
  7798. ]; };
  7799. NgbDropdown.propDecorators = {
  7800. _menu: [{ type: ContentChild, args: [NgbDropdownMenu, { static: false },] }],
  7801. _menuElement: [{ type: ContentChild, args: [NgbDropdownMenu, { read: ElementRef, static: false },] }],
  7802. _anchor: [{ type: ContentChild, args: [NgbDropdownAnchor, { static: false },] }],
  7803. autoClose: [{ type: Input }],
  7804. _open: [{ type: Input, args: ['open',] }],
  7805. placement: [{ type: Input }],
  7806. container: [{ type: Input }],
  7807. display: [{ type: Input }],
  7808. openChange: [{ type: Output }]
  7809. };
  7810. return NgbDropdown;
  7811. }());
  7812. /**
  7813. * @fileoverview added by tsickle
  7814. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7815. */
  7816. /** @type {?} */
  7817. var NGB_DROPDOWN_DIRECTIVES = [NgbDropdown, NgbDropdownAnchor, NgbDropdownToggle, NgbDropdownMenu, NgbDropdownItem, NgbNavbar];
  7818. var NgbDropdownModule = /** @class */ (function () {
  7819. function NgbDropdownModule() {
  7820. }
  7821. NgbDropdownModule.decorators = [
  7822. { type: NgModule, args: [{ declarations: NGB_DROPDOWN_DIRECTIVES, exports: NGB_DROPDOWN_DIRECTIVES },] }
  7823. ];
  7824. return NgbDropdownModule;
  7825. }());
  7826. /**
  7827. * @fileoverview added by tsickle
  7828. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7829. */
  7830. /**
  7831. * A configuration service for the [`NgbModal`](#/components/modal/api#NgbModal) service.
  7832. *
  7833. * You can inject this service, typically in your root component, and customize the values of its properties in
  7834. * order to provide default values for all modals used in the application.
  7835. *
  7836. * \@since 3.1.0
  7837. */
  7838. var NgbModalConfig = /** @class */ (function () {
  7839. function NgbModalConfig() {
  7840. this.backdrop = true;
  7841. this.keyboard = true;
  7842. }
  7843. NgbModalConfig.decorators = [
  7844. { type: Injectable, args: [{ providedIn: 'root' },] }
  7845. ];
  7846. /** @nocollapse */ NgbModalConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbModalConfig_Factory() { return new NgbModalConfig(); }, token: NgbModalConfig, providedIn: "root" });
  7847. return NgbModalConfig;
  7848. }());
  7849. /**
  7850. * @fileoverview added by tsickle
  7851. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7852. */
  7853. var ContentRef = /** @class */ (function () {
  7854. function ContentRef(nodes, viewRef, componentRef) {
  7855. this.nodes = nodes;
  7856. this.viewRef = viewRef;
  7857. this.componentRef = componentRef;
  7858. }
  7859. return ContentRef;
  7860. }());
  7861. /**
  7862. * @template T
  7863. */
  7864. var /**
  7865. * @template T
  7866. */
  7867. PopupService = /** @class */ (function () {
  7868. function PopupService(_type, _injector, _viewContainerRef, _renderer, _componentFactoryResolver, _applicationRef) {
  7869. this._type = _type;
  7870. this._injector = _injector;
  7871. this._viewContainerRef = _viewContainerRef;
  7872. this._renderer = _renderer;
  7873. this._componentFactoryResolver = _componentFactoryResolver;
  7874. this._applicationRef = _applicationRef;
  7875. }
  7876. /**
  7877. * @param {?=} content
  7878. * @param {?=} context
  7879. * @return {?}
  7880. */
  7881. PopupService.prototype.open = /**
  7882. * @param {?=} content
  7883. * @param {?=} context
  7884. * @return {?}
  7885. */
  7886. function (content, context) {
  7887. if (!this._windowRef) {
  7888. this._contentRef = this._getContentRef(content, context);
  7889. this._windowRef = this._viewContainerRef.createComponent(this._componentFactoryResolver.resolveComponentFactory(this._type), 0, this._injector, this._contentRef.nodes);
  7890. }
  7891. return this._windowRef;
  7892. };
  7893. /**
  7894. * @return {?}
  7895. */
  7896. PopupService.prototype.close = /**
  7897. * @return {?}
  7898. */
  7899. function () {
  7900. if (this._windowRef) {
  7901. this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView));
  7902. this._windowRef = null;
  7903. if (this._contentRef.viewRef) {
  7904. this._applicationRef.detachView(this._contentRef.viewRef);
  7905. this._contentRef.viewRef.destroy();
  7906. this._contentRef = null;
  7907. }
  7908. }
  7909. };
  7910. /**
  7911. * @private
  7912. * @param {?} content
  7913. * @param {?=} context
  7914. * @return {?}
  7915. */
  7916. PopupService.prototype._getContentRef = /**
  7917. * @private
  7918. * @param {?} content
  7919. * @param {?=} context
  7920. * @return {?}
  7921. */
  7922. function (content, context) {
  7923. if (!content) {
  7924. return new ContentRef([]);
  7925. }
  7926. else if (content instanceof TemplateRef) {
  7927. /** @type {?} */
  7928. var viewRef = content.createEmbeddedView(context);
  7929. this._applicationRef.attachView(viewRef);
  7930. return new ContentRef([viewRef.rootNodes], viewRef);
  7931. }
  7932. else {
  7933. return new ContentRef([[this._renderer.createText("" + content)]]);
  7934. }
  7935. };
  7936. return PopupService;
  7937. }());
  7938. /**
  7939. * @fileoverview added by tsickle
  7940. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7941. */
  7942. /** @type {?} */
  7943. var noop = (/**
  7944. * @return {?}
  7945. */
  7946. function () { });
  7947. /**
  7948. * Utility to handle the scrollbar.
  7949. *
  7950. * It allows to compensate the lack of a vertical scrollbar by adding an
  7951. * equivalent padding on the right of the body, and to remove this compensation.
  7952. */
  7953. var ScrollBar = /** @class */ (function () {
  7954. function ScrollBar(_document) {
  7955. this._document = _document;
  7956. }
  7957. /**
  7958. * To be called right before a potential vertical scrollbar would be removed:
  7959. *
  7960. * - if there was a scrollbar, adds some compensation padding to the body
  7961. * to keep the same layout as when the scrollbar is there
  7962. * - if there was none, there is nothing to do
  7963. *
  7964. * @return a callback used to revert the compensation (noop if there was none,
  7965. * otherwise a function removing the padding)
  7966. */
  7967. /**
  7968. * To be called right before a potential vertical scrollbar would be removed:
  7969. *
  7970. * - if there was a scrollbar, adds some compensation padding to the body
  7971. * to keep the same layout as when the scrollbar is there
  7972. * - if there was none, there is nothing to do
  7973. *
  7974. * @return {?} a callback used to revert the compensation (noop if there was none,
  7975. * otherwise a function removing the padding)
  7976. */
  7977. ScrollBar.prototype.compensate = /**
  7978. * To be called right before a potential vertical scrollbar would be removed:
  7979. *
  7980. * - if there was a scrollbar, adds some compensation padding to the body
  7981. * to keep the same layout as when the scrollbar is there
  7982. * - if there was none, there is nothing to do
  7983. *
  7984. * @return {?} a callback used to revert the compensation (noop if there was none,
  7985. * otherwise a function removing the padding)
  7986. */
  7987. function () {
  7988. /** @type {?} */
  7989. var width = this._getWidth();
  7990. return !this._isPresent(width) ? noop : this._adjustBody(width);
  7991. };
  7992. /**
  7993. * Adds a padding of the given width on the right of the body.
  7994. *
  7995. * @return a callback used to revert the padding to its previous value
  7996. */
  7997. /**
  7998. * Adds a padding of the given width on the right of the body.
  7999. *
  8000. * @private
  8001. * @param {?} scrollbarWidth
  8002. * @return {?} a callback used to revert the padding to its previous value
  8003. */
  8004. ScrollBar.prototype._adjustBody = /**
  8005. * Adds a padding of the given width on the right of the body.
  8006. *
  8007. * @private
  8008. * @param {?} scrollbarWidth
  8009. * @return {?} a callback used to revert the padding to its previous value
  8010. */
  8011. function (scrollbarWidth) {
  8012. /** @type {?} */
  8013. var body = this._document.body;
  8014. /** @type {?} */
  8015. var userSetPaddingStyle = body.style.paddingRight;
  8016. /** @type {?} */
  8017. var actualPadding = parseFloat(window.getComputedStyle(body)['padding-right']);
  8018. body.style['padding-right'] = actualPadding + scrollbarWidth + "px";
  8019. return (/**
  8020. * @return {?}
  8021. */
  8022. function () { return body.style['padding-right'] = userSetPaddingStyle; });
  8023. };
  8024. /**
  8025. * Tells whether a scrollbar is currently present on the body.
  8026. *
  8027. * @return true if scrollbar is present, false otherwise
  8028. */
  8029. /**
  8030. * Tells whether a scrollbar is currently present on the body.
  8031. *
  8032. * @private
  8033. * @param {?} scrollbarWidth
  8034. * @return {?} true if scrollbar is present, false otherwise
  8035. */
  8036. ScrollBar.prototype._isPresent = /**
  8037. * Tells whether a scrollbar is currently present on the body.
  8038. *
  8039. * @private
  8040. * @param {?} scrollbarWidth
  8041. * @return {?} true if scrollbar is present, false otherwise
  8042. */
  8043. function (scrollbarWidth) {
  8044. /** @type {?} */
  8045. var rect = this._document.body.getBoundingClientRect();
  8046. /** @type {?} */
  8047. var bodyToViewportGap = window.innerWidth - (rect.left + rect.right);
  8048. /** @type {?} */
  8049. var uncertainty = 0.1 * scrollbarWidth;
  8050. return bodyToViewportGap >= scrollbarWidth - uncertainty;
  8051. };
  8052. /**
  8053. * Calculates and returns the width of a scrollbar.
  8054. *
  8055. * @return the width of a scrollbar on this page
  8056. */
  8057. /**
  8058. * Calculates and returns the width of a scrollbar.
  8059. *
  8060. * @private
  8061. * @return {?} the width of a scrollbar on this page
  8062. */
  8063. ScrollBar.prototype._getWidth = /**
  8064. * Calculates and returns the width of a scrollbar.
  8065. *
  8066. * @private
  8067. * @return {?} the width of a scrollbar on this page
  8068. */
  8069. function () {
  8070. /** @type {?} */
  8071. var measurer = this._document.createElement('div');
  8072. measurer.className = 'modal-scrollbar-measure';
  8073. /** @type {?} */
  8074. var body = this._document.body;
  8075. body.appendChild(measurer);
  8076. /** @type {?} */
  8077. var width = measurer.getBoundingClientRect().width - measurer.clientWidth;
  8078. body.removeChild(measurer);
  8079. return width;
  8080. };
  8081. ScrollBar.decorators = [
  8082. { type: Injectable, args: [{ providedIn: 'root' },] }
  8083. ];
  8084. /** @nocollapse */
  8085. ScrollBar.ctorParameters = function () { return [
  8086. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
  8087. ]; };
  8088. /** @nocollapse */ ScrollBar.ngInjectableDef = ɵɵdefineInjectable({ factory: function ScrollBar_Factory() { return new ScrollBar(ɵɵinject(DOCUMENT)); }, token: ScrollBar, providedIn: "root" });
  8089. return ScrollBar;
  8090. }());
  8091. /**
  8092. * @fileoverview added by tsickle
  8093. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8094. */
  8095. var NgbModalBackdrop = /** @class */ (function () {
  8096. function NgbModalBackdrop() {
  8097. }
  8098. NgbModalBackdrop.decorators = [
  8099. { type: Component, args: [{
  8100. selector: 'ngb-modal-backdrop',
  8101. encapsulation: ViewEncapsulation.None,
  8102. template: '',
  8103. host: { '[class]': '"modal-backdrop fade show" + (backdropClass ? " " + backdropClass : "")', 'style': 'z-index: 1050' }
  8104. }] }
  8105. ];
  8106. NgbModalBackdrop.propDecorators = {
  8107. backdropClass: [{ type: Input }]
  8108. };
  8109. return NgbModalBackdrop;
  8110. }());
  8111. /**
  8112. * @fileoverview added by tsickle
  8113. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8114. */
  8115. /**
  8116. * A reference to the currently opened (active) modal.
  8117. *
  8118. * Instances of this class can be injected into your component passed as modal content.
  8119. * So you can `.close()` or `.dismiss()` the modal window from your component.
  8120. */
  8121. var /**
  8122. * A reference to the currently opened (active) modal.
  8123. *
  8124. * Instances of this class can be injected into your component passed as modal content.
  8125. * So you can `.close()` or `.dismiss()` the modal window from your component.
  8126. */
  8127. NgbActiveModal = /** @class */ (function () {
  8128. function NgbActiveModal() {
  8129. }
  8130. /**
  8131. * Closes the modal with an optional `result` value.
  8132. *
  8133. * The `NgbMobalRef.result` promise will be resolved with the provided value.
  8134. */
  8135. /**
  8136. * Closes the modal with an optional `result` value.
  8137. *
  8138. * The `NgbMobalRef.result` promise will be resolved with the provided value.
  8139. * @param {?=} result
  8140. * @return {?}
  8141. */
  8142. NgbActiveModal.prototype.close = /**
  8143. * Closes the modal with an optional `result` value.
  8144. *
  8145. * The `NgbMobalRef.result` promise will be resolved with the provided value.
  8146. * @param {?=} result
  8147. * @return {?}
  8148. */
  8149. function (result) { };
  8150. /**
  8151. * Dismisses the modal with an optional `reason` value.
  8152. *
  8153. * The `NgbModalRef.result` promise will be rejected with the provided value.
  8154. */
  8155. /**
  8156. * Dismisses the modal with an optional `reason` value.
  8157. *
  8158. * The `NgbModalRef.result` promise will be rejected with the provided value.
  8159. * @param {?=} reason
  8160. * @return {?}
  8161. */
  8162. NgbActiveModal.prototype.dismiss = /**
  8163. * Dismisses the modal with an optional `reason` value.
  8164. *
  8165. * The `NgbModalRef.result` promise will be rejected with the provided value.
  8166. * @param {?=} reason
  8167. * @return {?}
  8168. */
  8169. function (reason) { };
  8170. return NgbActiveModal;
  8171. }());
  8172. /**
  8173. * A reference to the newly opened modal returned by the `NgbModal.open()` method.
  8174. */
  8175. var /**
  8176. * A reference to the newly opened modal returned by the `NgbModal.open()` method.
  8177. */
  8178. NgbModalRef = /** @class */ (function () {
  8179. function NgbModalRef(_windowCmptRef, _contentRef, _backdropCmptRef, _beforeDismiss) {
  8180. var _this = this;
  8181. this._windowCmptRef = _windowCmptRef;
  8182. this._contentRef = _contentRef;
  8183. this._backdropCmptRef = _backdropCmptRef;
  8184. this._beforeDismiss = _beforeDismiss;
  8185. _windowCmptRef.instance.dismissEvent.subscribe((/**
  8186. * @param {?} reason
  8187. * @return {?}
  8188. */
  8189. function (reason) { _this.dismiss(reason); }));
  8190. this.result = new Promise((/**
  8191. * @param {?} resolve
  8192. * @param {?} reject
  8193. * @return {?}
  8194. */
  8195. function (resolve, reject) {
  8196. _this._resolve = resolve;
  8197. _this._reject = reject;
  8198. }));
  8199. this.result.then(null, (/**
  8200. * @return {?}
  8201. */
  8202. function () { }));
  8203. }
  8204. Object.defineProperty(NgbModalRef.prototype, "componentInstance", {
  8205. /**
  8206. * The instance of a component used for the modal content.
  8207. *
  8208. * When a `TemplateRef` is used as the content or when the modal is closed, will return `undefined`.
  8209. */
  8210. get: /**
  8211. * The instance of a component used for the modal content.
  8212. *
  8213. * When a `TemplateRef` is used as the content or when the modal is closed, will return `undefined`.
  8214. * @return {?}
  8215. */
  8216. function () {
  8217. if (this._contentRef && this._contentRef.componentRef) {
  8218. return this._contentRef.componentRef.instance;
  8219. }
  8220. },
  8221. enumerable: true,
  8222. configurable: true
  8223. });
  8224. /**
  8225. * Closes the modal with an optional `result` value.
  8226. *
  8227. * The `NgbMobalRef.result` promise will be resolved with the provided value.
  8228. */
  8229. /**
  8230. * Closes the modal with an optional `result` value.
  8231. *
  8232. * The `NgbMobalRef.result` promise will be resolved with the provided value.
  8233. * @param {?=} result
  8234. * @return {?}
  8235. */
  8236. NgbModalRef.prototype.close = /**
  8237. * Closes the modal with an optional `result` value.
  8238. *
  8239. * The `NgbMobalRef.result` promise will be resolved with the provided value.
  8240. * @param {?=} result
  8241. * @return {?}
  8242. */
  8243. function (result) {
  8244. if (this._windowCmptRef) {
  8245. this._resolve(result);
  8246. this._removeModalElements();
  8247. }
  8248. };
  8249. /**
  8250. * @private
  8251. * @param {?=} reason
  8252. * @return {?}
  8253. */
  8254. NgbModalRef.prototype._dismiss = /**
  8255. * @private
  8256. * @param {?=} reason
  8257. * @return {?}
  8258. */
  8259. function (reason) {
  8260. this._reject(reason);
  8261. this._removeModalElements();
  8262. };
  8263. /**
  8264. * Dismisses the modal with an optional `reason` value.
  8265. *
  8266. * The `NgbModalRef.result` promise will be rejected with the provided value.
  8267. */
  8268. /**
  8269. * Dismisses the modal with an optional `reason` value.
  8270. *
  8271. * The `NgbModalRef.result` promise will be rejected with the provided value.
  8272. * @param {?=} reason
  8273. * @return {?}
  8274. */
  8275. NgbModalRef.prototype.dismiss = /**
  8276. * Dismisses the modal with an optional `reason` value.
  8277. *
  8278. * The `NgbModalRef.result` promise will be rejected with the provided value.
  8279. * @param {?=} reason
  8280. * @return {?}
  8281. */
  8282. function (reason) {
  8283. var _this = this;
  8284. if (this._windowCmptRef) {
  8285. if (!this._beforeDismiss) {
  8286. this._dismiss(reason);
  8287. }
  8288. else {
  8289. /** @type {?} */
  8290. var dismiss = this._beforeDismiss();
  8291. if (dismiss && dismiss.then) {
  8292. dismiss.then((/**
  8293. * @param {?} result
  8294. * @return {?}
  8295. */
  8296. function (result) {
  8297. if (result !== false) {
  8298. _this._dismiss(reason);
  8299. }
  8300. }), (/**
  8301. * @return {?}
  8302. */
  8303. function () { }));
  8304. }
  8305. else if (dismiss !== false) {
  8306. this._dismiss(reason);
  8307. }
  8308. }
  8309. }
  8310. };
  8311. /**
  8312. * @private
  8313. * @return {?}
  8314. */
  8315. NgbModalRef.prototype._removeModalElements = /**
  8316. * @private
  8317. * @return {?}
  8318. */
  8319. function () {
  8320. /** @type {?} */
  8321. var windowNativeEl = this._windowCmptRef.location.nativeElement;
  8322. windowNativeEl.parentNode.removeChild(windowNativeEl);
  8323. this._windowCmptRef.destroy();
  8324. if (this._backdropCmptRef) {
  8325. /** @type {?} */
  8326. var backdropNativeEl = this._backdropCmptRef.location.nativeElement;
  8327. backdropNativeEl.parentNode.removeChild(backdropNativeEl);
  8328. this._backdropCmptRef.destroy();
  8329. }
  8330. if (this._contentRef && this._contentRef.viewRef) {
  8331. this._contentRef.viewRef.destroy();
  8332. }
  8333. this._windowCmptRef = null;
  8334. this._backdropCmptRef = null;
  8335. this._contentRef = null;
  8336. };
  8337. return NgbModalRef;
  8338. }());
  8339. /**
  8340. * @fileoverview added by tsickle
  8341. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8342. */
  8343. /** @enum {number} */
  8344. var ModalDismissReasons = {
  8345. BACKDROP_CLICK: 0,
  8346. ESC: 1,
  8347. };
  8348. ModalDismissReasons[ModalDismissReasons.BACKDROP_CLICK] = 'BACKDROP_CLICK';
  8349. ModalDismissReasons[ModalDismissReasons.ESC] = 'ESC';
  8350. /**
  8351. * @fileoverview added by tsickle
  8352. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8353. */
  8354. var NgbModalWindow = /** @class */ (function () {
  8355. function NgbModalWindow(_document, _elRef, _zone) {
  8356. this._document = _document;
  8357. this._elRef = _elRef;
  8358. this._zone = _zone;
  8359. this._closed$ = new Subject();
  8360. this.backdrop = true;
  8361. this.keyboard = true;
  8362. this.dismissEvent = new EventEmitter();
  8363. }
  8364. /**
  8365. * @param {?} reason
  8366. * @return {?}
  8367. */
  8368. NgbModalWindow.prototype.dismiss = /**
  8369. * @param {?} reason
  8370. * @return {?}
  8371. */
  8372. function (reason) { this.dismissEvent.emit(reason); };
  8373. /**
  8374. * @return {?}
  8375. */
  8376. NgbModalWindow.prototype.ngOnInit = /**
  8377. * @return {?}
  8378. */
  8379. function () { this._elWithFocus = this._document.activeElement; };
  8380. /**
  8381. * @return {?}
  8382. */
  8383. NgbModalWindow.prototype.ngAfterViewInit = /**
  8384. * @return {?}
  8385. */
  8386. function () {
  8387. var _this = this;
  8388. var nativeElement = this._elRef.nativeElement;
  8389. this._zone.runOutsideAngular((/**
  8390. * @return {?}
  8391. */
  8392. function () {
  8393. fromEvent(nativeElement, 'keydown')
  8394. .pipe(takeUntil(_this._closed$),
  8395. // tslint:disable-next-line:deprecation
  8396. filter((/**
  8397. * @param {?} e
  8398. * @return {?}
  8399. */
  8400. function (e) { return e.which === Key.Escape && _this.keyboard; })))
  8401. .subscribe((/**
  8402. * @param {?} event
  8403. * @return {?}
  8404. */
  8405. function (event) { return requestAnimationFrame((/**
  8406. * @return {?}
  8407. */
  8408. function () {
  8409. if (!event.defaultPrevented) {
  8410. _this._zone.run((/**
  8411. * @return {?}
  8412. */
  8413. function () { return _this.dismiss(ModalDismissReasons.ESC); }));
  8414. }
  8415. })); }));
  8416. // We're listening to 'mousedown' and 'mouseup' to prevent modal from closing when pressing the mouse
  8417. // inside the modal dialog and releasing it outside
  8418. /** @type {?} */
  8419. var preventClose = false;
  8420. fromEvent(_this._dialogEl.nativeElement, 'mousedown')
  8421. .pipe(takeUntil(_this._closed$), tap((/**
  8422. * @return {?}
  8423. */
  8424. function () { return preventClose = false; })), switchMap((/**
  8425. * @return {?}
  8426. */
  8427. function () { return fromEvent(nativeElement, 'mouseup').pipe(takeUntil(_this._closed$), take(1)); })), filter((/**
  8428. * @param {?} __0
  8429. * @return {?}
  8430. */
  8431. function (_a) {
  8432. var target = _a.target;
  8433. return nativeElement === target;
  8434. })))
  8435. .subscribe((/**
  8436. * @return {?}
  8437. */
  8438. function () { preventClose = true; }));
  8439. // We're listening to 'click' to dismiss modal on modal window click, except when:
  8440. // 1. clicking on modal dialog itself
  8441. // 2. closing was prevented by mousedown/up handlers
  8442. // 3. clicking on scrollbar when the viewport is too small and modal doesn't fit (click is not triggered at all)
  8443. fromEvent(nativeElement, 'click').pipe(takeUntil(_this._closed$)).subscribe((/**
  8444. * @param {?} __0
  8445. * @return {?}
  8446. */
  8447. function (_a) {
  8448. var target = _a.target;
  8449. if (_this.backdrop === true && nativeElement === target && !preventClose) {
  8450. _this._zone.run((/**
  8451. * @return {?}
  8452. */
  8453. function () { return _this.dismiss(ModalDismissReasons.BACKDROP_CLICK); }));
  8454. }
  8455. preventClose = false;
  8456. }));
  8457. }));
  8458. if (!nativeElement.contains(document.activeElement)) {
  8459. /** @type {?} */
  8460. var autoFocusable = (/** @type {?} */ (nativeElement.querySelector("[ngbAutofocus]")));
  8461. /** @type {?} */
  8462. var firstFocusable = getFocusableBoundaryElements(nativeElement)[0];
  8463. /** @type {?} */
  8464. var elementToFocus = autoFocusable || firstFocusable || nativeElement;
  8465. elementToFocus.focus();
  8466. }
  8467. };
  8468. /**
  8469. * @return {?}
  8470. */
  8471. NgbModalWindow.prototype.ngOnDestroy = /**
  8472. * @return {?}
  8473. */
  8474. function () {
  8475. var _this = this;
  8476. /** @type {?} */
  8477. var body = this._document.body;
  8478. /** @type {?} */
  8479. var elWithFocus = this._elWithFocus;
  8480. /** @type {?} */
  8481. var elementToFocus;
  8482. if (elWithFocus && elWithFocus['focus'] && body.contains(elWithFocus)) {
  8483. elementToFocus = elWithFocus;
  8484. }
  8485. else {
  8486. elementToFocus = body;
  8487. }
  8488. this._zone.runOutsideAngular((/**
  8489. * @return {?}
  8490. */
  8491. function () {
  8492. setTimeout((/**
  8493. * @return {?}
  8494. */
  8495. function () { return elementToFocus.focus(); }));
  8496. _this._elWithFocus = null;
  8497. }));
  8498. this._closed$.next();
  8499. };
  8500. NgbModalWindow.decorators = [
  8501. { type: Component, args: [{
  8502. selector: 'ngb-modal-window',
  8503. host: {
  8504. '[class]': '"modal fade show d-block" + (windowClass ? " " + windowClass : "")',
  8505. 'role': 'dialog',
  8506. 'tabindex': '-1',
  8507. '[attr.aria-modal]': 'true',
  8508. '[attr.aria-labelledby]': 'ariaLabelledBy',
  8509. },
  8510. template: "\n <div #dialog [class]=\"'modal-dialog' + (size ? ' modal-' + size : '') + (centered ? ' modal-dialog-centered' : '') +\n (scrollable ? ' modal-dialog-scrollable' : '')\" role=\"document\">\n <div class=\"modal-content\"><ng-content></ng-content></div>\n </div>\n ",
  8511. encapsulation: ViewEncapsulation.None,
  8512. styles: ["ngb-modal-window .component-host-scrollable{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}"]
  8513. }] }
  8514. ];
  8515. /** @nocollapse */
  8516. NgbModalWindow.ctorParameters = function () { return [
  8517. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
  8518. { type: ElementRef },
  8519. { type: NgZone }
  8520. ]; };
  8521. NgbModalWindow.propDecorators = {
  8522. _dialogEl: [{ type: ViewChild, args: ['dialog', { static: true },] }],
  8523. ariaLabelledBy: [{ type: Input }],
  8524. backdrop: [{ type: Input }],
  8525. centered: [{ type: Input }],
  8526. keyboard: [{ type: Input }],
  8527. scrollable: [{ type: Input }],
  8528. size: [{ type: Input }],
  8529. windowClass: [{ type: Input }],
  8530. dismissEvent: [{ type: Output, args: ['dismiss',] }]
  8531. };
  8532. return NgbModalWindow;
  8533. }());
  8534. /**
  8535. * @fileoverview added by tsickle
  8536. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8537. */
  8538. var NgbModalStack = /** @class */ (function () {
  8539. function NgbModalStack(_applicationRef, _injector, _document, _scrollBar, _rendererFactory, _ngZone) {
  8540. var _this = this;
  8541. this._applicationRef = _applicationRef;
  8542. this._injector = _injector;
  8543. this._document = _document;
  8544. this._scrollBar = _scrollBar;
  8545. this._rendererFactory = _rendererFactory;
  8546. this._ngZone = _ngZone;
  8547. this._activeWindowCmptHasChanged = new Subject();
  8548. this._ariaHiddenValues = new Map();
  8549. this._backdropAttributes = ['backdropClass'];
  8550. this._modalRefs = [];
  8551. this._windowAttributes = ['ariaLabelledBy', 'backdrop', 'centered', 'keyboard', 'scrollable', 'size', 'windowClass'];
  8552. this._windowCmpts = [];
  8553. // Trap focus on active WindowCmpt
  8554. this._activeWindowCmptHasChanged.subscribe((/**
  8555. * @return {?}
  8556. */
  8557. function () {
  8558. if (_this._windowCmpts.length) {
  8559. /** @type {?} */
  8560. var activeWindowCmpt = _this._windowCmpts[_this._windowCmpts.length - 1];
  8561. ngbFocusTrap(_this._ngZone, activeWindowCmpt.location.nativeElement, _this._activeWindowCmptHasChanged);
  8562. _this._revertAriaHidden();
  8563. _this._setAriaHidden(activeWindowCmpt.location.nativeElement);
  8564. }
  8565. }));
  8566. }
  8567. /**
  8568. * @param {?} moduleCFR
  8569. * @param {?} contentInjector
  8570. * @param {?} content
  8571. * @param {?} options
  8572. * @return {?}
  8573. */
  8574. NgbModalStack.prototype.open = /**
  8575. * @param {?} moduleCFR
  8576. * @param {?} contentInjector
  8577. * @param {?} content
  8578. * @param {?} options
  8579. * @return {?}
  8580. */
  8581. function (moduleCFR, contentInjector, content, options) {
  8582. var _this = this;
  8583. /** @type {?} */
  8584. var containerEl = isDefined(options.container) ? this._document.querySelector(options.container) : this._document.body;
  8585. /** @type {?} */
  8586. var renderer = this._rendererFactory.createRenderer(null, null);
  8587. /** @type {?} */
  8588. var revertPaddingForScrollBar = this._scrollBar.compensate();
  8589. /** @type {?} */
  8590. var removeBodyClass = (/**
  8591. * @return {?}
  8592. */
  8593. function () {
  8594. if (!_this._modalRefs.length) {
  8595. renderer.removeClass(_this._document.body, 'modal-open');
  8596. _this._revertAriaHidden();
  8597. }
  8598. });
  8599. if (!containerEl) {
  8600. throw new Error("The specified modal container \"" + (options.container || 'body') + "\" was not found in the DOM.");
  8601. }
  8602. /** @type {?} */
  8603. var activeModal = new NgbActiveModal();
  8604. /** @type {?} */
  8605. var contentRef = this._getContentRef(moduleCFR, options.injector || contentInjector, content, activeModal, options);
  8606. /** @type {?} */
  8607. var backdropCmptRef = options.backdrop !== false ? this._attachBackdrop(moduleCFR, containerEl) : null;
  8608. /** @type {?} */
  8609. var windowCmptRef = this._attachWindowComponent(moduleCFR, containerEl, contentRef);
  8610. /** @type {?} */
  8611. var ngbModalRef = new NgbModalRef(windowCmptRef, contentRef, backdropCmptRef, options.beforeDismiss);
  8612. this._registerModalRef(ngbModalRef);
  8613. this._registerWindowCmpt(windowCmptRef);
  8614. ngbModalRef.result.then(revertPaddingForScrollBar, revertPaddingForScrollBar);
  8615. ngbModalRef.result.then(removeBodyClass, removeBodyClass);
  8616. activeModal.close = (/**
  8617. * @param {?} result
  8618. * @return {?}
  8619. */
  8620. function (result) { ngbModalRef.close(result); });
  8621. activeModal.dismiss = (/**
  8622. * @param {?} reason
  8623. * @return {?}
  8624. */
  8625. function (reason) { ngbModalRef.dismiss(reason); });
  8626. this._applyWindowOptions(windowCmptRef.instance, options);
  8627. if (this._modalRefs.length === 1) {
  8628. renderer.addClass(this._document.body, 'modal-open');
  8629. }
  8630. if (backdropCmptRef && backdropCmptRef.instance) {
  8631. this._applyBackdropOptions(backdropCmptRef.instance, options);
  8632. }
  8633. return ngbModalRef;
  8634. };
  8635. /**
  8636. * @param {?=} reason
  8637. * @return {?}
  8638. */
  8639. NgbModalStack.prototype.dismissAll = /**
  8640. * @param {?=} reason
  8641. * @return {?}
  8642. */
  8643. function (reason) { this._modalRefs.forEach((/**
  8644. * @param {?} ngbModalRef
  8645. * @return {?}
  8646. */
  8647. function (ngbModalRef) { return ngbModalRef.dismiss(reason); })); };
  8648. /**
  8649. * @return {?}
  8650. */
  8651. NgbModalStack.prototype.hasOpenModals = /**
  8652. * @return {?}
  8653. */
  8654. function () { return this._modalRefs.length > 0; };
  8655. /**
  8656. * @private
  8657. * @param {?} moduleCFR
  8658. * @param {?} containerEl
  8659. * @return {?}
  8660. */
  8661. NgbModalStack.prototype._attachBackdrop = /**
  8662. * @private
  8663. * @param {?} moduleCFR
  8664. * @param {?} containerEl
  8665. * @return {?}
  8666. */
  8667. function (moduleCFR, containerEl) {
  8668. /** @type {?} */
  8669. var backdropFactory = moduleCFR.resolveComponentFactory(NgbModalBackdrop);
  8670. /** @type {?} */
  8671. var backdropCmptRef = backdropFactory.create(this._injector);
  8672. this._applicationRef.attachView(backdropCmptRef.hostView);
  8673. containerEl.appendChild(backdropCmptRef.location.nativeElement);
  8674. return backdropCmptRef;
  8675. };
  8676. /**
  8677. * @private
  8678. * @param {?} moduleCFR
  8679. * @param {?} containerEl
  8680. * @param {?} contentRef
  8681. * @return {?}
  8682. */
  8683. NgbModalStack.prototype._attachWindowComponent = /**
  8684. * @private
  8685. * @param {?} moduleCFR
  8686. * @param {?} containerEl
  8687. * @param {?} contentRef
  8688. * @return {?}
  8689. */
  8690. function (moduleCFR, containerEl, contentRef) {
  8691. /** @type {?} */
  8692. var windowFactory = moduleCFR.resolveComponentFactory(NgbModalWindow);
  8693. /** @type {?} */
  8694. var windowCmptRef = windowFactory.create(this._injector, contentRef.nodes);
  8695. this._applicationRef.attachView(windowCmptRef.hostView);
  8696. containerEl.appendChild(windowCmptRef.location.nativeElement);
  8697. return windowCmptRef;
  8698. };
  8699. /**
  8700. * @private
  8701. * @param {?} windowInstance
  8702. * @param {?} options
  8703. * @return {?}
  8704. */
  8705. NgbModalStack.prototype._applyWindowOptions = /**
  8706. * @private
  8707. * @param {?} windowInstance
  8708. * @param {?} options
  8709. * @return {?}
  8710. */
  8711. function (windowInstance, options) {
  8712. this._windowAttributes.forEach((/**
  8713. * @param {?} optionName
  8714. * @return {?}
  8715. */
  8716. function (optionName) {
  8717. if (isDefined(options[optionName])) {
  8718. windowInstance[optionName] = options[optionName];
  8719. }
  8720. }));
  8721. };
  8722. /**
  8723. * @private
  8724. * @param {?} backdropInstance
  8725. * @param {?} options
  8726. * @return {?}
  8727. */
  8728. NgbModalStack.prototype._applyBackdropOptions = /**
  8729. * @private
  8730. * @param {?} backdropInstance
  8731. * @param {?} options
  8732. * @return {?}
  8733. */
  8734. function (backdropInstance, options) {
  8735. this._backdropAttributes.forEach((/**
  8736. * @param {?} optionName
  8737. * @return {?}
  8738. */
  8739. function (optionName) {
  8740. if (isDefined(options[optionName])) {
  8741. backdropInstance[optionName] = options[optionName];
  8742. }
  8743. }));
  8744. };
  8745. /**
  8746. * @private
  8747. * @param {?} moduleCFR
  8748. * @param {?} contentInjector
  8749. * @param {?} content
  8750. * @param {?} activeModal
  8751. * @param {?} options
  8752. * @return {?}
  8753. */
  8754. NgbModalStack.prototype._getContentRef = /**
  8755. * @private
  8756. * @param {?} moduleCFR
  8757. * @param {?} contentInjector
  8758. * @param {?} content
  8759. * @param {?} activeModal
  8760. * @param {?} options
  8761. * @return {?}
  8762. */
  8763. function (moduleCFR, contentInjector, content, activeModal, options) {
  8764. if (!content) {
  8765. return new ContentRef([]);
  8766. }
  8767. else if (content instanceof TemplateRef) {
  8768. return this._createFromTemplateRef(content, activeModal);
  8769. }
  8770. else if (isString(content)) {
  8771. return this._createFromString(content);
  8772. }
  8773. else {
  8774. return this._createFromComponent(moduleCFR, contentInjector, content, activeModal, options);
  8775. }
  8776. };
  8777. /**
  8778. * @private
  8779. * @param {?} content
  8780. * @param {?} activeModal
  8781. * @return {?}
  8782. */
  8783. NgbModalStack.prototype._createFromTemplateRef = /**
  8784. * @private
  8785. * @param {?} content
  8786. * @param {?} activeModal
  8787. * @return {?}
  8788. */
  8789. function (content, activeModal) {
  8790. /** @type {?} */
  8791. var context = {
  8792. $implicit: activeModal,
  8793. close: /**
  8794. * @param {?} result
  8795. * @return {?}
  8796. */
  8797. function (result) { activeModal.close(result); },
  8798. dismiss: /**
  8799. * @param {?} reason
  8800. * @return {?}
  8801. */
  8802. function (reason) { activeModal.dismiss(reason); }
  8803. };
  8804. /** @type {?} */
  8805. var viewRef = content.createEmbeddedView(context);
  8806. this._applicationRef.attachView(viewRef);
  8807. return new ContentRef([viewRef.rootNodes], viewRef);
  8808. };
  8809. /**
  8810. * @private
  8811. * @param {?} content
  8812. * @return {?}
  8813. */
  8814. NgbModalStack.prototype._createFromString = /**
  8815. * @private
  8816. * @param {?} content
  8817. * @return {?}
  8818. */
  8819. function (content) {
  8820. /** @type {?} */
  8821. var component = this._document.createTextNode("" + content);
  8822. return new ContentRef([[component]]);
  8823. };
  8824. /**
  8825. * @private
  8826. * @param {?} moduleCFR
  8827. * @param {?} contentInjector
  8828. * @param {?} content
  8829. * @param {?} context
  8830. * @param {?} options
  8831. * @return {?}
  8832. */
  8833. NgbModalStack.prototype._createFromComponent = /**
  8834. * @private
  8835. * @param {?} moduleCFR
  8836. * @param {?} contentInjector
  8837. * @param {?} content
  8838. * @param {?} context
  8839. * @param {?} options
  8840. * @return {?}
  8841. */
  8842. function (moduleCFR, contentInjector, content, context, options) {
  8843. /** @type {?} */
  8844. var contentCmptFactory = moduleCFR.resolveComponentFactory(content);
  8845. /** @type {?} */
  8846. var modalContentInjector = Injector.create({ providers: [{ provide: NgbActiveModal, useValue: context }], parent: contentInjector });
  8847. /** @type {?} */
  8848. var componentRef = contentCmptFactory.create(modalContentInjector);
  8849. /** @type {?} */
  8850. var componentNativeEl = componentRef.location.nativeElement;
  8851. if (options.scrollable) {
  8852. ((/** @type {?} */ (componentNativeEl))).classList.add('component-host-scrollable');
  8853. }
  8854. this._applicationRef.attachView(componentRef.hostView);
  8855. // FIXME: we should here get rid of the component nativeElement
  8856. // and use `[Array.from(componentNativeEl.childNodes)]` instead and remove the above CSS class.
  8857. return new ContentRef([[componentNativeEl]], componentRef.hostView, componentRef);
  8858. };
  8859. /**
  8860. * @private
  8861. * @param {?} element
  8862. * @return {?}
  8863. */
  8864. NgbModalStack.prototype._setAriaHidden = /**
  8865. * @private
  8866. * @param {?} element
  8867. * @return {?}
  8868. */
  8869. function (element) {
  8870. var _this = this;
  8871. /** @type {?} */
  8872. var parent = element.parentElement;
  8873. if (parent && element !== this._document.body) {
  8874. Array.from(parent.children).forEach((/**
  8875. * @param {?} sibling
  8876. * @return {?}
  8877. */
  8878. function (sibling) {
  8879. if (sibling !== element && sibling.nodeName !== 'SCRIPT') {
  8880. _this._ariaHiddenValues.set(sibling, sibling.getAttribute('aria-hidden'));
  8881. sibling.setAttribute('aria-hidden', 'true');
  8882. }
  8883. }));
  8884. this._setAriaHidden(parent);
  8885. }
  8886. };
  8887. /**
  8888. * @private
  8889. * @return {?}
  8890. */
  8891. NgbModalStack.prototype._revertAriaHidden = /**
  8892. * @private
  8893. * @return {?}
  8894. */
  8895. function () {
  8896. this._ariaHiddenValues.forEach((/**
  8897. * @param {?} value
  8898. * @param {?} element
  8899. * @return {?}
  8900. */
  8901. function (value, element) {
  8902. if (value) {
  8903. element.setAttribute('aria-hidden', value);
  8904. }
  8905. else {
  8906. element.removeAttribute('aria-hidden');
  8907. }
  8908. }));
  8909. this._ariaHiddenValues.clear();
  8910. };
  8911. /**
  8912. * @private
  8913. * @param {?} ngbModalRef
  8914. * @return {?}
  8915. */
  8916. NgbModalStack.prototype._registerModalRef = /**
  8917. * @private
  8918. * @param {?} ngbModalRef
  8919. * @return {?}
  8920. */
  8921. function (ngbModalRef) {
  8922. var _this = this;
  8923. /** @type {?} */
  8924. var unregisterModalRef = (/**
  8925. * @return {?}
  8926. */
  8927. function () {
  8928. /** @type {?} */
  8929. var index = _this._modalRefs.indexOf(ngbModalRef);
  8930. if (index > -1) {
  8931. _this._modalRefs.splice(index, 1);
  8932. }
  8933. });
  8934. this._modalRefs.push(ngbModalRef);
  8935. ngbModalRef.result.then(unregisterModalRef, unregisterModalRef);
  8936. };
  8937. /**
  8938. * @private
  8939. * @param {?} ngbWindowCmpt
  8940. * @return {?}
  8941. */
  8942. NgbModalStack.prototype._registerWindowCmpt = /**
  8943. * @private
  8944. * @param {?} ngbWindowCmpt
  8945. * @return {?}
  8946. */
  8947. function (ngbWindowCmpt) {
  8948. var _this = this;
  8949. this._windowCmpts.push(ngbWindowCmpt);
  8950. this._activeWindowCmptHasChanged.next();
  8951. ngbWindowCmpt.onDestroy((/**
  8952. * @return {?}
  8953. */
  8954. function () {
  8955. /** @type {?} */
  8956. var index = _this._windowCmpts.indexOf(ngbWindowCmpt);
  8957. if (index > -1) {
  8958. _this._windowCmpts.splice(index, 1);
  8959. _this._activeWindowCmptHasChanged.next();
  8960. }
  8961. }));
  8962. };
  8963. NgbModalStack.decorators = [
  8964. { type: Injectable, args: [{ providedIn: 'root' },] }
  8965. ];
  8966. /** @nocollapse */
  8967. NgbModalStack.ctorParameters = function () { return [
  8968. { type: ApplicationRef },
  8969. { type: Injector },
  8970. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
  8971. { type: ScrollBar },
  8972. { type: RendererFactory2 },
  8973. { type: NgZone }
  8974. ]; };
  8975. /** @nocollapse */ NgbModalStack.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbModalStack_Factory() { return new NgbModalStack(ɵɵinject(ApplicationRef), ɵɵinject(INJECTOR), ɵɵinject(DOCUMENT), ɵɵinject(ScrollBar), ɵɵinject(RendererFactory2), ɵɵinject(NgZone)); }, token: NgbModalStack, providedIn: "root" });
  8976. return NgbModalStack;
  8977. }());
  8978. /**
  8979. * @fileoverview added by tsickle
  8980. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8981. */
  8982. /**
  8983. * A service for opening modal windows.
  8984. *
  8985. * Creating a modal is straightforward: create a component or a template and pass it as an argument to
  8986. * the `.open()` method.
  8987. */
  8988. var NgbModal = /** @class */ (function () {
  8989. function NgbModal(_moduleCFR, _injector, _modalStack, _config) {
  8990. this._moduleCFR = _moduleCFR;
  8991. this._injector = _injector;
  8992. this._modalStack = _modalStack;
  8993. this._config = _config;
  8994. }
  8995. /**
  8996. * Opens a new modal window with the specified content and supplied options.
  8997. *
  8998. * Content can be provided as a `TemplateRef` or a component type. If you pass a component type as content,
  8999. * then instances of those components can be injected with an instance of the `NgbActiveModal` class. You can then
  9000. * use `NgbActiveModal` methods to close / dismiss modals from "inside" of your component.
  9001. *
  9002. * Also see the [`NgbModalOptions`](#/components/modal/api#NgbModalOptions) for the list of supported options.
  9003. */
  9004. /**
  9005. * Opens a new modal window with the specified content and supplied options.
  9006. *
  9007. * Content can be provided as a `TemplateRef` or a component type. If you pass a component type as content,
  9008. * then instances of those components can be injected with an instance of the `NgbActiveModal` class. You can then
  9009. * use `NgbActiveModal` methods to close / dismiss modals from "inside" of your component.
  9010. *
  9011. * Also see the [`NgbModalOptions`](#/components/modal/api#NgbModalOptions) for the list of supported options.
  9012. * @param {?} content
  9013. * @param {?=} options
  9014. * @return {?}
  9015. */
  9016. NgbModal.prototype.open = /**
  9017. * Opens a new modal window with the specified content and supplied options.
  9018. *
  9019. * Content can be provided as a `TemplateRef` or a component type. If you pass a component type as content,
  9020. * then instances of those components can be injected with an instance of the `NgbActiveModal` class. You can then
  9021. * use `NgbActiveModal` methods to close / dismiss modals from "inside" of your component.
  9022. *
  9023. * Also see the [`NgbModalOptions`](#/components/modal/api#NgbModalOptions) for the list of supported options.
  9024. * @param {?} content
  9025. * @param {?=} options
  9026. * @return {?}
  9027. */
  9028. function (content, options) {
  9029. if (options === void 0) { options = {}; }
  9030. /** @type {?} */
  9031. var combinedOptions = Object.assign({}, this._config, options);
  9032. return this._modalStack.open(this._moduleCFR, this._injector, content, combinedOptions);
  9033. };
  9034. /**
  9035. * Dismisses all currently displayed modal windows with the supplied reason.
  9036. *
  9037. * @since 3.1.0
  9038. */
  9039. /**
  9040. * Dismisses all currently displayed modal windows with the supplied reason.
  9041. *
  9042. * \@since 3.1.0
  9043. * @param {?=} reason
  9044. * @return {?}
  9045. */
  9046. NgbModal.prototype.dismissAll = /**
  9047. * Dismisses all currently displayed modal windows with the supplied reason.
  9048. *
  9049. * \@since 3.1.0
  9050. * @param {?=} reason
  9051. * @return {?}
  9052. */
  9053. function (reason) { this._modalStack.dismissAll(reason); };
  9054. /**
  9055. * Indicates if there are currently any open modal windows in the application.
  9056. *
  9057. * @since 3.3.0
  9058. */
  9059. /**
  9060. * Indicates if there are currently any open modal windows in the application.
  9061. *
  9062. * \@since 3.3.0
  9063. * @return {?}
  9064. */
  9065. NgbModal.prototype.hasOpenModals = /**
  9066. * Indicates if there are currently any open modal windows in the application.
  9067. *
  9068. * \@since 3.3.0
  9069. * @return {?}
  9070. */
  9071. function () { return this._modalStack.hasOpenModals(); };
  9072. NgbModal.decorators = [
  9073. { type: Injectable, args: [{ providedIn: 'root' },] }
  9074. ];
  9075. /** @nocollapse */
  9076. NgbModal.ctorParameters = function () { return [
  9077. { type: ComponentFactoryResolver },
  9078. { type: Injector },
  9079. { type: NgbModalStack },
  9080. { type: NgbModalConfig }
  9081. ]; };
  9082. /** @nocollapse */ NgbModal.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbModal_Factory() { return new NgbModal(ɵɵinject(ComponentFactoryResolver), ɵɵinject(INJECTOR), ɵɵinject(NgbModalStack), ɵɵinject(NgbModalConfig)); }, token: NgbModal, providedIn: "root" });
  9083. return NgbModal;
  9084. }());
  9085. /**
  9086. * @fileoverview added by tsickle
  9087. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9088. */
  9089. var NgbModalModule = /** @class */ (function () {
  9090. function NgbModalModule() {
  9091. }
  9092. NgbModalModule.decorators = [
  9093. { type: NgModule, args: [{
  9094. declarations: [NgbModalBackdrop, NgbModalWindow],
  9095. entryComponents: [NgbModalBackdrop, NgbModalWindow],
  9096. providers: [NgbModal]
  9097. },] }
  9098. ];
  9099. return NgbModalModule;
  9100. }());
  9101. /**
  9102. * @fileoverview added by tsickle
  9103. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9104. */
  9105. /**
  9106. * A configuration service for the [`NgbNav`](#/components/nav/api#NgbNav) component.
  9107. *
  9108. * You can inject this service, typically in your root component, and customize the values of its properties in
  9109. * order to provide default values for all the navs used in the application.
  9110. *
  9111. * \@since 5.2.0
  9112. */
  9113. var NgbNavConfig = /** @class */ (function () {
  9114. function NgbNavConfig() {
  9115. this.destroyOnHide = true;
  9116. this.orientation = 'horizontal';
  9117. this.roles = 'tablist';
  9118. }
  9119. NgbNavConfig.decorators = [
  9120. { type: Injectable, args: [{ providedIn: 'root' },] }
  9121. ];
  9122. /** @nocollapse */ NgbNavConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbNavConfig_Factory() { return new NgbNavConfig(); }, token: NgbNavConfig, providedIn: "root" });
  9123. return NgbNavConfig;
  9124. }());
  9125. /**
  9126. * @fileoverview added by tsickle
  9127. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9128. */
  9129. /** @type {?} */
  9130. var isValidNavId = (/**
  9131. * @param {?} id
  9132. * @return {?}
  9133. */
  9134. function (id) { return isDefined(id) && id !== ''; });
  9135. /** @type {?} */
  9136. var navCounter = 0;
  9137. /**
  9138. * This directive must be used to wrap content to be displayed in the nav.
  9139. *
  9140. * \@since 5.2.0
  9141. */
  9142. var NgbNavContent = /** @class */ (function () {
  9143. function NgbNavContent(templateRef) {
  9144. this.templateRef = templateRef;
  9145. }
  9146. NgbNavContent.decorators = [
  9147. { type: Directive, args: [{ selector: 'ng-template[ngbNavContent]' },] }
  9148. ];
  9149. /** @nocollapse */
  9150. NgbNavContent.ctorParameters = function () { return [
  9151. { type: TemplateRef }
  9152. ]; };
  9153. return NgbNavContent;
  9154. }());
  9155. /**
  9156. * The directive used to group nav link and related nav content. As well as set nav identifier and some options.
  9157. *
  9158. * \@since 5.2.0
  9159. */
  9160. var NgbNavItem = /** @class */ (function () {
  9161. function NgbNavItem(nav, elementRef) {
  9162. this.elementRef = elementRef;
  9163. /**
  9164. * If `true`, the current nav item is disabled and can't be toggled by user.
  9165. *
  9166. * Nevertheless disabled nav can be selected programmatically via the `.select()` method and the `[activeId]` binding.
  9167. */
  9168. this.disabled = false;
  9169. // TODO: cf https://github.com/angular/angular/issues/30106
  9170. this._nav = nav;
  9171. }
  9172. /**
  9173. * @return {?}
  9174. */
  9175. NgbNavItem.prototype.ngAfterContentChecked = /**
  9176. * @return {?}
  9177. */
  9178. function () {
  9179. // We are using @ContentChildren instead of @ContentChild as in the Angular version being used
  9180. // only @ContentChildren allows us to specify the {descendants: false} option.
  9181. // Without {descendants: false} we are hitting bugs described in:
  9182. // https://github.com/ng-bootstrap/ng-bootstrap/issues/2240
  9183. this.contentTpl = this.contentTpls.first;
  9184. };
  9185. /**
  9186. * @return {?}
  9187. */
  9188. NgbNavItem.prototype.ngOnInit = /**
  9189. * @return {?}
  9190. */
  9191. function () {
  9192. if (!isDefined(this.domId)) {
  9193. this.domId = "ngb-nav-" + navCounter++;
  9194. }
  9195. };
  9196. Object.defineProperty(NgbNavItem.prototype, "active", {
  9197. get: /**
  9198. * @return {?}
  9199. */
  9200. function () { return this._nav.activeId === this.id; },
  9201. enumerable: true,
  9202. configurable: true
  9203. });
  9204. Object.defineProperty(NgbNavItem.prototype, "id", {
  9205. get: /**
  9206. * @return {?}
  9207. */
  9208. function () { return isValidNavId(this._id) ? this._id : this.domId; },
  9209. enumerable: true,
  9210. configurable: true
  9211. });
  9212. Object.defineProperty(NgbNavItem.prototype, "panelDomId", {
  9213. get: /**
  9214. * @return {?}
  9215. */
  9216. function () { return this.domId + "-panel"; },
  9217. enumerable: true,
  9218. configurable: true
  9219. });
  9220. /**
  9221. * @return {?}
  9222. */
  9223. NgbNavItem.prototype.isPanelInDom = /**
  9224. * @return {?}
  9225. */
  9226. function () {
  9227. return (isDefined(this.destroyOnHide) ? !this.destroyOnHide : !this._nav.destroyOnHide) || this.active;
  9228. };
  9229. NgbNavItem.decorators = [
  9230. { type: Directive, args: [{ selector: '[ngbNavItem]', exportAs: 'ngbNavItem', host: { '[class.nav-item]': 'true' } },] }
  9231. ];
  9232. /** @nocollapse */
  9233. NgbNavItem.ctorParameters = function () { return [
  9234. { type: undefined, decorators: [{ type: Inject, args: [forwardRef((/**
  9235. * @return {?}
  9236. */
  9237. function () { return NgbNav; })),] }] },
  9238. { type: ElementRef }
  9239. ]; };
  9240. NgbNavItem.propDecorators = {
  9241. destroyOnHide: [{ type: Input }],
  9242. disabled: [{ type: Input }],
  9243. domId: [{ type: Input }],
  9244. _id: [{ type: Input, args: ['ngbNavItem',] }],
  9245. contentTpls: [{ type: ContentChildren, args: [NgbNavContent, { descendants: false },] }]
  9246. };
  9247. return NgbNavItem;
  9248. }());
  9249. /**
  9250. * A nav directive that helps with implementing tabbed navigation components.
  9251. *
  9252. * \@since 5.2.0
  9253. */
  9254. var NgbNav = /** @class */ (function () {
  9255. function NgbNav(role, config, _cd) {
  9256. this.role = role;
  9257. this._cd = _cd;
  9258. /**
  9259. * The event emitted after the active nav changes
  9260. * The payload of the event is the newly active nav id
  9261. *
  9262. * If you want to prevent nav change, you should use `(navChange)` event
  9263. */
  9264. this.activeIdChange = new EventEmitter();
  9265. /**
  9266. * The nav change event emitted right before the nav change happens on user click.
  9267. *
  9268. * This event won't be emitted if nav is changed programmatically via `[activeId]` or `.select()`.
  9269. *
  9270. * See [`NgbNavChangeEvent`](#/components/nav/api#NgbNavChangeEvent) for payload details.
  9271. */
  9272. this.navChange = new EventEmitter();
  9273. this.destroyOnHide = config.destroyOnHide;
  9274. this.orientation = config.orientation;
  9275. this.roles = config.roles;
  9276. }
  9277. /**
  9278. * @param {?} item
  9279. * @return {?}
  9280. */
  9281. NgbNav.prototype.click = /**
  9282. * @param {?} item
  9283. * @return {?}
  9284. */
  9285. function (item) {
  9286. if (!item.disabled) {
  9287. this._updateActiveId(item.id);
  9288. }
  9289. };
  9290. /**
  9291. * Selects the nav with the given id and shows its associated pane.
  9292. * Any other nav that was previously selected becomes unselected and its associated pane is hidden.
  9293. */
  9294. /**
  9295. * Selects the nav with the given id and shows its associated pane.
  9296. * Any other nav that was previously selected becomes unselected and its associated pane is hidden.
  9297. * @param {?} id
  9298. * @return {?}
  9299. */
  9300. NgbNav.prototype.select = /**
  9301. * Selects the nav with the given id and shows its associated pane.
  9302. * Any other nav that was previously selected becomes unselected and its associated pane is hidden.
  9303. * @param {?} id
  9304. * @return {?}
  9305. */
  9306. function (id) { this._updateActiveId(id, false); };
  9307. /**
  9308. * @return {?}
  9309. */
  9310. NgbNav.prototype.ngAfterContentInit = /**
  9311. * @return {?}
  9312. */
  9313. function () {
  9314. if (!isDefined(this.activeId)) {
  9315. /** @type {?} */
  9316. var nextId = this.items.first ? this.items.first.id : null;
  9317. if (isValidNavId(nextId)) {
  9318. this._updateActiveId(nextId, false);
  9319. this._cd.detectChanges();
  9320. }
  9321. }
  9322. };
  9323. /**
  9324. * @private
  9325. * @param {?} nextId
  9326. * @param {?=} emitNavChange
  9327. * @return {?}
  9328. */
  9329. NgbNav.prototype._updateActiveId = /**
  9330. * @private
  9331. * @param {?} nextId
  9332. * @param {?=} emitNavChange
  9333. * @return {?}
  9334. */
  9335. function (nextId, emitNavChange) {
  9336. if (emitNavChange === void 0) { emitNavChange = true; }
  9337. if (this.activeId !== nextId) {
  9338. /** @type {?} */
  9339. var defaultPrevented_1 = false;
  9340. if (emitNavChange) {
  9341. this.navChange.emit({ activeId: this.activeId, nextId: nextId, preventDefault: (/**
  9342. * @return {?}
  9343. */
  9344. function () { defaultPrevented_1 = true; }) });
  9345. }
  9346. if (!defaultPrevented_1) {
  9347. this.activeId = nextId;
  9348. this.activeIdChange.emit(nextId);
  9349. }
  9350. }
  9351. };
  9352. NgbNav.decorators = [
  9353. { type: Directive, args: [{
  9354. selector: '[ngbNav]',
  9355. exportAs: 'ngbNav',
  9356. host: {
  9357. '[class.nav]': 'true',
  9358. '[class.flex-column]': "orientation === 'vertical'",
  9359. '[attr.aria-orientation]': "orientation === 'vertical' && roles === 'tablist' ? 'vertical' : undefined",
  9360. '[attr.role]': "role ? role : roles ? 'tablist' : undefined",
  9361. }
  9362. },] }
  9363. ];
  9364. /** @nocollapse */
  9365. NgbNav.ctorParameters = function () { return [
  9366. { type: String, decorators: [{ type: Attribute, args: ['role',] }] },
  9367. { type: NgbNavConfig },
  9368. { type: ChangeDetectorRef }
  9369. ]; };
  9370. NgbNav.propDecorators = {
  9371. activeId: [{ type: Input }],
  9372. activeIdChange: [{ type: Output }],
  9373. destroyOnHide: [{ type: Input }],
  9374. orientation: [{ type: Input }],
  9375. roles: [{ type: Input }],
  9376. items: [{ type: ContentChildren, args: [NgbNavItem,] }],
  9377. navChange: [{ type: Output }]
  9378. };
  9379. return NgbNav;
  9380. }());
  9381. /**
  9382. * A directive to put on the nav link.
  9383. *
  9384. * \@since 5.2.0
  9385. */
  9386. var NgbNavLink = /** @class */ (function () {
  9387. function NgbNavLink(role, navItem, nav) {
  9388. this.role = role;
  9389. this.navItem = navItem;
  9390. this.nav = nav;
  9391. }
  9392. /**
  9393. * @return {?}
  9394. */
  9395. NgbNavLink.prototype.hasNavItemClass = /**
  9396. * @return {?}
  9397. */
  9398. function () {
  9399. // with alternative markup we have to add `.nav-item` class, because `ngbNavItem` is on the ng-container
  9400. return this.navItem.elementRef.nativeElement.nodeType === Node.COMMENT_NODE;
  9401. };
  9402. NgbNavLink.decorators = [
  9403. { type: Directive, args: [{
  9404. selector: 'a[ngbNavLink]',
  9405. host: {
  9406. '[id]': 'navItem.domId',
  9407. '[class.nav-link]': 'true',
  9408. '[class.nav-item]': 'hasNavItemClass()',
  9409. '[attr.role]': "role ? role : nav.roles ? 'tab' : undefined",
  9410. 'href': '',
  9411. '[class.active]': 'navItem.active',
  9412. '[class.disabled]': 'navItem.disabled',
  9413. '[attr.tabindex]': 'navItem.disabled ? -1 : undefined',
  9414. '[attr.aria-controls]': 'navItem.isPanelInDom() ? navItem.panelDomId : null',
  9415. '[attr.aria-selected]': 'navItem.active',
  9416. '[attr.aria-disabled]': 'navItem.disabled',
  9417. '(click)': 'nav.click(navItem); $event.preventDefault()'
  9418. }
  9419. },] }
  9420. ];
  9421. /** @nocollapse */
  9422. NgbNavLink.ctorParameters = function () { return [
  9423. { type: String, decorators: [{ type: Attribute, args: ['role',] }] },
  9424. { type: NgbNavItem },
  9425. { type: NgbNav }
  9426. ]; };
  9427. return NgbNavLink;
  9428. }());
  9429. /**
  9430. * @fileoverview added by tsickle
  9431. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9432. */
  9433. /**
  9434. * The outlet where currently active nav content will be displayed.
  9435. *
  9436. * \@since 5.2.0
  9437. */
  9438. var NgbNavOutlet = /** @class */ (function () {
  9439. function NgbNavOutlet() {
  9440. }
  9441. NgbNavOutlet.decorators = [
  9442. { type: Component, args: [{
  9443. selector: '[ngbNavOutlet]',
  9444. host: { '[class.tab-content]': 'true' },
  9445. encapsulation: ViewEncapsulation.None,
  9446. template: "\n <ng-template ngFor let-item [ngForOf]=\"nav.items\">\n <div class=\"tab-pane\"\n *ngIf=\"item.isPanelInDom()\"\n [id]=\"item.panelDomId\"\n [class.active]=\"item.active\"\n [attr.role]=\"paneRole ? paneRole : nav.roles ? 'tabpanel' : undefined\"\n [attr.aria-labelledby]=\"item.domId\">\n <ng-template [ngTemplateOutlet]=\"item.contentTpl?.templateRef\" [ngTemplateOutletContext]=\"{$implicit: item.active}\"></ng-template>\n </div>\n </ng-template>\n "
  9447. }] }
  9448. ];
  9449. NgbNavOutlet.propDecorators = {
  9450. paneRole: [{ type: Input }],
  9451. nav: [{ type: Input, args: ['ngbNavOutlet',] }]
  9452. };
  9453. return NgbNavOutlet;
  9454. }());
  9455. /**
  9456. * @fileoverview added by tsickle
  9457. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9458. */
  9459. /** @type {?} */
  9460. var NGB_NAV_DIRECTIVES = [NgbNavContent, NgbNav, NgbNavItem, NgbNavLink, NgbNavOutlet];
  9461. var NgbNavModule = /** @class */ (function () {
  9462. function NgbNavModule() {
  9463. }
  9464. NgbNavModule.decorators = [
  9465. { type: NgModule, args: [{ declarations: NGB_NAV_DIRECTIVES, exports: NGB_NAV_DIRECTIVES, imports: [CommonModule] },] }
  9466. ];
  9467. return NgbNavModule;
  9468. }());
  9469. /**
  9470. * @fileoverview added by tsickle
  9471. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9472. */
  9473. /**
  9474. * A configuration service for the [`NgbPagination`](#/components/pagination/api#NgbPagination) component.
  9475. *
  9476. * You can inject this service, typically in your root component, and customize the values of its properties in
  9477. * order to provide default values for all the paginations used in the application.
  9478. */
  9479. var NgbPaginationConfig = /** @class */ (function () {
  9480. function NgbPaginationConfig() {
  9481. this.disabled = false;
  9482. this.boundaryLinks = false;
  9483. this.directionLinks = true;
  9484. this.ellipses = true;
  9485. this.maxSize = 0;
  9486. this.pageSize = 10;
  9487. this.rotate = false;
  9488. }
  9489. NgbPaginationConfig.decorators = [
  9490. { type: Injectable, args: [{ providedIn: 'root' },] }
  9491. ];
  9492. /** @nocollapse */ NgbPaginationConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbPaginationConfig_Factory() { return new NgbPaginationConfig(); }, token: NgbPaginationConfig, providedIn: "root" });
  9493. return NgbPaginationConfig;
  9494. }());
  9495. /**
  9496. * @fileoverview added by tsickle
  9497. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9498. */
  9499. /**
  9500. * A directive to match the 'ellipsis' link template
  9501. *
  9502. * \@since 4.1.0
  9503. */
  9504. var NgbPaginationEllipsis = /** @class */ (function () {
  9505. function NgbPaginationEllipsis(templateRef) {
  9506. this.templateRef = templateRef;
  9507. }
  9508. NgbPaginationEllipsis.decorators = [
  9509. { type: Directive, args: [{ selector: 'ng-template[ngbPaginationEllipsis]' },] }
  9510. ];
  9511. /** @nocollapse */
  9512. NgbPaginationEllipsis.ctorParameters = function () { return [
  9513. { type: TemplateRef }
  9514. ]; };
  9515. return NgbPaginationEllipsis;
  9516. }());
  9517. /**
  9518. * A directive to match the 'first' link template
  9519. *
  9520. * \@since 4.1.0
  9521. */
  9522. var NgbPaginationFirst = /** @class */ (function () {
  9523. function NgbPaginationFirst(templateRef) {
  9524. this.templateRef = templateRef;
  9525. }
  9526. NgbPaginationFirst.decorators = [
  9527. { type: Directive, args: [{ selector: 'ng-template[ngbPaginationFirst]' },] }
  9528. ];
  9529. /** @nocollapse */
  9530. NgbPaginationFirst.ctorParameters = function () { return [
  9531. { type: TemplateRef }
  9532. ]; };
  9533. return NgbPaginationFirst;
  9534. }());
  9535. /**
  9536. * A directive to match the 'last' link template
  9537. *
  9538. * \@since 4.1.0
  9539. */
  9540. var NgbPaginationLast = /** @class */ (function () {
  9541. function NgbPaginationLast(templateRef) {
  9542. this.templateRef = templateRef;
  9543. }
  9544. NgbPaginationLast.decorators = [
  9545. { type: Directive, args: [{ selector: 'ng-template[ngbPaginationLast]' },] }
  9546. ];
  9547. /** @nocollapse */
  9548. NgbPaginationLast.ctorParameters = function () { return [
  9549. { type: TemplateRef }
  9550. ]; };
  9551. return NgbPaginationLast;
  9552. }());
  9553. /**
  9554. * A directive to match the 'next' link template
  9555. *
  9556. * \@since 4.1.0
  9557. */
  9558. var NgbPaginationNext = /** @class */ (function () {
  9559. function NgbPaginationNext(templateRef) {
  9560. this.templateRef = templateRef;
  9561. }
  9562. NgbPaginationNext.decorators = [
  9563. { type: Directive, args: [{ selector: 'ng-template[ngbPaginationNext]' },] }
  9564. ];
  9565. /** @nocollapse */
  9566. NgbPaginationNext.ctorParameters = function () { return [
  9567. { type: TemplateRef }
  9568. ]; };
  9569. return NgbPaginationNext;
  9570. }());
  9571. /**
  9572. * A directive to match the page 'number' link template
  9573. *
  9574. * \@since 4.1.0
  9575. */
  9576. var NgbPaginationNumber = /** @class */ (function () {
  9577. function NgbPaginationNumber(templateRef) {
  9578. this.templateRef = templateRef;
  9579. }
  9580. NgbPaginationNumber.decorators = [
  9581. { type: Directive, args: [{ selector: 'ng-template[ngbPaginationNumber]' },] }
  9582. ];
  9583. /** @nocollapse */
  9584. NgbPaginationNumber.ctorParameters = function () { return [
  9585. { type: TemplateRef }
  9586. ]; };
  9587. return NgbPaginationNumber;
  9588. }());
  9589. /**
  9590. * A directive to match the 'previous' link template
  9591. *
  9592. * \@since 4.1.0
  9593. */
  9594. var NgbPaginationPrevious = /** @class */ (function () {
  9595. function NgbPaginationPrevious(templateRef) {
  9596. this.templateRef = templateRef;
  9597. }
  9598. NgbPaginationPrevious.decorators = [
  9599. { type: Directive, args: [{ selector: 'ng-template[ngbPaginationPrevious]' },] }
  9600. ];
  9601. /** @nocollapse */
  9602. NgbPaginationPrevious.ctorParameters = function () { return [
  9603. { type: TemplateRef }
  9604. ]; };
  9605. return NgbPaginationPrevious;
  9606. }());
  9607. /**
  9608. * A component that displays page numbers and allows to customize them in several ways.
  9609. */
  9610. var NgbPagination = /** @class */ (function () {
  9611. function NgbPagination(config) {
  9612. this.pageCount = 0;
  9613. this.pages = [];
  9614. /**
  9615. * The current page.
  9616. *
  9617. * Page numbers start with `1`.
  9618. */
  9619. this.page = 1;
  9620. /**
  9621. * An event fired when the page is changed. Will fire only if collection size is set and all values are valid.
  9622. *
  9623. * Event payload is the number of the newly selected page.
  9624. *
  9625. * Page numbers start with `1`.
  9626. */
  9627. this.pageChange = new EventEmitter(true);
  9628. this.disabled = config.disabled;
  9629. this.boundaryLinks = config.boundaryLinks;
  9630. this.directionLinks = config.directionLinks;
  9631. this.ellipses = config.ellipses;
  9632. this.maxSize = config.maxSize;
  9633. this.pageSize = config.pageSize;
  9634. this.rotate = config.rotate;
  9635. this.size = config.size;
  9636. }
  9637. /**
  9638. * @return {?}
  9639. */
  9640. NgbPagination.prototype.hasPrevious = /**
  9641. * @return {?}
  9642. */
  9643. function () { return this.page > 1; };
  9644. /**
  9645. * @return {?}
  9646. */
  9647. NgbPagination.prototype.hasNext = /**
  9648. * @return {?}
  9649. */
  9650. function () { return this.page < this.pageCount; };
  9651. /**
  9652. * @return {?}
  9653. */
  9654. NgbPagination.prototype.nextDisabled = /**
  9655. * @return {?}
  9656. */
  9657. function () { return !this.hasNext() || this.disabled; };
  9658. /**
  9659. * @return {?}
  9660. */
  9661. NgbPagination.prototype.previousDisabled = /**
  9662. * @return {?}
  9663. */
  9664. function () { return !this.hasPrevious() || this.disabled; };
  9665. /**
  9666. * @param {?} pageNumber
  9667. * @return {?}
  9668. */
  9669. NgbPagination.prototype.selectPage = /**
  9670. * @param {?} pageNumber
  9671. * @return {?}
  9672. */
  9673. function (pageNumber) { this._updatePages(pageNumber); };
  9674. /**
  9675. * @param {?} changes
  9676. * @return {?}
  9677. */
  9678. NgbPagination.prototype.ngOnChanges = /**
  9679. * @param {?} changes
  9680. * @return {?}
  9681. */
  9682. function (changes) { this._updatePages(this.page); };
  9683. /**
  9684. * @param {?} pageNumber
  9685. * @return {?}
  9686. */
  9687. NgbPagination.prototype.isEllipsis = /**
  9688. * @param {?} pageNumber
  9689. * @return {?}
  9690. */
  9691. function (pageNumber) { return pageNumber === -1; };
  9692. /**
  9693. * Appends ellipses and first/last page number to the displayed pages
  9694. */
  9695. /**
  9696. * Appends ellipses and first/last page number to the displayed pages
  9697. * @private
  9698. * @param {?} start
  9699. * @param {?} end
  9700. * @return {?}
  9701. */
  9702. NgbPagination.prototype._applyEllipses = /**
  9703. * Appends ellipses and first/last page number to the displayed pages
  9704. * @private
  9705. * @param {?} start
  9706. * @param {?} end
  9707. * @return {?}
  9708. */
  9709. function (start, end) {
  9710. if (this.ellipses) {
  9711. if (start > 0) {
  9712. // The first page will always be included. If the displayed range
  9713. // starts after the third page, then add ellipsis. But if the range
  9714. // starts on the third page, then add the second page instead of
  9715. // an ellipsis, because the ellipsis would only hide a single page.
  9716. if (start > 2) {
  9717. this.pages.unshift(-1);
  9718. }
  9719. else if (start === 2) {
  9720. this.pages.unshift(2);
  9721. }
  9722. this.pages.unshift(1);
  9723. }
  9724. if (end < this.pageCount) {
  9725. // The last page will always be included. If the displayed range
  9726. // ends before the third-last page, then add ellipsis. But if the range
  9727. // ends on third-last page, then add the second-last page instead of
  9728. // an ellipsis, because the ellipsis would only hide a single page.
  9729. if (end < (this.pageCount - 2)) {
  9730. this.pages.push(-1);
  9731. }
  9732. else if (end === (this.pageCount - 2)) {
  9733. this.pages.push(this.pageCount - 1);
  9734. }
  9735. this.pages.push(this.pageCount);
  9736. }
  9737. }
  9738. };
  9739. /**
  9740. * Rotates page numbers based on maxSize items visible.
  9741. * Currently selected page stays in the middle:
  9742. *
  9743. * Ex. for selected page = 6:
  9744. * [5,*6*,7] for maxSize = 3
  9745. * [4,5,*6*,7] for maxSize = 4
  9746. */
  9747. /**
  9748. * Rotates page numbers based on maxSize items visible.
  9749. * Currently selected page stays in the middle:
  9750. *
  9751. * Ex. for selected page = 6:
  9752. * [5,*6*,7] for maxSize = 3
  9753. * [4,5,*6*,7] for maxSize = 4
  9754. * @private
  9755. * @return {?}
  9756. */
  9757. NgbPagination.prototype._applyRotation = /**
  9758. * Rotates page numbers based on maxSize items visible.
  9759. * Currently selected page stays in the middle:
  9760. *
  9761. * Ex. for selected page = 6:
  9762. * [5,*6*,7] for maxSize = 3
  9763. * [4,5,*6*,7] for maxSize = 4
  9764. * @private
  9765. * @return {?}
  9766. */
  9767. function () {
  9768. /** @type {?} */
  9769. var start = 0;
  9770. /** @type {?} */
  9771. var end = this.pageCount;
  9772. /** @type {?} */
  9773. var leftOffset = Math.floor(this.maxSize / 2);
  9774. /** @type {?} */
  9775. var rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;
  9776. if (this.page <= leftOffset) {
  9777. // very beginning, no rotation -> [0..maxSize]
  9778. end = this.maxSize;
  9779. }
  9780. else if (this.pageCount - this.page < leftOffset) {
  9781. // very end, no rotation -> [len-maxSize..len]
  9782. start = this.pageCount - this.maxSize;
  9783. }
  9784. else {
  9785. // rotate
  9786. start = this.page - leftOffset - 1;
  9787. end = this.page + rightOffset;
  9788. }
  9789. return [start, end];
  9790. };
  9791. /**
  9792. * Paginates page numbers based on maxSize items per page.
  9793. */
  9794. /**
  9795. * Paginates page numbers based on maxSize items per page.
  9796. * @private
  9797. * @return {?}
  9798. */
  9799. NgbPagination.prototype._applyPagination = /**
  9800. * Paginates page numbers based on maxSize items per page.
  9801. * @private
  9802. * @return {?}
  9803. */
  9804. function () {
  9805. /** @type {?} */
  9806. var page = Math.ceil(this.page / this.maxSize) - 1;
  9807. /** @type {?} */
  9808. var start = page * this.maxSize;
  9809. /** @type {?} */
  9810. var end = start + this.maxSize;
  9811. return [start, end];
  9812. };
  9813. /**
  9814. * @private
  9815. * @param {?} newPageNo
  9816. * @return {?}
  9817. */
  9818. NgbPagination.prototype._setPageInRange = /**
  9819. * @private
  9820. * @param {?} newPageNo
  9821. * @return {?}
  9822. */
  9823. function (newPageNo) {
  9824. /** @type {?} */
  9825. var prevPageNo = this.page;
  9826. this.page = getValueInRange(newPageNo, this.pageCount, 1);
  9827. if (this.page !== prevPageNo && isNumber(this.collectionSize)) {
  9828. this.pageChange.emit(this.page);
  9829. }
  9830. };
  9831. /**
  9832. * @private
  9833. * @param {?} newPage
  9834. * @return {?}
  9835. */
  9836. NgbPagination.prototype._updatePages = /**
  9837. * @private
  9838. * @param {?} newPage
  9839. * @return {?}
  9840. */
  9841. function (newPage) {
  9842. var _a, _b;
  9843. this.pageCount = Math.ceil(this.collectionSize / this.pageSize);
  9844. if (!isNumber(this.pageCount)) {
  9845. this.pageCount = 0;
  9846. }
  9847. // fill-in model needed to render pages
  9848. this.pages.length = 0;
  9849. for (var i = 1; i <= this.pageCount; i++) {
  9850. this.pages.push(i);
  9851. }
  9852. // set page within 1..max range
  9853. this._setPageInRange(newPage);
  9854. // apply maxSize if necessary
  9855. if (this.maxSize > 0 && this.pageCount > this.maxSize) {
  9856. /** @type {?} */
  9857. var start = 0;
  9858. /** @type {?} */
  9859. var end = this.pageCount;
  9860. // either paginating or rotating page numbers
  9861. if (this.rotate) {
  9862. _a = __read(this._applyRotation(), 2), start = _a[0], end = _a[1];
  9863. }
  9864. else {
  9865. _b = __read(this._applyPagination(), 2), start = _b[0], end = _b[1];
  9866. }
  9867. this.pages = this.pages.slice(start, end);
  9868. // adding ellipses
  9869. this._applyEllipses(start, end);
  9870. }
  9871. };
  9872. NgbPagination.decorators = [
  9873. { type: Component, args: [{
  9874. selector: 'ngb-pagination',
  9875. changeDetection: ChangeDetectionStrategy.OnPush,
  9876. host: { 'role': 'navigation' },
  9877. template: "\n <ng-template #first><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.first\">&laquo;&laquo;</span></ng-template>\n <ng-template #previous><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.previous\">&laquo;</span></ng-template>\n <ng-template #next><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.next\">&raquo;</span></ng-template>\n <ng-template #last><span aria-hidden=\"true\" i18n=\"@@ngb.pagination.last\">&raquo;&raquo;</span></ng-template>\n <ng-template #ellipsis>...</ng-template>\n <ng-template #defaultNumber let-page let-currentPage=\"currentPage\">\n {{ page }}\n <span *ngIf=\"page === currentPage\" class=\"sr-only\">(current)</span>\n </ng-template>\n <ul [class]=\"'pagination' + (size ? ' pagination-' + size : '')\">\n <li *ngIf=\"boundaryLinks\" class=\"page-item\"\n [class.disabled]=\"previousDisabled()\">\n <a aria-label=\"First\" i18n-aria-label=\"@@ngb.pagination.first-aria\" class=\"page-link\" href\n (click)=\"selectPage(1); $event.preventDefault()\" [attr.tabindex]=\"previousDisabled() ? '-1' : null\"\n [attr.aria-disabled]=\"previousDisabled() ? 'true' : null\">\n <ng-template [ngTemplateOutlet]=\"tplFirst?.templateRef || first\"\n [ngTemplateOutletContext]=\"{disabled: previousDisabled(), currentPage: page}\"></ng-template>\n </a>\n </li>\n\n <li *ngIf=\"directionLinks\" class=\"page-item\"\n [class.disabled]=\"previousDisabled()\">\n <a aria-label=\"Previous\" i18n-aria-label=\"@@ngb.pagination.previous-aria\" class=\"page-link\" href\n (click)=\"selectPage(page-1); $event.preventDefault()\" [attr.tabindex]=\"previousDisabled() ? '-1' : null\"\n [attr.aria-disabled]=\"previousDisabled() ? 'true' : null\">\n <ng-template [ngTemplateOutlet]=\"tplPrevious?.templateRef || previous\"\n [ngTemplateOutletContext]=\"{disabled: previousDisabled()}\"></ng-template>\n </a>\n </li>\n <li *ngFor=\"let pageNumber of pages\" class=\"page-item\" [class.active]=\"pageNumber === page\"\n [class.disabled]=\"isEllipsis(pageNumber) || disabled\" [attr.aria-current]=\"(pageNumber === page ? 'page' : null)\">\n <a *ngIf=\"isEllipsis(pageNumber)\" class=\"page-link\" tabindex=\"-1\" aria-disabled=\"true\">\n <ng-template [ngTemplateOutlet]=\"tplEllipsis?.templateRef || ellipsis\"\n [ngTemplateOutletContext]=\"{disabled: true, currentPage: page}\"></ng-template>\n </a>\n <a *ngIf=\"!isEllipsis(pageNumber)\" class=\"page-link\" href (click)=\"selectPage(pageNumber); $event.preventDefault()\" [attr.tabindex]=\"disabled ? '-1' : null\"\n [attr.aria-disabled]=\"disabled ? 'true' : null\">\n <ng-template [ngTemplateOutlet]=\"tplNumber?.templateRef || defaultNumber\"\n [ngTemplateOutletContext]=\"{disabled: disabled, $implicit: pageNumber, currentPage: page}\"></ng-template>\n </a>\n </li>\n <li *ngIf=\"directionLinks\" class=\"page-item\" [class.disabled]=\"nextDisabled()\">\n <a aria-label=\"Next\" i18n-aria-label=\"@@ngb.pagination.next-aria\" class=\"page-link\" href\n (click)=\"selectPage(page+1); $event.preventDefault()\" [attr.tabindex]=\"nextDisabled() ? '-1' : null\"\n [attr.aria-disabled]=\"nextDisabled() ? 'true' : null\">\n <ng-template [ngTemplateOutlet]=\"tplNext?.templateRef || next\"\n [ngTemplateOutletContext]=\"{disabled: nextDisabled(), currentPage: page}\"></ng-template>\n </a>\n </li>\n\n <li *ngIf=\"boundaryLinks\" class=\"page-item\" [class.disabled]=\"nextDisabled()\">\n <a aria-label=\"Last\" i18n-aria-label=\"@@ngb.pagination.last-aria\" class=\"page-link\" href\n (click)=\"selectPage(pageCount); $event.preventDefault()\" [attr.tabindex]=\"nextDisabled() ? '-1' : null\"\n [attr.aria-disabled]=\"nextDisabled() ? 'true' : null\">\n <ng-template [ngTemplateOutlet]=\"tplLast?.templateRef || last\"\n [ngTemplateOutletContext]=\"{disabled: nextDisabled(), currentPage: page}\"></ng-template>\n </a>\n </li>\n </ul>\n "
  9878. }] }
  9879. ];
  9880. /** @nocollapse */
  9881. NgbPagination.ctorParameters = function () { return [
  9882. { type: NgbPaginationConfig }
  9883. ]; };
  9884. NgbPagination.propDecorators = {
  9885. tplEllipsis: [{ type: ContentChild, args: [NgbPaginationEllipsis, { static: false },] }],
  9886. tplFirst: [{ type: ContentChild, args: [NgbPaginationFirst, { static: false },] }],
  9887. tplLast: [{ type: ContentChild, args: [NgbPaginationLast, { static: false },] }],
  9888. tplNext: [{ type: ContentChild, args: [NgbPaginationNext, { static: false },] }],
  9889. tplNumber: [{ type: ContentChild, args: [NgbPaginationNumber, { static: false },] }],
  9890. tplPrevious: [{ type: ContentChild, args: [NgbPaginationPrevious, { static: false },] }],
  9891. disabled: [{ type: Input }],
  9892. boundaryLinks: [{ type: Input }],
  9893. directionLinks: [{ type: Input }],
  9894. ellipses: [{ type: Input }],
  9895. rotate: [{ type: Input }],
  9896. collectionSize: [{ type: Input }],
  9897. maxSize: [{ type: Input }],
  9898. page: [{ type: Input }],
  9899. pageSize: [{ type: Input }],
  9900. pageChange: [{ type: Output }],
  9901. size: [{ type: Input }]
  9902. };
  9903. return NgbPagination;
  9904. }());
  9905. /**
  9906. * @fileoverview added by tsickle
  9907. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9908. */
  9909. /** @type {?} */
  9910. var DIRECTIVES = [
  9911. NgbPagination, NgbPaginationEllipsis, NgbPaginationFirst, NgbPaginationLast, NgbPaginationNext, NgbPaginationNumber,
  9912. NgbPaginationPrevious
  9913. ];
  9914. var NgbPaginationModule = /** @class */ (function () {
  9915. function NgbPaginationModule() {
  9916. }
  9917. NgbPaginationModule.decorators = [
  9918. { type: NgModule, args: [{ declarations: DIRECTIVES, exports: DIRECTIVES, imports: [CommonModule] },] }
  9919. ];
  9920. return NgbPaginationModule;
  9921. }());
  9922. /**
  9923. * @fileoverview added by tsickle
  9924. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9925. */
  9926. var Trigger = /** @class */ (function () {
  9927. function Trigger(open, close) {
  9928. this.open = open;
  9929. this.close = close;
  9930. if (!close) {
  9931. this.close = open;
  9932. }
  9933. }
  9934. /**
  9935. * @return {?}
  9936. */
  9937. Trigger.prototype.isManual = /**
  9938. * @return {?}
  9939. */
  9940. function () { return this.open === 'manual' || this.close === 'manual'; };
  9941. return Trigger;
  9942. }());
  9943. /** @type {?} */
  9944. var DEFAULT_ALIASES = {
  9945. 'hover': ['mouseenter', 'mouseleave'],
  9946. 'focus': ['focusin', 'focusout'],
  9947. };
  9948. /**
  9949. * @param {?} triggers
  9950. * @param {?=} aliases
  9951. * @return {?}
  9952. */
  9953. function parseTriggers(triggers, aliases) {
  9954. if (aliases === void 0) { aliases = DEFAULT_ALIASES; }
  9955. /** @type {?} */
  9956. var trimmedTriggers = (triggers || '').trim();
  9957. if (trimmedTriggers.length === 0) {
  9958. return [];
  9959. }
  9960. /** @type {?} */
  9961. var parsedTriggers = trimmedTriggers.split(/\s+/).map((/**
  9962. * @param {?} trigger
  9963. * @return {?}
  9964. */
  9965. function (trigger) { return trigger.split(':'); })).map((/**
  9966. * @param {?} triggerPair
  9967. * @return {?}
  9968. */
  9969. function (triggerPair) {
  9970. /** @type {?} */
  9971. var alias = aliases[triggerPair[0]] || triggerPair;
  9972. return new Trigger(alias[0], alias[1]);
  9973. }));
  9974. /** @type {?} */
  9975. var manualTriggers = parsedTriggers.filter((/**
  9976. * @param {?} triggerPair
  9977. * @return {?}
  9978. */
  9979. function (triggerPair) { return triggerPair.isManual(); }));
  9980. if (manualTriggers.length > 1) {
  9981. throw 'Triggers parse error: only one manual trigger is allowed';
  9982. }
  9983. if (manualTriggers.length === 1 && parsedTriggers.length > 1) {
  9984. throw 'Triggers parse error: manual trigger can\'t be mixed with other triggers';
  9985. }
  9986. return parsedTriggers;
  9987. }
  9988. /**
  9989. * @param {?} renderer
  9990. * @param {?} nativeElement
  9991. * @param {?} triggers
  9992. * @param {?} isOpenedFn
  9993. * @return {?}
  9994. */
  9995. function observeTriggers(renderer, nativeElement, triggers, isOpenedFn) {
  9996. return new Observable((/**
  9997. * @param {?} subscriber
  9998. * @return {?}
  9999. */
  10000. function (subscriber) {
  10001. /** @type {?} */
  10002. var listeners = [];
  10003. /** @type {?} */
  10004. var openFn = (/**
  10005. * @return {?}
  10006. */
  10007. function () { return subscriber.next(true); });
  10008. /** @type {?} */
  10009. var closeFn = (/**
  10010. * @return {?}
  10011. */
  10012. function () { return subscriber.next(false); });
  10013. /** @type {?} */
  10014. var toggleFn = (/**
  10015. * @return {?}
  10016. */
  10017. function () { return subscriber.next(!isOpenedFn()); });
  10018. triggers.forEach((/**
  10019. * @param {?} trigger
  10020. * @return {?}
  10021. */
  10022. function (trigger) {
  10023. if (trigger.open === trigger.close) {
  10024. listeners.push(renderer.listen(nativeElement, trigger.open, toggleFn));
  10025. }
  10026. else {
  10027. listeners.push(renderer.listen(nativeElement, trigger.open, openFn), renderer.listen(nativeElement, trigger.close, closeFn));
  10028. }
  10029. }));
  10030. return (/**
  10031. * @return {?}
  10032. */
  10033. function () { listeners.forEach((/**
  10034. * @param {?} unsubscribeFn
  10035. * @return {?}
  10036. */
  10037. function (unsubscribeFn) { return unsubscribeFn(); })); });
  10038. }));
  10039. }
  10040. /** @type {?} */
  10041. var delayOrNoop = (/**
  10042. * @template T
  10043. * @param {?} time
  10044. * @return {?}
  10045. */
  10046. function (time) { return time > 0 ? delay(time) : (/**
  10047. * @param {?} a
  10048. * @return {?}
  10049. */
  10050. function (a) { return a; }); });
  10051. /**
  10052. * @param {?} openDelay
  10053. * @param {?} closeDelay
  10054. * @param {?} isOpenedFn
  10055. * @return {?}
  10056. */
  10057. function triggerDelay(openDelay, closeDelay, isOpenedFn) {
  10058. return (/**
  10059. * @param {?} input$
  10060. * @return {?}
  10061. */
  10062. function (input$) {
  10063. /** @type {?} */
  10064. var pending = null;
  10065. /** @type {?} */
  10066. var filteredInput$ = input$.pipe(map((/**
  10067. * @param {?} open
  10068. * @return {?}
  10069. */
  10070. function (open) { return ({ open: open }); })), filter((/**
  10071. * @param {?} event
  10072. * @return {?}
  10073. */
  10074. function (event) {
  10075. /** @type {?} */
  10076. var currentlyOpen = isOpenedFn();
  10077. if (currentlyOpen !== event.open && (!pending || pending.open === currentlyOpen)) {
  10078. pending = event;
  10079. return true;
  10080. }
  10081. if (pending && pending.open !== event.open) {
  10082. pending = null;
  10083. }
  10084. return false;
  10085. })), share());
  10086. /** @type {?} */
  10087. var delayedOpen$ = filteredInput$.pipe(filter((/**
  10088. * @param {?} event
  10089. * @return {?}
  10090. */
  10091. function (event) { return event.open; })), delayOrNoop(openDelay));
  10092. /** @type {?} */
  10093. var delayedClose$ = filteredInput$.pipe(filter((/**
  10094. * @param {?} event
  10095. * @return {?}
  10096. */
  10097. function (event) { return !event.open; })), delayOrNoop(closeDelay));
  10098. return merge(delayedOpen$, delayedClose$)
  10099. .pipe(filter((/**
  10100. * @param {?} event
  10101. * @return {?}
  10102. */
  10103. function (event) {
  10104. if (event === pending) {
  10105. pending = null;
  10106. return event.open !== isOpenedFn();
  10107. }
  10108. return false;
  10109. })), map((/**
  10110. * @param {?} event
  10111. * @return {?}
  10112. */
  10113. function (event) { return event.open; })));
  10114. });
  10115. }
  10116. /**
  10117. * @param {?} renderer
  10118. * @param {?} nativeElement
  10119. * @param {?} triggers
  10120. * @param {?} isOpenedFn
  10121. * @param {?} openFn
  10122. * @param {?} closeFn
  10123. * @param {?=} openDelay
  10124. * @param {?=} closeDelay
  10125. * @return {?}
  10126. */
  10127. function listenToTriggers(renderer, nativeElement, triggers, isOpenedFn, openFn, closeFn, openDelay, closeDelay) {
  10128. if (openDelay === void 0) { openDelay = 0; }
  10129. if (closeDelay === void 0) { closeDelay = 0; }
  10130. /** @type {?} */
  10131. var parsedTriggers = parseTriggers(triggers);
  10132. if (parsedTriggers.length === 1 && parsedTriggers[0].isManual()) {
  10133. return (/**
  10134. * @return {?}
  10135. */
  10136. function () { });
  10137. }
  10138. /** @type {?} */
  10139. var subscription = observeTriggers(renderer, nativeElement, parsedTriggers, isOpenedFn)
  10140. .pipe(triggerDelay(openDelay, closeDelay, isOpenedFn))
  10141. .subscribe((/**
  10142. * @param {?} open
  10143. * @return {?}
  10144. */
  10145. function (open) { return (open ? openFn() : closeFn()); }));
  10146. return (/**
  10147. * @return {?}
  10148. */
  10149. function () { return subscription.unsubscribe(); });
  10150. }
  10151. /**
  10152. * @fileoverview added by tsickle
  10153. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10154. */
  10155. /**
  10156. * A configuration service for the [`NgbPopover`](#/components/popover/api#NgbPopover) component.
  10157. *
  10158. * You can inject this service, typically in your root component, and customize the values of its properties in
  10159. * order to provide default values for all the popovers used in the application.
  10160. */
  10161. var NgbPopoverConfig = /** @class */ (function () {
  10162. function NgbPopoverConfig() {
  10163. this.autoClose = true;
  10164. this.placement = 'auto';
  10165. this.triggers = 'click';
  10166. this.disablePopover = false;
  10167. this.openDelay = 0;
  10168. this.closeDelay = 0;
  10169. }
  10170. NgbPopoverConfig.decorators = [
  10171. { type: Injectable, args: [{ providedIn: 'root' },] }
  10172. ];
  10173. /** @nocollapse */ NgbPopoverConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbPopoverConfig_Factory() { return new NgbPopoverConfig(); }, token: NgbPopoverConfig, providedIn: "root" });
  10174. return NgbPopoverConfig;
  10175. }());
  10176. /**
  10177. * @fileoverview added by tsickle
  10178. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10179. */
  10180. /** @type {?} */
  10181. var nextId$3 = 0;
  10182. var NgbPopoverWindow = /** @class */ (function () {
  10183. function NgbPopoverWindow() {
  10184. }
  10185. /**
  10186. * @return {?}
  10187. */
  10188. NgbPopoverWindow.prototype.isTitleTemplate = /**
  10189. * @return {?}
  10190. */
  10191. function () { return this.title instanceof TemplateRef; };
  10192. NgbPopoverWindow.decorators = [
  10193. { type: Component, args: [{
  10194. selector: 'ngb-popover-window',
  10195. changeDetection: ChangeDetectionStrategy.OnPush,
  10196. encapsulation: ViewEncapsulation.None,
  10197. host: { '[class]': '"popover" + (popoverClass ? " " + popoverClass : "")', 'role': 'tooltip', '[id]': 'id' },
  10198. template: "\n <div class=\"arrow\"></div>\n <h3 class=\"popover-header\" *ngIf=\"title != null\">\n <ng-template #simpleTitle>{{title}}</ng-template>\n <ng-template [ngTemplateOutlet]=\"isTitleTemplate() ? title : simpleTitle\" [ngTemplateOutletContext]=\"context\"></ng-template>\n </h3>\n <div class=\"popover-body\"><ng-content></ng-content></div>",
  10199. styles: ["ngb-popover-window.bs-popover-bottom>.arrow,ngb-popover-window.bs-popover-top>.arrow{left:50%;margin-left:-.5rem}ngb-popover-window.bs-popover-bottom-left>.arrow,ngb-popover-window.bs-popover-top-left>.arrow{left:2em}ngb-popover-window.bs-popover-bottom-right>.arrow,ngb-popover-window.bs-popover-top-right>.arrow{left:auto;right:2em}ngb-popover-window.bs-popover-left>.arrow,ngb-popover-window.bs-popover-right>.arrow{top:50%;margin-top:-.5rem}ngb-popover-window.bs-popover-left-top>.arrow,ngb-popover-window.bs-popover-right-top>.arrow{top:.7em}ngb-popover-window.bs-popover-left-bottom>.arrow,ngb-popover-window.bs-popover-right-bottom>.arrow{top:auto;bottom:.7em}"]
  10200. }] }
  10201. ];
  10202. NgbPopoverWindow.propDecorators = {
  10203. title: [{ type: Input }],
  10204. id: [{ type: Input }],
  10205. popoverClass: [{ type: Input }],
  10206. context: [{ type: Input }]
  10207. };
  10208. return NgbPopoverWindow;
  10209. }());
  10210. /**
  10211. * A lightweight and extensible directive for fancy popover creation.
  10212. */
  10213. var NgbPopover = /** @class */ (function () {
  10214. function NgbPopover(_elementRef, _renderer, injector, componentFactoryResolver, viewContainerRef, config, _ngZone, _document, _changeDetector, applicationRef) {
  10215. var _this = this;
  10216. this._elementRef = _elementRef;
  10217. this._renderer = _renderer;
  10218. this._ngZone = _ngZone;
  10219. this._document = _document;
  10220. this._changeDetector = _changeDetector;
  10221. /**
  10222. * An event emitted when the popover is shown. Contains no payload.
  10223. */
  10224. this.shown = new EventEmitter();
  10225. /**
  10226. * An event emitted when the popover is hidden. Contains no payload.
  10227. */
  10228. this.hidden = new EventEmitter();
  10229. this._ngbPopoverWindowId = "ngb-popover-" + nextId$3++;
  10230. this.autoClose = config.autoClose;
  10231. this.placement = config.placement;
  10232. this.triggers = config.triggers;
  10233. this.container = config.container;
  10234. this.disablePopover = config.disablePopover;
  10235. this.popoverClass = config.popoverClass;
  10236. this.openDelay = config.openDelay;
  10237. this.closeDelay = config.closeDelay;
  10238. this._popupService = new PopupService(NgbPopoverWindow, injector, viewContainerRef, _renderer, componentFactoryResolver, applicationRef);
  10239. this._zoneSubscription = _ngZone.onStable.subscribe((/**
  10240. * @return {?}
  10241. */
  10242. function () {
  10243. if (_this._windowRef) {
  10244. positionElements(_this._elementRef.nativeElement, _this._windowRef.location.nativeElement, _this.placement, _this.container === 'body', 'bs-popover');
  10245. }
  10246. }));
  10247. }
  10248. /**
  10249. * @private
  10250. * @return {?}
  10251. */
  10252. NgbPopover.prototype._isDisabled = /**
  10253. * @private
  10254. * @return {?}
  10255. */
  10256. function () {
  10257. if (this.disablePopover) {
  10258. return true;
  10259. }
  10260. if (!this.ngbPopover && !this.popoverTitle) {
  10261. return true;
  10262. }
  10263. return false;
  10264. };
  10265. /**
  10266. * Opens the popover.
  10267. *
  10268. * This is considered to be a "manual" triggering.
  10269. * The `context` is an optional value to be injected into the popover template when it is created.
  10270. */
  10271. /**
  10272. * Opens the popover.
  10273. *
  10274. * This is considered to be a "manual" triggering.
  10275. * The `context` is an optional value to be injected into the popover template when it is created.
  10276. * @param {?=} context
  10277. * @return {?}
  10278. */
  10279. NgbPopover.prototype.open = /**
  10280. * Opens the popover.
  10281. *
  10282. * This is considered to be a "manual" triggering.
  10283. * The `context` is an optional value to be injected into the popover template when it is created.
  10284. * @param {?=} context
  10285. * @return {?}
  10286. */
  10287. function (context) {
  10288. var _this = this;
  10289. if (!this._windowRef && !this._isDisabled()) {
  10290. this._windowRef = this._popupService.open(this.ngbPopover, context);
  10291. this._windowRef.instance.title = this.popoverTitle;
  10292. this._windowRef.instance.context = context;
  10293. this._windowRef.instance.popoverClass = this.popoverClass;
  10294. this._windowRef.instance.id = this._ngbPopoverWindowId;
  10295. this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', this._ngbPopoverWindowId);
  10296. if (this.container === 'body') {
  10297. this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);
  10298. }
  10299. // We need to detect changes, because we don't know where .open() might be called from.
  10300. // Ex. opening popover from one of lifecycle hooks that run after the CD
  10301. // (say from ngAfterViewInit) will result in 'ExpressionHasChanged' exception
  10302. this._windowRef.changeDetectorRef.detectChanges();
  10303. // We need to mark for check, because popover won't work inside the OnPush component.
  10304. // Ex. when we use expression like `{{ popover.isOpen() : 'opened' : 'closed' }}`
  10305. // inside the template of an OnPush component and we change the popover from
  10306. // open -> closed, the expression in question won't be updated unless we explicitly
  10307. // mark the parent component to be checked.
  10308. this._windowRef.changeDetectorRef.markForCheck();
  10309. ngbAutoClose(this._ngZone, this._document, this.autoClose, (/**
  10310. * @return {?}
  10311. */
  10312. function () { return _this.close(); }), this.hidden, [this._windowRef.location.nativeElement]);
  10313. this.shown.emit();
  10314. }
  10315. };
  10316. /**
  10317. * Closes the popover.
  10318. *
  10319. * This is considered to be a "manual" triggering of the popover.
  10320. */
  10321. /**
  10322. * Closes the popover.
  10323. *
  10324. * This is considered to be a "manual" triggering of the popover.
  10325. * @return {?}
  10326. */
  10327. NgbPopover.prototype.close = /**
  10328. * Closes the popover.
  10329. *
  10330. * This is considered to be a "manual" triggering of the popover.
  10331. * @return {?}
  10332. */
  10333. function () {
  10334. if (this._windowRef) {
  10335. this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
  10336. this._popupService.close();
  10337. this._windowRef = null;
  10338. this.hidden.emit();
  10339. this._changeDetector.markForCheck();
  10340. }
  10341. };
  10342. /**
  10343. * Toggles the popover.
  10344. *
  10345. * This is considered to be a "manual" triggering of the popover.
  10346. */
  10347. /**
  10348. * Toggles the popover.
  10349. *
  10350. * This is considered to be a "manual" triggering of the popover.
  10351. * @return {?}
  10352. */
  10353. NgbPopover.prototype.toggle = /**
  10354. * Toggles the popover.
  10355. *
  10356. * This is considered to be a "manual" triggering of the popover.
  10357. * @return {?}
  10358. */
  10359. function () {
  10360. if (this._windowRef) {
  10361. this.close();
  10362. }
  10363. else {
  10364. this.open();
  10365. }
  10366. };
  10367. /**
  10368. * Returns `true`, if the popover is currently shown.
  10369. */
  10370. /**
  10371. * Returns `true`, if the popover is currently shown.
  10372. * @return {?}
  10373. */
  10374. NgbPopover.prototype.isOpen = /**
  10375. * Returns `true`, if the popover is currently shown.
  10376. * @return {?}
  10377. */
  10378. function () { return this._windowRef != null; };
  10379. /**
  10380. * @return {?}
  10381. */
  10382. NgbPopover.prototype.ngOnInit = /**
  10383. * @return {?}
  10384. */
  10385. function () {
  10386. this._unregisterListenersFn = listenToTriggers(this._renderer, this._elementRef.nativeElement, this.triggers, this.isOpen.bind(this), this.open.bind(this), this.close.bind(this), +this.openDelay, +this.closeDelay);
  10387. };
  10388. /**
  10389. * @param {?} __0
  10390. * @return {?}
  10391. */
  10392. NgbPopover.prototype.ngOnChanges = /**
  10393. * @param {?} __0
  10394. * @return {?}
  10395. */
  10396. function (_a) {
  10397. var ngbPopover = _a.ngbPopover, popoverTitle = _a.popoverTitle, disablePopover = _a.disablePopover, popoverClass = _a.popoverClass;
  10398. if (popoverClass && this.isOpen()) {
  10399. this._windowRef.instance.popoverClass = popoverClass.currentValue;
  10400. }
  10401. // close popover if title and content become empty, or disablePopover set to true
  10402. if ((ngbPopover || popoverTitle || disablePopover) && this._isDisabled()) {
  10403. this.close();
  10404. }
  10405. };
  10406. /**
  10407. * @return {?}
  10408. */
  10409. NgbPopover.prototype.ngOnDestroy = /**
  10410. * @return {?}
  10411. */
  10412. function () {
  10413. this.close();
  10414. // This check is needed as it might happen that ngOnDestroy is called before ngOnInit
  10415. // under certain conditions, see: https://github.com/ng-bootstrap/ng-bootstrap/issues/2199
  10416. if (this._unregisterListenersFn) {
  10417. this._unregisterListenersFn();
  10418. }
  10419. this._zoneSubscription.unsubscribe();
  10420. };
  10421. NgbPopover.decorators = [
  10422. { type: Directive, args: [{ selector: '[ngbPopover]', exportAs: 'ngbPopover' },] }
  10423. ];
  10424. /** @nocollapse */
  10425. NgbPopover.ctorParameters = function () { return [
  10426. { type: ElementRef },
  10427. { type: Renderer2 },
  10428. { type: Injector },
  10429. { type: ComponentFactoryResolver },
  10430. { type: ViewContainerRef },
  10431. { type: NgbPopoverConfig },
  10432. { type: NgZone },
  10433. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
  10434. { type: ChangeDetectorRef },
  10435. { type: ApplicationRef }
  10436. ]; };
  10437. NgbPopover.propDecorators = {
  10438. autoClose: [{ type: Input }],
  10439. ngbPopover: [{ type: Input }],
  10440. popoverTitle: [{ type: Input }],
  10441. placement: [{ type: Input }],
  10442. triggers: [{ type: Input }],
  10443. container: [{ type: Input }],
  10444. disablePopover: [{ type: Input }],
  10445. popoverClass: [{ type: Input }],
  10446. openDelay: [{ type: Input }],
  10447. closeDelay: [{ type: Input }],
  10448. shown: [{ type: Output }],
  10449. hidden: [{ type: Output }]
  10450. };
  10451. return NgbPopover;
  10452. }());
  10453. /**
  10454. * @fileoverview added by tsickle
  10455. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10456. */
  10457. var NgbPopoverModule = /** @class */ (function () {
  10458. function NgbPopoverModule() {
  10459. }
  10460. NgbPopoverModule.decorators = [
  10461. { type: NgModule, args: [{
  10462. declarations: [NgbPopover, NgbPopoverWindow],
  10463. exports: [NgbPopover],
  10464. imports: [CommonModule],
  10465. entryComponents: [NgbPopoverWindow]
  10466. },] }
  10467. ];
  10468. return NgbPopoverModule;
  10469. }());
  10470. /**
  10471. * @fileoverview added by tsickle
  10472. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10473. */
  10474. /**
  10475. * A configuration service for the [`NgbProgressbar`](#/components/progressbar/api#NgbProgressbar) component.
  10476. *
  10477. * You can inject this service, typically in your root component, and customize the values of its properties in
  10478. * order to provide default values for all the progress bars used in the application.
  10479. */
  10480. var NgbProgressbarConfig = /** @class */ (function () {
  10481. function NgbProgressbarConfig() {
  10482. this.max = 100;
  10483. this.animated = false;
  10484. this.striped = false;
  10485. this.showValue = false;
  10486. }
  10487. NgbProgressbarConfig.decorators = [
  10488. { type: Injectable, args: [{ providedIn: 'root' },] }
  10489. ];
  10490. /** @nocollapse */ NgbProgressbarConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbProgressbarConfig_Factory() { return new NgbProgressbarConfig(); }, token: NgbProgressbarConfig, providedIn: "root" });
  10491. return NgbProgressbarConfig;
  10492. }());
  10493. /**
  10494. * @fileoverview added by tsickle
  10495. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10496. */
  10497. /**
  10498. * A directive that provides feedback on the progress of a workflow or an action.
  10499. */
  10500. var NgbProgressbar = /** @class */ (function () {
  10501. function NgbProgressbar(config) {
  10502. /**
  10503. * The current value for the progress bar.
  10504. *
  10505. * Should be in the `[0, max]` range.
  10506. */
  10507. this.value = 0;
  10508. this.max = config.max;
  10509. this.animated = config.animated;
  10510. this.striped = config.striped;
  10511. this.textType = config.textType;
  10512. this.type = config.type;
  10513. this.showValue = config.showValue;
  10514. this.height = config.height;
  10515. }
  10516. Object.defineProperty(NgbProgressbar.prototype, "max", {
  10517. get: /**
  10518. * @return {?}
  10519. */
  10520. function () { return this._max; },
  10521. /**
  10522. * The maximal value to be displayed in the progress bar.
  10523. *
  10524. * Should be a positive number. Will default to 100 otherwise.
  10525. */
  10526. set: /**
  10527. * The maximal value to be displayed in the progress bar.
  10528. *
  10529. * Should be a positive number. Will default to 100 otherwise.
  10530. * @param {?} max
  10531. * @return {?}
  10532. */
  10533. function (max) {
  10534. this._max = !isNumber(max) || max <= 0 ? 100 : max;
  10535. },
  10536. enumerable: true,
  10537. configurable: true
  10538. });
  10539. /**
  10540. * @return {?}
  10541. */
  10542. NgbProgressbar.prototype.getValue = /**
  10543. * @return {?}
  10544. */
  10545. function () { return getValueInRange(this.value, this.max); };
  10546. /**
  10547. * @return {?}
  10548. */
  10549. NgbProgressbar.prototype.getPercentValue = /**
  10550. * @return {?}
  10551. */
  10552. function () { return 100 * this.getValue() / this.max; };
  10553. NgbProgressbar.decorators = [
  10554. { type: Component, args: [{
  10555. selector: 'ngb-progressbar',
  10556. changeDetection: ChangeDetectionStrategy.OnPush,
  10557. encapsulation: ViewEncapsulation.None,
  10558. template: "\n <div class=\"progress\" [style.height]=\"height\">\n <div class=\"progress-bar{{type ? ' bg-' + type : ''}}{{textType ? ' text-' + textType : ''}}\n {{animated ? ' progress-bar-animated' : ''}}{{striped ? ' progress-bar-striped' : ''}}\" role=\"progressbar\" [style.width.%]=\"getPercentValue()\"\n [attr.aria-valuenow]=\"getValue()\" aria-valuemin=\"0\" [attr.aria-valuemax]=\"max\">\n <span *ngIf=\"showValue\" i18n=\"@@ngb.progressbar.value\">{{getPercentValue()}}%</span><ng-content></ng-content>\n </div>\n </div>\n "
  10559. }] }
  10560. ];
  10561. /** @nocollapse */
  10562. NgbProgressbar.ctorParameters = function () { return [
  10563. { type: NgbProgressbarConfig }
  10564. ]; };
  10565. NgbProgressbar.propDecorators = {
  10566. max: [{ type: Input }],
  10567. animated: [{ type: Input }],
  10568. striped: [{ type: Input }],
  10569. showValue: [{ type: Input }],
  10570. textType: [{ type: Input }],
  10571. type: [{ type: Input }],
  10572. value: [{ type: Input }],
  10573. height: [{ type: Input }]
  10574. };
  10575. return NgbProgressbar;
  10576. }());
  10577. /**
  10578. * @fileoverview added by tsickle
  10579. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10580. */
  10581. var NgbProgressbarModule = /** @class */ (function () {
  10582. function NgbProgressbarModule() {
  10583. }
  10584. NgbProgressbarModule.decorators = [
  10585. { type: NgModule, args: [{ declarations: [NgbProgressbar], exports: [NgbProgressbar], imports: [CommonModule] },] }
  10586. ];
  10587. return NgbProgressbarModule;
  10588. }());
  10589. /**
  10590. * @fileoverview added by tsickle
  10591. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10592. */
  10593. /**
  10594. * A configuration service for the [`NgbRating`](#/components/rating/api#NgbRating) component.
  10595. *
  10596. * You can inject this service, typically in your root component, and customize the values of its properties in
  10597. * order to provide default values for all the ratings used in the application.
  10598. */
  10599. var NgbRatingConfig = /** @class */ (function () {
  10600. function NgbRatingConfig() {
  10601. this.max = 10;
  10602. this.readonly = false;
  10603. this.resettable = false;
  10604. }
  10605. NgbRatingConfig.decorators = [
  10606. { type: Injectable, args: [{ providedIn: 'root' },] }
  10607. ];
  10608. /** @nocollapse */ NgbRatingConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbRatingConfig_Factory() { return new NgbRatingConfig(); }, token: NgbRatingConfig, providedIn: "root" });
  10609. return NgbRatingConfig;
  10610. }());
  10611. /**
  10612. * @fileoverview added by tsickle
  10613. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10614. */
  10615. /** @type {?} */
  10616. var NGB_RATING_VALUE_ACCESSOR = {
  10617. provide: NG_VALUE_ACCESSOR,
  10618. useExisting: forwardRef((/**
  10619. * @return {?}
  10620. */
  10621. function () { return NgbRating; })),
  10622. multi: true
  10623. };
  10624. /**
  10625. * A directive that helps visualising and interacting with a star rating bar.
  10626. */
  10627. var NgbRating = /** @class */ (function () {
  10628. function NgbRating(config, _changeDetectorRef) {
  10629. this._changeDetectorRef = _changeDetectorRef;
  10630. this.contexts = [];
  10631. this.disabled = false;
  10632. /**
  10633. * An event emitted when the user is hovering over a given rating.
  10634. *
  10635. * Event payload equals to the rating being hovered over.
  10636. */
  10637. this.hover = new EventEmitter();
  10638. /**
  10639. * An event emitted when the user stops hovering over a given rating.
  10640. *
  10641. * Event payload equals to the rating of the last item being hovered over.
  10642. */
  10643. this.leave = new EventEmitter();
  10644. /**
  10645. * An event emitted when the user selects a new rating.
  10646. *
  10647. * Event payload equals to the newly selected rating.
  10648. */
  10649. this.rateChange = new EventEmitter(true);
  10650. this.onChange = (/**
  10651. * @param {?} _
  10652. * @return {?}
  10653. */
  10654. function (_) { });
  10655. this.onTouched = (/**
  10656. * @return {?}
  10657. */
  10658. function () { });
  10659. this.max = config.max;
  10660. this.readonly = config.readonly;
  10661. }
  10662. /**
  10663. * @return {?}
  10664. */
  10665. NgbRating.prototype.ariaValueText = /**
  10666. * @return {?}
  10667. */
  10668. function () { return this.nextRate + " out of " + this.max; };
  10669. /**
  10670. * @param {?} value
  10671. * @return {?}
  10672. */
  10673. NgbRating.prototype.enter = /**
  10674. * @param {?} value
  10675. * @return {?}
  10676. */
  10677. function (value) {
  10678. if (!this.readonly && !this.disabled) {
  10679. this._updateState(value);
  10680. }
  10681. this.hover.emit(value);
  10682. };
  10683. /**
  10684. * @return {?}
  10685. */
  10686. NgbRating.prototype.handleBlur = /**
  10687. * @return {?}
  10688. */
  10689. function () { this.onTouched(); };
  10690. /**
  10691. * @param {?} value
  10692. * @return {?}
  10693. */
  10694. NgbRating.prototype.handleClick = /**
  10695. * @param {?} value
  10696. * @return {?}
  10697. */
  10698. function (value) { this.update(this.resettable && this.rate === value ? 0 : value); };
  10699. /**
  10700. * @param {?} event
  10701. * @return {?}
  10702. */
  10703. NgbRating.prototype.handleKeyDown = /**
  10704. * @param {?} event
  10705. * @return {?}
  10706. */
  10707. function (event) {
  10708. // tslint:disable-next-line:deprecation
  10709. switch (event.which) {
  10710. case Key.ArrowDown:
  10711. case Key.ArrowLeft:
  10712. this.update(this.rate - 1);
  10713. break;
  10714. case Key.ArrowUp:
  10715. case Key.ArrowRight:
  10716. this.update(this.rate + 1);
  10717. break;
  10718. case Key.Home:
  10719. this.update(0);
  10720. break;
  10721. case Key.End:
  10722. this.update(this.max);
  10723. break;
  10724. default:
  10725. return;
  10726. }
  10727. // note 'return' in default case
  10728. event.preventDefault();
  10729. };
  10730. /**
  10731. * @param {?} changes
  10732. * @return {?}
  10733. */
  10734. NgbRating.prototype.ngOnChanges = /**
  10735. * @param {?} changes
  10736. * @return {?}
  10737. */
  10738. function (changes) {
  10739. if (changes['rate']) {
  10740. this.update(this.rate);
  10741. }
  10742. };
  10743. /**
  10744. * @return {?}
  10745. */
  10746. NgbRating.prototype.ngOnInit = /**
  10747. * @return {?}
  10748. */
  10749. function () {
  10750. this.contexts = Array.from({ length: this.max }, (/**
  10751. * @param {?} v
  10752. * @param {?} k
  10753. * @return {?}
  10754. */
  10755. function (v, k) { return ({ fill: 0, index: k }); }));
  10756. this._updateState(this.rate);
  10757. };
  10758. /**
  10759. * @param {?} fn
  10760. * @return {?}
  10761. */
  10762. NgbRating.prototype.registerOnChange = /**
  10763. * @param {?} fn
  10764. * @return {?}
  10765. */
  10766. function (fn) { this.onChange = fn; };
  10767. /**
  10768. * @param {?} fn
  10769. * @return {?}
  10770. */
  10771. NgbRating.prototype.registerOnTouched = /**
  10772. * @param {?} fn
  10773. * @return {?}
  10774. */
  10775. function (fn) { this.onTouched = fn; };
  10776. /**
  10777. * @return {?}
  10778. */
  10779. NgbRating.prototype.reset = /**
  10780. * @return {?}
  10781. */
  10782. function () {
  10783. this.leave.emit(this.nextRate);
  10784. this._updateState(this.rate);
  10785. };
  10786. /**
  10787. * @param {?} isDisabled
  10788. * @return {?}
  10789. */
  10790. NgbRating.prototype.setDisabledState = /**
  10791. * @param {?} isDisabled
  10792. * @return {?}
  10793. */
  10794. function (isDisabled) { this.disabled = isDisabled; };
  10795. /**
  10796. * @param {?} value
  10797. * @param {?=} internalChange
  10798. * @return {?}
  10799. */
  10800. NgbRating.prototype.update = /**
  10801. * @param {?} value
  10802. * @param {?=} internalChange
  10803. * @return {?}
  10804. */
  10805. function (value, internalChange) {
  10806. if (internalChange === void 0) { internalChange = true; }
  10807. /** @type {?} */
  10808. var newRate = getValueInRange(value, this.max, 0);
  10809. if (!this.readonly && !this.disabled && this.rate !== newRate) {
  10810. this.rate = newRate;
  10811. this.rateChange.emit(this.rate);
  10812. }
  10813. if (internalChange) {
  10814. this.onChange(this.rate);
  10815. this.onTouched();
  10816. }
  10817. this._updateState(this.rate);
  10818. };
  10819. /**
  10820. * @param {?} value
  10821. * @return {?}
  10822. */
  10823. NgbRating.prototype.writeValue = /**
  10824. * @param {?} value
  10825. * @return {?}
  10826. */
  10827. function (value) {
  10828. this.update(value, false);
  10829. this._changeDetectorRef.markForCheck();
  10830. };
  10831. /**
  10832. * @private
  10833. * @param {?} index
  10834. * @return {?}
  10835. */
  10836. NgbRating.prototype._getFillValue = /**
  10837. * @private
  10838. * @param {?} index
  10839. * @return {?}
  10840. */
  10841. function (index) {
  10842. /** @type {?} */
  10843. var diff = this.nextRate - index;
  10844. if (diff >= 1) {
  10845. return 100;
  10846. }
  10847. if (diff < 1 && diff > 0) {
  10848. return parseInt((diff * 100).toFixed(2), 10);
  10849. }
  10850. return 0;
  10851. };
  10852. /**
  10853. * @private
  10854. * @param {?} nextValue
  10855. * @return {?}
  10856. */
  10857. NgbRating.prototype._updateState = /**
  10858. * @private
  10859. * @param {?} nextValue
  10860. * @return {?}
  10861. */
  10862. function (nextValue) {
  10863. var _this = this;
  10864. this.nextRate = nextValue;
  10865. this.contexts.forEach((/**
  10866. * @param {?} context
  10867. * @param {?} index
  10868. * @return {?}
  10869. */
  10870. function (context, index) { return context.fill = _this._getFillValue(index); }));
  10871. };
  10872. NgbRating.decorators = [
  10873. { type: Component, args: [{
  10874. selector: 'ngb-rating',
  10875. changeDetection: ChangeDetectionStrategy.OnPush,
  10876. encapsulation: ViewEncapsulation.None,
  10877. host: {
  10878. 'class': 'd-inline-flex',
  10879. 'tabindex': '0',
  10880. 'role': 'slider',
  10881. 'aria-valuemin': '0',
  10882. '[attr.aria-valuemax]': 'max',
  10883. '[attr.aria-valuenow]': 'nextRate',
  10884. '[attr.aria-valuetext]': 'ariaValueText()',
  10885. '[attr.aria-disabled]': 'readonly ? true : null',
  10886. '(blur)': 'handleBlur()',
  10887. '(keydown)': 'handleKeyDown($event)',
  10888. '(mouseleave)': 'reset()'
  10889. },
  10890. template: "\n <ng-template #t let-fill=\"fill\">{{ fill === 100 ? '&#9733;' : '&#9734;' }}</ng-template>\n <ng-template ngFor [ngForOf]=\"contexts\" let-index=\"index\">\n <span class=\"sr-only\">({{ index < nextRate ? '*' : ' ' }})</span>\n <span (mouseenter)=\"enter(index + 1)\" (click)=\"handleClick(index + 1)\" [style.cursor]=\"readonly || disabled ? 'default' : 'pointer'\">\n <ng-template [ngTemplateOutlet]=\"starTemplate || starTemplateFromContent || t\" [ngTemplateOutletContext]=\"contexts[index]\">\n </ng-template>\n </span>\n </ng-template>\n ",
  10891. providers: [NGB_RATING_VALUE_ACCESSOR]
  10892. }] }
  10893. ];
  10894. /** @nocollapse */
  10895. NgbRating.ctorParameters = function () { return [
  10896. { type: NgbRatingConfig },
  10897. { type: ChangeDetectorRef }
  10898. ]; };
  10899. NgbRating.propDecorators = {
  10900. max: [{ type: Input }],
  10901. rate: [{ type: Input }],
  10902. readonly: [{ type: Input }],
  10903. resettable: [{ type: Input }],
  10904. starTemplate: [{ type: Input }],
  10905. starTemplateFromContent: [{ type: ContentChild, args: [TemplateRef, { static: false },] }],
  10906. hover: [{ type: Output }],
  10907. leave: [{ type: Output }],
  10908. rateChange: [{ type: Output }]
  10909. };
  10910. return NgbRating;
  10911. }());
  10912. /**
  10913. * @fileoverview added by tsickle
  10914. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10915. */
  10916. var NgbRatingModule = /** @class */ (function () {
  10917. function NgbRatingModule() {
  10918. }
  10919. NgbRatingModule.decorators = [
  10920. { type: NgModule, args: [{ declarations: [NgbRating], exports: [NgbRating], imports: [CommonModule] },] }
  10921. ];
  10922. return NgbRatingModule;
  10923. }());
  10924. /**
  10925. * @fileoverview added by tsickle
  10926. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10927. */
  10928. /**
  10929. * A configuration service for the [`NgbTabset`](#/components/tabset/api#NgbTabset) component.
  10930. *
  10931. * You can inject this service, typically in your root component, and customize the values of its properties in
  10932. * order to provide default values for all the tabsets used in the application.
  10933. */
  10934. var NgbTabsetConfig = /** @class */ (function () {
  10935. function NgbTabsetConfig() {
  10936. this.justify = 'start';
  10937. this.orientation = 'horizontal';
  10938. this.type = 'tabs';
  10939. }
  10940. NgbTabsetConfig.decorators = [
  10941. { type: Injectable, args: [{ providedIn: 'root' },] }
  10942. ];
  10943. /** @nocollapse */ NgbTabsetConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbTabsetConfig_Factory() { return new NgbTabsetConfig(); }, token: NgbTabsetConfig, providedIn: "root" });
  10944. return NgbTabsetConfig;
  10945. }());
  10946. /**
  10947. * @fileoverview added by tsickle
  10948. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  10949. */
  10950. /** @type {?} */
  10951. var nextId$4 = 0;
  10952. /**
  10953. * A directive to wrap tab titles that need to contain HTML markup or other directives.
  10954. *
  10955. * Alternatively you could use the `NgbTab.title` input for string titles.
  10956. */
  10957. var NgbTabTitle = /** @class */ (function () {
  10958. function NgbTabTitle(templateRef) {
  10959. this.templateRef = templateRef;
  10960. }
  10961. NgbTabTitle.decorators = [
  10962. { type: Directive, args: [{ selector: 'ng-template[ngbTabTitle]' },] }
  10963. ];
  10964. /** @nocollapse */
  10965. NgbTabTitle.ctorParameters = function () { return [
  10966. { type: TemplateRef }
  10967. ]; };
  10968. return NgbTabTitle;
  10969. }());
  10970. /**
  10971. * A directive to wrap content to be displayed in a tab.
  10972. */
  10973. var NgbTabContent = /** @class */ (function () {
  10974. function NgbTabContent(templateRef) {
  10975. this.templateRef = templateRef;
  10976. }
  10977. NgbTabContent.decorators = [
  10978. { type: Directive, args: [{ selector: 'ng-template[ngbTabContent]' },] }
  10979. ];
  10980. /** @nocollapse */
  10981. NgbTabContent.ctorParameters = function () { return [
  10982. { type: TemplateRef }
  10983. ]; };
  10984. return NgbTabContent;
  10985. }());
  10986. /**
  10987. * A directive representing an individual tab.
  10988. */
  10989. var NgbTab = /** @class */ (function () {
  10990. function NgbTab() {
  10991. /**
  10992. * The tab identifier.
  10993. *
  10994. * Must be unique for the entire document for proper accessibility support.
  10995. */
  10996. this.id = "ngb-tab-" + nextId$4++;
  10997. /**
  10998. * If `true`, the current tab is disabled and can't be toggled.
  10999. */
  11000. this.disabled = false;
  11001. }
  11002. /**
  11003. * @return {?}
  11004. */
  11005. NgbTab.prototype.ngAfterContentChecked = /**
  11006. * @return {?}
  11007. */
  11008. function () {
  11009. // We are using @ContentChildren instead of @ContentChild as in the Angular version being used
  11010. // only @ContentChildren allows us to specify the {descendants: false} option.
  11011. // Without {descendants: false} we are hitting bugs described in:
  11012. // https://github.com/ng-bootstrap/ng-bootstrap/issues/2240
  11013. this.titleTpl = this.titleTpls.first;
  11014. this.contentTpl = this.contentTpls.first;
  11015. };
  11016. NgbTab.decorators = [
  11017. { type: Directive, args: [{ selector: 'ngb-tab' },] }
  11018. ];
  11019. NgbTab.propDecorators = {
  11020. id: [{ type: Input }],
  11021. title: [{ type: Input }],
  11022. disabled: [{ type: Input }],
  11023. titleTpls: [{ type: ContentChildren, args: [NgbTabTitle, { descendants: false },] }],
  11024. contentTpls: [{ type: ContentChildren, args: [NgbTabContent, { descendants: false },] }]
  11025. };
  11026. return NgbTab;
  11027. }());
  11028. /**
  11029. * A component that makes it easy to create tabbed interface.
  11030. */
  11031. var NgbTabset = /** @class */ (function () {
  11032. function NgbTabset(config) {
  11033. /**
  11034. * If `true`, non-visible tabs content will be removed from DOM. Otherwise it will just be hidden.
  11035. */
  11036. this.destroyOnHide = true;
  11037. /**
  11038. * A tab change event emitted right before the tab change happens.
  11039. *
  11040. * See [`NgbTabChangeEvent`](#/components/tabset/api#NgbTabChangeEvent) for payload details.
  11041. */
  11042. this.tabChange = new EventEmitter();
  11043. this.type = config.type;
  11044. this.justify = config.justify;
  11045. this.orientation = config.orientation;
  11046. }
  11047. Object.defineProperty(NgbTabset.prototype, "justify", {
  11048. /**
  11049. * The horizontal alignment of the tabs with flexbox utilities.
  11050. */
  11051. set: /**
  11052. * The horizontal alignment of the tabs with flexbox utilities.
  11053. * @param {?} className
  11054. * @return {?}
  11055. */
  11056. function (className) {
  11057. if (className === 'fill' || className === 'justified') {
  11058. this.justifyClass = "nav-" + className;
  11059. }
  11060. else {
  11061. this.justifyClass = "justify-content-" + className;
  11062. }
  11063. },
  11064. enumerable: true,
  11065. configurable: true
  11066. });
  11067. /**
  11068. * Selects the tab with the given id and shows its associated content panel.
  11069. *
  11070. * Any other tab that was previously selected becomes unselected and its associated pane is removed from DOM or
  11071. * hidden depending on the `destroyOnHide` value.
  11072. */
  11073. /**
  11074. * Selects the tab with the given id and shows its associated content panel.
  11075. *
  11076. * Any other tab that was previously selected becomes unselected and its associated pane is removed from DOM or
  11077. * hidden depending on the `destroyOnHide` value.
  11078. * @param {?} tabId
  11079. * @return {?}
  11080. */
  11081. NgbTabset.prototype.select = /**
  11082. * Selects the tab with the given id and shows its associated content panel.
  11083. *
  11084. * Any other tab that was previously selected becomes unselected and its associated pane is removed from DOM or
  11085. * hidden depending on the `destroyOnHide` value.
  11086. * @param {?} tabId
  11087. * @return {?}
  11088. */
  11089. function (tabId) {
  11090. /** @type {?} */
  11091. var selectedTab = this._getTabById(tabId);
  11092. if (selectedTab && !selectedTab.disabled && this.activeId !== selectedTab.id) {
  11093. /** @type {?} */
  11094. var defaultPrevented_1 = false;
  11095. this.tabChange.emit({ activeId: this.activeId, nextId: selectedTab.id, preventDefault: (/**
  11096. * @return {?}
  11097. */
  11098. function () { defaultPrevented_1 = true; }) });
  11099. if (!defaultPrevented_1) {
  11100. this.activeId = selectedTab.id;
  11101. }
  11102. }
  11103. };
  11104. /**
  11105. * @return {?}
  11106. */
  11107. NgbTabset.prototype.ngAfterContentChecked = /**
  11108. * @return {?}
  11109. */
  11110. function () {
  11111. // auto-correct activeId that might have been set incorrectly as input
  11112. /** @type {?} */
  11113. var activeTab = this._getTabById(this.activeId);
  11114. this.activeId = activeTab ? activeTab.id : (this.tabs.length ? this.tabs.first.id : null);
  11115. };
  11116. /**
  11117. * @private
  11118. * @param {?} id
  11119. * @return {?}
  11120. */
  11121. NgbTabset.prototype._getTabById = /**
  11122. * @private
  11123. * @param {?} id
  11124. * @return {?}
  11125. */
  11126. function (id) {
  11127. /** @type {?} */
  11128. var tabsWithId = this.tabs.filter((/**
  11129. * @param {?} tab
  11130. * @return {?}
  11131. */
  11132. function (tab) { return tab.id === id; }));
  11133. return tabsWithId.length ? tabsWithId[0] : null;
  11134. };
  11135. NgbTabset.decorators = [
  11136. { type: Component, args: [{
  11137. selector: 'ngb-tabset',
  11138. exportAs: 'ngbTabset',
  11139. encapsulation: ViewEncapsulation.None,
  11140. template: "\n <ul [class]=\"'nav nav-' + type + (orientation == 'horizontal'? ' ' + justifyClass : ' flex-column')\" role=\"tablist\">\n <li class=\"nav-item\" *ngFor=\"let tab of tabs\">\n <a [id]=\"tab.id\" class=\"nav-link\" [class.active]=\"tab.id === activeId\" [class.disabled]=\"tab.disabled\"\n href (click)=\"select(tab.id); $event.preventDefault()\" role=\"tab\" [attr.tabindex]=\"(tab.disabled ? '-1': undefined)\"\n [attr.aria-controls]=\"(!destroyOnHide || tab.id === activeId ? tab.id + '-panel' : null)\"\n [attr.aria-selected]=\"tab.id === activeId\" [attr.aria-disabled]=\"tab.disabled\">\n {{tab.title}}<ng-template [ngTemplateOutlet]=\"tab.titleTpl?.templateRef\"></ng-template>\n </a>\n </li>\n </ul>\n <div class=\"tab-content\">\n <ng-template ngFor let-tab [ngForOf]=\"tabs\">\n <div\n class=\"tab-pane {{tab.id === activeId ? 'active' : null}}\"\n *ngIf=\"!destroyOnHide || tab.id === activeId\"\n role=\"tabpanel\"\n [attr.aria-labelledby]=\"tab.id\" id=\"{{tab.id}}-panel\">\n <ng-template [ngTemplateOutlet]=\"tab.contentTpl?.templateRef\"></ng-template>\n </div>\n </ng-template>\n </div>\n "
  11141. }] }
  11142. ];
  11143. /** @nocollapse */
  11144. NgbTabset.ctorParameters = function () { return [
  11145. { type: NgbTabsetConfig }
  11146. ]; };
  11147. NgbTabset.propDecorators = {
  11148. tabs: [{ type: ContentChildren, args: [NgbTab,] }],
  11149. activeId: [{ type: Input }],
  11150. destroyOnHide: [{ type: Input }],
  11151. justify: [{ type: Input }],
  11152. orientation: [{ type: Input }],
  11153. type: [{ type: Input }],
  11154. tabChange: [{ type: Output }]
  11155. };
  11156. return NgbTabset;
  11157. }());
  11158. /**
  11159. * @fileoverview added by tsickle
  11160. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11161. */
  11162. /** @type {?} */
  11163. var NGB_TABSET_DIRECTIVES = [NgbTabset, NgbTab, NgbTabContent, NgbTabTitle];
  11164. var NgbTabsetModule = /** @class */ (function () {
  11165. function NgbTabsetModule() {
  11166. }
  11167. NgbTabsetModule.decorators = [
  11168. { type: NgModule, args: [{ declarations: NGB_TABSET_DIRECTIVES, exports: NGB_TABSET_DIRECTIVES, imports: [CommonModule, NgbNavModule] },] }
  11169. ];
  11170. return NgbTabsetModule;
  11171. }());
  11172. /**
  11173. * @fileoverview added by tsickle
  11174. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11175. */
  11176. var NgbTime = /** @class */ (function () {
  11177. function NgbTime(hour, minute, second) {
  11178. this.hour = toInteger(hour);
  11179. this.minute = toInteger(minute);
  11180. this.second = toInteger(second);
  11181. }
  11182. /**
  11183. * @param {?=} step
  11184. * @return {?}
  11185. */
  11186. NgbTime.prototype.changeHour = /**
  11187. * @param {?=} step
  11188. * @return {?}
  11189. */
  11190. function (step) {
  11191. if (step === void 0) { step = 1; }
  11192. this.updateHour((isNaN(this.hour) ? 0 : this.hour) + step);
  11193. };
  11194. /**
  11195. * @param {?} hour
  11196. * @return {?}
  11197. */
  11198. NgbTime.prototype.updateHour = /**
  11199. * @param {?} hour
  11200. * @return {?}
  11201. */
  11202. function (hour) {
  11203. if (isNumber(hour)) {
  11204. this.hour = (hour < 0 ? 24 + hour : hour) % 24;
  11205. }
  11206. else {
  11207. this.hour = NaN;
  11208. }
  11209. };
  11210. /**
  11211. * @param {?=} step
  11212. * @return {?}
  11213. */
  11214. NgbTime.prototype.changeMinute = /**
  11215. * @param {?=} step
  11216. * @return {?}
  11217. */
  11218. function (step) {
  11219. if (step === void 0) { step = 1; }
  11220. this.updateMinute((isNaN(this.minute) ? 0 : this.minute) + step);
  11221. };
  11222. /**
  11223. * @param {?} minute
  11224. * @return {?}
  11225. */
  11226. NgbTime.prototype.updateMinute = /**
  11227. * @param {?} minute
  11228. * @return {?}
  11229. */
  11230. function (minute) {
  11231. if (isNumber(minute)) {
  11232. this.minute = minute % 60 < 0 ? 60 + minute % 60 : minute % 60;
  11233. this.changeHour(Math.floor(minute / 60));
  11234. }
  11235. else {
  11236. this.minute = NaN;
  11237. }
  11238. };
  11239. /**
  11240. * @param {?=} step
  11241. * @return {?}
  11242. */
  11243. NgbTime.prototype.changeSecond = /**
  11244. * @param {?=} step
  11245. * @return {?}
  11246. */
  11247. function (step) {
  11248. if (step === void 0) { step = 1; }
  11249. this.updateSecond((isNaN(this.second) ? 0 : this.second) + step);
  11250. };
  11251. /**
  11252. * @param {?} second
  11253. * @return {?}
  11254. */
  11255. NgbTime.prototype.updateSecond = /**
  11256. * @param {?} second
  11257. * @return {?}
  11258. */
  11259. function (second) {
  11260. if (isNumber(second)) {
  11261. this.second = second < 0 ? 60 + second % 60 : second % 60;
  11262. this.changeMinute(Math.floor(second / 60));
  11263. }
  11264. else {
  11265. this.second = NaN;
  11266. }
  11267. };
  11268. /**
  11269. * @param {?=} checkSecs
  11270. * @return {?}
  11271. */
  11272. NgbTime.prototype.isValid = /**
  11273. * @param {?=} checkSecs
  11274. * @return {?}
  11275. */
  11276. function (checkSecs) {
  11277. if (checkSecs === void 0) { checkSecs = true; }
  11278. return isNumber(this.hour) && isNumber(this.minute) && (checkSecs ? isNumber(this.second) : true);
  11279. };
  11280. /**
  11281. * @return {?}
  11282. */
  11283. NgbTime.prototype.toString = /**
  11284. * @return {?}
  11285. */
  11286. function () { return (this.hour || 0) + ":" + (this.minute || 0) + ":" + (this.second || 0); };
  11287. return NgbTime;
  11288. }());
  11289. /**
  11290. * @fileoverview added by tsickle
  11291. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11292. */
  11293. /**
  11294. * A configuration service for the [`NgbTimepicker`](#/components/timepicker/api#NgbTimepicker) component.
  11295. *
  11296. * You can inject this service, typically in your root component, and customize the values of its properties in
  11297. * order to provide default values for all the timepickers used in the application.
  11298. */
  11299. var NgbTimepickerConfig = /** @class */ (function () {
  11300. function NgbTimepickerConfig() {
  11301. this.meridian = false;
  11302. this.spinners = true;
  11303. this.seconds = false;
  11304. this.hourStep = 1;
  11305. this.minuteStep = 1;
  11306. this.secondStep = 1;
  11307. this.disabled = false;
  11308. this.readonlyInputs = false;
  11309. this.size = 'medium';
  11310. }
  11311. NgbTimepickerConfig.decorators = [
  11312. { type: Injectable, args: [{ providedIn: 'root' },] }
  11313. ];
  11314. /** @nocollapse */ NgbTimepickerConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbTimepickerConfig_Factory() { return new NgbTimepickerConfig(); }, token: NgbTimepickerConfig, providedIn: "root" });
  11315. return NgbTimepickerConfig;
  11316. }());
  11317. /**
  11318. * @fileoverview added by tsickle
  11319. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11320. */
  11321. /**
  11322. * @return {?}
  11323. */
  11324. function NGB_DATEPICKER_TIME_ADAPTER_FACTORY() {
  11325. return new NgbTimeStructAdapter();
  11326. }
  11327. /**
  11328. * An abstract service that does the conversion between the internal timepicker `NgbTimeStruct` model and
  11329. * any provided user time model `T`, ex. a string, a native date, etc.
  11330. *
  11331. * The adapter is used **only** for conversion when binding timepicker to a form control,
  11332. * ex. `[(ngModel)]="userTimeModel"`. Here `userTimeModel` can be of any type.
  11333. *
  11334. * The default timepicker implementation assumes we use `NgbTimeStruct` as a user model.
  11335. *
  11336. * See the [custom time adapter demo](#/components/timepicker/examples#adapter) for an example.
  11337. *
  11338. * \@since 2.2.0
  11339. * @abstract
  11340. * @template T
  11341. */
  11342. var NgbTimeAdapter = /** @class */ (function () {
  11343. function NgbTimeAdapter() {
  11344. }
  11345. NgbTimeAdapter.decorators = [
  11346. { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_DATEPICKER_TIME_ADAPTER_FACTORY },] }
  11347. ];
  11348. /** @nocollapse */ NgbTimeAdapter.ngInjectableDef = ɵɵdefineInjectable({ factory: NGB_DATEPICKER_TIME_ADAPTER_FACTORY, token: NgbTimeAdapter, providedIn: "root" });
  11349. return NgbTimeAdapter;
  11350. }());
  11351. var NgbTimeStructAdapter = /** @class */ (function (_super) {
  11352. __extends(NgbTimeStructAdapter, _super);
  11353. function NgbTimeStructAdapter() {
  11354. return _super !== null && _super.apply(this, arguments) || this;
  11355. }
  11356. /**
  11357. * Converts a NgbTimeStruct value into NgbTimeStruct value
  11358. */
  11359. /**
  11360. * Converts a NgbTimeStruct value into NgbTimeStruct value
  11361. * @param {?} time
  11362. * @return {?}
  11363. */
  11364. NgbTimeStructAdapter.prototype.fromModel = /**
  11365. * Converts a NgbTimeStruct value into NgbTimeStruct value
  11366. * @param {?} time
  11367. * @return {?}
  11368. */
  11369. function (time) {
  11370. return (time && isInteger(time.hour) && isInteger(time.minute)) ?
  11371. { hour: time.hour, minute: time.minute, second: isInteger(time.second) ? time.second : null } :
  11372. null;
  11373. };
  11374. /**
  11375. * Converts a NgbTimeStruct value into NgbTimeStruct value
  11376. */
  11377. /**
  11378. * Converts a NgbTimeStruct value into NgbTimeStruct value
  11379. * @param {?} time
  11380. * @return {?}
  11381. */
  11382. NgbTimeStructAdapter.prototype.toModel = /**
  11383. * Converts a NgbTimeStruct value into NgbTimeStruct value
  11384. * @param {?} time
  11385. * @return {?}
  11386. */
  11387. function (time) {
  11388. return (time && isInteger(time.hour) && isInteger(time.minute)) ?
  11389. { hour: time.hour, minute: time.minute, second: isInteger(time.second) ? time.second : null } :
  11390. null;
  11391. };
  11392. NgbTimeStructAdapter.decorators = [
  11393. { type: Injectable }
  11394. ];
  11395. return NgbTimeStructAdapter;
  11396. }(NgbTimeAdapter));
  11397. /**
  11398. * @fileoverview added by tsickle
  11399. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11400. */
  11401. /**
  11402. * @param {?} locale
  11403. * @return {?}
  11404. */
  11405. function NGB_TIMEPICKER_I18N_FACTORY(locale) {
  11406. return new NgbTimepickerI18nDefault(locale);
  11407. }
  11408. /**
  11409. * Type of the service supplying day periods (for example, 'AM' and 'PM') to NgbTimepicker component.
  11410. * The default implementation of this service honors the Angular locale, and uses the registered locale data,
  11411. * as explained in the Angular i18n guide.
  11412. * @abstract
  11413. */
  11414. var NgbTimepickerI18n = /** @class */ (function () {
  11415. function NgbTimepickerI18n() {
  11416. }
  11417. NgbTimepickerI18n.decorators = [
  11418. { type: Injectable, args: [{ providedIn: 'root', useFactory: NGB_TIMEPICKER_I18N_FACTORY, deps: [LOCALE_ID] },] }
  11419. ];
  11420. /** @nocollapse */ NgbTimepickerI18n.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbTimepickerI18n_Factory() { return NGB_TIMEPICKER_I18N_FACTORY(ɵɵinject(LOCALE_ID)); }, token: NgbTimepickerI18n, providedIn: "root" });
  11421. return NgbTimepickerI18n;
  11422. }());
  11423. var NgbTimepickerI18nDefault = /** @class */ (function (_super) {
  11424. __extends(NgbTimepickerI18nDefault, _super);
  11425. function NgbTimepickerI18nDefault(locale) {
  11426. var _this = _super.call(this) || this;
  11427. _this._periods = getLocaleDayPeriods(locale, FormStyle.Standalone, TranslationWidth.Narrow);
  11428. return _this;
  11429. }
  11430. /**
  11431. * @return {?}
  11432. */
  11433. NgbTimepickerI18nDefault.prototype.getMorningPeriod = /**
  11434. * @return {?}
  11435. */
  11436. function () { return this._periods[0]; };
  11437. /**
  11438. * @return {?}
  11439. */
  11440. NgbTimepickerI18nDefault.prototype.getAfternoonPeriod = /**
  11441. * @return {?}
  11442. */
  11443. function () { return this._periods[1]; };
  11444. NgbTimepickerI18nDefault.decorators = [
  11445. { type: Injectable }
  11446. ];
  11447. /** @nocollapse */
  11448. NgbTimepickerI18nDefault.ctorParameters = function () { return [
  11449. { type: String, decorators: [{ type: Inject, args: [LOCALE_ID,] }] }
  11450. ]; };
  11451. return NgbTimepickerI18nDefault;
  11452. }(NgbTimepickerI18n));
  11453. /**
  11454. * @fileoverview added by tsickle
  11455. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11456. */
  11457. /** @type {?} */
  11458. var FILTER_REGEX = /[^0-9]/g;
  11459. /** @type {?} */
  11460. var NGB_TIMEPICKER_VALUE_ACCESSOR = {
  11461. provide: NG_VALUE_ACCESSOR,
  11462. useExisting: forwardRef((/**
  11463. * @return {?}
  11464. */
  11465. function () { return NgbTimepicker; })),
  11466. multi: true
  11467. };
  11468. /**
  11469. * A directive that helps with wth picking hours, minutes and seconds.
  11470. */
  11471. var NgbTimepicker = /** @class */ (function () {
  11472. function NgbTimepicker(_config, _ngbTimeAdapter, _cd, i18n) {
  11473. this._config = _config;
  11474. this._ngbTimeAdapter = _ngbTimeAdapter;
  11475. this._cd = _cd;
  11476. this.i18n = i18n;
  11477. this.onChange = (/**
  11478. * @param {?} _
  11479. * @return {?}
  11480. */
  11481. function (_) { });
  11482. this.onTouched = (/**
  11483. * @return {?}
  11484. */
  11485. function () { });
  11486. this.meridian = _config.meridian;
  11487. this.spinners = _config.spinners;
  11488. this.seconds = _config.seconds;
  11489. this.hourStep = _config.hourStep;
  11490. this.minuteStep = _config.minuteStep;
  11491. this.secondStep = _config.secondStep;
  11492. this.disabled = _config.disabled;
  11493. this.readonlyInputs = _config.readonlyInputs;
  11494. this.size = _config.size;
  11495. }
  11496. Object.defineProperty(NgbTimepicker.prototype, "hourStep", {
  11497. get: /**
  11498. * @return {?}
  11499. */
  11500. function () { return this._hourStep; },
  11501. /**
  11502. * The number of hours to add/subtract when clicking hour spinners.
  11503. */
  11504. set: /**
  11505. * The number of hours to add/subtract when clicking hour spinners.
  11506. * @param {?} step
  11507. * @return {?}
  11508. */
  11509. function (step) {
  11510. this._hourStep = isInteger(step) ? step : this._config.hourStep;
  11511. },
  11512. enumerable: true,
  11513. configurable: true
  11514. });
  11515. Object.defineProperty(NgbTimepicker.prototype, "minuteStep", {
  11516. get: /**
  11517. * @return {?}
  11518. */
  11519. function () { return this._minuteStep; },
  11520. /**
  11521. * The number of minutes to add/subtract when clicking minute spinners.
  11522. */
  11523. set: /**
  11524. * The number of minutes to add/subtract when clicking minute spinners.
  11525. * @param {?} step
  11526. * @return {?}
  11527. */
  11528. function (step) {
  11529. this._minuteStep = isInteger(step) ? step : this._config.minuteStep;
  11530. },
  11531. enumerable: true,
  11532. configurable: true
  11533. });
  11534. Object.defineProperty(NgbTimepicker.prototype, "secondStep", {
  11535. get: /**
  11536. * @return {?}
  11537. */
  11538. function () { return this._secondStep; },
  11539. /**
  11540. * The number of seconds to add/subtract when clicking second spinners.
  11541. */
  11542. set: /**
  11543. * The number of seconds to add/subtract when clicking second spinners.
  11544. * @param {?} step
  11545. * @return {?}
  11546. */
  11547. function (step) {
  11548. this._secondStep = isInteger(step) ? step : this._config.secondStep;
  11549. },
  11550. enumerable: true,
  11551. configurable: true
  11552. });
  11553. /**
  11554. * @param {?} value
  11555. * @return {?}
  11556. */
  11557. NgbTimepicker.prototype.writeValue = /**
  11558. * @param {?} value
  11559. * @return {?}
  11560. */
  11561. function (value) {
  11562. /** @type {?} */
  11563. var structValue = this._ngbTimeAdapter.fromModel(value);
  11564. this.model = structValue ? new NgbTime(structValue.hour, structValue.minute, structValue.second) : new NgbTime();
  11565. if (!this.seconds && (!structValue || !isNumber(structValue.second))) {
  11566. this.model.second = 0;
  11567. }
  11568. this._cd.markForCheck();
  11569. };
  11570. /**
  11571. * @param {?} fn
  11572. * @return {?}
  11573. */
  11574. NgbTimepicker.prototype.registerOnChange = /**
  11575. * @param {?} fn
  11576. * @return {?}
  11577. */
  11578. function (fn) { this.onChange = fn; };
  11579. /**
  11580. * @param {?} fn
  11581. * @return {?}
  11582. */
  11583. NgbTimepicker.prototype.registerOnTouched = /**
  11584. * @param {?} fn
  11585. * @return {?}
  11586. */
  11587. function (fn) { this.onTouched = fn; };
  11588. /**
  11589. * @param {?} isDisabled
  11590. * @return {?}
  11591. */
  11592. NgbTimepicker.prototype.setDisabledState = /**
  11593. * @param {?} isDisabled
  11594. * @return {?}
  11595. */
  11596. function (isDisabled) { this.disabled = isDisabled; };
  11597. /**
  11598. * @param {?} step
  11599. * @return {?}
  11600. */
  11601. NgbTimepicker.prototype.changeHour = /**
  11602. * @param {?} step
  11603. * @return {?}
  11604. */
  11605. function (step) {
  11606. this.model.changeHour(step);
  11607. this.propagateModelChange();
  11608. };
  11609. /**
  11610. * @param {?} step
  11611. * @return {?}
  11612. */
  11613. NgbTimepicker.prototype.changeMinute = /**
  11614. * @param {?} step
  11615. * @return {?}
  11616. */
  11617. function (step) {
  11618. this.model.changeMinute(step);
  11619. this.propagateModelChange();
  11620. };
  11621. /**
  11622. * @param {?} step
  11623. * @return {?}
  11624. */
  11625. NgbTimepicker.prototype.changeSecond = /**
  11626. * @param {?} step
  11627. * @return {?}
  11628. */
  11629. function (step) {
  11630. this.model.changeSecond(step);
  11631. this.propagateModelChange();
  11632. };
  11633. /**
  11634. * @param {?} newVal
  11635. * @return {?}
  11636. */
  11637. NgbTimepicker.prototype.updateHour = /**
  11638. * @param {?} newVal
  11639. * @return {?}
  11640. */
  11641. function (newVal) {
  11642. /** @type {?} */
  11643. var isPM = this.model.hour >= 12;
  11644. /** @type {?} */
  11645. var enteredHour = toInteger(newVal);
  11646. if (this.meridian && (isPM && enteredHour < 12 || !isPM && enteredHour === 12)) {
  11647. this.model.updateHour(enteredHour + 12);
  11648. }
  11649. else {
  11650. this.model.updateHour(enteredHour);
  11651. }
  11652. this.propagateModelChange();
  11653. };
  11654. /**
  11655. * @param {?} newVal
  11656. * @return {?}
  11657. */
  11658. NgbTimepicker.prototype.updateMinute = /**
  11659. * @param {?} newVal
  11660. * @return {?}
  11661. */
  11662. function (newVal) {
  11663. this.model.updateMinute(toInteger(newVal));
  11664. this.propagateModelChange();
  11665. };
  11666. /**
  11667. * @param {?} newVal
  11668. * @return {?}
  11669. */
  11670. NgbTimepicker.prototype.updateSecond = /**
  11671. * @param {?} newVal
  11672. * @return {?}
  11673. */
  11674. function (newVal) {
  11675. this.model.updateSecond(toInteger(newVal));
  11676. this.propagateModelChange();
  11677. };
  11678. /**
  11679. * @return {?}
  11680. */
  11681. NgbTimepicker.prototype.toggleMeridian = /**
  11682. * @return {?}
  11683. */
  11684. function () {
  11685. if (this.meridian) {
  11686. this.changeHour(12);
  11687. }
  11688. };
  11689. /**
  11690. * @param {?} input
  11691. * @return {?}
  11692. */
  11693. NgbTimepicker.prototype.formatInput = /**
  11694. * @param {?} input
  11695. * @return {?}
  11696. */
  11697. function (input) { input.value = input.value.replace(FILTER_REGEX, ''); };
  11698. /**
  11699. * @param {?} value
  11700. * @return {?}
  11701. */
  11702. NgbTimepicker.prototype.formatHour = /**
  11703. * @param {?} value
  11704. * @return {?}
  11705. */
  11706. function (value) {
  11707. if (isNumber(value)) {
  11708. if (this.meridian) {
  11709. return padNumber(value % 12 === 0 ? 12 : value % 12);
  11710. }
  11711. else {
  11712. return padNumber(value % 24);
  11713. }
  11714. }
  11715. else {
  11716. return padNumber(NaN);
  11717. }
  11718. };
  11719. /**
  11720. * @param {?} value
  11721. * @return {?}
  11722. */
  11723. NgbTimepicker.prototype.formatMinSec = /**
  11724. * @param {?} value
  11725. * @return {?}
  11726. */
  11727. function (value) { return padNumber(value); };
  11728. Object.defineProperty(NgbTimepicker.prototype, "isSmallSize", {
  11729. get: /**
  11730. * @return {?}
  11731. */
  11732. function () { return this.size === 'small'; },
  11733. enumerable: true,
  11734. configurable: true
  11735. });
  11736. Object.defineProperty(NgbTimepicker.prototype, "isLargeSize", {
  11737. get: /**
  11738. * @return {?}
  11739. */
  11740. function () { return this.size === 'large'; },
  11741. enumerable: true,
  11742. configurable: true
  11743. });
  11744. /**
  11745. * @param {?} changes
  11746. * @return {?}
  11747. */
  11748. NgbTimepicker.prototype.ngOnChanges = /**
  11749. * @param {?} changes
  11750. * @return {?}
  11751. */
  11752. function (changes) {
  11753. if (changes['seconds'] && !this.seconds && this.model && !isNumber(this.model.second)) {
  11754. this.model.second = 0;
  11755. this.propagateModelChange(false);
  11756. }
  11757. };
  11758. /**
  11759. * @private
  11760. * @param {?=} touched
  11761. * @return {?}
  11762. */
  11763. NgbTimepicker.prototype.propagateModelChange = /**
  11764. * @private
  11765. * @param {?=} touched
  11766. * @return {?}
  11767. */
  11768. function (touched) {
  11769. if (touched === void 0) { touched = true; }
  11770. if (touched) {
  11771. this.onTouched();
  11772. }
  11773. if (this.model.isValid(this.seconds)) {
  11774. this.onChange(this._ngbTimeAdapter.toModel({ hour: this.model.hour, minute: this.model.minute, second: this.model.second }));
  11775. }
  11776. else {
  11777. this.onChange(this._ngbTimeAdapter.toModel(null));
  11778. }
  11779. };
  11780. NgbTimepicker.decorators = [
  11781. { type: Component, args: [{
  11782. selector: 'ngb-timepicker',
  11783. encapsulation: ViewEncapsulation.None,
  11784. template: "\n <fieldset [disabled]=\"disabled\" [class.disabled]=\"disabled\">\n <div class=\"ngb-tp\">\n <div class=\"ngb-tp-input-container ngb-tp-hour\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeHour(hourStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.increment-hours\">Increment hours</span>\n </button>\n <input type=\"text\" class=\"ngb-tp-input form-control\" [class.form-control-sm]=\"isSmallSize\"\n [class.form-control-lg]=\"isLargeSize\"\n maxlength=\"2\" inputmode=\"numeric\" placeholder=\"HH\" i18n-placeholder=\"@@ngb.timepicker.HH\"\n [value]=\"formatHour(model?.hour)\" (change)=\"updateHour($event.target.value)\"\n [readOnly]=\"readonlyInputs\" [disabled]=\"disabled\" aria-label=\"Hours\" i18n-aria-label=\"@@ngb.timepicker.hours\"\n (input)=\"formatInput($event.target)\"\n (keydown.ArrowUp)=\"changeHour(hourStep); $event.preventDefault()\"\n (keydown.ArrowDown)=\"changeHour(-hourStep); $event.preventDefault()\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeHour(-hourStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron bottom\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.decrement-hours\">Decrement hours</span>\n </button>\n </div>\n <div class=\"ngb-tp-spacer\">:</div>\n <div class=\"ngb-tp-input-container ngb-tp-minute\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeMinute(minuteStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.increment-minutes\">Increment minutes</span>\n </button>\n <input type=\"text\" class=\"ngb-tp-input form-control\" [class.form-control-sm]=\"isSmallSize\" [class.form-control-lg]=\"isLargeSize\"\n maxlength=\"2\" inputmode=\"numeric\" placeholder=\"MM\" i18n-placeholder=\"@@ngb.timepicker.MM\"\n [value]=\"formatMinSec(model?.minute)\" (change)=\"updateMinute($event.target.value)\"\n [readOnly]=\"readonlyInputs\" [disabled]=\"disabled\" aria-label=\"Minutes\" i18n-aria-label=\"@@ngb.timepicker.minutes\"\n (input)=\"formatInput($event.target)\"\n (keydown.ArrowUp)=\"changeMinute(minuteStep); $event.preventDefault()\"\n (keydown.ArrowDown)=\"changeMinute(-minuteStep); $event.preventDefault()\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeMinute(-minuteStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron bottom\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.decrement-minutes\">Decrement minutes</span>\n </button>\n </div>\n <div *ngIf=\"seconds\" class=\"ngb-tp-spacer\">:</div>\n <div *ngIf=\"seconds\" class=\"ngb-tp-input-container ngb-tp-second\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeSecond(secondStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.increment-seconds\">Increment seconds</span>\n </button>\n <input type=\"text\" class=\"ngb-tp-input form-control\" [class.form-control-sm]=\"isSmallSize\" [class.form-control-lg]=\"isLargeSize\"\n maxlength=\"2\" inputmode=\"numeric\" placeholder=\"SS\" i18n-placeholder=\"@@ngb.timepicker.SS\"\n [value]=\"formatMinSec(model?.second)\" (change)=\"updateSecond($event.target.value)\"\n [readOnly]=\"readonlyInputs\" [disabled]=\"disabled\" aria-label=\"Seconds\" i18n-aria-label=\"@@ngb.timepicker.seconds\"\n (input)=\"formatInput($event.target)\"\n (keydown.ArrowUp)=\"changeSecond(secondStep); $event.preventDefault()\"\n (keydown.ArrowDown)=\"changeSecond(-secondStep); $event.preventDefault()\">\n <button *ngIf=\"spinners\" tabindex=\"-1\" type=\"button\" (click)=\"changeSecond(-secondStep)\"\n class=\"btn btn-link\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\" [class.disabled]=\"disabled\"\n [disabled]=\"disabled\">\n <span class=\"chevron ngb-tp-chevron bottom\"></span>\n <span class=\"sr-only\" i18n=\"@@ngb.timepicker.decrement-seconds\">Decrement seconds</span>\n </button>\n </div>\n <div *ngIf=\"meridian\" class=\"ngb-tp-spacer\"></div>\n <div *ngIf=\"meridian\" class=\"ngb-tp-meridian\">\n <button type=\"button\" class=\"btn btn-outline-primary\" [class.btn-sm]=\"isSmallSize\" [class.btn-lg]=\"isLargeSize\"\n [disabled]=\"disabled\" [class.disabled]=\"disabled\"\n (click)=\"toggleMeridian()\">\n <ng-container *ngIf=\"model?.hour >= 12; else am\" i18n=\"@@ngb.timepicker.PM\">{{ i18n.getAfternoonPeriod() }}</ng-container>\n <ng-template #am i18n=\"@@ngb.timepicker.AM\">{{ i18n.getMorningPeriod() }}</ng-template>\n </button>\n </div>\n </div>\n </fieldset>\n ",
  11785. providers: [NGB_TIMEPICKER_VALUE_ACCESSOR],
  11786. styles: ["ngb-timepicker{font-size:1rem}.ngb-tp{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.ngb-tp-input-container{width:4em}.ngb-tp-chevron::before{border-style:solid;border-width:.29em .29em 0 0;content:\"\";display:inline-block;height:.69em;left:.05em;position:relative;top:.15em;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);vertical-align:middle;width:.69em}.ngb-tp-chevron.bottom:before{top:-.3em;-webkit-transform:rotate(135deg);transform:rotate(135deg)}.ngb-tp-input{text-align:center}.ngb-tp-hour,.ngb-tp-meridian,.ngb-tp-minute,.ngb-tp-second{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.ngb-tp-spacer{width:1em;text-align:center}"]
  11787. }] }
  11788. ];
  11789. /** @nocollapse */
  11790. NgbTimepicker.ctorParameters = function () { return [
  11791. { type: NgbTimepickerConfig },
  11792. { type: NgbTimeAdapter },
  11793. { type: ChangeDetectorRef },
  11794. { type: NgbTimepickerI18n }
  11795. ]; };
  11796. NgbTimepicker.propDecorators = {
  11797. meridian: [{ type: Input }],
  11798. spinners: [{ type: Input }],
  11799. seconds: [{ type: Input }],
  11800. hourStep: [{ type: Input }],
  11801. minuteStep: [{ type: Input }],
  11802. secondStep: [{ type: Input }],
  11803. readonlyInputs: [{ type: Input }],
  11804. size: [{ type: Input }]
  11805. };
  11806. return NgbTimepicker;
  11807. }());
  11808. /**
  11809. * @fileoverview added by tsickle
  11810. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11811. */
  11812. var NgbTimepickerModule = /** @class */ (function () {
  11813. function NgbTimepickerModule() {
  11814. }
  11815. NgbTimepickerModule.decorators = [
  11816. { type: NgModule, args: [{ declarations: [NgbTimepicker], exports: [NgbTimepicker], imports: [CommonModule] },] }
  11817. ];
  11818. return NgbTimepickerModule;
  11819. }());
  11820. /**
  11821. * @fileoverview added by tsickle
  11822. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11823. */
  11824. /**
  11825. * Configuration service for the NgbToast component. You can inject this service, typically in your root component,
  11826. * and customize the values of its properties in order to provide default values for all the toasts used in the
  11827. * application.
  11828. *
  11829. * \@since 5.0.0
  11830. */
  11831. var NgbToastConfig = /** @class */ (function () {
  11832. function NgbToastConfig() {
  11833. this.autohide = true;
  11834. this.delay = 500;
  11835. this.ariaLive = 'polite';
  11836. }
  11837. NgbToastConfig.decorators = [
  11838. { type: Injectable, args: [{ providedIn: 'root' },] }
  11839. ];
  11840. /** @nocollapse */ NgbToastConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbToastConfig_Factory() { return new NgbToastConfig(); }, token: NgbToastConfig, providedIn: "root" });
  11841. return NgbToastConfig;
  11842. }());
  11843. /**
  11844. * @fileoverview added by tsickle
  11845. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11846. */
  11847. /**
  11848. * This directive allows the usage of HTML markup or other directives
  11849. * inside of the toast's header.
  11850. *
  11851. * \@since 5.0.0
  11852. */
  11853. var NgbToastHeader = /** @class */ (function () {
  11854. function NgbToastHeader() {
  11855. }
  11856. NgbToastHeader.decorators = [
  11857. { type: Directive, args: [{ selector: '[ngbToastHeader]' },] }
  11858. ];
  11859. return NgbToastHeader;
  11860. }());
  11861. /**
  11862. * Toasts provide feedback messages as notifications to the user.
  11863. * Goal is to mimic the push notifications available both on mobile and desktop operating systems.
  11864. *
  11865. * \@since 5.0.0
  11866. */
  11867. var NgbToast = /** @class */ (function () {
  11868. function NgbToast(ariaLive, config) {
  11869. this.ariaLive = ariaLive;
  11870. /**
  11871. * A template like `<ng-template ngbToastHeader></ng-template>` can be
  11872. * used in the projected content to allow markup usage.
  11873. */
  11874. this.contentHeaderTpl = null;
  11875. /**
  11876. * An event fired immediately when toast's `hide()` method has been called.
  11877. * It can only occur in 2 different scenarios:
  11878. * - `autohide` timeout fires
  11879. * - user clicks on a closing cross (&times)
  11880. *
  11881. * Additionally this output is purely informative. The toast won't disappear. It's up to the user to take care of
  11882. * that.
  11883. */
  11884. this.hideOutput = new EventEmitter();
  11885. if (this.ariaLive == null) {
  11886. this.ariaLive = config.ariaLive;
  11887. }
  11888. this.delay = config.delay;
  11889. this.autohide = config.autohide;
  11890. }
  11891. /**
  11892. * @return {?}
  11893. */
  11894. NgbToast.prototype.ngAfterContentInit = /**
  11895. * @return {?}
  11896. */
  11897. function () { this._init(); };
  11898. /**
  11899. * @param {?} changes
  11900. * @return {?}
  11901. */
  11902. NgbToast.prototype.ngOnChanges = /**
  11903. * @param {?} changes
  11904. * @return {?}
  11905. */
  11906. function (changes) {
  11907. if ('autohide' in changes) {
  11908. this._clearTimeout();
  11909. this._init();
  11910. }
  11911. };
  11912. /**
  11913. * @return {?}
  11914. */
  11915. NgbToast.prototype.hide = /**
  11916. * @return {?}
  11917. */
  11918. function () {
  11919. this._clearTimeout();
  11920. this.hideOutput.emit();
  11921. };
  11922. /**
  11923. * @private
  11924. * @return {?}
  11925. */
  11926. NgbToast.prototype._init = /**
  11927. * @private
  11928. * @return {?}
  11929. */
  11930. function () {
  11931. var _this = this;
  11932. if (this.autohide && !this._timeoutID) {
  11933. this._timeoutID = setTimeout((/**
  11934. * @return {?}
  11935. */
  11936. function () { return _this.hide(); }), this.delay);
  11937. }
  11938. };
  11939. /**
  11940. * @private
  11941. * @return {?}
  11942. */
  11943. NgbToast.prototype._clearTimeout = /**
  11944. * @private
  11945. * @return {?}
  11946. */
  11947. function () {
  11948. if (this._timeoutID) {
  11949. clearTimeout(this._timeoutID);
  11950. this._timeoutID = null;
  11951. }
  11952. };
  11953. NgbToast.decorators = [
  11954. { type: Component, args: [{
  11955. selector: 'ngb-toast',
  11956. exportAs: 'ngbToast',
  11957. encapsulation: ViewEncapsulation.None,
  11958. host: {
  11959. 'role': 'alert',
  11960. '[attr.aria-live]': 'ariaLive',
  11961. 'aria-atomic': 'true',
  11962. '[class.toast]': 'true',
  11963. '[class.show]': 'true',
  11964. },
  11965. template: "\n <ng-template #headerTpl>\n <strong class=\"mr-auto\">{{header}}</strong>\n </ng-template>\n <ng-template [ngIf]=\"contentHeaderTpl || header\">\n <div class=\"toast-header\">\n <ng-template [ngTemplateOutlet]=\"contentHeaderTpl || headerTpl\"></ng-template>\n <button type=\"button\" class=\"close\" aria-label=\"Close\" i18n-aria-label=\"@@ngb.toast.close-aria\" (click)=\"hide()\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n </ng-template>\n <div class=\"toast-body\">\n <ng-content></ng-content>\n </div>\n ",
  11966. styles: [".ngb-toasts{position:fixed;top:0;right:0;margin:.5em;z-index:1200}ngb-toast .toast-header .close{margin-left:auto;margin-bottom:.25rem}"]
  11967. }] }
  11968. ];
  11969. /** @nocollapse */
  11970. NgbToast.ctorParameters = function () { return [
  11971. { type: String, decorators: [{ type: Attribute, args: ['aria-live',] }] },
  11972. { type: NgbToastConfig }
  11973. ]; };
  11974. NgbToast.propDecorators = {
  11975. delay: [{ type: Input }],
  11976. autohide: [{ type: Input }],
  11977. header: [{ type: Input }],
  11978. contentHeaderTpl: [{ type: ContentChild, args: [NgbToastHeader, { read: TemplateRef, static: true },] }],
  11979. hideOutput: [{ type: Output, args: ['hide',] }]
  11980. };
  11981. return NgbToast;
  11982. }());
  11983. /**
  11984. * @fileoverview added by tsickle
  11985. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11986. */
  11987. var NgbToastModule = /** @class */ (function () {
  11988. function NgbToastModule() {
  11989. }
  11990. NgbToastModule.decorators = [
  11991. { type: NgModule, args: [{ declarations: [NgbToast, NgbToastHeader], imports: [CommonModule], exports: [NgbToast, NgbToastHeader] },] }
  11992. ];
  11993. return NgbToastModule;
  11994. }());
  11995. /**
  11996. * @fileoverview added by tsickle
  11997. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11998. */
  11999. /**
  12000. * A configuration service for the [`NgbTooltip`](#/components/tooltip/api#NgbTooltip) component.
  12001. *
  12002. * You can inject this service, typically in your root component, and customize the values of its properties in
  12003. * order to provide default values for all the tooltips used in the application.
  12004. */
  12005. var NgbTooltipConfig = /** @class */ (function () {
  12006. function NgbTooltipConfig() {
  12007. this.autoClose = true;
  12008. this.placement = 'auto';
  12009. this.triggers = 'hover focus';
  12010. this.disableTooltip = false;
  12011. this.openDelay = 0;
  12012. this.closeDelay = 0;
  12013. }
  12014. NgbTooltipConfig.decorators = [
  12015. { type: Injectable, args: [{ providedIn: 'root' },] }
  12016. ];
  12017. /** @nocollapse */ NgbTooltipConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbTooltipConfig_Factory() { return new NgbTooltipConfig(); }, token: NgbTooltipConfig, providedIn: "root" });
  12018. return NgbTooltipConfig;
  12019. }());
  12020. /**
  12021. * @fileoverview added by tsickle
  12022. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  12023. */
  12024. /** @type {?} */
  12025. var nextId$5 = 0;
  12026. var NgbTooltipWindow = /** @class */ (function () {
  12027. function NgbTooltipWindow() {
  12028. }
  12029. NgbTooltipWindow.decorators = [
  12030. { type: Component, args: [{
  12031. selector: 'ngb-tooltip-window',
  12032. changeDetection: ChangeDetectionStrategy.OnPush,
  12033. encapsulation: ViewEncapsulation.None,
  12034. host: { '[class]': '"tooltip show" + (tooltipClass ? " " + tooltipClass : "")', 'role': 'tooltip', '[id]': 'id' },
  12035. template: "<div class=\"arrow\"></div><div class=\"tooltip-inner\"><ng-content></ng-content></div>",
  12036. styles: ["ngb-tooltip-window.bs-tooltip-bottom .arrow,ngb-tooltip-window.bs-tooltip-top .arrow{left:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-bottom-left .arrow,ngb-tooltip-window.bs-tooltip-top-left .arrow{left:1em}ngb-tooltip-window.bs-tooltip-bottom-right .arrow,ngb-tooltip-window.bs-tooltip-top-right .arrow{left:auto;right:.8rem}ngb-tooltip-window.bs-tooltip-left .arrow,ngb-tooltip-window.bs-tooltip-right .arrow{top:calc(50% - .4rem)}ngb-tooltip-window.bs-tooltip-left-top .arrow,ngb-tooltip-window.bs-tooltip-right-top .arrow{top:.4rem}ngb-tooltip-window.bs-tooltip-left-bottom .arrow,ngb-tooltip-window.bs-tooltip-right-bottom .arrow{top:auto;bottom:.4rem}"]
  12037. }] }
  12038. ];
  12039. NgbTooltipWindow.propDecorators = {
  12040. id: [{ type: Input }],
  12041. tooltipClass: [{ type: Input }]
  12042. };
  12043. return NgbTooltipWindow;
  12044. }());
  12045. /**
  12046. * A lightweight and extensible directive for fancy tooltip creation.
  12047. */
  12048. var NgbTooltip = /** @class */ (function () {
  12049. function NgbTooltip(_elementRef, _renderer, injector, componentFactoryResolver, viewContainerRef, config, _ngZone, _document, _changeDetector, applicationRef) {
  12050. var _this = this;
  12051. this._elementRef = _elementRef;
  12052. this._renderer = _renderer;
  12053. this._ngZone = _ngZone;
  12054. this._document = _document;
  12055. this._changeDetector = _changeDetector;
  12056. /**
  12057. * An event emitted when the tooltip is shown. Contains no payload.
  12058. */
  12059. this.shown = new EventEmitter();
  12060. /**
  12061. * An event emitted when the popover is hidden. Contains no payload.
  12062. */
  12063. this.hidden = new EventEmitter();
  12064. this._ngbTooltipWindowId = "ngb-tooltip-" + nextId$5++;
  12065. this.autoClose = config.autoClose;
  12066. this.placement = config.placement;
  12067. this.triggers = config.triggers;
  12068. this.container = config.container;
  12069. this.disableTooltip = config.disableTooltip;
  12070. this.tooltipClass = config.tooltipClass;
  12071. this.openDelay = config.openDelay;
  12072. this.closeDelay = config.closeDelay;
  12073. this._popupService = new PopupService(NgbTooltipWindow, injector, viewContainerRef, _renderer, componentFactoryResolver, applicationRef);
  12074. this._zoneSubscription = _ngZone.onStable.subscribe((/**
  12075. * @return {?}
  12076. */
  12077. function () {
  12078. if (_this._windowRef) {
  12079. positionElements(_this._elementRef.nativeElement, _this._windowRef.location.nativeElement, _this.placement, _this.container === 'body', 'bs-tooltip');
  12080. }
  12081. }));
  12082. }
  12083. Object.defineProperty(NgbTooltip.prototype, "ngbTooltip", {
  12084. get: /**
  12085. * @return {?}
  12086. */
  12087. function () { return this._ngbTooltip; },
  12088. /**
  12089. * The string content or a `TemplateRef` for the content to be displayed in the tooltip.
  12090. *
  12091. * If the content if falsy, the tooltip won't open.
  12092. */
  12093. set: /**
  12094. * The string content or a `TemplateRef` for the content to be displayed in the tooltip.
  12095. *
  12096. * If the content if falsy, the tooltip won't open.
  12097. * @param {?} value
  12098. * @return {?}
  12099. */
  12100. function (value) {
  12101. this._ngbTooltip = value;
  12102. if (!value && this._windowRef) {
  12103. this.close();
  12104. }
  12105. },
  12106. enumerable: true,
  12107. configurable: true
  12108. });
  12109. /**
  12110. * Opens the tooltip.
  12111. *
  12112. * This is considered to be a "manual" triggering.
  12113. * The `context` is an optional value to be injected into the tooltip template when it is created.
  12114. */
  12115. /**
  12116. * Opens the tooltip.
  12117. *
  12118. * This is considered to be a "manual" triggering.
  12119. * The `context` is an optional value to be injected into the tooltip template when it is created.
  12120. * @param {?=} context
  12121. * @return {?}
  12122. */
  12123. NgbTooltip.prototype.open = /**
  12124. * Opens the tooltip.
  12125. *
  12126. * This is considered to be a "manual" triggering.
  12127. * The `context` is an optional value to be injected into the tooltip template when it is created.
  12128. * @param {?=} context
  12129. * @return {?}
  12130. */
  12131. function (context) {
  12132. var _this = this;
  12133. if (!this._windowRef && this._ngbTooltip && !this.disableTooltip) {
  12134. this._windowRef = this._popupService.open(this._ngbTooltip, context);
  12135. this._windowRef.instance.tooltipClass = this.tooltipClass;
  12136. this._windowRef.instance.id = this._ngbTooltipWindowId;
  12137. this._renderer.setAttribute(this._elementRef.nativeElement, 'aria-describedby', this._ngbTooltipWindowId);
  12138. if (this.container === 'body') {
  12139. this._document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);
  12140. }
  12141. // We need to detect changes, because we don't know where .open() might be called from.
  12142. // Ex. opening tooltip from one of lifecycle hooks that run after the CD
  12143. // (say from ngAfterViewInit) will result in 'ExpressionHasChanged' exception
  12144. this._windowRef.changeDetectorRef.detectChanges();
  12145. // We need to mark for check, because tooltip won't work inside the OnPush component.
  12146. // Ex. when we use expression like `{{ tooltip.isOpen() : 'opened' : 'closed' }}`
  12147. // inside the template of an OnPush component and we change the tooltip from
  12148. // open -> closed, the expression in question won't be updated unless we explicitly
  12149. // mark the parent component to be checked.
  12150. this._windowRef.changeDetectorRef.markForCheck();
  12151. ngbAutoClose(this._ngZone, this._document, this.autoClose, (/**
  12152. * @return {?}
  12153. */
  12154. function () { return _this.close(); }), this.hidden, [this._windowRef.location.nativeElement]);
  12155. this.shown.emit();
  12156. }
  12157. };
  12158. /**
  12159. * Closes the tooltip.
  12160. *
  12161. * This is considered to be a "manual" triggering of the tooltip.
  12162. */
  12163. /**
  12164. * Closes the tooltip.
  12165. *
  12166. * This is considered to be a "manual" triggering of the tooltip.
  12167. * @return {?}
  12168. */
  12169. NgbTooltip.prototype.close = /**
  12170. * Closes the tooltip.
  12171. *
  12172. * This is considered to be a "manual" triggering of the tooltip.
  12173. * @return {?}
  12174. */
  12175. function () {
  12176. if (this._windowRef != null) {
  12177. this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');
  12178. this._popupService.close();
  12179. this._windowRef = null;
  12180. this.hidden.emit();
  12181. this._changeDetector.markForCheck();
  12182. }
  12183. };
  12184. /**
  12185. * Toggles the tooltip.
  12186. *
  12187. * This is considered to be a "manual" triggering of the tooltip.
  12188. */
  12189. /**
  12190. * Toggles the tooltip.
  12191. *
  12192. * This is considered to be a "manual" triggering of the tooltip.
  12193. * @return {?}
  12194. */
  12195. NgbTooltip.prototype.toggle = /**
  12196. * Toggles the tooltip.
  12197. *
  12198. * This is considered to be a "manual" triggering of the tooltip.
  12199. * @return {?}
  12200. */
  12201. function () {
  12202. if (this._windowRef) {
  12203. this.close();
  12204. }
  12205. else {
  12206. this.open();
  12207. }
  12208. };
  12209. /**
  12210. * Returns `true`, if the popover is currently shown.
  12211. */
  12212. /**
  12213. * Returns `true`, if the popover is currently shown.
  12214. * @return {?}
  12215. */
  12216. NgbTooltip.prototype.isOpen = /**
  12217. * Returns `true`, if the popover is currently shown.
  12218. * @return {?}
  12219. */
  12220. function () { return this._windowRef != null; };
  12221. /**
  12222. * @return {?}
  12223. */
  12224. NgbTooltip.prototype.ngOnInit = /**
  12225. * @return {?}
  12226. */
  12227. function () {
  12228. this._unregisterListenersFn = listenToTriggers(this._renderer, this._elementRef.nativeElement, this.triggers, this.isOpen.bind(this), this.open.bind(this), this.close.bind(this), +this.openDelay, +this.closeDelay);
  12229. };
  12230. /**
  12231. * @param {?} __0
  12232. * @return {?}
  12233. */
  12234. NgbTooltip.prototype.ngOnChanges = /**
  12235. * @param {?} __0
  12236. * @return {?}
  12237. */
  12238. function (_a) {
  12239. var tooltipClass = _a.tooltipClass;
  12240. if (tooltipClass && this.isOpen()) {
  12241. this._windowRef.instance.tooltipClass = tooltipClass.currentValue;
  12242. }
  12243. };
  12244. /**
  12245. * @return {?}
  12246. */
  12247. NgbTooltip.prototype.ngOnDestroy = /**
  12248. * @return {?}
  12249. */
  12250. function () {
  12251. this.close();
  12252. // This check is needed as it might happen that ngOnDestroy is called before ngOnInit
  12253. // under certain conditions, see: https://github.com/ng-bootstrap/ng-bootstrap/issues/2199
  12254. if (this._unregisterListenersFn) {
  12255. this._unregisterListenersFn();
  12256. }
  12257. this._zoneSubscription.unsubscribe();
  12258. };
  12259. NgbTooltip.decorators = [
  12260. { type: Directive, args: [{ selector: '[ngbTooltip]', exportAs: 'ngbTooltip' },] }
  12261. ];
  12262. /** @nocollapse */
  12263. NgbTooltip.ctorParameters = function () { return [
  12264. { type: ElementRef },
  12265. { type: Renderer2 },
  12266. { type: Injector },
  12267. { type: ComponentFactoryResolver },
  12268. { type: ViewContainerRef },
  12269. { type: NgbTooltipConfig },
  12270. { type: NgZone },
  12271. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
  12272. { type: ChangeDetectorRef },
  12273. { type: ApplicationRef }
  12274. ]; };
  12275. NgbTooltip.propDecorators = {
  12276. autoClose: [{ type: Input }],
  12277. placement: [{ type: Input }],
  12278. triggers: [{ type: Input }],
  12279. container: [{ type: Input }],
  12280. disableTooltip: [{ type: Input }],
  12281. tooltipClass: [{ type: Input }],
  12282. openDelay: [{ type: Input }],
  12283. closeDelay: [{ type: Input }],
  12284. shown: [{ type: Output }],
  12285. hidden: [{ type: Output }],
  12286. ngbTooltip: [{ type: Input }]
  12287. };
  12288. return NgbTooltip;
  12289. }());
  12290. /**
  12291. * @fileoverview added by tsickle
  12292. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  12293. */
  12294. var NgbTooltipModule = /** @class */ (function () {
  12295. function NgbTooltipModule() {
  12296. }
  12297. NgbTooltipModule.decorators = [
  12298. { type: NgModule, args: [{ declarations: [NgbTooltip, NgbTooltipWindow], exports: [NgbTooltip], entryComponents: [NgbTooltipWindow] },] }
  12299. ];
  12300. return NgbTooltipModule;
  12301. }());
  12302. /**
  12303. * @fileoverview added by tsickle
  12304. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  12305. */
  12306. /**
  12307. * A component that helps with text highlighting.
  12308. *
  12309. * If splits the `result` text into parts that contain the searched `term` and generates the HTML markup to simplify
  12310. * highlighting:
  12311. *
  12312. * Ex. `result="Alaska"` and `term="as"` will produce `Al<span class="ngb-highlight">as</span>ka`.
  12313. */
  12314. var NgbHighlight = /** @class */ (function () {
  12315. function NgbHighlight() {
  12316. /**
  12317. * The CSS class for `<span>` elements wrapping the `term` inside the `result`.
  12318. */
  12319. this.highlightClass = 'ngb-highlight';
  12320. }
  12321. /**
  12322. * @param {?} changes
  12323. * @return {?}
  12324. */
  12325. NgbHighlight.prototype.ngOnChanges = /**
  12326. * @param {?} changes
  12327. * @return {?}
  12328. */
  12329. function (changes) {
  12330. /** @type {?} */
  12331. var result = toString(this.result);
  12332. /** @type {?} */
  12333. var terms = Array.isArray(this.term) ? this.term : [this.term];
  12334. /** @type {?} */
  12335. var escapedTerms = terms.map((/**
  12336. * @param {?} term
  12337. * @return {?}
  12338. */
  12339. function (term) { return regExpEscape(toString(term)); })).filter((/**
  12340. * @param {?} term
  12341. * @return {?}
  12342. */
  12343. function (term) { return term; }));
  12344. this.parts = escapedTerms.length ? result.split(new RegExp("(" + escapedTerms.join('|') + ")", 'gmi')) : [result];
  12345. };
  12346. NgbHighlight.decorators = [
  12347. { type: Component, args: [{
  12348. selector: 'ngb-highlight',
  12349. changeDetection: ChangeDetectionStrategy.OnPush,
  12350. encapsulation: ViewEncapsulation.None,
  12351. template: "<ng-template ngFor [ngForOf]=\"parts\" let-part let-isOdd=\"odd\">" +
  12352. "<span *ngIf=\"isOdd; else even\" [class]=\"highlightClass\">{{part}}</span><ng-template #even>{{part}}</ng-template>" +
  12353. "</ng-template>",
  12354. styles: [".ngb-highlight{font-weight:700}"]
  12355. }] }
  12356. ];
  12357. NgbHighlight.propDecorators = {
  12358. highlightClass: [{ type: Input }],
  12359. result: [{ type: Input }],
  12360. term: [{ type: Input }]
  12361. };
  12362. return NgbHighlight;
  12363. }());
  12364. /**
  12365. * @fileoverview added by tsickle
  12366. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  12367. */
  12368. var NgbTypeaheadWindow = /** @class */ (function () {
  12369. function NgbTypeaheadWindow() {
  12370. this.activeIdx = 0;
  12371. /**
  12372. * Flag indicating if the first row should be active initially
  12373. */
  12374. this.focusFirst = true;
  12375. /**
  12376. * A function used to format a given result before display. This function should return a formatted string without any
  12377. * HTML markup
  12378. */
  12379. this.formatter = toString;
  12380. /**
  12381. * Event raised when user selects a particular result row
  12382. */
  12383. this.selectEvent = new EventEmitter();
  12384. this.activeChangeEvent = new EventEmitter();
  12385. }
  12386. /**
  12387. * @return {?}
  12388. */
  12389. NgbTypeaheadWindow.prototype.hasActive = /**
  12390. * @return {?}
  12391. */
  12392. function () { return this.activeIdx > -1 && this.activeIdx < this.results.length; };
  12393. /**
  12394. * @return {?}
  12395. */
  12396. NgbTypeaheadWindow.prototype.getActive = /**
  12397. * @return {?}
  12398. */
  12399. function () { return this.results[this.activeIdx]; };
  12400. /**
  12401. * @param {?} activeIdx
  12402. * @return {?}
  12403. */
  12404. NgbTypeaheadWindow.prototype.markActive = /**
  12405. * @param {?} activeIdx
  12406. * @return {?}
  12407. */
  12408. function (activeIdx) {
  12409. this.activeIdx = activeIdx;
  12410. this._activeChanged();
  12411. };
  12412. /**
  12413. * @return {?}
  12414. */
  12415. NgbTypeaheadWindow.prototype.next = /**
  12416. * @return {?}
  12417. */
  12418. function () {
  12419. if (this.activeIdx === this.results.length - 1) {
  12420. this.activeIdx = this.focusFirst ? (this.activeIdx + 1) % this.results.length : -1;
  12421. }
  12422. else {
  12423. this.activeIdx++;
  12424. }
  12425. this._activeChanged();
  12426. };
  12427. /**
  12428. * @return {?}
  12429. */
  12430. NgbTypeaheadWindow.prototype.prev = /**
  12431. * @return {?}
  12432. */
  12433. function () {
  12434. if (this.activeIdx < 0) {
  12435. this.activeIdx = this.results.length - 1;
  12436. }
  12437. else if (this.activeIdx === 0) {
  12438. this.activeIdx = this.focusFirst ? this.results.length - 1 : -1;
  12439. }
  12440. else {
  12441. this.activeIdx--;
  12442. }
  12443. this._activeChanged();
  12444. };
  12445. /**
  12446. * @return {?}
  12447. */
  12448. NgbTypeaheadWindow.prototype.resetActive = /**
  12449. * @return {?}
  12450. */
  12451. function () {
  12452. this.activeIdx = this.focusFirst ? 0 : -1;
  12453. this._activeChanged();
  12454. };
  12455. /**
  12456. * @param {?} item
  12457. * @return {?}
  12458. */
  12459. NgbTypeaheadWindow.prototype.select = /**
  12460. * @param {?} item
  12461. * @return {?}
  12462. */
  12463. function (item) { this.selectEvent.emit(item); };
  12464. /**
  12465. * @return {?}
  12466. */
  12467. NgbTypeaheadWindow.prototype.ngOnInit = /**
  12468. * @return {?}
  12469. */
  12470. function () { this.resetActive(); };
  12471. /**
  12472. * @private
  12473. * @return {?}
  12474. */
  12475. NgbTypeaheadWindow.prototype._activeChanged = /**
  12476. * @private
  12477. * @return {?}
  12478. */
  12479. function () {
  12480. this.activeChangeEvent.emit(this.activeIdx >= 0 ? this.id + '-' + this.activeIdx : undefined);
  12481. };
  12482. NgbTypeaheadWindow.decorators = [
  12483. { type: Component, args: [{
  12484. selector: 'ngb-typeahead-window',
  12485. exportAs: 'ngbTypeaheadWindow',
  12486. encapsulation: ViewEncapsulation.None,
  12487. host: { '(mousedown)': '$event.preventDefault()', 'class': 'dropdown-menu show', 'role': 'listbox', '[id]': 'id' },
  12488. template: "\n <ng-template #rt let-result=\"result\" let-term=\"term\" let-formatter=\"formatter\">\n <ngb-highlight [result]=\"formatter(result)\" [term]=\"term\"></ngb-highlight>\n </ng-template>\n <ng-template ngFor [ngForOf]=\"results\" let-result let-idx=\"index\">\n <button type=\"button\" class=\"dropdown-item\" role=\"option\"\n [id]=\"id + '-' + idx\"\n [class.active]=\"idx === activeIdx\"\n (mouseenter)=\"markActive(idx)\"\n (click)=\"select(result)\">\n <ng-template [ngTemplateOutlet]=\"resultTemplate || rt\"\n [ngTemplateOutletContext]=\"{result: result, term: term, formatter: formatter}\"></ng-template>\n </button>\n </ng-template>\n "
  12489. }] }
  12490. ];
  12491. NgbTypeaheadWindow.propDecorators = {
  12492. id: [{ type: Input }],
  12493. focusFirst: [{ type: Input }],
  12494. results: [{ type: Input }],
  12495. term: [{ type: Input }],
  12496. formatter: [{ type: Input }],
  12497. resultTemplate: [{ type: Input }],
  12498. selectEvent: [{ type: Output, args: ['select',] }],
  12499. activeChangeEvent: [{ type: Output, args: ['activeChange',] }]
  12500. };
  12501. return NgbTypeaheadWindow;
  12502. }());
  12503. /**
  12504. * @fileoverview added by tsickle
  12505. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  12506. */
  12507. /** @type {?} */
  12508. var ARIA_LIVE_DELAY = new InjectionToken('live announcer delay', { providedIn: 'root', factory: ARIA_LIVE_DELAY_FACTORY });
  12509. /**
  12510. * @return {?}
  12511. */
  12512. function ARIA_LIVE_DELAY_FACTORY() {
  12513. return 100;
  12514. }
  12515. /**
  12516. * @param {?} document
  12517. * @param {?=} lazyCreate
  12518. * @return {?}
  12519. */
  12520. function getLiveElement(document, lazyCreate) {
  12521. if (lazyCreate === void 0) { lazyCreate = false; }
  12522. /** @type {?} */
  12523. var element = (/** @type {?} */ (document.body.querySelector('#ngb-live')));
  12524. if (element == null && lazyCreate) {
  12525. element = document.createElement('div');
  12526. element.setAttribute('id', 'ngb-live');
  12527. element.setAttribute('aria-live', 'polite');
  12528. element.setAttribute('aria-atomic', 'true');
  12529. element.classList.add('sr-only');
  12530. document.body.appendChild(element);
  12531. }
  12532. return element;
  12533. }
  12534. var Live = /** @class */ (function () {
  12535. function Live(_document, _delay) {
  12536. this._document = _document;
  12537. this._delay = _delay;
  12538. }
  12539. /**
  12540. * @return {?}
  12541. */
  12542. Live.prototype.ngOnDestroy = /**
  12543. * @return {?}
  12544. */
  12545. function () {
  12546. /** @type {?} */
  12547. var element = getLiveElement(this._document);
  12548. if (element) {
  12549. element.parentElement.removeChild(element);
  12550. }
  12551. };
  12552. /**
  12553. * @param {?} message
  12554. * @return {?}
  12555. */
  12556. Live.prototype.say = /**
  12557. * @param {?} message
  12558. * @return {?}
  12559. */
  12560. function (message) {
  12561. /** @type {?} */
  12562. var element = getLiveElement(this._document, true);
  12563. /** @type {?} */
  12564. var delay = this._delay;
  12565. element.textContent = '';
  12566. /** @type {?} */
  12567. var setText = (/**
  12568. * @return {?}
  12569. */
  12570. function () { return element.textContent = message; });
  12571. if (delay === null) {
  12572. setText();
  12573. }
  12574. else {
  12575. setTimeout(setText, delay);
  12576. }
  12577. };
  12578. Live.decorators = [
  12579. { type: Injectable, args: [{ providedIn: 'root' },] }
  12580. ];
  12581. /** @nocollapse */
  12582. Live.ctorParameters = function () { return [
  12583. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
  12584. { type: undefined, decorators: [{ type: Inject, args: [ARIA_LIVE_DELAY,] }] }
  12585. ]; };
  12586. /** @nocollapse */ Live.ngInjectableDef = ɵɵdefineInjectable({ factory: function Live_Factory() { return new Live(ɵɵinject(DOCUMENT), ɵɵinject(ARIA_LIVE_DELAY)); }, token: Live, providedIn: "root" });
  12587. return Live;
  12588. }());
  12589. /**
  12590. * @fileoverview added by tsickle
  12591. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  12592. */
  12593. /**
  12594. * A configuration service for the [`NgbTypeahead`](#/components/typeahead/api#NgbTypeahead) component.
  12595. *
  12596. * You can inject this service, typically in your root component, and customize the values of its properties in
  12597. * order to provide default values for all the typeaheads used in the application.
  12598. */
  12599. var NgbTypeaheadConfig = /** @class */ (function () {
  12600. function NgbTypeaheadConfig() {
  12601. this.editable = true;
  12602. this.focusFirst = true;
  12603. this.showHint = false;
  12604. this.placement = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
  12605. }
  12606. NgbTypeaheadConfig.decorators = [
  12607. { type: Injectable, args: [{ providedIn: 'root' },] }
  12608. ];
  12609. /** @nocollapse */ NgbTypeaheadConfig.ngInjectableDef = ɵɵdefineInjectable({ factory: function NgbTypeaheadConfig_Factory() { return new NgbTypeaheadConfig(); }, token: NgbTypeaheadConfig, providedIn: "root" });
  12610. return NgbTypeaheadConfig;
  12611. }());
  12612. /**
  12613. * @fileoverview added by tsickle
  12614. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  12615. */
  12616. /** @type {?} */
  12617. var NGB_TYPEAHEAD_VALUE_ACCESSOR = {
  12618. provide: NG_VALUE_ACCESSOR,
  12619. useExisting: forwardRef((/**
  12620. * @return {?}
  12621. */
  12622. function () { return NgbTypeahead; })),
  12623. multi: true
  12624. };
  12625. /** @type {?} */
  12626. var nextWindowId = 0;
  12627. /**
  12628. * A directive providing a simple way of creating powerful typeaheads from any text input.
  12629. */
  12630. var NgbTypeahead = /** @class */ (function () {
  12631. function NgbTypeahead(_elementRef, viewContainerRef, _renderer, injector, componentFactoryResolver, config, ngZone, _live, _document, _ngZone, _changeDetector, applicationRef) {
  12632. var _this = this;
  12633. this._elementRef = _elementRef;
  12634. this._renderer = _renderer;
  12635. this._live = _live;
  12636. this._document = _document;
  12637. this._ngZone = _ngZone;
  12638. this._changeDetector = _changeDetector;
  12639. this._closed$ = new Subject();
  12640. /**
  12641. * The value for the `autocomplete` attribute for the `<input>` element.
  12642. *
  12643. * Defaults to `"off"` to disable the native browser autocomplete, but you can override it if necessary.
  12644. *
  12645. * \@since 2.1.0
  12646. */
  12647. this.autocomplete = 'off';
  12648. /**
  12649. * The preferred placement of the typeahead.
  12650. *
  12651. * Possible values are `"top"`, `"top-left"`, `"top-right"`, `"bottom"`, `"bottom-left"`,
  12652. * `"bottom-right"`, `"left"`, `"left-top"`, `"left-bottom"`, `"right"`, `"right-top"`,
  12653. * `"right-bottom"`
  12654. *
  12655. * Accepts an array of strings or a string with space separated possible values.
  12656. *
  12657. * The default order of preference is `"bottom-left bottom-right top-left top-right"`
  12658. *
  12659. * Please see the [positioning overview](#/positioning) for more details.
  12660. */
  12661. this.placement = 'bottom-left';
  12662. /**
  12663. * An event emitted right before an item is selected from the result list.
  12664. *
  12665. * Event payload is of type [`NgbTypeaheadSelectItemEvent`](#/components/typeahead/api#NgbTypeaheadSelectItemEvent).
  12666. */
  12667. this.selectItem = new EventEmitter();
  12668. this.popupId = "ngb-typeahead-" + nextWindowId++;
  12669. this._onTouched = (/**
  12670. * @return {?}
  12671. */
  12672. function () { });
  12673. this._onChange = (/**
  12674. * @param {?} _
  12675. * @return {?}
  12676. */
  12677. function (_) { });
  12678. this.container = config.container;
  12679. this.editable = config.editable;
  12680. this.focusFirst = config.focusFirst;
  12681. this.showHint = config.showHint;
  12682. this.placement = config.placement;
  12683. this._valueChanges = fromEvent(_elementRef.nativeElement, 'input')
  12684. .pipe(map((/**
  12685. * @param {?} $event
  12686. * @return {?}
  12687. */
  12688. function ($event) { return ((/** @type {?} */ ($event.target))).value; })));
  12689. this._resubscribeTypeahead = new BehaviorSubject(null);
  12690. this._popupService = new PopupService(NgbTypeaheadWindow, injector, viewContainerRef, _renderer, componentFactoryResolver, applicationRef);
  12691. this._zoneSubscription = ngZone.onStable.subscribe((/**
  12692. * @return {?}
  12693. */
  12694. function () {
  12695. if (_this.isPopupOpen()) {
  12696. positionElements(_this._elementRef.nativeElement, _this._windowRef.location.nativeElement, _this.placement, _this.container === 'body');
  12697. }
  12698. }));
  12699. }
  12700. /**
  12701. * @return {?}
  12702. */
  12703. NgbTypeahead.prototype.ngOnInit = /**
  12704. * @return {?}
  12705. */
  12706. function () {
  12707. var _this = this;
  12708. /** @type {?} */
  12709. var inputValues$ = this._valueChanges.pipe(tap((/**
  12710. * @param {?} value
  12711. * @return {?}
  12712. */
  12713. function (value) {
  12714. _this._inputValueBackup = _this.showHint ? value : null;
  12715. _this._onChange(_this.editable ? value : undefined);
  12716. })));
  12717. /** @type {?} */
  12718. var results$ = inputValues$.pipe(this.ngbTypeahead);
  12719. /** @type {?} */
  12720. var userInput$ = this._resubscribeTypeahead.pipe(switchMap((/**
  12721. * @return {?}
  12722. */
  12723. function () { return results$; })));
  12724. this._subscription = this._subscribeToUserInput(userInput$);
  12725. };
  12726. /**
  12727. * @return {?}
  12728. */
  12729. NgbTypeahead.prototype.ngOnDestroy = /**
  12730. * @return {?}
  12731. */
  12732. function () {
  12733. this._closePopup();
  12734. this._unsubscribeFromUserInput();
  12735. this._zoneSubscription.unsubscribe();
  12736. };
  12737. /**
  12738. * @param {?} fn
  12739. * @return {?}
  12740. */
  12741. NgbTypeahead.prototype.registerOnChange = /**
  12742. * @param {?} fn
  12743. * @return {?}
  12744. */
  12745. function (fn) { this._onChange = fn; };
  12746. /**
  12747. * @param {?} fn
  12748. * @return {?}
  12749. */
  12750. NgbTypeahead.prototype.registerOnTouched = /**
  12751. * @param {?} fn
  12752. * @return {?}
  12753. */
  12754. function (fn) { this._onTouched = fn; };
  12755. /**
  12756. * @param {?} value
  12757. * @return {?}
  12758. */
  12759. NgbTypeahead.prototype.writeValue = /**
  12760. * @param {?} value
  12761. * @return {?}
  12762. */
  12763. function (value) {
  12764. this._writeInputValue(this._formatItemForInput(value));
  12765. if (this.showHint) {
  12766. this._inputValueBackup = value;
  12767. }
  12768. };
  12769. /**
  12770. * @param {?} isDisabled
  12771. * @return {?}
  12772. */
  12773. NgbTypeahead.prototype.setDisabledState = /**
  12774. * @param {?} isDisabled
  12775. * @return {?}
  12776. */
  12777. function (isDisabled) {
  12778. this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
  12779. };
  12780. /**
  12781. * Dismisses typeahead popup window
  12782. */
  12783. /**
  12784. * Dismisses typeahead popup window
  12785. * @return {?}
  12786. */
  12787. NgbTypeahead.prototype.dismissPopup = /**
  12788. * Dismisses typeahead popup window
  12789. * @return {?}
  12790. */
  12791. function () {
  12792. if (this.isPopupOpen()) {
  12793. this._resubscribeTypeahead.next(null);
  12794. this._closePopup();
  12795. if (this.showHint && this._inputValueBackup !== null) {
  12796. this._writeInputValue(this._inputValueBackup);
  12797. }
  12798. this._changeDetector.markForCheck();
  12799. }
  12800. };
  12801. /**
  12802. * Returns true if the typeahead popup window is displayed
  12803. */
  12804. /**
  12805. * Returns true if the typeahead popup window is displayed
  12806. * @return {?}
  12807. */
  12808. NgbTypeahead.prototype.isPopupOpen = /**
  12809. * Returns true if the typeahead popup window is displayed
  12810. * @return {?}
  12811. */
  12812. function () { return this._windowRef != null; };
  12813. /**
  12814. * @return {?}
  12815. */
  12816. NgbTypeahead.prototype.handleBlur = /**
  12817. * @return {?}
  12818. */
  12819. function () {
  12820. this._resubscribeTypeahead.next(null);
  12821. this._onTouched();
  12822. };
  12823. /**
  12824. * @param {?} event
  12825. * @return {?}
  12826. */
  12827. NgbTypeahead.prototype.handleKeyDown = /**
  12828. * @param {?} event
  12829. * @return {?}
  12830. */
  12831. function (event) {
  12832. if (!this.isPopupOpen()) {
  12833. return;
  12834. }
  12835. // tslint:disable-next-line:deprecation
  12836. switch (event.which) {
  12837. case Key.ArrowDown:
  12838. event.preventDefault();
  12839. this._windowRef.instance.next();
  12840. this._showHint();
  12841. break;
  12842. case Key.ArrowUp:
  12843. event.preventDefault();
  12844. this._windowRef.instance.prev();
  12845. this._showHint();
  12846. break;
  12847. case Key.Enter:
  12848. case Key.Tab:
  12849. /** @type {?} */
  12850. var result = this._windowRef.instance.getActive();
  12851. if (isDefined(result)) {
  12852. event.preventDefault();
  12853. event.stopPropagation();
  12854. this._selectResult(result);
  12855. }
  12856. this._closePopup();
  12857. break;
  12858. }
  12859. };
  12860. /**
  12861. * @private
  12862. * @return {?}
  12863. */
  12864. NgbTypeahead.prototype._openPopup = /**
  12865. * @private
  12866. * @return {?}
  12867. */
  12868. function () {
  12869. var _this = this;
  12870. if (!this.isPopupOpen()) {
  12871. this._inputValueBackup = this._elementRef.nativeElement.value;
  12872. this._windowRef = this._popupService.open();
  12873. this._windowRef.instance.id = this.popupId;
  12874. this._windowRef.instance.selectEvent.subscribe((/**
  12875. * @param {?} result
  12876. * @return {?}
  12877. */
  12878. function (result) { return _this._selectResultClosePopup(result); }));
  12879. this._windowRef.instance.activeChangeEvent.subscribe((/**
  12880. * @param {?} activeId
  12881. * @return {?}
  12882. */
  12883. function (activeId) { return _this.activeDescendant = activeId; }));
  12884. if (this.container === 'body') {
  12885. window.document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);
  12886. }
  12887. this._changeDetector.markForCheck();
  12888. ngbAutoClose(this._ngZone, this._document, 'outside', (/**
  12889. * @return {?}
  12890. */
  12891. function () { return _this.dismissPopup(); }), this._closed$, [this._elementRef.nativeElement, this._windowRef.location.nativeElement]);
  12892. }
  12893. };
  12894. /**
  12895. * @private
  12896. * @return {?}
  12897. */
  12898. NgbTypeahead.prototype._closePopup = /**
  12899. * @private
  12900. * @return {?}
  12901. */
  12902. function () {
  12903. this._closed$.next();
  12904. this._popupService.close();
  12905. this._windowRef = null;
  12906. this.activeDescendant = undefined;
  12907. };
  12908. /**
  12909. * @private
  12910. * @param {?} result
  12911. * @return {?}
  12912. */
  12913. NgbTypeahead.prototype._selectResult = /**
  12914. * @private
  12915. * @param {?} result
  12916. * @return {?}
  12917. */
  12918. function (result) {
  12919. /** @type {?} */
  12920. var defaultPrevented = false;
  12921. this.selectItem.emit({ item: result, preventDefault: (/**
  12922. * @return {?}
  12923. */
  12924. function () { defaultPrevented = true; }) });
  12925. this._resubscribeTypeahead.next(null);
  12926. if (!defaultPrevented) {
  12927. this.writeValue(result);
  12928. this._onChange(result);
  12929. }
  12930. };
  12931. /**
  12932. * @private
  12933. * @param {?} result
  12934. * @return {?}
  12935. */
  12936. NgbTypeahead.prototype._selectResultClosePopup = /**
  12937. * @private
  12938. * @param {?} result
  12939. * @return {?}
  12940. */
  12941. function (result) {
  12942. this._selectResult(result);
  12943. this._closePopup();
  12944. };
  12945. /**
  12946. * @private
  12947. * @return {?}
  12948. */
  12949. NgbTypeahead.prototype._showHint = /**
  12950. * @private
  12951. * @return {?}
  12952. */
  12953. function () {
  12954. if (this.showHint && this._windowRef.instance.hasActive() && this._inputValueBackup != null) {
  12955. /** @type {?} */
  12956. var userInputLowerCase = this._inputValueBackup.toLowerCase();
  12957. /** @type {?} */
  12958. var formattedVal = this._formatItemForInput(this._windowRef.instance.getActive());
  12959. if (userInputLowerCase === formattedVal.substr(0, this._inputValueBackup.length).toLowerCase()) {
  12960. this._writeInputValue(this._inputValueBackup + formattedVal.substr(this._inputValueBackup.length));
  12961. this._elementRef.nativeElement['setSelectionRange'].apply(this._elementRef.nativeElement, [this._inputValueBackup.length, formattedVal.length]);
  12962. }
  12963. else {
  12964. this._writeInputValue(formattedVal);
  12965. }
  12966. }
  12967. };
  12968. /**
  12969. * @private
  12970. * @param {?} item
  12971. * @return {?}
  12972. */
  12973. NgbTypeahead.prototype._formatItemForInput = /**
  12974. * @private
  12975. * @param {?} item
  12976. * @return {?}
  12977. */
  12978. function (item) {
  12979. return item != null && this.inputFormatter ? this.inputFormatter(item) : toString(item);
  12980. };
  12981. /**
  12982. * @private
  12983. * @param {?} value
  12984. * @return {?}
  12985. */
  12986. NgbTypeahead.prototype._writeInputValue = /**
  12987. * @private
  12988. * @param {?} value
  12989. * @return {?}
  12990. */
  12991. function (value) {
  12992. this._renderer.setProperty(this._elementRef.nativeElement, 'value', toString(value));
  12993. };
  12994. /**
  12995. * @private
  12996. * @param {?} userInput$
  12997. * @return {?}
  12998. */
  12999. NgbTypeahead.prototype._subscribeToUserInput = /**
  13000. * @private
  13001. * @param {?} userInput$
  13002. * @return {?}
  13003. */
  13004. function (userInput$) {
  13005. var _this = this;
  13006. return userInput$.subscribe((/**
  13007. * @param {?} results
  13008. * @return {?}
  13009. */
  13010. function (results) {
  13011. if (!results || results.length === 0) {
  13012. _this._closePopup();
  13013. }
  13014. else {
  13015. _this._openPopup();
  13016. _this._windowRef.instance.focusFirst = _this.focusFirst;
  13017. _this._windowRef.instance.results = results;
  13018. _this._windowRef.instance.term = _this._elementRef.nativeElement.value;
  13019. if (_this.resultFormatter) {
  13020. _this._windowRef.instance.formatter = _this.resultFormatter;
  13021. }
  13022. if (_this.resultTemplate) {
  13023. _this._windowRef.instance.resultTemplate = _this.resultTemplate;
  13024. }
  13025. _this._windowRef.instance.resetActive();
  13026. // The observable stream we are subscribing to might have async steps
  13027. // and if a component containing typeahead is using the OnPush strategy
  13028. // the change detection turn wouldn't be invoked automatically.
  13029. _this._windowRef.changeDetectorRef.detectChanges();
  13030. _this._showHint();
  13031. }
  13032. // live announcer
  13033. /** @type {?} */
  13034. var count = results ? results.length : 0;
  13035. _this._live.say(count === 0 ? 'No results available' : count + " result" + (count === 1 ? '' : 's') + " available");
  13036. }));
  13037. };
  13038. /**
  13039. * @private
  13040. * @return {?}
  13041. */
  13042. NgbTypeahead.prototype._unsubscribeFromUserInput = /**
  13043. * @private
  13044. * @return {?}
  13045. */
  13046. function () {
  13047. if (this._subscription) {
  13048. this._subscription.unsubscribe();
  13049. }
  13050. this._subscription = null;
  13051. };
  13052. NgbTypeahead.decorators = [
  13053. { type: Directive, args: [{
  13054. selector: 'input[ngbTypeahead]',
  13055. exportAs: 'ngbTypeahead',
  13056. host: {
  13057. '(blur)': 'handleBlur()',
  13058. '[class.open]': 'isPopupOpen()',
  13059. '(keydown)': 'handleKeyDown($event)',
  13060. '[autocomplete]': 'autocomplete',
  13061. 'autocapitalize': 'off',
  13062. 'autocorrect': 'off',
  13063. 'role': 'combobox',
  13064. 'aria-multiline': 'false',
  13065. '[attr.aria-autocomplete]': 'showHint ? "both" : "list"',
  13066. '[attr.aria-activedescendant]': 'activeDescendant',
  13067. '[attr.aria-owns]': 'isPopupOpen() ? popupId : null',
  13068. '[attr.aria-expanded]': 'isPopupOpen()'
  13069. },
  13070. providers: [NGB_TYPEAHEAD_VALUE_ACCESSOR]
  13071. },] }
  13072. ];
  13073. /** @nocollapse */
  13074. NgbTypeahead.ctorParameters = function () { return [
  13075. { type: ElementRef },
  13076. { type: ViewContainerRef },
  13077. { type: Renderer2 },
  13078. { type: Injector },
  13079. { type: ComponentFactoryResolver },
  13080. { type: NgbTypeaheadConfig },
  13081. { type: NgZone },
  13082. { type: Live },
  13083. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
  13084. { type: NgZone },
  13085. { type: ChangeDetectorRef },
  13086. { type: ApplicationRef }
  13087. ]; };
  13088. NgbTypeahead.propDecorators = {
  13089. autocomplete: [{ type: Input }],
  13090. container: [{ type: Input }],
  13091. editable: [{ type: Input }],
  13092. focusFirst: [{ type: Input }],
  13093. inputFormatter: [{ type: Input }],
  13094. ngbTypeahead: [{ type: Input }],
  13095. resultFormatter: [{ type: Input }],
  13096. resultTemplate: [{ type: Input }],
  13097. showHint: [{ type: Input }],
  13098. placement: [{ type: Input }],
  13099. selectItem: [{ type: Output }]
  13100. };
  13101. return NgbTypeahead;
  13102. }());
  13103. /**
  13104. * @fileoverview added by tsickle
  13105. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  13106. */
  13107. var NgbTypeaheadModule = /** @class */ (function () {
  13108. function NgbTypeaheadModule() {
  13109. }
  13110. NgbTypeaheadModule.decorators = [
  13111. { type: NgModule, args: [{
  13112. declarations: [NgbTypeahead, NgbHighlight, NgbTypeaheadWindow],
  13113. exports: [NgbTypeahead, NgbHighlight],
  13114. imports: [CommonModule],
  13115. entryComponents: [NgbTypeaheadWindow]
  13116. },] }
  13117. ];
  13118. return NgbTypeaheadModule;
  13119. }());
  13120. /**
  13121. * @fileoverview added by tsickle
  13122. * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  13123. */
  13124. /** @type {?} */
  13125. var NGB_MODULES = [
  13126. NgbAccordionModule, NgbAlertModule, NgbButtonsModule, NgbCarouselModule, NgbCollapseModule, NgbDatepickerModule,
  13127. NgbDropdownModule, NgbModalModule, NgbNavModule, NgbPaginationModule, NgbPopoverModule, NgbProgressbarModule,
  13128. NgbRatingModule, NgbTabsetModule, NgbTimepickerModule, NgbToastModule, NgbTooltipModule, NgbTypeaheadModule
  13129. ];
  13130. var NgbModule = /** @class */ (function () {
  13131. function NgbModule() {
  13132. }
  13133. NgbModule.decorators = [
  13134. { type: NgModule, args: [{ imports: NGB_MODULES, exports: NGB_MODULES },] }
  13135. ];
  13136. return NgbModule;
  13137. }());
  13138. export { ModalDismissReasons, NgbAccordion, NgbAccordionConfig, NgbAccordionModule, NgbActiveModal, NgbAlert, NgbAlertConfig, NgbAlertModule, NgbButtonLabel, NgbButtonsModule, NgbCalendar, NgbCalendarGregorian, NgbCalendarHebrew, NgbCalendarIslamicCivil, NgbCalendarIslamicUmalqura, NgbCalendarPersian, NgbCarousel, NgbCarouselConfig, NgbCarouselModule, NgbCheckBox, NgbCollapse, NgbCollapseModule, NgbDate, NgbDateAdapter, NgbDateNativeAdapter, NgbDateNativeUTCAdapter, NgbDateParserFormatter, NgbDatepicker, NgbDatepickerConfig, NgbDatepickerI18n, NgbDatepickerI18nHebrew, NgbDatepickerKeyboardService, NgbDatepickerModule, NgbDropdown, NgbDropdownAnchor, NgbDropdownConfig, NgbDropdownItem, NgbDropdownMenu, NgbDropdownModule, NgbDropdownToggle, NgbHighlight, NgbInputDatepicker, NgbInputDatepickerConfig, NgbModal, NgbModalConfig, NgbModalModule, NgbModalRef, NgbModule, NgbNav, NgbNavConfig, NgbNavContent, NgbNavItem, NgbNavLink, NgbNavModule, NgbNavOutlet, NgbNavbar, NgbPagination, NgbPaginationConfig, NgbPaginationEllipsis, NgbPaginationFirst, NgbPaginationLast, NgbPaginationModule, NgbPaginationNext, NgbPaginationNumber, NgbPaginationPrevious, NgbPanel, NgbPanelContent, NgbPanelHeader, NgbPanelTitle, NgbPanelToggle, NgbPopover, NgbPopoverConfig, NgbPopoverModule, NgbProgressbar, NgbProgressbarConfig, NgbProgressbarModule, NgbRadio, NgbRadioGroup, NgbRating, NgbRatingConfig, NgbRatingModule, NgbSlide, NgbSlideEventDirection, NgbSlideEventSource, NgbTab, NgbTabContent, NgbTabTitle, NgbTabset, NgbTabsetConfig, NgbTabsetModule, NgbTimeAdapter, NgbTimepicker, NgbTimepickerConfig, NgbTimepickerI18n, NgbTimepickerModule, NgbToast, NgbToastConfig, NgbToastHeader, NgbToastModule, NgbTooltip, NgbTooltipConfig, NgbTooltipModule, NgbTypeahead, NgbTypeaheadConfig, NgbTypeaheadModule, NGB_CAROUSEL_DIRECTIVES as ɵa, NGB_DATEPICKER_CALENDAR_FACTORY as ɵb, Live as ɵba, NgbCalendarHijri as ɵbb, ContentRef as ɵbc, NgbDatepickerMonthView as ɵc, NgbDatepickerDayView as ɵd, NgbDatepickerNavigation as ɵe, NgbDatepickerNavigationSelect as ɵf, NGB_DATEPICKER_18N_FACTORY as ɵg, NgbDatepickerI18nDefault as ɵh, NGB_DATEPICKER_DATE_ADAPTER_FACTORY as ɵi, NgbDateStructAdapter as ɵj, NGB_DATEPICKER_PARSER_FORMATTER_FACTORY as ɵk, NgbDateISOParserFormatter as ɵl, NgbPopoverWindow as ɵm, NGB_DATEPICKER_TIME_ADAPTER_FACTORY as ɵn, NgbTimeStructAdapter as ɵo, NGB_TIMEPICKER_I18N_FACTORY as ɵp, NgbTimepickerI18nDefault as ɵq, NgbTooltipWindow as ɵr, NgbTypeaheadWindow as ɵs, NgbDatepickerService as ɵt, NgbModalBackdrop as ɵu, NgbModalWindow as ɵv, NgbModalStack as ɵw, ScrollBar as ɵx, ARIA_LIVE_DELAY as ɵy, ARIA_LIVE_DELAY_FACTORY as ɵz };
  13139. //# sourceMappingURL=ng-bootstrap.js.map