diff --git a/README.md b/README.md index 6c46831..4129fd2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Web Programming +# webdbprogramming -Welcome to Web Programming course. In this page, you will find all the material related to the lecture. +web db programming 기말과제 (컴퓨터공학과 202135933 김수정) -웹개발 과목을 등록하는 학생 여러분께 짐심으로 환영합니다. -해당 페이지에서는 강의 관련 내용이 나와있습니다. -## We will discuss about particularly about the backend programming that will cover Javascript, NodeJS, ExpressJS and MySQL database in particular. \ No newline at end of file +code/main.js를 실행 후 로컬 서버로 접속하면 웹 페이지에 접근할 수 있습니다.(http://localhost:65000) + +db: db/hoteldb.sql을 다운받아 사용할 수 있습니다. diff --git a/code/locales/en.json b/code/locales/en.json new file mode 100644 index 0000000..ba1ba69 --- /dev/null +++ b/code/locales/en.json @@ -0,0 +1,16 @@ +{ + "about": "about us", + "room": "room", + "contacts": "contacts", + "reservation": "reservation", + "login": "login", + "signup": "sign up", + "mypage": "mypage", + "id": "id", + "password": "password", + "password2": "confirm password", + "name": "name", + "phone": "phone", + "book": "book a room", + "logout": "logout" +} \ No newline at end of file diff --git a/code/locales/ko.json b/code/locales/ko.json new file mode 100644 index 0000000..9d321c2 --- /dev/null +++ b/code/locales/ko.json @@ -0,0 +1,17 @@ +{ + "about": "호텔 소개", + "room": "객실", + "contacts": "문의", + "reservation": "예약", + "login": "로그인", + "signup": "회원가입", + "mypage": "마이페이지", + "id": "아이디", + "password": "비밀번호", + "password2": "비밀번호 확인", + "name": "이름", + "phone": "전화번호", + "book": "예약하기", + "contact": "contact", + "logout": "logout" +} \ No newline at end of file diff --git a/code/main.js b/code/main.js new file mode 100644 index 0000000..9dc7421 --- /dev/null +++ b/code/main.js @@ -0,0 +1,532 @@ +const express = require('express') +const mysql = require('mysql') +const app = express(); +const ejs = require("ejs"); +var session = require('express-session'); +const flash = require('connect-flash'); +const cookieParser = require('cookie-parser'); +const i18n = require('i18n'); +const PORT = 65000; + +app.use(express.json()) +app.use(express.urlencoded({extended: true})) + +i18n.configure({ + locales:['en', 'ko'], + directory: __dirname+"/locales", + defaultLocale: 'ko', + cookie: 'lang', + objectNotation: true, +}) + +app.use(cookieParser()) +app.use(i18n.init) + +app.use(session({ + resave: false, //don't save session if unmodified + saveUninitialized: false, //don't create session until sth stored + secret: 'keyboard cat' + })) + +app.use((req, res, next) => { + res.locals.id = req.session.userid || null; + if(req.session.userid){ + res.locals.role = req.session.role; + }else{ + res.locals.role = 3; + } + next() +}) + +app.use("/css", express.static(__dirname+"/views/css")) +app.use("/js", express.static(__dirname+"/views/js")) +app.use("/fonts", express.static(__dirname+"/views/fonts")) +app.use("/images", express.static(__dirname+"/views/images")) + +app.set("view engine", "ejs") +app.set("views", "./views") + +app.use(flash()) + + +// mysql database 연결 +const pool = mysql.createPool({ + host: 'localhost', + user: 'root', + password: '', + database: 'hoteldb' +}) + +// localhost:PORT로 접속 +app.listen(PORT, ()=>{ + console.log("연결 완료! link -> http://localhost:" + PORT); +}); + + + +const loginRequire = (req, res, next) => { + if(req.session.userid){ + next() + } else { + res.redirect("/login"); + } +} + +const logoutRequire = (req, res, next) => { + if(req.session.userid){ + res.redirect("/"); + } else { + next() + } +} + +const adminRequire = (req, res, next) => { + if(req.session.role === 1){ + next() + } else { + res.redirect("/"); + } +} + +/** + * Language Routes + */ +app.get('/lang/:locale', (req, res) => { + const locale = req.params.locale; + console.log('local ='+locale) + res.cookie('lang', locale); + res.redirect('back'); // Redirect back to the previous page or use a specific URL + }); + +/* home */ +app.get("/", (req, res)=>{ + res.render('index', { + pageTitle: 'Home', + }); +}); + +/* sign up */ +app.get("/sign-up", logoutRequire, (req, res)=>{ + res.render('sign-up', { + pageTitle: res.__('signup'), + }); +}); + +// id 중복 확인 +app.get("/checkid/:id", (req, res) => { + const id = req.params.id + pool.getConnection((err, conn) => { + if (err) { + console.error(err); + return; + } + // userid와 동일한 id가 users 안에 존재하는지 검색 + conn.query('SELECT userid FROM users WHERE userid = ?', [id], function (err, results, fields) { + conn.release(); + if (err) { + console.error(err); + return; + }else{ + // 중복되는 경우 + if (results.length === 1) { + res.render('notice', { + pageTitle: 'WARNING!', + detail: '이미 존재하는 ID입니다.', + }); + // 사용 가능한 경우 + } else { + res.render('notice', { + pageTitle: 'OK!', + detail: '사용 가능한 ID입니다.', + }); + } + } + }); + }); +}); + +// 비밀번호와 비밀번호 확인이 일치하는지를 출력 +app.get("/checkpw/:flag", (req, res) => { + const flag = req.params.flag + //비밀번호가 일치하는 경우 + if(flag === '1'){ + res.render('notice', { + pageTitle: 'OK!', + detail: '비밀번호가 일치합니다.', + }); + } + //비밀번호가 일치하지 않는 경우 + else{ + res.render('notice', { + pageTitle: 'WARNING!', + detail: '비밀번호가 일치하지 않습니다.', + }); + } +}); + +// 회원가입(insert) +app.post("/process/sign-up", logoutRequire, (req, res)=>{ + pool.getConnection((err, conn) => { + if(err) throw err + const params = req.body + const userid = params.userid + const userpw = params.userpw + const userpw2 = params.userpw2 + const username = params.username + const useremail = params.useremail + const userphone = params.userphone + + //비밀번호 미일치 시 + if(userpw !== userpw2){ + console.log(`비밀번호가 일치하지 않습니다.`); + res.render('notice', { + pageTitle: 'WARNING!', + detail: '비밀번호가 일치하지 않습니다.', + }); + } else { + // 동일한 id가 이미 존재하는지 검색 + conn.query('select userid from users where userid = ?', [userid], function(err, results, fields){ + if(err){throw err} + + if(results.length === 1){ + console.log(`이미 존재하는 ID입니다.`); + res.render('notice', { + pageTitle: 'WARNING!', + detail: '이미 존재하는 ID입니다.', + }); + // 사용 가능한 ID일 경우 users에 insert + }else{ + conn.query('INSERT INTO users (userid, userpw, username, useremail, userphone) VALUES (?, ?, ?, ?, ?)', [userid, userpw, username, useremail, userphone], (err, rows) => { + if(err) { + res.status(500).send('Error retreiving the data') + } + else { + res.render('notice', { + pageTitle: 'OK!', + detail: '회원가입이 완료되었습니다.', + }); + } + }) + } + }) + } + conn.release() + }) +}); + + +/* login */ +app.get("/login", logoutRequire, (req, res)=>{ + res.render('login', { + pageTitle: res.__('login'), + }); +}); + +// login 과정 +app.get("/process/log-in", (req, res)=>{ + pool.getConnection((err, conn) => { + if(err) throw err + const params = req.query + const userid = params.userid + const userpw = params.userpw + // 입력한 id와 비밀번호가 일치하는지 확인 + exec = conn.query('select userpw, roleid from users where userid = ?', [userid], function(err, results, fields){ + conn.release() + console.log('SQL', exec.sql) + if(err){ + console.log(err) + res.status(500).send('Error retreiving the data') + }else{ + if(results.length === 1){ + if(results[0].userpw === userpw){ + req.session.userid = userid; + req.session.role = results[0].roleid; + res.redirect('back'); + }else{ + res.render('notice', { + pageTitle: 'WARNING!', + detail: '비밀번호가 일치하지 않습니다.', + }); + } + // 존재하지 않는 id로 form을 제출한 경우 + }else{ + res.render('notice', { + pageTitle: 'WARNING!', + detail: '존재하지 않는 ID입니다.', + }); + } + } + }) + }) +}); + +/* logout */ +app.get("/logout", (req, res)=>{ + req.session.destroy(()=>{ + res.redirect('/'); + }); +}) + +/* about */ +app.get("/about-us", (req, res)=>{ + res.render('about-us', { + pageTitle: res.__('about'), + }); +}); + +/* room */ +app.get("/room", (req, res)=>{ + pool.getConnection((err, conn) =>{ + if(err) throw err + + // rooms table에서 정보를 받아 출력함 + const exec = conn.query('Select * from rooms', (err, rows) => { + conn.release() + console.log('SQL', exec.sql) + if(err) { + res.status(500).send('Error retreiving the data') + } + else { + res.render('room', {pageTitle: res.__('room'), data: rows}) + } + }) + }) +}); + +app.post("/process/room/:roomid", adminRequire, (req, res)=>{ + const roomid = req.params.roomid; + const num = req.body.roomcnt; + + pool.getConnection((err, conn) => { + if(err) throw err + conn.query('update rooms set roomnum = ? where roomid = ?', [num, roomid], (err, rows)=>{ + if(err) throw err; + else{ + res.redirect('/room') + } + conn.release() + }) + }) +}) + + +/* mypage */ +app.get("/mypage", loginRequire, (req, res)=>{ + const userid = req.session.userid + pool.getConnection((err, conn) =>{ + if(err) throw err + // userid에 해당하는 user의 예약 기록 출력을 위해 reservation table 검색 + if(req.session.role === 1){ + res.render('mypage', { + pageTitle: res.__('mypage'), + data: null + }); + } else { + const exec = conn.query('select * FROM reservation where userid = ?', [userid], (err, rows) => { + console.log(rows) + console.log('SQL', exec.sql) + if(err) { + res.status(500).send('Error retreiving the data') + } + else { + res.render('mypage', { + pageTitle: res.__('mypage'), + data: rows + }); + } + }) + } + conn.release() + }) +}) + +// 비밀번호 변경(update)을 위한 새 비밀번호 입력 페이지 +app.get("/update/pw", loginRequire, (req, res)=>{ + res.render('updatepw', { + pageTitle: res.__('mypage'), + }); +}) + +// 비밀번호 변경(update) +app.post("/process/update/pw", loginRequire, (req, res)=>{ + const userid = req.session.userid + const params = req.body + const nowpw = params.nowpw + const newpw = params.newpw + const newpw2 = params.newpw2 + + //(새) 비밀번호 확인이 일치하지 않을 경우 + if(newpw !== newpw2){ + res.render('notice', { + pageTitle: 'WARNING!', + detail: '비밀번호 변경에 실패했습니다.', + id: userid + }); + }else{ + pool.getConnection((err, conn) => { + if(err) throw err + + // 현재 비밀번호 검색 + conn.query('select userpw from users where userid = ?', [userid], (err, rows)=>{ + if(err){ + console.log(err); + res.status(500).send('Error retreiving the data') + } else{ + //현재 비밀번호를 정확하게 입력한 경우 password 변경(update) + if(rows[0].userpw === nowpw){ + conn.query('update users set userpw = ? where userid = ?', [newpw, userid], (err, rows)=>{ + if(err) throw err; + else{ + res.render('notice', { + pageTitle: 'OK!', + detail: '비밀번호 변경에 성공했습니다.', + }); + } + }) + // 현재 비밀번호를 틀리게 입력한 경우 + }else{ + res.render('notice', { + pageTitle: 'WARNING!', + detail: '비밀번호 변경에 실패했습니다.', + }); + } + } + }) + conn.release() + }) + } + +}) + +// 예약, 예약 확인 및 취소 +app.get("/reservation", loginRequire, (req, res)=>{ + res.render('reservation', { + pageTitle: res.__('reservation') + }); +}) + +app.get("/book/list", loginRequire, (req, res)=>{ + const userid = req.session.userid + const params = req.query + const checkin = params.checkin + const checkout = params.checkout + const num = params.num + console.log(checkin) + + if(checkin > checkout){ + res.render('notice', { + pageTitle: 'WARNING!', + detail: `접근 불가능한 날짜입니다. checkin: ${checkin}, checkout: ${checkout}`, + }); + }else{ + pool.getConnection((err, conn) =>{ + if(err) throw err + if(req.session.role === 1){ + const exec = conn.query('select * FROM reservation where (checkindate between ? and ?) or (checkoutdate between ? and ?)', [checkin, checkout, checkin,checkout], (err, rows) => { + + console.log('SQL', exec.sql) + if(err) { + res.status(500).send('Error retreiving the data') + } + else { + res.render('booklist', { + pageTitle: res.__('reservation'), + checkin: checkin, + checkout:checkout, + data: rows + }); + } + }) + } else { + const exec = conn.query('select C.roomid, C.roomname, C.roomdesc, roomnum - cnt as availcnt from rooms as C inner join (select A.roomid, ifnull(B.cnt, 0) as cnt from rooms as A left outer join (select roomid, count(*) as cnt from reservation where ((checkindate between ? and ?) or (checkoutdate between ? and ?)) group by roomid) as B on A.roomid = B.roomid)as D on C.roomid = D.roomid where roomnum > cnt and numofperson >= ?' + , [checkin, checkout, checkin, checkout, num], (err, rows) => { + console.log(rows) + console.log('SQL', exec.sql) + if(err) { + res.status(500).send('Error retreiving the data') + } + else { + res.render('booklist', { + pageTitle: res.__('reservation'), + checkin: checkin, + checkout:checkout, + data: rows + }); + } + }) + } + conn.release() + }) +} +}) + +/* book a room */ +app.post("/book", loginRequire, (req, res)=>{ + const userid = req.session.userid + const params = req.body + const checkin = params.checkin + const checkout = params.checkout + const roomid = params.roomid + console.log(params) + + //올바른 날짜를 입력하였는지 확인(checkout 날짜가 checkin 날짜보다 빠를 수 없음) + if(checkin > checkout){ + res.render('notice', { + pageTitle: 'WARNING!', + detail: `접근 불가능한 날짜입니다. checkin: ${checkin}, checkout: ${checkout}`, + }); + }else{ + + pool.getConnection((err, conn) => { + if (err) { + console.error(err); + return; + } + conn.query('INSERT INTO reservation (userid, roomid, checkindate, checkoutdate) VALUES (?, ?, ?, ?)', [userid, roomid, checkin, checkout], (err, rows) => { + if(err) { + console.log(err); + res.status(500).send('Error retreiving the data') + } + else { + res.redirect("/mypage") + } + }) + conn.release(); + }); + + } +}); + +// 예약 취소(delete) +app.get("/delete/reservation/:rid", loginRequire, (req, res)=>{ + const reservationid = req.params.rid; + const userid = req.session.userid + pool.getConnection((err, conn) => { + if (err) { + console.error(err); + res.status(500).send('Error retreiving the data') + } + + conn.query('select * from reservation where userid = ? and reservationid = ?', [userid, reservationid], function(err, results, fields){ + if(err){throw err} + + if(results.length === 1 || req.session.role === 1){ + // 예약 취소(delete) + conn.query('delete from reservation where reservationid = ?', [reservationid], function (err, results, fields) { + if (err) { + console.error(err); + res.status(500).send('Error retreiving the data') + }else{ + res.redirect("back") + } + }); + }else{ + res.render('notice', { + pageTitle: 'WARNING!', + detail: '유효하지 않은 접근입니다.', + }); + } + }); + conn.release(); + }); +}) diff --git a/code/views/about-us.ejs b/code/views/about-us.ejs new file mode 100644 index 0000000..d6d309c --- /dev/null +++ b/code/views/about-us.ejs @@ -0,0 +1,142 @@ +<%- include('head') %> +<%- include('head2') %> + +
+
+
+
+
+
+
+
+
+
+

A Few Words About Us

+

Tired of your daily routine? Seeking for a place to stay and rest with your family? You are in the right place! Our spa resort and hotel provides luxury and historic accommodations for travelers. It combines modern style and amenities with traditional values.

+

All rooms are equipped with air conditioners and LCD TVs. Free WI-FI service is available throughout the territory of the hotel. Our restaurant food and meals from world cuisines unite people connecting history and traditions. Experience our warm hospitality, high quality of service and exceptional comfort! Make a reservation for your dream vacation today!

+
+
+
+
+
+
+

What People Say

+
+
+
+ +
+
+
+
+
+
+
+

Our Team

+
+ +
+
+
+
+
    +
  • +
  • +
  • +
+
+
+
Theresa SmithGeneral Manager
+
+
+ +
+
+
+
+
    +
  • +
  • +
  • +
+
+
+
Albert MillsCosmetologist
+
+
+ +
+
+
+
+
    +
  • +
  • +
  • +
+
+
+
Sandra AdamsReceptionist
+
+
+
+
+
+<%- include('foot') %> \ No newline at end of file diff --git a/code/views/booklist.ejs b/code/views/booklist.ejs new file mode 100644 index 0000000..d24f7d5 --- /dev/null +++ b/code/views/booklist.ejs @@ -0,0 +1,73 @@ +<%- include('head') %> +<%- include('head2') %> +
+
+

checkin: <%= checkin %>

+

checkout: <%= checkout %>

+ +
+
+
+ <% if(data.length === 0) { %> +

+

예약 가능한 객실이 없습니다.

+

해당 날짜의 모든 객실이 예약된 상태입니다.

+ <% }else{ %> +

+ + + <% if(role === 1) { %> + + + + + + + <% } else { %> + + + + + <% } %> + + + + <% data.forEach((row, index)=>{ %> + <% if(role === 1) { %> + + + + + + + + + <% } else { %> + + + + + + + + + + <% } %> + + <% }) %> + +
Nouserroomcheck-incheck-out예약취소room소개남은 방 개수예약하기
<%= index+1 %> <%= row.userid %> <% x = row.roomid %> + <% if(x === 1) { %> Single + <% } if(x === 2) { %> Twin + <% } if(x === 3) { %> Double + <% } if(x === 4) { %> Family + <% } %> + <%= row.checkindate.toLocaleDateString() %> <%= row.checkoutdate.toLocaleDateString() %> + 취소 +
<%= row.roomname %> <%= row.roomdesc %> <%= row.availcnt %> + +
+ <% } %> +
+
+<%- include('foot') %> \ No newline at end of file diff --git a/code/views/css/bootstrap.css b/code/views/css/bootstrap.css new file mode 100644 index 0000000..fce1557 --- /dev/null +++ b/code/views/css/bootstrap.css @@ -0,0 +1,45 @@ +@charset "UTF-8"; /** +* Template Style +* +* [Table of contents] +* 1 Bootstrap Framework +* 1.1 Normalize +* 1.2 Scaffolding +* 1.3 Type +* 1.4 Code +* 1.5 Tables +* 1.6 Forms +* 1.7 Buttons +* 1.8 Grids +* 1.9 Component animations +* 1.10 Dropdowns +* 1.11 Button Groups +* 1.12 Input Groups +* 1.13 Navs +* 1.14 Navbar +* 1.15 Breadcrumbs +* 1.16 Pagination +* 1.17 Pager +* 1.18 Labels +* 1.19 Badges +* 1.20 Jumbotron +* 1.21 Thumbnails +* 1.22 Alerts +* 1.23 Progress bars +* 1.24 Media +* 1.25 List Group +* 1.26 Panels +* 1.27 Responsive Embed +* 1.28 Wells +* 1.29 Close +* 1.30 Glyphicons +* 1.31 Modals +* 1.32 Tooltip +* 1.33 Popovers +* 1.34 Carousel +* 1.35 Utilities +* 1.36 Context styling +* 1.37 Responsive Utilities +*/ /* + * Bootstrap Framework + */ /*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } body { margin: 0; } article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } audio, canvas, progress, video { display: inline-block; vertical-align: baseline; } audio:not([controls]) { display: none; height: 0; } [hidden], template { display: none; } a { background-color: transparent; } a:active, a:hover { outline: 0; } abbr[title] { border-bottom: 1px dotted; } b, strong { font-weight: bold; } dfn { font-style: italic; } h1 { font-size: 2em; margin: 0.67em 0; } mark { background: #ff0; color: #000; } small { font-size: 80%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { border: 0; } svg:not(:root) { overflow: hidden; } figure { margin: 1em 40px; } hr { box-sizing: content-box; height: 0; } pre { overflow: auto; } code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } button, input, optgroup, select, textarea { color: inherit; font: inherit; margin: 0; } button { overflow: visible; } button, select { text-transform: none; } button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } button[disabled], html input[disabled] { cursor: default; } button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } input { line-height: normal; } input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; } input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } input[type="search"] { -webkit-appearance: textfield; box-sizing: content-box; } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } legend { border: 0; padding: 0; } textarea { overflow: auto; } optgroup { font-weight: bold; } table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0; } /*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ @media print { *, *:before, *:after { background: transparent !important; color: #000 !important; box-shadow: none !important; text-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } a[href^="#"]:after, a[href^="javascript:"]:after { content: ""; } pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } thead { display: table-header-group; } tr, img { page-break-inside: avoid; } img { max-width: 100% !important; } p, h2, h3 { orphans: 3; widows: 3; } h2, h3 { page-break-after: avoid; } .navbar { display: none; } .btn > .caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table td, .table th { background-color: #fff !important; } .table-bordered th, .table-bordered td { border: 1px solid #ddd !important; } } @font-face { font-family: 'Glyphicons Halflings'; src: url("../fonts/bootstrap/glyphicons-halflings-regular.eot"); src: url("../fonts/bootstrap/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("../fonts/bootstrap/glyphicons-halflings-regular.woff2") format("woff2"), url("../fonts/bootstrap/glyphicons-halflings-regular.woff") format("woff"), url("../fonts/bootstrap/glyphicons-halflings-regular.ttf") format("truetype"), url("../fonts/bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg"); } .glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'Glyphicons Halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .glyphicon-asterisk:before { content: "\002a"; } .glyphicon-plus:before { content: "\002b"; } .glyphicon-euro:before, .glyphicon-eur:before { content: "\20ac"; } .glyphicon-minus:before { content: "\2212"; } .glyphicon-cloud:before { content: "\2601"; } .glyphicon-envelope:before { content: "\2709"; } .glyphicon-pencil:before { content: "\270f"; } .glyphicon-glass:before { content: "\e001"; } .glyphicon-music:before { content: "\e002"; } .glyphicon-search:before { content: "\e003"; } .glyphicon-heart:before { content: "\e005"; } .glyphicon-star:before { content: "\e006"; } .glyphicon-star-empty:before { content: "\e007"; } .glyphicon-user:before { content: "\e008"; } .glyphicon-film:before { content: "\e009"; } .glyphicon-th-large:before { content: "\e010"; } .glyphicon-th:before { content: "\e011"; } .glyphicon-th-list:before { content: "\e012"; } .glyphicon-ok:before { content: "\e013"; } .glyphicon-remove:before { content: "\e014"; } .glyphicon-zoom-in:before { content: "\e015"; } .glyphicon-zoom-out:before { content: "\e016"; } .glyphicon-off:before { content: "\e017"; } .glyphicon-signal:before { content: "\e018"; } .glyphicon-cog:before { content: "\e019"; } .glyphicon-trash:before { content: "\e020"; } .glyphicon-home:before { content: "\e021"; } .glyphicon-file:before { content: "\e022"; } .glyphicon-time:before { content: "\e023"; } .glyphicon-road:before { content: "\e024"; } .glyphicon-download-alt:before { content: "\e025"; } .glyphicon-download:before { content: "\e026"; } .glyphicon-upload:before { content: "\e027"; } .glyphicon-inbox:before { content: "\e028"; } .glyphicon-play-circle:before { content: "\e029"; } .glyphicon-repeat:before { content: "\e030"; } .glyphicon-refresh:before { content: "\e031"; } .glyphicon-list-alt:before { content: "\e032"; } .glyphicon-lock:before { content: "\e033"; } .glyphicon-flag:before { content: "\e034"; } .glyphicon-headphones:before { content: "\e035"; } .glyphicon-volume-off:before { content: "\e036"; } .glyphicon-volume-down:before { content: "\e037"; } .glyphicon-volume-up:before { content: "\e038"; } .glyphicon-qrcode:before { content: "\e039"; } .glyphicon-barcode:before { content: "\e040"; } .glyphicon-tag:before { content: "\e041"; } .glyphicon-tags:before { content: "\e042"; } .glyphicon-book:before { content: "\e043"; } .glyphicon-bookmark:before { content: "\e044"; } .glyphicon-print:before { content: "\e045"; } .glyphicon-camera:before { content: "\e046"; } .glyphicon-font:before { content: "\e047"; } .glyphicon-bold:before { content: "\e048"; } .glyphicon-italic:before { content: "\e049"; } .glyphicon-text-height:before { content: "\e050"; } .glyphicon-text-width:before { content: "\e051"; } .glyphicon-align-left:before { content: "\e052"; } .glyphicon-align-center:before { content: "\e053"; } .glyphicon-align-right:before { content: "\e054"; } .glyphicon-align-justify:before { content: "\e055"; } .glyphicon-list:before { content: "\e056"; } .glyphicon-indent-left:before { content: "\e057"; } .glyphicon-indent-right:before { content: "\e058"; } .glyphicon-facetime-video:before { content: "\e059"; } .glyphicon-picture:before { content: "\e060"; } .glyphicon-map-marker:before { content: "\e062"; } .glyphicon-adjust:before { content: "\e063"; } .glyphicon-tint:before { content: "\e064"; } .glyphicon-edit:before { content: "\e065"; } .glyphicon-share:before { content: "\e066"; } .glyphicon-check:before { content: "\e067"; } .glyphicon-move:before { content: "\e068"; } .glyphicon-step-backward:before { content: "\e069"; } .glyphicon-fast-backward:before { content: "\e070"; } .glyphicon-backward:before { content: "\e071"; } .glyphicon-play:before { content: "\e072"; } .glyphicon-pause:before { content: "\e073"; } .glyphicon-stop:before { content: "\e074"; } .glyphicon-forward:before { content: "\e075"; } .glyphicon-fast-forward:before { content: "\e076"; } .glyphicon-step-forward:before { content: "\e077"; } .glyphicon-eject:before { content: "\e078"; } .glyphicon-chevron-left:before { content: "\e079"; } .glyphicon-chevron-right:before { content: "\e080"; } .glyphicon-plus-sign:before { content: "\e081"; } .glyphicon-minus-sign:before { content: "\e082"; } .glyphicon-remove-sign:before { content: "\e083"; } .glyphicon-ok-sign:before { content: "\e084"; } .glyphicon-question-sign:before { content: "\e085"; } .glyphicon-info-sign:before { content: "\e086"; } .glyphicon-screenshot:before { content: "\e087"; } .glyphicon-remove-circle:before { content: "\e088"; } .glyphicon-ok-circle:before { content: "\e089"; } .glyphicon-ban-circle:before { content: "\e090"; } .glyphicon-arrow-left:before { content: "\e091"; } .glyphicon-arrow-right:before { content: "\e092"; } .glyphicon-arrow-up:before { content: "\e093"; } .glyphicon-arrow-down:before { content: "\e094"; } .glyphicon-share-alt:before { content: "\e095"; } .glyphicon-resize-full:before { content: "\e096"; } .glyphicon-resize-small:before { content: "\e097"; } .glyphicon-exclamation-sign:before { content: "\e101"; } .glyphicon-gift:before { content: "\e102"; } .glyphicon-leaf:before { content: "\e103"; } .glyphicon-fire:before { content: "\e104"; } .glyphicon-eye-open:before { content: "\e105"; } .glyphicon-eye-close:before { content: "\e106"; } .glyphicon-warning-sign:before { content: "\e107"; } .glyphicon-plane:before { content: "\e108"; } .glyphicon-calendar:before { content: "\e109"; } .glyphicon-random:before { content: "\e110"; } .glyphicon-comment:before { content: "\e111"; } .glyphicon-magnet:before { content: "\e112"; } .glyphicon-chevron-up:before { content: "\e113"; } .glyphicon-chevron-down:before { content: "\e114"; } .glyphicon-retweet:before { content: "\e115"; } .glyphicon-shopping-cart:before { content: "\e116"; } .glyphicon-folder-close:before { content: "\e117"; } .glyphicon-folder-open:before { content: "\e118"; } .glyphicon-resize-vertical:before { content: "\e119"; } .glyphicon-resize-horizontal:before { content: "\e120"; } .glyphicon-hdd:before { content: "\e121"; } .glyphicon-bullhorn:before { content: "\e122"; } .glyphicon-bell:before { content: "\e123"; } .glyphicon-certificate:before { content: "\e124"; } .glyphicon-thumbs-up:before { content: "\e125"; } .glyphicon-thumbs-down:before { content: "\e126"; } .glyphicon-hand-right:before { content: "\e127"; } .glyphicon-hand-left:before { content: "\e128"; } .glyphicon-hand-up:before { content: "\e129"; } .glyphicon-hand-down:before { content: "\e130"; } .glyphicon-circle-arrow-right:before { content: "\e131"; } .glyphicon-circle-arrow-left:before { content: "\e132"; } .glyphicon-circle-arrow-up:before { content: "\e133"; } .glyphicon-circle-arrow-down:before { content: "\e134"; } .glyphicon-globe:before { content: "\e135"; } .glyphicon-wrench:before { content: "\e136"; } .glyphicon-tasks:before { content: "\e137"; } .glyphicon-filter:before { content: "\e138"; } .glyphicon-briefcase:before { content: "\e139"; } .glyphicon-fullscreen:before { content: "\e140"; } .glyphicon-dashboard:before { content: "\e141"; } .glyphicon-paperclip:before { content: "\e142"; } .glyphicon-heart-empty:before { content: "\e143"; } .glyphicon-link:before { content: "\e144"; } .glyphicon-phone:before { content: "\e145"; } .glyphicon-pushpin:before { content: "\e146"; } .glyphicon-usd:before { content: "\e148"; } .glyphicon-gbp:before { content: "\e149"; } .glyphicon-sort:before { content: "\e150"; } .glyphicon-sort-by-alphabet:before { content: "\e151"; } .glyphicon-sort-by-alphabet-alt:before { content: "\e152"; } .glyphicon-sort-by-order:before { content: "\e153"; } .glyphicon-sort-by-order-alt:before { content: "\e154"; } .glyphicon-sort-by-attributes:before { content: "\e155"; } .glyphicon-sort-by-attributes-alt:before { content: "\e156"; } .glyphicon-unchecked:before { content: "\e157"; } .glyphicon-expand:before { content: "\e158"; } .glyphicon-collapse-down:before { content: "\e159"; } .glyphicon-collapse-up:before { content: "\e160"; } .glyphicon-log-in:before { content: "\e161"; } .glyphicon-flash:before { content: "\e162"; } .glyphicon-log-out:before { content: "\e163"; } .glyphicon-new-window:before { content: "\e164"; } .glyphicon-record:before { content: "\e165"; } .glyphicon-save:before { content: "\e166"; } .glyphicon-open:before { content: "\e167"; } .glyphicon-saved:before { content: "\e168"; } .glyphicon-import:before { content: "\e169"; } .glyphicon-export:before { content: "\e170"; } .glyphicon-send:before { content: "\e171"; } .glyphicon-floppy-disk:before { content: "\e172"; } .glyphicon-floppy-saved:before { content: "\e173"; } .glyphicon-floppy-remove:before { content: "\e174"; } .glyphicon-floppy-save:before { content: "\e175"; } .glyphicon-floppy-open:before { content: "\e176"; } .glyphicon-credit-card:before { content: "\e177"; } .glyphicon-transfer:before { content: "\e178"; } .glyphicon-cutlery:before { content: "\e179"; } .glyphicon-header:before { content: "\e180"; } .glyphicon-compressed:before { content: "\e181"; } .glyphicon-earphone:before { content: "\e182"; } .glyphicon-phone-alt:before { content: "\e183"; } .glyphicon-tower:before { content: "\e184"; } .glyphicon-stats:before { content: "\e185"; } .glyphicon-sd-video:before { content: "\e186"; } .glyphicon-hd-video:before { content: "\e187"; } .glyphicon-subtitles:before { content: "\e188"; } .glyphicon-sound-stereo:before { content: "\e189"; } .glyphicon-sound-dolby:before { content: "\e190"; } .glyphicon-sound-5-1:before { content: "\e191"; } .glyphicon-sound-6-1:before { content: "\e192"; } .glyphicon-sound-7-1:before { content: "\e193"; } .glyphicon-copyright-mark:before { content: "\e194"; } .glyphicon-registration-mark:before { content: "\e195"; } .glyphicon-cloud-download:before { content: "\e197"; } .glyphicon-cloud-upload:before { content: "\e198"; } .glyphicon-tree-conifer:before { content: "\e199"; } .glyphicon-tree-deciduous:before { content: "\e200"; } .glyphicon-cd:before { content: "\e201"; } .glyphicon-save-file:before { content: "\e202"; } .glyphicon-open-file:before { content: "\e203"; } .glyphicon-level-up:before { content: "\e204"; } .glyphicon-copy:before { content: "\e205"; } .glyphicon-paste:before { content: "\e206"; } .glyphicon-alert:before { content: "\e209"; } .glyphicon-equalizer:before { content: "\e210"; } .glyphicon-king:before { content: "\e211"; } .glyphicon-queen:before { content: "\e212"; } .glyphicon-pawn:before { content: "\e213"; } .glyphicon-bishop:before { content: "\e214"; } .glyphicon-knight:before { content: "\e215"; } .glyphicon-baby-formula:before { content: "\e216"; } .glyphicon-tent:before { content: "\26fa"; } .glyphicon-blackboard:before { content: "\e218"; } .glyphicon-bed:before { content: "\e219"; } .glyphicon-apple:before { content: "\f8ff"; } .glyphicon-erase:before { content: "\e221"; } .glyphicon-hourglass:before { content: "\231b"; } .glyphicon-lamp:before { content: "\e223"; } .glyphicon-duplicate:before { content: "\e224"; } .glyphicon-piggy-bank:before { content: "\e225"; } .glyphicon-scissors:before { content: "\e226"; } .glyphicon-bitcoin:before { content: "\e227"; } .glyphicon-btc:before { content: "\e227"; } .glyphicon-xbt:before { content: "\e227"; } .glyphicon-yen:before { content: "\00a5"; } .glyphicon-jpy:before { content: "\00a5"; } .glyphicon-ruble:before { content: "\20bd"; } .glyphicon-rub:before { content: "\20bd"; } .glyphicon-scale:before { content: "\e230"; } .glyphicon-ice-lolly:before { content: "\e231"; } .glyphicon-ice-lolly-tasted:before { content: "\e232"; } .glyphicon-education:before { content: "\e233"; } .glyphicon-option-horizontal:before { content: "\e234"; } .glyphicon-option-vertical:before { content: "\e235"; } .glyphicon-menu-hamburger:before { content: "\e236"; } .glyphicon-modal-window:before { content: "\e237"; } .glyphicon-oil:before { content: "\e238"; } .glyphicon-grain:before { content: "\e239"; } .glyphicon-sunglasses:before { content: "\e240"; } .glyphicon-text-size:before { content: "\e241"; } .glyphicon-text-color:before { content: "\e242"; } .glyphicon-text-background:before { content: "\e243"; } .glyphicon-object-align-top:before { content: "\e244"; } .glyphicon-object-align-bottom:before { content: "\e245"; } .glyphicon-object-align-horizontal:before { content: "\e246"; } .glyphicon-object-align-left:before { content: "\e247"; } .glyphicon-object-align-vertical:before { content: "\e248"; } .glyphicon-object-align-right:before { content: "\e249"; } .glyphicon-triangle-right:before { content: "\e250"; } .glyphicon-triangle-left:before { content: "\e251"; } .glyphicon-triangle-bottom:before { content: "\e252"; } .glyphicon-triangle-top:before { content: "\e253"; } .glyphicon-console:before { content: "\e254"; } .glyphicon-superscript:before { content: "\e255"; } .glyphicon-subscript:before { content: "\e256"; } .glyphicon-menu-left:before { content: "\e257"; } .glyphicon-menu-right:before { content: "\e258"; } .glyphicon-menu-down:before { content: "\e259"; } .glyphicon-menu-up:before { content: "\e260"; } * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html { font-size: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.42857; color: #333333; background-color: #fff; } input, button, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; } a { color: #337ab7; text-decoration: none; } a:hover, a:focus { color: #23527c; text-decoration: underline; } a:focus { outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } figure { margin: 0; } img { vertical-align: middle; } .img-responsive { display: block; max-width: 100%; height: auto; } .img-rounded { border-radius: 6px; } .img-thumbnail { padding: 4px; line-height: 1.42857; background-color: #fff; border: 1px solid #ddd; border-radius: 4px; -webkit-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; display: inline-block; max-width: 100%; height: auto; } .img-circle { border-radius: 50%; } hr { margin-top: 20px; margin-bottom: 20px; border: 0; border-top: 1px solid #eeeeee; } .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } .sr-only-focusable:active, .sr-only-focusable:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; } [role="button"] { cursor: pointer; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit; } h1 small, h1 .small, h2 small, h2 .small, h3 small, h3 .small, h4 small, h4 .small, h5 small, h5 .small, h6 small, h6 .small, .h1 small, .h1 .small, .h2 small, .h2 .small, .h3 small, .h3 .small, .h4 small, .h4 .small, .h5 small, .h5 .small, .h6 small, .h6 .small { font-weight: normal; line-height: 1; color: #777777; } h1, .h1, h2, .h2, h3, .h3 { margin-top: 20px; margin-bottom: 10px; } h1 small, h1 .small, .h1 small, .h1 .small, h2 small, h2 .small, .h2 small, .h2 .small, h3 small, h3 .small, .h3 small, .h3 .small { font-size: 65%; } h4, .h4, h5, .h5, h6, .h6 { margin-top: 10px; margin-bottom: 10px; } h4 small, h4 .small, .h4 small, .h4 .small, h5 small, h5 .small, .h5 small, .h5 .small, h6 small, h6 .small, .h6 small, .h6 .small { font-size: 75%; } h1, .h1 { font-size: 36px; } h2, .h2 { font-size: 30px; } h3, .h3 { font-size: 24px; } h4, .h4 { font-size: 18px; } h5, .h5 { font-size: 14px; } h6, .h6 { font-size: 12px; } p { margin: 0 0 10px; } .lead { margin-bottom: 20px; font-size: 16px; font-weight: 300; line-height: 1.4; } @media (min-width: 768px) { .lead { font-size: 21px; } } small, .small { font-size: 85%; } mark, .mark { background-color: #fcf8e3; padding: .2em; } .text-left { text-align: left; } .text-right { text-align: right; } .text-center { text-align: center; } .text-justify { text-align: justify; } .text-nowrap { white-space: nowrap; } .text-lowercase { text-transform: lowercase; } .text-uppercase, .initialism { text-transform: uppercase; } .text-capitalize { text-transform: capitalize; } .text-muted { color: #777777; } .text-primary { color: #337ab7; } a.text-primary:hover, a.text-primary:focus { color: #286090; } .text-success { color: #3c763d; } a.text-success:hover, a.text-success:focus { color: #2b542c; } .text-info { color: #31708f; } a.text-info:hover, a.text-info:focus { color: #245269; } .text-warning { color: #8a6d3b; } a.text-warning:hover, a.text-warning:focus { color: #66512c; } .text-danger { color: #a94442; } a.text-danger:hover, a.text-danger:focus { color: #843534; } .bg-primary { color: #fff; } .bg-primary { background-color: #337ab7; } a.bg-primary:hover, a.bg-primary:focus { background-color: #286090; } .bg-success { background-color: #dff0d8; } a.bg-success:hover, a.bg-success:focus { background-color: #c1e2b3; } .bg-info { background-color: #d9edf7; } a.bg-info:hover, a.bg-info:focus { background-color: #afd9ee; } .bg-warning { background-color: #fcf8e3; } a.bg-warning:hover, a.bg-warning:focus { background-color: #f7ecb5; } .bg-danger { background-color: #f2dede; } a.bg-danger:hover, a.bg-danger:focus { background-color: #e4b9b9; } .page-header { padding-bottom: 9px; margin: 40px 0 20px; border-bottom: 1px solid #eeeeee; } ul, ol { margin-top: 0; margin-bottom: 10px; } ul ul, ul ol, ol ul, ol ol { margin-bottom: 0; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; list-style: none; margin-left: -5px; } .list-inline > li { display: inline-block; padding-left: 5px; padding-right: 5px; } dl { margin-top: 0; margin-bottom: 20px; } dt, dd { line-height: 1.42857; } dt { font-weight: bold; } dd { margin-left: 0; } .dl-horizontal dd:before, .dl-horizontal dd:after { content: " "; display: table; } .dl-horizontal dd:after { clear: both; } @media (min-width: 768px) { .dl-horizontal dt { float: left; width: 160px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 180px; } } abbr[title], abbr[data-original-title] { cursor: help; border-bottom: 1px dotted #777777; } .initialism { font-size: 90%; } blockquote { padding: 10px 20px; margin: 0 0 20px; font-size: 17.5px; border-left: 5px solid #eeeeee; } blockquote p:last-child, blockquote ul:last-child, blockquote ol:last-child { margin-bottom: 0; } blockquote footer, blockquote small, blockquote .small { display: block; font-size: 80%; line-height: 1.42857; color: #777777; } blockquote footer:before, blockquote small:before, blockquote .small:before { content: '\2014 \00A0'; } .blockquote-reverse, blockquote.pull-right { padding-right: 15px; padding-left: 0; border-right: 5px solid #eeeeee; border-left: 0; text-align: right; } .blockquote-reverse footer:before, .blockquote-reverse small:before, .blockquote-reverse .small:before, blockquote.pull-right footer:before, blockquote.pull-right small:before, blockquote.pull-right .small:before { content: ''; } .blockquote-reverse footer:after, .blockquote-reverse small:after, .blockquote-reverse .small:after, blockquote.pull-right footer:after, blockquote.pull-right small:after, blockquote.pull-right .small:after { content: '\00A0 \2014'; } address { margin-bottom: 20px; font-style: normal; line-height: 1.42857; } code, kbd, pre, samp { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; border-radius: 4px; } kbd { padding: 2px 4px; font-size: 90%; color: #fff; background-color: #333; border-radius: 3px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); } kbd kbd { padding: 0; font-size: 100%; font-weight: bold; box-shadow: none; } pre { display: block; padding: 9.5px; margin: 0 0 10px; font-size: 13px; line-height: 1.42857; word-break: break-all; word-wrap: break-word; color: #333333; background-color: #f5f5f5; border: 1px solid #ccc; border-radius: 4px; } pre code { padding: 0; font-size: inherit; color: inherit; white-space: pre-wrap; background-color: transparent; border-radius: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } .container { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } .container:before, .container:after { content: " "; display: table; } .container:after { clear: both; } @media (min-width: 768px) { .container { width: 750px; } } @media (min-width: 992px) { .container { width: 970px; } } @media (min-width: 1200px) { .container { width: 1170px; } } .container-fluid { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } .container-fluid:before, .container-fluid:after { content: " "; display: table; } .container-fluid:after { clear: both; } .row { margin-left: -15px; margin-right: -15px; } .row:before, .row:after { content: " "; display: table; } .row:after { clear: both; } .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { float: left; } .col-xs-1 { width: 8.33333%; } .col-xs-2 { width: 16.66667%; } .col-xs-3 { width: 25%; } .col-xs-4 { width: 33.33333%; } .col-xs-5 { width: 41.66667%; } .col-xs-6 { width: 50%; } .col-xs-7 { width: 58.33333%; } .col-xs-8 { width: 66.66667%; } .col-xs-9 { width: 75%; } .col-xs-10 { width: 83.33333%; } .col-xs-11 { width: 91.66667%; } .col-xs-12 { width: 100%; } .col-xs-pull-0 { right: auto; } .col-xs-pull-1 { right: 8.33333%; } .col-xs-pull-2 { right: 16.66667%; } .col-xs-pull-3 { right: 25%; } .col-xs-pull-4 { right: 33.33333%; } .col-xs-pull-5 { right: 41.66667%; } .col-xs-pull-6 { right: 50%; } .col-xs-pull-7 { right: 58.33333%; } .col-xs-pull-8 { right: 66.66667%; } .col-xs-pull-9 { right: 75%; } .col-xs-pull-10 { right: 83.33333%; } .col-xs-pull-11 { right: 91.66667%; } .col-xs-pull-12 { right: 100%; } .col-xs-push-0 { left: auto; } .col-xs-push-1 { left: 8.33333%; } .col-xs-push-2 { left: 16.66667%; } .col-xs-push-3 { left: 25%; } .col-xs-push-4 { left: 33.33333%; } .col-xs-push-5 { left: 41.66667%; } .col-xs-push-6 { left: 50%; } .col-xs-push-7 { left: 58.33333%; } .col-xs-push-8 { left: 66.66667%; } .col-xs-push-9 { left: 75%; } .col-xs-push-10 { left: 83.33333%; } .col-xs-push-11 { left: 91.66667%; } .col-xs-push-12 { left: 100%; } .col-xs-offset-0 { margin-left: 0%; } .col-xs-offset-1 { margin-left: 8.33333%; } .col-xs-offset-2 { margin-left: 16.66667%; } .col-xs-offset-3 { margin-left: 25%; } .col-xs-offset-4 { margin-left: 33.33333%; } .col-xs-offset-5 { margin-left: 41.66667%; } .col-xs-offset-6 { margin-left: 50%; } .col-xs-offset-7 { margin-left: 58.33333%; } .col-xs-offset-8 { margin-left: 66.66667%; } .col-xs-offset-9 { margin-left: 75%; } .col-xs-offset-10 { margin-left: 83.33333%; } .col-xs-offset-11 { margin-left: 91.66667%; } .col-xs-offset-12 { margin-left: 100%; } @media (min-width: 768px) { .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { float: left; } .col-sm-1 { width: 8.33333%; } .col-sm-2 { width: 16.66667%; } .col-sm-3 { width: 25%; } .col-sm-4 { width: 33.33333%; } .col-sm-5 { width: 41.66667%; } .col-sm-6 { width: 50%; } .col-sm-7 { width: 58.33333%; } .col-sm-8 { width: 66.66667%; } .col-sm-9 { width: 75%; } .col-sm-10 { width: 83.33333%; } .col-sm-11 { width: 91.66667%; } .col-sm-12 { width: 100%; } .col-sm-pull-0 { right: auto; } .col-sm-pull-1 { right: 8.33333%; } .col-sm-pull-2 { right: 16.66667%; } .col-sm-pull-3 { right: 25%; } .col-sm-pull-4 { right: 33.33333%; } .col-sm-pull-5 { right: 41.66667%; } .col-sm-pull-6 { right: 50%; } .col-sm-pull-7 { right: 58.33333%; } .col-sm-pull-8 { right: 66.66667%; } .col-sm-pull-9 { right: 75%; } .col-sm-pull-10 { right: 83.33333%; } .col-sm-pull-11 { right: 91.66667%; } .col-sm-pull-12 { right: 100%; } .col-sm-push-0 { left: auto; } .col-sm-push-1 { left: 8.33333%; } .col-sm-push-2 { left: 16.66667%; } .col-sm-push-3 { left: 25%; } .col-sm-push-4 { left: 33.33333%; } .col-sm-push-5 { left: 41.66667%; } .col-sm-push-6 { left: 50%; } .col-sm-push-7 { left: 58.33333%; } .col-sm-push-8 { left: 66.66667%; } .col-sm-push-9 { left: 75%; } .col-sm-push-10 { left: 83.33333%; } .col-sm-push-11 { left: 91.66667%; } .col-sm-push-12 { left: 100%; } .col-sm-offset-0 { margin-left: 0%; } .col-sm-offset-1 { margin-left: 8.33333%; } .col-sm-offset-2 { margin-left: 16.66667%; } .col-sm-offset-3 { margin-left: 25%; } .col-sm-offset-4 { margin-left: 33.33333%; } .col-sm-offset-5 { margin-left: 41.66667%; } .col-sm-offset-6 { margin-left: 50%; } .col-sm-offset-7 { margin-left: 58.33333%; } .col-sm-offset-8 { margin-left: 66.66667%; } .col-sm-offset-9 { margin-left: 75%; } .col-sm-offset-10 { margin-left: 83.33333%; } .col-sm-offset-11 { margin-left: 91.66667%; } .col-sm-offset-12 { margin-left: 100%; } } @media (min-width: 992px) { .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { float: left; } .col-md-1 { width: 8.33333%; } .col-md-2 { width: 16.66667%; } .col-md-3 { width: 25%; } .col-md-4 { width: 33.33333%; } .col-md-5 { width: 41.66667%; } .col-md-6 { width: 50%; } .col-md-7 { width: 58.33333%; } .col-md-8 { width: 66.66667%; } .col-md-9 { width: 75%; } .col-md-10 { width: 83.33333%; } .col-md-11 { width: 91.66667%; } .col-md-12 { width: 100%; } .col-md-pull-0 { right: auto; } .col-md-pull-1 { right: 8.33333%; } .col-md-pull-2 { right: 16.66667%; } .col-md-pull-3 { right: 25%; } .col-md-pull-4 { right: 33.33333%; } .col-md-pull-5 { right: 41.66667%; } .col-md-pull-6 { right: 50%; } .col-md-pull-7 { right: 58.33333%; } .col-md-pull-8 { right: 66.66667%; } .col-md-pull-9 { right: 75%; } .col-md-pull-10 { right: 83.33333%; } .col-md-pull-11 { right: 91.66667%; } .col-md-pull-12 { right: 100%; } .col-md-push-0 { left: auto; } .col-md-push-1 { left: 8.33333%; } .col-md-push-2 { left: 16.66667%; } .col-md-push-3 { left: 25%; } .col-md-push-4 { left: 33.33333%; } .col-md-push-5 { left: 41.66667%; } .col-md-push-6 { left: 50%; } .col-md-push-7 { left: 58.33333%; } .col-md-push-8 { left: 66.66667%; } .col-md-push-9 { left: 75%; } .col-md-push-10 { left: 83.33333%; } .col-md-push-11 { left: 91.66667%; } .col-md-push-12 { left: 100%; } .col-md-offset-0 { margin-left: 0%; } .col-md-offset-1 { margin-left: 8.33333%; } .col-md-offset-2 { margin-left: 16.66667%; } .col-md-offset-3 { margin-left: 25%; } .col-md-offset-4 { margin-left: 33.33333%; } .col-md-offset-5 { margin-left: 41.66667%; } .col-md-offset-6 { margin-left: 50%; } .col-md-offset-7 { margin-left: 58.33333%; } .col-md-offset-8 { margin-left: 66.66667%; } .col-md-offset-9 { margin-left: 75%; } .col-md-offset-10 { margin-left: 83.33333%; } .col-md-offset-11 { margin-left: 91.66667%; } .col-md-offset-12 { margin-left: 100%; } } @media (min-width: 1200px) { .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { float: left; } .col-lg-1 { width: 8.33333%; } .col-lg-2 { width: 16.66667%; } .col-lg-3 { width: 25%; } .col-lg-4 { width: 33.33333%; } .col-lg-5 { width: 41.66667%; } .col-lg-6 { width: 50%; } .col-lg-7 { width: 58.33333%; } .col-lg-8 { width: 66.66667%; } .col-lg-9 { width: 75%; } .col-lg-10 { width: 83.33333%; } .col-lg-11 { width: 91.66667%; } .col-lg-12 { width: 100%; } .col-lg-pull-0 { right: auto; } .col-lg-pull-1 { right: 8.33333%; } .col-lg-pull-2 { right: 16.66667%; } .col-lg-pull-3 { right: 25%; } .col-lg-pull-4 { right: 33.33333%; } .col-lg-pull-5 { right: 41.66667%; } .col-lg-pull-6 { right: 50%; } .col-lg-pull-7 { right: 58.33333%; } .col-lg-pull-8 { right: 66.66667%; } .col-lg-pull-9 { right: 75%; } .col-lg-pull-10 { right: 83.33333%; } .col-lg-pull-11 { right: 91.66667%; } .col-lg-pull-12 { right: 100%; } .col-lg-push-0 { left: auto; } .col-lg-push-1 { left: 8.33333%; } .col-lg-push-2 { left: 16.66667%; } .col-lg-push-3 { left: 25%; } .col-lg-push-4 { left: 33.33333%; } .col-lg-push-5 { left: 41.66667%; } .col-lg-push-6 { left: 50%; } .col-lg-push-7 { left: 58.33333%; } .col-lg-push-8 { left: 66.66667%; } .col-lg-push-9 { left: 75%; } .col-lg-push-10 { left: 83.33333%; } .col-lg-push-11 { left: 91.66667%; } .col-lg-push-12 { left: 100%; } .col-lg-offset-0 { margin-left: 0%; } .col-lg-offset-1 { margin-left: 8.33333%; } .col-lg-offset-2 { margin-left: 16.66667%; } .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-4 { margin-left: 33.33333%; } .col-lg-offset-5 { margin-left: 41.66667%; } .col-lg-offset-6 { margin-left: 50%; } .col-lg-offset-7 { margin-left: 58.33333%; } .col-lg-offset-8 { margin-left: 66.66667%; } .col-lg-offset-9 { margin-left: 75%; } .col-lg-offset-10 { margin-left: 83.33333%; } .col-lg-offset-11 { margin-left: 91.66667%; } .col-lg-offset-12 { margin-left: 100%; } } table { background-color: transparent; } caption { padding-top: 8px; padding-bottom: 8px; color: #777777; text-align: left; } th { text-align: left; } .table { width: 100%; max-width: 100%; margin-bottom: 20px; } .table > thead > tr > th, .table > thead > tr > td, .table > tbody > tr > th, .table > tbody > tr > td, .table > tfoot > tr > th, .table > tfoot > tr > td { padding: 8px; line-height: 1.42857; vertical-align: top; border-top: 1px solid #ddd; } .table > thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #ddd; } .table > caption + thead > tr:first-child > th, .table > caption + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > td, .table > thead:first-child > tr:first-child > th, .table > thead:first-child > tr:first-child > td { border-top: 0; } .table > tbody + tbody { border-top: 2px solid #ddd; } .table .table { background-color: #fff; } .table-condensed > thead > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > th, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > th, .table-condensed > tfoot > tr > td { padding: 5px; } .table-bordered { border: 1px solid #ddd; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > th, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > th, .table-bordered > tfoot > tr > td { border: 1px solid #ddd; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 2px; } .table-striped > tbody > tr:nth-of-type(odd) { background-color: #f9f9f9; } .table-hover > tbody > tr:hover { background-color: #f5f5f5; } table col[class*="col-"] { position: static; float: none; display: table-column; } table td[class*="col-"], table th[class*="col-"] { position: static; float: none; display: table-cell; } .table > thead > tr > td.active, .table > thead > tr > th.active, .table > thead > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr > td.active, .table > tbody > tr > th.active, .table > tbody > tr.active > td, .table > tbody > tr.active > th, .table > tfoot > tr > td.active, .table > tfoot > tr > th.active, .table > tfoot > tr.active > td, .table > tfoot > tr.active > th { background-color: #f5f5f5; } .table-hover > tbody > tr > td.active:hover, .table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, .table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th { background-color: #e8e8e8; } .table > thead > tr > td.success, .table > thead > tr > th.success, .table > thead > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr > td.success, .table > tbody > tr > th.success, .table > tbody > tr.success > td, .table > tbody > tr.success > th, .table > tfoot > tr > td.success, .table > tfoot > tr > th.success, .table > tfoot > tr.success > td, .table > tfoot > tr.success > th { background-color: #dff0d8; } .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th { background-color: #d0e9c6; } .table > thead > tr > td.info, .table > thead > tr > th.info, .table > thead > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr > td.info, .table > tbody > tr > th.info, .table > tbody > tr.info > td, .table > tbody > tr.info > th, .table > tfoot > tr > td.info, .table > tfoot > tr > th.info, .table > tfoot > tr.info > td, .table > tfoot > tr.info > th { background-color: #d9edf7; } .table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th { background-color: #c4e3f3; } .table > thead > tr > td.warning, .table > thead > tr > th.warning, .table > thead > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr > td.warning, .table > tbody > tr > th.warning, .table > tbody > tr.warning > td, .table > tbody > tr.warning > th, .table > tfoot > tr > td.warning, .table > tfoot > tr > th.warning, .table > tfoot > tr.warning > td, .table > tfoot > tr.warning > th { background-color: #fcf8e3; } .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th { background-color: #faf2cc; } .table > thead > tr > td.danger, .table > thead > tr > th.danger, .table > thead > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr > td.danger, .table > tbody > tr > th.danger, .table > tbody > tr.danger > td, .table > tbody > tr.danger > th, .table > tfoot > tr > td.danger, .table > tfoot > tr > th.danger, .table > tfoot > tr.danger > td, .table > tfoot > tr.danger > th { background-color: #f2dede; } .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th { background-color: #ebcccc; } .table-responsive { overflow-x: auto; min-height: 0.01%; } @media screen and (max-width: 767px) { .table-responsive { width: 100%; margin-bottom: 15px; overflow-y: hidden; -ms-overflow-style: -ms-autohiding-scrollbar; border: 1px solid #ddd; } .table-responsive > .table { margin-bottom: 0; } .table-responsive > .table > thead > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > tfoot > tr > td { white-space: nowrap; } .table-responsive > .table-bordered { border: 0; } .table-responsive > .table-bordered > thead > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .table-responsive > .table-bordered > thead > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > td { border-bottom: 0; } } fieldset { padding: 0; margin: 0; border: 0; min-width: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 20px; font-size: 21px; line-height: inherit; color: #333333; border: 0; border-bottom: 1px solid #e5e5e5; } label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: bold; } input[type="search"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; margin-top: 1px \9; line-height: normal; } input[type="file"] { display: block; } input[type="range"] { display: block; width: 100%; } select[multiple], select[size] { height: auto; } input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } output { display: block; padding-top: 7px; font-size: 14px; line-height: 1.42857; color: #555555; } .form-control { display: block; width: 100%; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857; color: #555555; background-color: #fff; background-image: none; border: 1px solid #ccc; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; } .form-control:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); } .form-control::-moz-placeholder { color: #999; opacity: 1; } .form-control:-ms-input-placeholder { color: #999; } .form-control::-webkit-input-placeholder { color: #999; } .form-control::-ms-expand { border: 0; background-color: transparent; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { background-color: #eeeeee; opacity: 1; } .form-control[disabled], fieldset[disabled] .form-control { cursor: not-allowed; } textarea.form-control { height: auto; } input[type="search"] { -webkit-appearance: none; } @media screen and (-webkit-min-device-pixel-ratio: 0) { input[type="date"].form-control, input[type="time"].form-control, input[type="datetime-local"].form-control, input[type="month"].form-control { line-height: 34px; } input[type="date"].input-sm, .input-group-sm > input.form-control[type="date"], .input-group-sm > input.input-group-addon[type="date"], .input-group-sm > .input-group-btn > input.btn[type="date"], .input-group-sm input[type="date"], input[type="time"].input-sm, .input-group-sm > input.form-control[type="time"], .input-group-sm > input.input-group-addon[type="time"], .input-group-sm > .input-group-btn > input.btn[type="time"], .input-group-sm input[type="time"], input[type="datetime-local"].input-sm, .input-group-sm > input.form-control[type="datetime-local"], .input-group-sm > input.input-group-addon[type="datetime-local"], .input-group-sm > .input-group-btn > input.btn[type="datetime-local"], .input-group-sm input[type="datetime-local"], input[type="month"].input-sm, .input-group-sm > input.form-control[type="month"], .input-group-sm > input.input-group-addon[type="month"], .input-group-sm > .input-group-btn > input.btn[type="month"], .input-group-sm input[type="month"] { line-height: 30px; } input[type="date"].input-lg, .input-group-lg > input.form-control[type="date"], .input-group-lg > input.input-group-addon[type="date"], .input-group-lg > .input-group-btn > input.btn[type="date"], .input-group-lg input[type="date"], input[type="time"].input-lg, .input-group-lg > input.form-control[type="time"], .input-group-lg > input.input-group-addon[type="time"], .input-group-lg > .input-group-btn > input.btn[type="time"], .input-group-lg input[type="time"], input[type="datetime-local"].input-lg, .input-group-lg > input.form-control[type="datetime-local"], .input-group-lg > input.input-group-addon[type="datetime-local"], .input-group-lg > .input-group-btn > input.btn[type="datetime-local"], .input-group-lg input[type="datetime-local"], input[type="month"].input-lg, .input-group-lg > input.form-control[type="month"], .input-group-lg > input.input-group-addon[type="month"], .input-group-lg > .input-group-btn > input.btn[type="month"], .input-group-lg input[type="month"] { line-height: 46px; } } .form-group { margin-bottom: 15px; } .radio, .checkbox { position: relative; display: block; margin-top: 10px; margin-bottom: 10px; } .radio label, .checkbox label { min-height: 20px; padding-left: 20px; margin-bottom: 0; font-weight: normal; cursor: pointer; } .radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] { position: absolute; margin-left: -20px; margin-top: 4px \9; } .radio + .radio, .checkbox + .checkbox { margin-top: -5px; } .radio-inline, .checkbox-inline { position: relative; display: inline-block; padding-left: 20px; margin-bottom: 0; vertical-align: middle; font-weight: normal; cursor: pointer; } .radio-inline + .radio-inline, .checkbox-inline + .checkbox-inline { margin-top: 0; margin-left: 10px; } input[type="radio"][disabled], input[type="radio"].disabled, fieldset[disabled] input[type="radio"], input[type="checkbox"][disabled], input[type="checkbox"].disabled, fieldset[disabled] input[type="checkbox"] { cursor: not-allowed; } .radio-inline.disabled, fieldset[disabled] .radio-inline, .checkbox-inline.disabled, fieldset[disabled] .checkbox-inline { cursor: not-allowed; } .radio.disabled label, fieldset[disabled] .radio label, .checkbox.disabled label, fieldset[disabled] .checkbox label { cursor: not-allowed; } .form-control-static { padding-top: 7px; padding-bottom: 7px; margin-bottom: 0; min-height: 34px; } .form-control-static.input-lg, .input-group-lg > .form-control-static.form-control, .input-group-lg > .form-control-static.input-group-addon, .input-group-lg > .input-group-btn > .form-control-static.btn, .form-control-static.input-sm, .input-group-sm > .form-control-static.form-control, .input-group-sm > .form-control-static.input-group-addon, .input-group-sm > .input-group-btn > .form-control-static.btn { padding-left: 0; padding-right: 0; } .input-sm, .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-sm, .input-group-sm > select.form-control, .input-group-sm > select.input-group-addon, .input-group-sm > .input-group-btn > select.btn { height: 30px; line-height: 30px; } textarea.input-sm, .input-group-sm > textarea.form-control, .input-group-sm > textarea.input-group-addon, .input-group-sm > .input-group-btn > textarea.btn, select[multiple].input-sm, .input-group-sm > select.form-control[multiple], .input-group-sm > select.input-group-addon[multiple], .input-group-sm > .input-group-btn > select.btn[multiple] { height: auto; } .form-group-sm .form-control { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .form-group-sm select.form-control { height: 30px; line-height: 30px; } .form-group-sm textarea.form-control, .form-group-sm select[multiple].form-control { height: auto; } .form-group-sm .form-control-static { height: 30px; min-height: 32px; padding: 6px 10px; font-size: 12px; line-height: 1.5; } .input-lg, .input-group-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.33333; border-radius: 6px; } select.input-lg, .input-group-lg > select.form-control, .input-group-lg > select.input-group-addon, .input-group-lg > .input-group-btn > select.btn { height: 46px; line-height: 46px; } textarea.input-lg, .input-group-lg > textarea.form-control, .input-group-lg > textarea.input-group-addon, .input-group-lg > .input-group-btn > textarea.btn, select[multiple].input-lg, .input-group-lg > select.form-control[multiple], .input-group-lg > select.input-group-addon[multiple], .input-group-lg > .input-group-btn > select.btn[multiple] { height: auto; } .form-group-lg .form-control { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.33333; border-radius: 6px; } .form-group-lg select.form-control { height: 46px; line-height: 46px; } .form-group-lg textarea.form-control, .form-group-lg select[multiple].form-control { height: auto; } .form-group-lg .form-control-static { height: 46px; min-height: 38px; padding: 11px 16px; font-size: 18px; line-height: 1.33333; } .has-feedback { position: relative; } .has-feedback .form-control { padding-right: 42.5px; } .form-control-feedback { position: absolute; top: 0; right: 0; z-index: 2; display: block; width: 34px; height: 34px; line-height: 34px; text-align: center; pointer-events: none; } .input-lg + .form-control-feedback, .input-group-lg > .form-control + .form-control-feedback, .input-group-lg > .input-group-addon + .form-control-feedback, .input-group-lg > .input-group-btn > .btn + .form-control-feedback, .input-group-lg + .form-control-feedback, .form-group-lg .form-control + .form-control-feedback { width: 46px; height: 46px; line-height: 46px; } .input-sm + .form-control-feedback, .input-group-sm > .form-control + .form-control-feedback, .input-group-sm > .input-group-addon + .form-control-feedback, .input-group-sm > .input-group-btn > .btn + .form-control-feedback, .input-group-sm + .form-control-feedback, .form-group-sm .form-control + .form-control-feedback { width: 30px; height: 30px; line-height: 30px; } .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline, .has-success.radio label, .has-success.checkbox label, .has-success.radio-inline label, .has-success.checkbox-inline label { color: #3c763d; } .has-success .form-control { border-color: #3c763d; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-success .form-control:focus { border-color: #2b542c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; } .has-success .input-group-addon { color: #3c763d; border-color: #3c763d; background-color: #dff0d8; } .has-success .form-control-feedback { color: #3c763d; } .has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline, .has-warning.radio label, .has-warning.checkbox label, .has-warning.radio-inline label, .has-warning.checkbox-inline label { color: #8a6d3b; } .has-warning .form-control { border-color: #8a6d3b; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-warning .form-control:focus { border-color: #66512c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; } .has-warning .input-group-addon { color: #8a6d3b; border-color: #8a6d3b; background-color: #fcf8e3; } .has-warning .form-control-feedback { color: #8a6d3b; } .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline, .has-error.radio label, .has-error.checkbox label, .has-error.radio-inline label, .has-error.checkbox-inline label { color: #a94442; } .has-error .form-control { border-color: #a94442; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } .has-error .form-control:focus { border-color: #843534; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; } .has-error .input-group-addon { color: #a94442; border-color: #a94442; background-color: #f2dede; } .has-error .form-control-feedback { color: #a94442; } .has-feedback label ~ .form-control-feedback { top: 25px; } .has-feedback label.sr-only ~ .form-control-feedback { top: 0; } .help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; } @media (min-width: 768px) { .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; } .form-inline .form-control-static { display: inline-block; } .form-inline .input-group { display: inline-table; vertical-align: middle; } .form-inline .input-group .input-group-addon, .form-inline .input-group .input-group-btn, .form-inline .input-group .form-control { width: auto; } .form-inline .input-group > .form-control { width: 100%; } .form-inline .control-label { margin-bottom: 0; vertical-align: middle; } .form-inline .radio, .form-inline .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .form-inline .radio label, .form-inline .checkbox label { padding-left: 0; } .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .form-inline .has-feedback .form-control-feedback { top: 0; } } .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline { margin-top: 0; margin-bottom: 0; padding-top: 7px; } .form-horizontal .radio, .form-horizontal .checkbox { min-height: 27px; } .form-horizontal .form-group { margin-left: -15px; margin-right: -15px; } .form-horizontal .form-group:before, .form-horizontal .form-group:after { content: " "; display: table; } .form-horizontal .form-group:after { clear: both; } @media (min-width: 768px) { .form-horizontal .control-label { text-align: right; margin-bottom: 0; padding-top: 7px; } } .form-horizontal .has-feedback .form-control-feedback { right: 15px; } @media (min-width: 768px) { .form-horizontal .form-group-lg .control-label { padding-top: 11px; font-size: 18px; } } @media (min-width: 768px) { .form-horizontal .form-group-sm .control-label { padding-top: 6px; font-size: 12px; } } .btn { display: inline-block; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; touch-action: manipulation; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 6px 12px; font-size: 14px; line-height: 1.42857; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .btn:focus, .btn.focus, .btn:active:focus, .btn:active.focus, .btn.active:focus, .btn.active.focus { outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn:hover, .btn:focus, .btn.focus { color: #333; text-decoration: none; } .btn:active, .btn.active { outline: 0; background-image: none; -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn.disabled, .btn[disabled], fieldset[disabled] .btn { cursor: not-allowed; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; } a.btn.disabled, fieldset[disabled] a.btn { pointer-events: none; } .btn-default { color: #333; background-color: #fff; border-color: #ccc; } .btn-default:focus, .btn-default.focus { color: #333; background-color: #e6e6e6; border-color: #8c8c8c; } .btn-default:hover { color: #333; background-color: #e6e6e6; border-color: #adadad; } .btn-default:active, .btn-default.active, .open > .btn-default.dropdown-toggle { color: #333; background-color: #e6e6e6; border-color: #adadad; } .btn-default:active:hover, .btn-default:active:focus, .btn-default:active.focus, .btn-default.active:hover, .btn-default.active:focus, .btn-default.active.focus, .open > .btn-default.dropdown-toggle:hover, .open > .btn-default.dropdown-toggle:focus, .open > .btn-default.dropdown-toggle.focus { color: #333; background-color: #d4d4d4; border-color: #8c8c8c; } .btn-default:active, .btn-default.active, .open > .btn-default.dropdown-toggle { background-image: none; } .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled.focus, .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled].focus, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default.focus { background-color: #fff; border-color: #ccc; } .btn-default .badge { color: #fff; background-color: #333; } .btn-primary { color: #fff; background-color: #337ab7; border-color: #2e6da4; } .btn-primary:focus, .btn-primary.focus { color: #fff; background-color: #286090; border-color: #122b40; } .btn-primary:hover { color: #fff; background-color: #286090; border-color: #204d74; } .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle { color: #fff; background-color: #286090; border-color: #204d74; } .btn-primary:active:hover, .btn-primary:active:focus, .btn-primary:active.focus, .btn-primary.active:hover, .btn-primary.active:focus, .btn-primary.active.focus, .open > .btn-primary.dropdown-toggle:hover, .open > .btn-primary.dropdown-toggle:focus, .open > .btn-primary.dropdown-toggle.focus { color: #fff; background-color: #204d74; border-color: #122b40; } .btn-primary:active, .btn-primary.active, .open > .btn-primary.dropdown-toggle { background-image: none; } .btn-primary.disabled:hover, .btn-primary.disabled:focus, .btn-primary.disabled.focus, .btn-primary[disabled]:hover, .btn-primary[disabled]:focus, .btn-primary[disabled].focus, fieldset[disabled] .btn-primary:hover, fieldset[disabled] .btn-primary:focus, fieldset[disabled] .btn-primary.focus { background-color: #337ab7; border-color: #2e6da4; } .btn-primary .badge { color: #337ab7; background-color: #fff; } .btn-success { color: #fff; background-color: #5cb85c; border-color: #4cae4c; } .btn-success:focus, .btn-success.focus { color: #fff; background-color: #449d44; border-color: #255625; } .btn-success:hover { color: #fff; background-color: #449d44; border-color: #398439; } .btn-success:active, .btn-success.active, .open > .btn-success.dropdown-toggle { color: #fff; background-color: #449d44; border-color: #398439; } .btn-success:active:hover, .btn-success:active:focus, .btn-success:active.focus, .btn-success.active:hover, .btn-success.active:focus, .btn-success.active.focus, .open > .btn-success.dropdown-toggle:hover, .open > .btn-success.dropdown-toggle:focus, .open > .btn-success.dropdown-toggle.focus { color: #fff; background-color: #398439; border-color: #255625; } .btn-success:active, .btn-success.active, .open > .btn-success.dropdown-toggle { background-image: none; } .btn-success.disabled:hover, .btn-success.disabled:focus, .btn-success.disabled.focus, .btn-success[disabled]:hover, .btn-success[disabled]:focus, .btn-success[disabled].focus, fieldset[disabled] .btn-success:hover, fieldset[disabled] .btn-success:focus, fieldset[disabled] .btn-success.focus { background-color: #5cb85c; border-color: #4cae4c; } .btn-success .badge { color: #5cb85c; background-color: #fff; } .btn-info { color: #fff; background-color: #5bc0de; border-color: #46b8da; } .btn-info:focus, .btn-info.focus { color: #fff; background-color: #31b0d5; border-color: #1b6d85; } .btn-info:hover { color: #fff; background-color: #31b0d5; border-color: #269abc; } .btn-info:active, .btn-info.active, .open > .btn-info.dropdown-toggle { color: #fff; background-color: #31b0d5; border-color: #269abc; } .btn-info:active:hover, .btn-info:active:focus, .btn-info:active.focus, .btn-info.active:hover, .btn-info.active:focus, .btn-info.active.focus, .open > .btn-info.dropdown-toggle:hover, .open > .btn-info.dropdown-toggle:focus, .open > .btn-info.dropdown-toggle.focus { color: #fff; background-color: #269abc; border-color: #1b6d85; } .btn-info:active, .btn-info.active, .open > .btn-info.dropdown-toggle { background-image: none; } .btn-info.disabled:hover, .btn-info.disabled:focus, .btn-info.disabled.focus, .btn-info[disabled]:hover, .btn-info[disabled]:focus, .btn-info[disabled].focus, fieldset[disabled] .btn-info:hover, fieldset[disabled] .btn-info:focus, fieldset[disabled] .btn-info.focus { background-color: #5bc0de; border-color: #46b8da; } .btn-info .badge { color: #5bc0de; background-color: #fff; } .btn-warning { color: #fff; background-color: #f0ad4e; border-color: #eea236; } .btn-warning:focus, .btn-warning.focus { color: #fff; background-color: #ec971f; border-color: #985f0d; } .btn-warning:hover { color: #fff; background-color: #ec971f; border-color: #d58512; } .btn-warning:active, .btn-warning.active, .open > .btn-warning.dropdown-toggle { color: #fff; background-color: #ec971f; border-color: #d58512; } .btn-warning:active:hover, .btn-warning:active:focus, .btn-warning:active.focus, .btn-warning.active:hover, .btn-warning.active:focus, .btn-warning.active.focus, .open > .btn-warning.dropdown-toggle:hover, .open > .btn-warning.dropdown-toggle:focus, .open > .btn-warning.dropdown-toggle.focus { color: #fff; background-color: #d58512; border-color: #985f0d; } .btn-warning:active, .btn-warning.active, .open > .btn-warning.dropdown-toggle { background-image: none; } .btn-warning.disabled:hover, .btn-warning.disabled:focus, .btn-warning.disabled.focus, .btn-warning[disabled]:hover, .btn-warning[disabled]:focus, .btn-warning[disabled].focus, fieldset[disabled] .btn-warning:hover, fieldset[disabled] .btn-warning:focus, fieldset[disabled] .btn-warning.focus { background-color: #f0ad4e; border-color: #eea236; } .btn-warning .badge { color: #f0ad4e; background-color: #fff; } .btn-danger { color: #fff; background-color: #d9534f; border-color: #d43f3a; } .btn-danger:focus, .btn-danger.focus { color: #fff; background-color: #c9302c; border-color: #761c19; } .btn-danger:hover { color: #fff; background-color: #c9302c; border-color: #ac2925; } .btn-danger:active, .btn-danger.active, .open > .btn-danger.dropdown-toggle { color: #fff; background-color: #c9302c; border-color: #ac2925; } .btn-danger:active:hover, .btn-danger:active:focus, .btn-danger:active.focus, .btn-danger.active:hover, .btn-danger.active:focus, .btn-danger.active.focus, .open > .btn-danger.dropdown-toggle:hover, .open > .btn-danger.dropdown-toggle:focus, .open > .btn-danger.dropdown-toggle.focus { color: #fff; background-color: #ac2925; border-color: #761c19; } .btn-danger:active, .btn-danger.active, .open > .btn-danger.dropdown-toggle { background-image: none; } .btn-danger.disabled:hover, .btn-danger.disabled:focus, .btn-danger.disabled.focus, .btn-danger[disabled]:hover, .btn-danger[disabled]:focus, .btn-danger[disabled].focus, fieldset[disabled] .btn-danger:hover, fieldset[disabled] .btn-danger:focus, fieldset[disabled] .btn-danger.focus { background-color: #d9534f; border-color: #d43f3a; } .btn-danger .badge { color: #d9534f; background-color: #fff; } .btn-link { color: #337ab7; font-weight: normal; border-radius: 0; } .btn-link, .btn-link:active, .btn-link.active, .btn-link[disabled], fieldset[disabled] .btn-link { background-color: transparent; -webkit-box-shadow: none; box-shadow: none; } .btn-link, .btn-link:hover, .btn-link:focus, .btn-link:active { border-color: transparent; } .btn-link:hover, .btn-link:focus { color: #23527c; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:hover, fieldset[disabled] .btn-link:focus { color: #777777; text-decoration: none; } .btn-lg, .btn-group-lg > .btn { padding: 10px 16px; font-size: 18px; line-height: 1.33333; border-radius: 6px; } .btn-sm, .btn-group-sm > .btn { padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-xs, .btn-group-xs > .btn { padding: 1px 5px; font-size: 12px; line-height: 1.5; border-radius: 3px; } .btn-block { display: block; width: 100%; } .btn-block + .btn-block { margin-top: 5px; } input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block { width: 100%; } .fade { opacity: 0; -webkit-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; } .fade.in { opacity: 1; } .collapse { display: none; } .collapse.in { display: block; } tr.collapse.in { display: table-row; } tbody.collapse.in { display: table-row-group; } .collapsing { position: relative; height: 0; overflow: hidden; -webkit-transition-property: height, visibility; transition-property: height, visibility; -webkit-transition-duration: 0.35s; transition-duration: 0.35s; -webkit-transition-timing-function: ease; transition-timing-function: ease; } .caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px dashed; border-top: 4px solid \9; border-right: 4px solid transparent; border-left: 4px solid transparent; } .dropup, .dropdown { position: relative; } .dropdown-toggle:focus { outline: 0; } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 5px 0; margin: 2px 0 0; list-style: none; font-size: 14px; text-align: left; background-color: #fff; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 4px; -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); background-clip: padding-box; } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.42857; color: #333333; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { text-decoration: none; color: #262626; background-color: #f5f5f5; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #fff; text-decoration: none; outline: 0; background-color: #337ab7; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #777777; } .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { text-decoration: none; background-color: transparent; background-image: none; filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); cursor: not-allowed; } .open > .dropdown-menu { display: block; } .open > a { outline: 0; } .dropdown-menu-right { left: auto; right: 0; } .dropdown-menu-left { left: 0; right: auto; } .dropdown-header { display: block; padding: 3px 20px; font-size: 12px; line-height: 1.42857; color: #777777; white-space: nowrap; } .dropdown-backdrop { position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 990; } .pull-right > .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px dashed; border-bottom: 4px solid \9; content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 2px; } @media (min-width: 768px) { .navbar-right .dropdown-menu { right: 0; left: auto; } .navbar-right .dropdown-menu-left { left: 0; right: auto; } } .btn-group, .btn-group-vertical { position: relative; display: inline-block; vertical-align: middle; } .btn-group > .btn, .btn-group-vertical > .btn { position: relative; float: left; } .btn-group > .btn:hover, .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn:hover, .btn-group-vertical > .btn:focus, .btn-group-vertical > .btn:active, .btn-group-vertical > .btn.active { z-index: 2; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group { margin-left: -1px; } .btn-toolbar { margin-left: -5px; } .btn-toolbar:before, .btn-toolbar:after { content: " "; display: table; } .btn-toolbar:after { clear: both; } .btn-toolbar .btn, .btn-toolbar .btn-group, .btn-toolbar .input-group { float: left; } .btn-toolbar > .btn, .btn-toolbar > .btn-group, .btn-toolbar > .input-group { margin-left: 5px; } .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { border-radius: 0; } .btn-group > .btn:first-child { margin-left: 0; } .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn:last-child:not(:first-child), .btn-group > .dropdown-toggle:not(:first-child) { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group > .btn-group { float: left; } .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { border-bottom-left-radius: 0; border-top-left-radius: 0; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group > .btn + .dropdown-toggle { padding-left: 8px; padding-right: 8px; } .btn-group > .btn-lg + .dropdown-toggle, .btn-group-lg.btn-group > .btn + .dropdown-toggle { padding-left: 12px; padding-right: 12px; } .btn-group.open .dropdown-toggle { -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); } .btn-group.open .dropdown-toggle.btn-link { -webkit-box-shadow: none; box-shadow: none; } .btn .caret { margin-left: 0; } .btn-lg .caret, .btn-group-lg > .btn .caret { border-width: 5px 5px 0; border-bottom-width: 0; } .dropup .btn-lg .caret, .dropup .btn-group-lg > .btn .caret { border-width: 0 5px 5px; } .btn-group-vertical > .btn, .btn-group-vertical > .btn-group, .btn-group-vertical > .btn-group > .btn { display: block; float: none; width: 100%; max-width: 100%; } .btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after { content: " "; display: table; } .btn-group-vertical > .btn-group:after { clear: both; } .btn-group-vertical > .btn-group > .btn { float: none; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } .btn-group-vertical > .btn:not(:first-child):not(:last-child) { border-radius: 0; } .btn-group-vertical > .btn:first-child:not(:last-child) { border-top-right-radius: 4px; border-top-left-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:last-child:not(:first-child) { border-top-right-radius: 0; border-top-left-radius: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { border-radius: 0; } .btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, .btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { border-top-right-radius: 0; border-top-left-radius: 0; } .btn-group-justified { display: table; width: 100%; table-layout: fixed; border-collapse: separate; } .btn-group-justified > .btn, .btn-group-justified > .btn-group { float: none; display: table-cell; width: 1%; } .btn-group-justified > .btn-group .btn { width: 100%; } .btn-group-justified > .btn-group .dropdown-menu { left: auto; } [data-toggle="buttons"] > .btn input[type="radio"], [data-toggle="buttons"] > .btn input[type="checkbox"], [data-toggle="buttons"] > .btn-group > .btn input[type="radio"], [data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { position: absolute; clip: rect(0, 0, 0, 0); pointer-events: none; } .input-group { position: relative; display: table; border-collapse: separate; } .input-group[class*="col-"] { float: none; padding-left: 0; padding-right: 0; } .input-group .form-control { position: relative; z-index: 2; float: left; width: 100%; margin-bottom: 0; } .input-group .form-control:focus { z-index: 3; } .input-group-addon, .input-group-btn, .input-group .form-control { display: table-cell; } .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child), .input-group .form-control:not(:first-child):not(:last-child) { border-radius: 0; } .input-group-addon, .input-group-btn { width: 1%; white-space: nowrap; vertical-align: middle; } .input-group-addon { padding: 6px 12px; font-size: 14px; font-weight: normal; line-height: 1; color: #555555; text-align: center; background-color: #eeeeee; border: 1px solid #ccc; border-radius: 4px; } .input-group-addon.input-sm, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .input-group-addon.btn { padding: 5px 10px; font-size: 12px; border-radius: 3px; } .input-group-addon.input-lg, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .input-group-addon.btn { padding: 10px 16px; font-size: 18px; border-radius: 6px; } .input-group-addon input[type="radio"], .input-group-addon input[type="checkbox"] { margin-top: 0; } .input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { border-bottom-right-radius: 0; border-top-right-radius: 0; } .input-group-addon:first-child { border-right: 0; } .input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group > .btn, .input-group-btn:last-child > .dropdown-toggle, .input-group-btn:first-child > .btn:not(:first-child), .input-group-btn:first-child > .btn-group:not(:first-child) > .btn { border-bottom-left-radius: 0; border-top-left-radius: 0; } .input-group-addon:last-child { border-left: 0; } .input-group-btn { position: relative; font-size: 0; white-space: nowrap; } .input-group-btn > .btn { position: relative; } .input-group-btn > .btn + .btn { margin-left: -1px; } .input-group-btn > .btn:hover, .input-group-btn > .btn:focus, .input-group-btn > .btn:active { z-index: 2; } .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group { margin-right: -1px; } .input-group-btn:last-child > .btn, .input-group-btn:last-child > .btn-group { z-index: 2; margin-left: -1px; } .nav { margin-bottom: 0; padding-left: 0; list-style: none; } .nav:before, .nav:after { content: " "; display: table; } .nav:after { clear: both; } .nav > li { position: relative; display: block; } .nav > li > a { position: relative; display: block; padding: 10px 15px; } .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; background-color: #eeeeee; } .nav > li.disabled > a { color: #777777; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { color: #777777; text-decoration: none; background-color: transparent; cursor: not-allowed; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background-color: #eeeeee; border-color: #337ab7; } .nav .nav-divider { height: 1px; margin: 9px 0; overflow: hidden; background-color: #e5e5e5; } .nav > li > a > img { max-width: none; } .nav-tabs { border-bottom: 1px solid #ddd; } .nav-tabs > li { float: left; margin-bottom: -1px; } .nav-tabs > li > a { margin-right: 2px; line-height: 1.42857; border: 1px solid transparent; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #ddd; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #555555; background-color: #fff; border: 1px solid #ddd; border-bottom-color: transparent; cursor: default; } .nav-pills > li { float: left; } .nav-pills > li > a { border-radius: 4px; } .nav-pills > li + li { margin-left: 2px; } .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus { color: #fff; background-color: #337ab7; } .nav-stacked > li { float: none; } .nav-stacked > li + li { margin-top: 2px; margin-left: 0; } .nav-justified, .nav-tabs.nav-justified { width: 100%; } .nav-justified > li, .nav-tabs.nav-justified > li { float: none; } .nav-justified > li > a, .nav-tabs.nav-justified > li > a { text-align: center; margin-bottom: 5px; } .nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-justified > li, .nav-tabs.nav-justified > li { display: table-cell; width: 1%; } .nav-justified > li > a, .nav-tabs.nav-justified > li > a { margin-bottom: 0; } } .nav-tabs-justified, .nav-tabs.nav-justified { border-bottom: 0; } .nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs-justified > .active > a, .nav-tabs.nav-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:focus { border: 1px solid #ddd; } @media (min-width: 768px) { .nav-tabs-justified > li > a, .nav-tabs.nav-justified > li > a { border-bottom: 1px solid #ddd; border-radius: 4px 4px 0 0; } .nav-tabs-justified > .active > a, .nav-tabs.nav-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus, .nav-tabs.nav-justified > .active > a:focus { border-bottom-color: #fff; } } .tab-content > .tab-pane { display: none; } .tab-content > .active { display: block; } .nav-tabs .dropdown-menu { margin-top: -1px; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar { position: relative; min-height: 50px; margin-bottom: 20px; border: 1px solid transparent; } .navbar:before, .navbar:after { content: " "; display: table; } .navbar:after { clear: both; } @media (min-width: 768px) { .navbar { border-radius: 4px; } } .navbar-header:before, .navbar-header:after { content: " "; display: table; } .navbar-header:after { clear: both; } @media (min-width: 768px) { .navbar-header { float: left; } } .navbar-collapse { overflow-x: visible; padding-right: 15px; padding-left: 15px; border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); -webkit-overflow-scrolling: touch; } .navbar-collapse:before, .navbar-collapse:after { content: " "; display: table; } .navbar-collapse:after { clear: both; } .navbar-collapse.in { overflow-y: auto; } @media (min-width: 768px) { .navbar-collapse { width: auto; border-top: 0; box-shadow: none; } .navbar-collapse.collapse { display: block !important; height: auto !important; padding-bottom: 0; overflow: visible !important; } .navbar-collapse.in { overflow-y: visible; } .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { padding-left: 0; padding-right: 0; } } .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 340px; } @media (max-device-width: 480px) and (orientation: landscape) { .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 200px; } } .container > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-header, .container-fluid > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { .container > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-header, .container-fluid > .navbar-collapse { margin-right: 0; margin-left: 0; } } .navbar-static-top { z-index: 1000; border-width: 0 0 1px; } @media (min-width: 768px) { .navbar-static-top { border-radius: 0; } } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; } @media (min-width: 768px) { .navbar-fixed-top, .navbar-fixed-bottom { border-radius: 0; } } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-fixed-bottom { bottom: 0; margin-bottom: 0; border-width: 1px 0 0; } .navbar-brand { float: left; padding: 15px 15px; font-size: 18px; line-height: 20px; height: 50px; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } .navbar-brand > img { display: block; } @media (min-width: 768px) { .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { margin-left: -15px; } } .navbar-toggle { position: relative; float: right; margin-right: 15px; padding: 9px 10px; margin-top: 8px; margin-bottom: 8px; background-color: transparent; background-image: none; border: 1px solid transparent; border-radius: 4px; } .navbar-toggle:focus { outline: 0; } .navbar-toggle .icon-bar { display: block; width: 22px; height: 2px; border-radius: 1px; } .navbar-toggle .icon-bar + .icon-bar { margin-top: 4px; } @media (min-width: 768px) { .navbar-toggle { display: none; } } .navbar-nav { margin: 7.5px -15px; } .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; line-height: 20px; } @media (max-width: 767px) { .navbar-nav .open .dropdown-menu { position: static; float: none; width: auto; margin-top: 0; background-color: transparent; border: 0; box-shadow: none; } .navbar-nav .open .dropdown-menu > li > a, .navbar-nav .open .dropdown-menu .dropdown-header { padding: 5px 15px 5px 25px; } .navbar-nav .open .dropdown-menu > li > a { line-height: 20px; } .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-nav .open .dropdown-menu > li > a:focus { background-image: none; } } @media (min-width: 768px) { .navbar-nav { float: left; margin: 0; } .navbar-nav > li { float: left; } .navbar-nav > li > a { padding-top: 15px; padding-bottom: 15px; } } .navbar-form { margin-left: -15px; margin-right: -15px; padding: 10px 15px; border-top: 1px solid transparent; border-bottom: 1px solid transparent; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); margin-top: 8px; margin-bottom: 8px; } @media (min-width: 768px) { .navbar-form .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .navbar-form .form-control { display: inline-block; width: auto; vertical-align: middle; } .navbar-form .form-control-static { display: inline-block; } .navbar-form .input-group { display: inline-table; vertical-align: middle; } .navbar-form .input-group .input-group-addon, .navbar-form .input-group .input-group-btn, .navbar-form .input-group .form-control { width: auto; } .navbar-form .input-group > .form-control { width: 100%; } .navbar-form .control-label { margin-bottom: 0; vertical-align: middle; } .navbar-form .radio, .navbar-form .checkbox { display: inline-block; margin-top: 0; margin-bottom: 0; vertical-align: middle; } .navbar-form .radio label, .navbar-form .checkbox label { padding-left: 0; } .navbar-form .radio input[type="radio"], .navbar-form .checkbox input[type="checkbox"] { position: relative; margin-left: 0; } .navbar-form .has-feedback .form-control-feedback { top: 0; } } @media (max-width: 767px) { .navbar-form .form-group { margin-bottom: 5px; } .navbar-form .form-group:last-child { margin-bottom: 0; } } @media (min-width: 768px) { .navbar-form { width: auto; border: 0; margin-left: 0; margin-right: 0; padding-top: 0; padding-bottom: 0; -webkit-box-shadow: none; box-shadow: none; } } .navbar-nav > li > .dropdown-menu { margin-top: 0; border-top-right-radius: 0; border-top-left-radius: 0; } .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { margin-bottom: 0; border-top-right-radius: 4px; border-top-left-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .navbar-btn { margin-top: 8px; margin-bottom: 8px; } .navbar-btn.btn-sm, .btn-group-sm > .navbar-btn.btn { margin-top: 10px; margin-bottom: 10px; } .navbar-btn.btn-xs, .btn-group-xs > .navbar-btn.btn { margin-top: 14px; margin-bottom: 14px; } .navbar-text { margin-top: 15px; margin-bottom: 15px; } @media (min-width: 768px) { .navbar-text { float: left; margin-left: 15px; margin-right: 15px; } } @media (min-width: 768px) { .navbar-left { float: left !important; } .navbar-right { float: right !important; margin-right: -15px; } .navbar-right ~ .navbar-right { margin-right: 0; } } .navbar-default { background-color: #f8f8f8; border-color: #e7e7e7; } .navbar-default .navbar-brand { color: #777; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #5e5e5e; background-color: transparent; } .navbar-default .navbar-text { color: #777; } .navbar-default .navbar-nav > li > a { color: #777; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #333; background-color: transparent; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color: #555; background-color: #e7e7e7; } .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #ccc; background-color: transparent; } .navbar-default .navbar-toggle { border-color: #ddd; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: #ddd; } .navbar-default .navbar-toggle .icon-bar { background-color: #888; } .navbar-default .navbar-collapse, .navbar-default .navbar-form { border-color: #e7e7e7; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { background-color: #e7e7e7; color: #555; } @media (max-width: 767px) { .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #777; } .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #333; background-color: transparent; } .navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { color: #555; background-color: #e7e7e7; } .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #ccc; background-color: transparent; } } .navbar-default .navbar-link { color: #777; } .navbar-default .navbar-link:hover { color: #333; } .navbar-default .btn-link { color: #777; } .navbar-default .btn-link:hover, .navbar-default .btn-link:focus { color: #333; } .navbar-default .btn-link[disabled]:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:hover, fieldset[disabled] .navbar-default .btn-link:focus { color: #ccc; } .navbar-inverse { background-color: #222; border-color: #090909; } .navbar-inverse .navbar-brand { color: #9d9d9d; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-text { color: #9d9d9d; } .navbar-inverse .navbar-nav > li > a { color: #9d9d9d; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #fff; background-color: #090909; } .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { color: #444; background-color: transparent; } .navbar-inverse .navbar-toggle { border-color: #333; } .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { background-color: #333; } .navbar-inverse .navbar-toggle .icon-bar { background-color: #fff; } .navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { border-color: #101010; } .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus { background-color: #090909; color: #fff; } @media (max-width: 767px) { .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { border-color: #090909; } .navbar-inverse .navbar-nav .open .dropdown-menu .divider { background-color: #090909; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #9d9d9d; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { color: #fff; background-color: transparent; } .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { color: #fff; background-color: #090909; } .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #444; background-color: transparent; } } .navbar-inverse .navbar-link { color: #9d9d9d; } .navbar-inverse .navbar-link:hover { color: #fff; } .navbar-inverse .btn-link { color: #9d9d9d; } .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus { color: #fff; } .navbar-inverse .btn-link[disabled]:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:hover, fieldset[disabled] .navbar-inverse .btn-link:focus { color: #444; } .breadcrumb { padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #f5f5f5; border-radius: 4px; } .breadcrumb > li { display: inline-block; } .breadcrumb > li + li:before { content: "/ "; padding: 0 5px; color: #ccc; } .breadcrumb > .active { color: #777777; } .pagination { display: inline-block; padding-left: 0; margin: 20px 0; border-radius: 4px; } .pagination > li { display: inline; } .pagination > li > a, .pagination > li > span { position: relative; float: left; padding: 6px 12px; line-height: 1.42857; text-decoration: none; color: #337ab7; background-color: #fff; border: 1px solid #ddd; margin-left: -1px; } .pagination > li:first-child > a, .pagination > li:first-child > span { margin-left: 0; border-bottom-left-radius: 4px; border-top-left-radius: 4px; } .pagination > li:last-child > a, .pagination > li:last-child > span { border-bottom-right-radius: 4px; border-top-right-radius: 4px; } .pagination > li > a:hover, .pagination > li > a:focus, .pagination > li > span:hover, .pagination > li > span:focus { z-index: 2; color: #23527c; background-color: #eeeeee; border-color: #ddd; } .pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus { z-index: 3; color: #fff; background-color: #337ab7; border-color: #337ab7; cursor: default; } .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #777777; background-color: #fff; border-color: #ddd; cursor: not-allowed; } .pagination-lg > li > a, .pagination-lg > li > span { padding: 10px 16px; font-size: 18px; line-height: 1.33333; } .pagination-lg > li:first-child > a, .pagination-lg > li:first-child > span { border-bottom-left-radius: 6px; border-top-left-radius: 6px; } .pagination-lg > li:last-child > a, .pagination-lg > li:last-child > span { border-bottom-right-radius: 6px; border-top-right-radius: 6px; } .pagination-sm > li > a, .pagination-sm > li > span { padding: 5px 10px; font-size: 12px; line-height: 1.5; } .pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span { border-bottom-left-radius: 3px; border-top-left-radius: 3px; } .pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span { border-bottom-right-radius: 3px; border-top-right-radius: 3px; } .pager { padding-left: 0; margin: 20px 0; list-style: none; text-align: center; } .pager:before, .pager:after { content: " "; display: table; } .pager:after { clear: both; } .pager li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #fff; border: 1px solid #ddd; border-radius: 15px; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #eeeeee; } .pager .next > a, .pager .next > span { float: right; } .pager .previous > a, .pager .previous > span { float: left; } .pager .disabled > a, .pager .disabled > a:hover, .pager .disabled > a:focus, .pager .disabled > span { color: #777777; background-color: #fff; cursor: not-allowed; } .label { display: inline; padding: .2em .6em .3em; font-size: 75%; font-weight: bold; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; } .label:empty { display: none; } .btn .label { position: relative; top: -1px; } a.label:hover, a.label:focus { color: #fff; text-decoration: none; cursor: pointer; } .label-default { background-color: #777777; } .label-default[href]:hover, .label-default[href]:focus { background-color: #5e5e5e; } .label-primary { background-color: #337ab7; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #286090; } .label-success { background-color: #5cb85c; } .label-success[href]:hover, .label-success[href]:focus { background-color: #449d44; } .label-info { background-color: #5bc0de; } .label-info[href]:hover, .label-info[href]:focus { background-color: #31b0d5; } .label-warning { background-color: #f0ad4e; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #ec971f; } .label-danger { background-color: #d9534f; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #c9302c; } .badge { display: inline-block; min-width: 10px; padding: 3px 7px; font-size: 12px; font-weight: bold; color: #fff; line-height: 1; vertical-align: middle; white-space: nowrap; text-align: center; background-color: #777777; border-radius: 10px; } .badge:empty { display: none; } .btn .badge { position: relative; top: -1px; } .btn-xs .badge, .btn-group-xs > .btn .badge, .btn-group-xs > .btn .badge { top: 0; padding: 1px 5px; } .list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #337ab7; background-color: #fff; } .list-group-item > .badge { float: right; } .list-group-item > .badge + .badge { margin-right: 5px; } .nav-pills > li > a > .badge { margin-left: 3px; } a.badge:hover, a.badge:focus { color: #fff; text-decoration: none; cursor: pointer; } .jumbotron { padding-top: 30px; padding-bottom: 30px; margin-bottom: 30px; color: inherit; background-color: #eeeeee; } .jumbotron h1, .jumbotron .h1 { color: inherit; } .jumbotron p { margin-bottom: 15px; font-size: 21px; font-weight: 200; } .jumbotron > hr { border-top-color: #d5d5d5; } .container .jumbotron, .container-fluid .jumbotron { border-radius: 6px; padding-left: 15px; padding-right: 15px; } .jumbotron .container { max-width: 100%; } @media screen and (min-width: 768px) { .jumbotron { padding-top: 48px; padding-bottom: 48px; } .container .jumbotron, .container-fluid .jumbotron { padding-left: 60px; padding-right: 60px; } .jumbotron h1, .jumbotron .h1 { font-size: 63px; } } .thumbnail { display: block; padding: 4px; margin-bottom: 20px; line-height: 1.42857; background-color: #fff; border: 1px solid #ddd; border-radius: 4px; -webkit-transition: border 0.2s ease-in-out; -o-transition: border 0.2s ease-in-out; transition: border 0.2s ease-in-out; } .thumbnail > img, .thumbnail a > img { display: block; max-width: 100%; height: auto; margin-left: auto; margin-right: auto; } .thumbnail .caption { padding: 9px; color: #333333; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { border-color: #337ab7; } .alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; } .alert h4 { margin-top: 0; color: inherit; } .alert .alert-link { font-weight: bold; } .alert > p, .alert > ul { margin-bottom: 0; } .alert > p + p { margin-top: 5px; } .alert-dismissable, .alert-dismissible { padding-right: 35px; } .alert-dismissable .close, .alert-dismissible .close { position: relative; top: -2px; right: -21px; color: inherit; } .alert-success { background-color: #dff0d8; border-color: #d6e9c6; color: #3c763d; } .alert-success hr { border-top-color: #c9e2b3; } .alert-success .alert-link { color: #2b542c; } .alert-info { background-color: #d9edf7; border-color: #bce8f1; color: #31708f; } .alert-info hr { border-top-color: #a6e1ec; } .alert-info .alert-link { color: #245269; } .alert-warning { background-color: #fcf8e3; border-color: #faebcc; color: #8a6d3b; } .alert-warning hr { border-top-color: #f7e1b5; } .alert-warning .alert-link { color: #66512c; } .alert-danger { background-color: #f2dede; border-color: #ebccd1; color: #a94442; } .alert-danger hr { border-top-color: #e4b9c0; } .alert-danger .alert-link { color: #843534; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { overflow: hidden; height: 20px; margin-bottom: 20px; background-color: #f5f5f5; border-radius: 4px; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); } .progress-bar { float: left; width: 0%; height: 100%; font-size: 12px; line-height: 20px; color: #fff; text-align: center; background-color: #337ab7; -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -webkit-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease; } .progress-striped .progress-bar, .progress-bar-striped { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-size: 40px 40px; } .progress.active .progress-bar, .progress-bar.active { -webkit-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-bar-success { background-color: #5cb85c; } .progress-striped .progress-bar-success { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-info { background-color: #5bc0de; } .progress-striped .progress-bar-info { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-warning { background-color: #f0ad4e; } .progress-striped .progress-bar-warning { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .progress-bar-danger { background-color: #d9534f; } .progress-striped .progress-bar-danger { background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); } .media { margin-top: 15px; } .media:first-child { margin-top: 0; } .media, .media-body { zoom: 1; overflow: hidden; } .media-body { width: 10000px; } .media-object { display: block; } .media-object.img-thumbnail { max-width: none; } .media-right, .media > .pull-right { padding-left: 10px; } .media-left, .media > .pull-left { padding-right: 10px; } .media-left, .media-right, .media-body { display: table-cell; vertical-align: top; } .media-middle { vertical-align: middle; } .media-bottom { vertical-align: bottom; } .media-heading { margin-top: 0; margin-bottom: 5px; } .media-list { padding-left: 0; list-style: none; } .list-group { margin-bottom: 20px; padding-left: 0; } .list-group-item { position: relative; display: block; padding: 10px 15px; margin-bottom: -1px; background-color: #fff; border: 1px solid #ddd; } .list-group-item:first-child { border-top-right-radius: 4px; border-top-left-radius: 4px; } .list-group-item:last-child { margin-bottom: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } a.list-group-item, button.list-group-item { color: #555; } a.list-group-item .list-group-item-heading, button.list-group-item .list-group-item-heading { color: #333; } a.list-group-item:hover, a.list-group-item:focus, button.list-group-item:hover, button.list-group-item:focus { text-decoration: none; color: #555; background-color: #f5f5f5; } button.list-group-item { width: 100%; text-align: left; } .list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus { background-color: #eeeeee; color: #777777; cursor: not-allowed; } .list-group-item.disabled .list-group-item-heading, .list-group-item.disabled:hover .list-group-item-heading, .list-group-item.disabled:focus .list-group-item-heading { color: inherit; } .list-group-item.disabled .list-group-item-text, .list-group-item.disabled:hover .list-group-item-text, .list-group-item.disabled:focus .list-group-item-text { color: #777777; } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { z-index: 2; color: #fff; background-color: #337ab7; border-color: #337ab7; } .list-group-item.active .list-group-item-heading, .list-group-item.active .list-group-item-heading > small, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading > small, .list-group-item.active:focus .list-group-item-heading > .small { color: inherit; } .list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text { color: #c7ddef; } .list-group-item-success { color: #3c763d; background-color: #dff0d8; } a.list-group-item-success, button.list-group-item-success { color: #3c763d; } a.list-group-item-success .list-group-item-heading, button.list-group-item-success .list-group-item-heading { color: inherit; } a.list-group-item-success:hover, a.list-group-item-success:focus, button.list-group-item-success:hover, button.list-group-item-success:focus { color: #3c763d; background-color: #d0e9c6; } a.list-group-item-success.active, a.list-group-item-success.active:hover, a.list-group-item-success.active:focus, button.list-group-item-success.active, button.list-group-item-success.active:hover, button.list-group-item-success.active:focus { color: #fff; background-color: #3c763d; border-color: #3c763d; } .list-group-item-info { color: #31708f; background-color: #d9edf7; } a.list-group-item-info, button.list-group-item-info { color: #31708f; } a.list-group-item-info .list-group-item-heading, button.list-group-item-info .list-group-item-heading { color: inherit; } a.list-group-item-info:hover, a.list-group-item-info:focus, button.list-group-item-info:hover, button.list-group-item-info:focus { color: #31708f; background-color: #c4e3f3; } a.list-group-item-info.active, a.list-group-item-info.active:hover, a.list-group-item-info.active:focus, button.list-group-item-info.active, button.list-group-item-info.active:hover, button.list-group-item-info.active:focus { color: #fff; background-color: #31708f; border-color: #31708f; } .list-group-item-warning { color: #8a6d3b; background-color: #fcf8e3; } a.list-group-item-warning, button.list-group-item-warning { color: #8a6d3b; } a.list-group-item-warning .list-group-item-heading, button.list-group-item-warning .list-group-item-heading { color: inherit; } a.list-group-item-warning:hover, a.list-group-item-warning:focus, button.list-group-item-warning:hover, button.list-group-item-warning:focus { color: #8a6d3b; background-color: #faf2cc; } a.list-group-item-warning.active, a.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus, button.list-group-item-warning.active, button.list-group-item-warning.active:hover, button.list-group-item-warning.active:focus { color: #fff; background-color: #8a6d3b; border-color: #8a6d3b; } .list-group-item-danger { color: #a94442; background-color: #f2dede; } a.list-group-item-danger, button.list-group-item-danger { color: #a94442; } a.list-group-item-danger .list-group-item-heading, button.list-group-item-danger .list-group-item-heading { color: inherit; } a.list-group-item-danger:hover, a.list-group-item-danger:focus, button.list-group-item-danger:hover, button.list-group-item-danger:focus { color: #a94442; background-color: #ebcccc; } a.list-group-item-danger.active, a.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus, button.list-group-item-danger.active, button.list-group-item-danger.active:hover, button.list-group-item-danger.active:focus { color: #fff; background-color: #a94442; border-color: #a94442; } .list-group-item-heading { margin-top: 0; margin-bottom: 5px; } .list-group-item-text { margin-bottom: 0; line-height: 1.3; } .panel { margin-bottom: 20px; background-color: #fff; border: 1px solid transparent; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); } .panel-body { padding: 15px; } .panel-body:before, .panel-body:after { content: " "; display: table; } .panel-body:after { clear: both; } .panel-heading { padding: 10px 15px; border-bottom: 1px solid transparent; border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel-heading > .dropdown .dropdown-toggle { color: inherit; } .panel-title { margin-top: 0; margin-bottom: 0; font-size: 16px; color: inherit; } .panel-title > a, .panel-title > small, .panel-title > .small, .panel-title > small > a, .panel-title > .small > a { color: inherit; } .panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #ddd; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .list-group, .panel > .panel-collapse > .list-group { margin-bottom: 0; } .panel > .list-group .list-group-item, .panel > .panel-collapse > .list-group .list-group-item { border-width: 1px 0; border-radius: 0; } .panel > .list-group:first-child .list-group-item:first-child, .panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { border-top: 0; border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel > .list-group:last-child .list-group-item:last-child, .panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { border-bottom: 0; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .panel-heading + .panel-collapse > .list-group .list-group-item:first-child { border-top-right-radius: 0; border-top-left-radius: 0; } .panel-heading + .list-group .list-group-item:first-child { border-top-width: 0; } .list-group + .panel-footer { border-top-width: 0; } .panel > .table, .panel > .table-responsive > .table, .panel > .panel-collapse > .table { margin-bottom: 0; } .panel > .table caption, .panel > .table-responsive > .table caption, .panel > .panel-collapse > .table caption { padding-left: 15px; padding-right: 15px; } .panel > .table:first-child, .panel > .table-responsive:first-child > .table:first-child { border-top-right-radius: 3px; border-top-left-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { border-top-left-radius: 3px; border-top-right-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { border-top-left-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { border-top-right-radius: 3px; } .panel > .table:last-child, .panel > .table-responsive:last-child > .table:last-child { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { border-bottom-right-radius: 3px; } .panel > .panel-body + .table, .panel > .panel-body + .table-responsive, .panel > .table + .panel-body, .panel > .table-responsive + .panel-body { border-top: 1px solid #ddd; } .panel > .table > tbody:first-child > tr:first-child th, .panel > .table > tbody:first-child > tr:first-child td { border-top: 0; } .panel > .table-bordered, .panel > .table-responsive > .table-bordered { border: 0; } .panel > .table-bordered > thead > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .panel > .table-bordered > thead > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { border-bottom: 0; } .panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { border-bottom: 0; } .panel > .table-responsive { border: 0; margin-bottom: 0; } .panel-group { margin-bottom: 20px; } .panel-group .panel { margin-bottom: 0; border-radius: 4px; } .panel-group .panel + .panel { margin-top: 5px; } .panel-group .panel-heading { border-bottom: 0; } .panel-group .panel-heading + .panel-collapse > .panel-body, .panel-group .panel-heading + .panel-collapse > .list-group { border-top: 1px solid #ddd; } .panel-group .panel-footer { border-top: 0; } .panel-group .panel-footer + .panel-collapse .panel-body { border-bottom: 1px solid #ddd; } .panel-default { border-color: #ddd; } .panel-default > .panel-heading { color: #333333; background-color: #f5f5f5; border-color: #ddd; } .panel-default > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ddd; } .panel-default > .panel-heading .badge { color: #f5f5f5; background-color: #333333; } .panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ddd; } .panel-primary { border-color: #337ab7; } .panel-primary > .panel-heading { color: #fff; background-color: #337ab7; border-color: #337ab7; } .panel-primary > .panel-heading + .panel-collapse > .panel-body { border-top-color: #337ab7; } .panel-primary > .panel-heading .badge { color: #337ab7; background-color: #fff; } .panel-primary > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #337ab7; } .panel-success { border-color: #d6e9c6; } .panel-success > .panel-heading { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; } .panel-success > .panel-heading + .panel-collapse > .panel-body { border-top-color: #d6e9c6; } .panel-success > .panel-heading .badge { color: #dff0d8; background-color: #3c763d; } .panel-success > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #d6e9c6; } .panel-info { border-color: #bce8f1; } .panel-info > .panel-heading { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; } .panel-info > .panel-heading + .panel-collapse > .panel-body { border-top-color: #bce8f1; } .panel-info > .panel-heading .badge { color: #d9edf7; background-color: #31708f; } .panel-info > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #bce8f1; } .panel-warning { border-color: #faebcc; } .panel-warning > .panel-heading { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; } .panel-warning > .panel-heading + .panel-collapse > .panel-body { border-top-color: #faebcc; } .panel-warning > .panel-heading .badge { color: #fcf8e3; background-color: #8a6d3b; } .panel-warning > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #faebcc; } .panel-danger { border-color: #ebccd1; } .panel-danger > .panel-heading { color: #a94442; background-color: #f2dede; border-color: #ebccd1; } .panel-danger > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ebccd1; } .panel-danger > .panel-heading .badge { color: #f2dede; background-color: #a94442; } .panel-danger > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ebccd1; } .embed-responsive { position: relative; display: block; height: 0; padding: 0; overflow: hidden; } .embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object, .embed-responsive video { position: absolute; top: 0; left: 0; bottom: 0; height: 100%; width: 100%; border: 0; } .embed-responsive-16by9 { padding-bottom: 56.25%; } .embed-responsive-4by3 { padding-bottom: 75%; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } .well blockquote { border-color: #ddd; border-color: rgba(0, 0, 0, 0.15); } .well-lg { padding: 24px; border-radius: 6px; } .well-sm { padding: 9px; border-radius: 3px; } .close { float: right; font-size: 21px; font-weight: bold; line-height: 1; color: #000; text-shadow: 0 1px 0 #fff; opacity: 0.2; filter: alpha(opacity=20); } .close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; opacity: 0.5; filter: alpha(opacity=50); } button.close { padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; } .modal-open { overflow: hidden; } .modal { display: none; overflow: hidden; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; -webkit-overflow-scrolling: touch; outline: 0; } .modal.fade .modal-dialog { -webkit-transform: translate(0, -25%); -ms-transform: translate(0, -25%); -o-transform: translate(0, -25%); transform: translate(0, -25%); -webkit-transition: -webkit-transform 0.3s ease-out; -moz-transition: -moz-transform 0.3s ease-out; -o-transition: -o-transform 0.3s ease-out; transition: transform 0.3s ease-out; } .modal.in .modal-dialog { -webkit-transform: translate(0, 0); -ms-transform: translate(0, 0); -o-transform: translate(0, 0); transform: translate(0, 0); } .modal-open .modal { overflow-x: hidden; overflow-y: auto; } .modal-dialog { position: relative; width: auto; margin: 10px; } .modal-content { position: relative; background-color: #fff; border: 1px solid #999; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); background-clip: padding-box; outline: 0; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000; } .modal-backdrop.fade { opacity: 0; filter: alpha(opacity=0); } .modal-backdrop.in { opacity: 0.5; filter: alpha(opacity=50); } .modal-header { padding: 15px; border-bottom: 1px solid #e5e5e5; } .modal-header:before, .modal-header:after { content: " "; display: table; } .modal-header:after { clear: both; } .modal-header .close { margin-top: -2px; } .modal-title { margin: 0; line-height: 1.42857; } .modal-body { position: relative; padding: 15px; } .modal-footer { padding: 15px; text-align: right; border-top: 1px solid #e5e5e5; } .modal-footer:before, .modal-footer:after { content: " "; display: table; } .modal-footer:after { clear: both; } .modal-footer .btn + .btn { margin-left: 5px; margin-bottom: 0; } .modal-footer .btn-group .btn + .btn { margin-left: -1px; } .modal-footer .btn-block + .btn-block { margin-left: 0; } .modal-scrollbar-measure { position: absolute; top: -9999px; width: 50px; height: 50px; overflow: scroll; } @media (min-width: 768px) { .modal-dialog { width: 600px; margin: 30px auto; } .modal-content { -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); } .modal-sm { width: 300px; } } @media (min-width: 992px) { .modal-lg { width: 900px; } } .tooltip { position: absolute; z-index: 1070; display: block; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: normal; font-weight: normal; letter-spacing: normal; line-break: auto; line-height: 1.42857; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; white-space: normal; word-break: normal; word-spacing: normal; word-wrap: normal; font-size: 12px; opacity: 0; filter: alpha(opacity=0); } .tooltip.in { opacity: 0.9; filter: alpha(opacity=90); } .tooltip.top { margin-top: -3px; padding: 5px 0; } .tooltip.right { margin-left: 3px; padding: 0 5px; } .tooltip.bottom { margin-top: 3px; padding: 5px 0; } .tooltip.left { margin-left: -3px; padding: 0 5px; } .tooltip-inner { max-width: 200px; padding: 3px 8px; color: #fff; text-align: center; background-color: #000; border-radius: 4px; } .tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.top-left .tooltip-arrow { bottom: 0; right: 5px; margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.top-right .tooltip-arrow { bottom: 0; left: 5px; margin-bottom: -5px; border-width: 5px 5px 0; border-top-color: #000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .tooltip.bottom-left .tooltip-arrow { top: 0; right: 5px; margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .tooltip.bottom-right .tooltip-arrow { top: 0; left: 5px; margin-top: -5px; border-width: 0 5px 5px; border-bottom-color: #000; } .popover { position: absolute; top: 0; left: 0; z-index: 1060; display: none; max-width: 276px; padding: 1px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-style: normal; font-weight: normal; letter-spacing: normal; line-break: auto; line-height: 1.42857; text-align: left; text-align: start; text-decoration: none; text-shadow: none; text-transform: none; white-space: normal; word-break: normal; word-spacing: normal; word-wrap: normal; font-size: 14px; background-color: #fff; background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); } .popover.top { margin-top: -10px; } .popover.right { margin-left: 10px; } .popover.bottom { margin-top: 10px; } .popover.left { margin-left: -10px; } .popover-title { margin: 0; padding: 8px 14px; font-size: 14px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-radius: 5px 5px 0 0; } .popover-content { padding: 9px 14px; } .popover > .arrow, .popover > .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; } .popover > .arrow { border-width: 11px; } .popover > .arrow:after { border-width: 10px; content: ""; } .popover.top > .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; border-top-color: #999999; border-top-color: rgba(0, 0, 0, 0.25); bottom: -11px; } .popover.top > .arrow:after { content: " "; bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: #fff; } .popover.right > .arrow { top: 50%; left: -11px; margin-top: -11px; border-left-width: 0; border-right-color: #999999; border-right-color: rgba(0, 0, 0, 0.25); } .popover.right > .arrow:after { content: " "; left: 1px; bottom: -10px; border-left-width: 0; border-right-color: #fff; } .popover.bottom > .arrow { left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #999999; border-bottom-color: rgba(0, 0, 0, 0.25); top: -11px; } .popover.bottom > .arrow:after { content: " "; top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: #fff; } .popover.left > .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #999999; border-left-color: rgba(0, 0, 0, 0.25); } .popover.left > .arrow:after { content: " "; right: 1px; border-right-width: 0; border-left-color: #fff; bottom: -10px; } .carousel { position: relative; } .carousel-inner { position: relative; overflow: hidden; width: 100%; } .carousel-inner > .item { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; max-width: 100%; height: auto; line-height: 1; } @media all and (transform-3d), (-webkit-transform-3d) { .carousel-inner > .item { -webkit-transition: -webkit-transform 0.6s ease-in-out; -moz-transition: -moz-transform 0.6s ease-in-out; -o-transition: -o-transform 0.6s ease-in-out; transition: transform 0.6s ease-in-out; -webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden; -webkit-perspective: 1000px; -moz-perspective: 1000px; perspective: 1000px; } .carousel-inner > .item.next, .carousel-inner > .item.active.right { -webkit-transform: translate3d(100%, 0, 0); transform: translate3d(100%, 0, 0); left: 0; } .carousel-inner > .item.prev, .carousel-inner > .item.active.left { -webkit-transform: translate3d(-100%, 0, 0); transform: translate3d(-100%, 0, 0); left: 0; } .carousel-inner > .item.next.left, .carousel-inner > .item.prev.right, .carousel-inner > .item.active { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); left: 0; } } .carousel-inner > .active, .carousel-inner > .next, .carousel-inner > .prev { display: block; } .carousel-inner > .active { left: 0; } .carousel-inner > .next, .carousel-inner > .prev { position: absolute; top: 0; width: 100%; } .carousel-inner > .next { left: 100%; } .carousel-inner > .prev { left: -100%; } .carousel-inner > .next.left, .carousel-inner > .prev.right { left: 0; } .carousel-inner > .active.left { left: -100%; } .carousel-inner > .active.right { left: 100%; } .carousel-control { position: absolute; top: 0; left: 0; bottom: 0; width: 15%; opacity: 0.5; filter: alpha(opacity=50); font-size: 20px; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); background-color: rgba(0, 0, 0, 0); } .carousel-control.left { background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); } .carousel-control.right { left: auto; right: 0; background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); } .carousel-control:hover, .carousel-control:focus { outline: 0; color: #fff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); } .carousel-control .icon-prev, .carousel-control .icon-next, .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right { position: absolute; top: 50%; margin-top: -10px; z-index: 5; display: inline-block; } .carousel-control .icon-prev, .carousel-control .glyphicon-chevron-left { left: 50%; margin-left: -10px; } .carousel-control .icon-next, .carousel-control .glyphicon-chevron-right { right: 50%; margin-right: -10px; } .carousel-control .icon-prev, .carousel-control .icon-next { width: 20px; height: 20px; line-height: 1; font-family: serif; } .carousel-control .icon-prev:before { content: '\2039'; } .carousel-control .icon-next:before { content: '\203a'; } .carousel-indicators { position: absolute; bottom: 10px; left: 50%; z-index: 15; width: 60%; margin-left: -30%; padding-left: 0; list-style: none; text-align: center; } .carousel-indicators li { display: inline-block; width: 10px; height: 10px; margin: 1px; text-indent: -999px; border: 1px solid #fff; border-radius: 10px; cursor: pointer; background-color: #000 \9; background-color: rgba(0, 0, 0, 0); } .carousel-indicators .active { margin: 0; width: 12px; height: 12px; background-color: #fff; } .carousel-caption { position: absolute; left: 15%; right: 15%; bottom: 20px; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #fff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } .carousel-caption .btn { text-shadow: none; } @media screen and (min-width: 768px) { .carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next { width: 30px; height: 30px; margin-top: -10px; font-size: 30px; } .carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev { margin-left: -10px; } .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next { margin-right: -10px; } .carousel-caption { left: 20%; right: 20%; padding-bottom: 30px; } .carousel-indicators { bottom: 20px; } } .clearfix:before, .clearfix:after { content: " "; display: table; } .clearfix:after { clear: both; } .center-block { display: block; margin-left: auto; margin-right: auto; } .pull-right { float: right !important; } .pull-left { float: left !important; } .hide { display: none !important; } .show { display: block !important; } .invisible { visibility: hidden; } .text-hide { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .hidden { display: none !important; } .affix { position: fixed; } @-ms-viewport { width: device-width; } .visible-xs { display: none !important; } .visible-sm { display: none !important; } .visible-md { display: none !important; } .visible-lg { display: none !important; } .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-lg-block, .visible-lg-inline, .visible-lg-inline-block { display: none !important; } @media (max-width: 767px) { .visible-xs { display: block !important; } table.visible-xs { display: table !important; } tr.visible-xs { display: table-row !important; } th.visible-xs, td.visible-xs { display: table-cell !important; } } @media (max-width: 767px) { .visible-xs-block { display: block !important; } } @media (max-width: 767px) { .visible-xs-inline { display: inline !important; } } @media (max-width: 767px) { .visible-xs-inline-block { display: inline-block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm { display: block !important; } table.visible-sm { display: table !important; } tr.visible-sm { display: table-row !important; } th.visible-sm, td.visible-sm { display: table-cell !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-block { display: block !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline { display: inline !important; } } @media (min-width: 768px) and (max-width: 991px) { .visible-sm-inline-block { display: inline-block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md { display: block !important; } table.visible-md { display: table !important; } tr.visible-md { display: table-row !important; } th.visible-md, td.visible-md { display: table-cell !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-block { display: block !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline { display: inline !important; } } @media (min-width: 992px) and (max-width: 1199px) { .visible-md-inline-block { display: inline-block !important; } } @media (min-width: 1200px) { .visible-lg { display: block !important; } table.visible-lg { display: table !important; } tr.visible-lg { display: table-row !important; } th.visible-lg, td.visible-lg { display: table-cell !important; } } @media (min-width: 1200px) { .visible-lg-block { display: block !important; } } @media (min-width: 1200px) { .visible-lg-inline { display: inline !important; } } @media (min-width: 1200px) { .visible-lg-inline-block { display: inline-block !important; } } @media (max-width: 767px) { .hidden-xs { display: none !important; } } @media (min-width: 768px) and (max-width: 991px) { .hidden-sm { display: none !important; } } @media (min-width: 992px) and (max-width: 1199px) { .hidden-md { display: none !important; } } @media (min-width: 1200px) { .hidden-lg { display: none !important; } } .visible-print { display: none !important; } @media print { .visible-print { display: block !important; } table.visible-print { display: table !important; } tr.visible-print { display: table-row !important; } th.visible-print, td.visible-print { display: table-cell !important; } } .visible-print-block { display: none !important; } @media print { .visible-print-block { display: block !important; } } .visible-print-inline { display: none !important; } @media print { .visible-print-inline { display: inline !important; } } .visible-print-inline-block { display: none !important; } @media print { .visible-print-inline-block { display: inline-block !important; } } @media print { .hidden-print { display: none !important; } } \ No newline at end of file diff --git a/code/views/css/style.css b/code/views/css/style.css new file mode 100644 index 0000000..9a49aff --- /dev/null +++ b/code/views/css/style.css @@ -0,0 +1,31725 @@ +@charset "UTF-8"; +/* +* +* Trunk version 1.2.2 +* +*/ +/** +* Template Style +* +* [Table of contents] +* 1. Custom styles +* 1.1 Main Styles +* 1.2 Typography +* 1.3 Backgrounds +* 1.4 Colors +* 1.5 Main layout +* +* 2. Components +* 2.1 Icons +* 2.2 Buttons +* 2.3 Forms +* 2.4 Tables +* 2.5 Lists +* 2.6 Post +* 2.7 Thumbnail +* 2.8 Tooltip +* 2.9 Snackbars +* 2.10 Navigation +* 2.11 Preloader +* 2.12 Breadcrumbs +* 2.13 Panel custom +* 2.14 Pagination custom +* +* 3. Helpers +* 3.1 Text-alignment +* 3.2 Text-styling +* 3.3 Visibility responsive +* 3.4 Groups +* 3.5 Context Styling +* 3.6 Sections +* 3.7 Offsets +* +* 4. Modules +* 4.1 Flex grid +* 4.2 Unit-responsive +* +* 5 Plugins +* 5.1 Animate +* 5.2 Isotope +* 5.3 Owl Carousel +* 5.4 RD Navbar +* 5.5 RD Parallax +* 5.6 RD Google-Map +* 5.7 RD Search +* 5.8 To top +* 5.9 Tabs +* 5.10 Photoswipe +* 5.11 Progress-bars +* 5.12 Counter +* 5.13 jquery-circle-progress +* 5.14 Timecircles +* 5.15 Swiper +* +* 6. Fonts +* 6.1 FontAwesome +* 6.2 MDI +**/ +/* +* +* Main Styles +* ================================================== +*/ +html *:first-child { + margin-top: 0; +} + +html *:last-child { + margin-bottom: 0; +} + +body { + font-family: "Lato", Helvetica, Arial, sans-serif; + font-size: 14px; + font-weight: 400; + line-height: 1.71429; + color: #9b9b9b; + background-color: #fff; +} + +mark { + background: #8f859e; + color: #fff; + padding: 2px 4px; +} + +a { + color: #8f859e; + text-decoration: none; + transition: all 250ms ease-in; +} + +a:hover, a:focus { + color: #695f77; + text-decoration: none; + outline: none; +} + +a[href*='callto'], a[href*='mailto'] { + white-space: nowrap; +} + +a.hover, a.active { + color: #695f77; +} + +.link-gray, .link-gray:active, .link-gray:focus { + color: #9b9b9b; +} + +.link-gray:hover { + color: #8f859e; +} + +.link-gray-dark, .link-gray-dark:active, .link-gray-dark:focus { + color: #363d41; +} + +.link-gray-dark:hover { + color: #8f859e; +} + +.link-gray-darker, .link-gray-darker:active, .link-gray-darker:focus { + color: #151515; +} + +.link-gray-darker:hover { + color: #8f859e; +} + +.link-hover { + color: #695f77; +} + +.link-press { + color: #695f77; +} + +.link-underline { + text-decoration: underline; +} + +.site-map-link { + color: #151515; +} + +.site-map-link:before { + padding-right: 17px; + color: #151515; + font-size: 15px; +} + +.heading-link { + font-size: 18px; + font-family: "Poppins", Helvetica, Arial, sans-serif; +} + +.p a:hover, +.list a:hover { + text-decoration: underline; +} + +.p a.site-map-link, +.list a.site-map-link { + text-decoration: none; +} + +.overflow-hidden { + overflow: hidden; +} + +p { + margin-bottom: 0; +} + +img { + display: inline-block; + max-width: 100%; + height: auto; +} + +.img-rounded { + border-radius: 4px; +} + +/* +* +* Typography +* ================================================== +*/ +h1, h2, h3, h4, h5, h6, .heading-1, .heading-2, .heading-3, .heading-4, .heading-5, .heading-6 { + margin-top: 0; + margin-bottom: 0; + font-family: "Poppins", Helvetica, Arial, sans-serif; + font-weight: 700; + letter-spacing: 0; + color: #151515; +} + +h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, .heading-1 a, .heading-2 a, .heading-3 a, .heading-4 a, .heading-5 a, .heading-6 a { + transition: .3s all ease; +} + +h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover, .heading-1 a:hover, .heading-2 a:hover, .heading-3 a:hover, .heading-4 a:hover, .heading-5 a:hover, .heading-6 a:hover { + color: #695f77; +} + +h1, +.heading-1 { + font-size: 48px; + line-height: 1.2; +} + +@media (min-width: 768px) { + h1, + .heading-1 { + line-height: 1.15789; + font-size: 95px; + } +} + +h2, +.heading-2 { + font-size: 32px; + line-height: 1.5; +} + +@media (min-width: 768px) { + h2, + .heading-2 { + line-height: 0.93333; + font-size: 60px; + } +} + +h3, +.heading-3 { + font-size: 28px; + line-height: 1.5; +} + +@media (min-width: 768px) { + h3, + .heading-3 { + line-height: 1; + font-size: 36px; + } +} + +h4, +.heading-4 { + font-size: 20px; + line-height: 1.5; +} + +@media (min-width: 768px) { + h4, + .heading-4 { + line-height: 1.25; + font-size: 24px; + } +} + +h5, +.heading-5 { + font-size: 18px; + line-height: 1.5; +} + +@media (min-width: 768px) { + h5, + .heading-5 { + line-height: 1.66667; + font-size: 18px; + } +} + +h6, +.heading-6 { + font-size: 17px; + line-height: 1.5; +} + +@media (min-width: 768px) { + h6, + .heading-6 { + line-height: 1.25; + font-size: 16px; + } +} + +.heading-variant-1 > span { + display: inline-block; +} + +.heading-variant-1 > span + * { + margin-top: 15px; +} + +* + .page .subtitle-group-variant-1 { + margin-top: 15px; +} + +@media (min-width: 1200px) { + .page .subtitle-group-variant-1 { + padding-top: 10px; + padding-bottom: 20px; + } +} + +.big { + font-size: 16px; +} + +small, +.small { + display: block; + font-size: 15px; +} + +hr { + margin-top: 0; + margin-bottom: 0; + border-top: 1px solid #ebebeb; +} + +.divider { + display: inline-block; + margin-bottom: 0; + border: none; + height: 1px; + width: 100%; + background-color: #8f859e; +} + +.divider-xs { + max-width: 45px; + height: 2px; +} + +.divider-xs-2 { + max-width: 85px; + height: 2px; +} + +.divider-sm { + max-width: 160px; +} + +.divider-left { + margin-left: 0; +} + +.divider-custom { + position: relative; + background-color: #ddd; +} + +.divider-custom:before { + position: absolute; + top: 0; + left: 0; + width: 45px; + border-top: 1px solid #8f859e; + content: ""; + display: inline-block; +} + +.divider-secondary { + background: #dcd1d5; +} + +.heading-subtitle-divider-wrap { + display: flex; + flex-direction: column; + align-items: center; +} + +* + .heading-subtitle-divider-wrap { + margin-top: 15px; +} + +.heading-subtitle-divider-wrap:before { + content: ""; + display: inline-block; + margin-bottom: 15px; + border-top: 4px solid #dcd1d5; + width: 125px; +} + +@media (min-width: 768px) { + .heading-subtitle-divider-wrap { + align-items: center; + flex-direction: row; + } + * + .heading-subtitle-divider-wrap { + margin-top: 25px; + } + .heading-subtitle-divider-wrap:before { + margin-bottom: 0; + margin-right: 15px; + } +} + +/* +* +* Backgrounds +* ================================================== +*/ +.bg-white { + background-color: #fff; +} + +.bg-white + .bg-white { + padding-top: 0; +} + +.bg-gray-dark { + background-color: #363d41; +} + +.bg-gray-dark + .bg-gray-dark { + padding-top: 0; +} + +.bg-gray-light { + background-color: #f2f3f8; +} + +.bg-gray-light + .bg-gray-light { + padding-top: 0; +} + +.bg-primary { + background-color: #8f859e; +} + +.bg-primary + .bg-primary { + padding-top: 0; +} + +.bg-gray-10 { + background-color: #6f6f6f; +} + +.bg-gray-10 + .bg-gray-10 { + padding-top: 0; +} + +.bg-gray-13 { + background-color: #323232; +} + +.bg-gray-13 + .bg-gray-13 { + padding-top: 0; +} + +.bg-gray-11 { + background-color: #3b3b3b; +} + +.bg-gray-11 + .bg-gray-11 { + padding-top: 0; +} + +.bg-secondary-3 { + background-color: #464646; +} + +.bg-secondary-3 + .bg-secondary-3 { + padding-top: 0; +} + +.bg-half-secondary-3 { + position: relative; +} + +.bg-half-secondary-3:before { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 70%; + content: ''; + background-color: #464646; + z-index: -1; +} + +.bg-half-secondary-3 p { + color: rgba(255, 255, 255, 0.5); +} + +.bg-secondary-3 + .bg-half-secondary-3 { + padding-top: 0; +} + +@media (min-width: 768px) { + .bg-half-secondary-3:before { + bottom: 60%; + } +} + +@media (min-width: 1200px) { + .bg-half-secondary-3:before { + bottom: 44%; + } +} + +.bg-secondary-4 { + background: #f3f3f3; +} + +.bg-soon { + background: url(../images/coming-soon.jpg) no-repeat 50%; +} + +.bg-image { + background-size: cover; + background-position: center top; +} + +@media (min-width: 992px) { + html.desktop .bg-fixed { + background-attachment: fixed; + } +} + +/* +* +* Colors +* ================================================== +*/ +.page .text-gray-base { + color: #000; +} + +.page a.text-gray-base:hover, +.page a.text-gray-base:focus { + color: #8f859e; +} + +.page .text-gray-darker { + color: #151515; +} + +.page a.text-gray-darker:hover, +.page a.text-gray-darker:focus { + color: #8f859e; +} + +.page .text-gray-dark { + color: #363d41; +} + +.page a.text-gray-dark:hover, +.page a.text-gray-dark:focus { + color: #8f859e; +} + +.page .text-gray { + color: #9b9b9b; +} + +.page a.text-gray:hover, +.page a.text-gray:focus { + color: #8f859e; +} + +.page .text-gray-light { + color: #f2f3f8; +} + +.page a.text-gray-light:hover, +.page a.text-gray-light:focus { + color: #8f859e; +} + +.page .text-gray-lighter { + color: #ebebeb; +} + +.page a.text-gray-lighter:hover, +.page a.text-gray-lighter:focus { + color: #8f859e; +} + +.page .text-primary { + color: #8f859e; +} + +.page a.text-primary:hover, +.page a.text-primary:focus { + color: #756a86; +} + +.page .text-secondary { + color: #dcd1d5; +} + +.page a.text-secondary:hover, +.page a.text-secondary:focus { + color: #c6b4bb; +} + +.page .text-white { + color: #fff; +} + +.page a.text-white:hover, +.page a.text-white:focus { + color: #e6e6e6; +} + +/* +* +* Main layout +* ================================================== +*/ +.element-mod { + color: #151515; +} + +.figure-default { + color: #9b9b9b; +} + +.figure-default figcaption { + margin-top: 10px; +} + +.subtitle { + font-size: 24px; +} + +.extra-large { + font-size: 90px; + line-height: 1.3; +} + +@media (min-width: 768px) { + .extra-large { + font-size: 140px; + } +} + +@media (min-width: 1200px) { + .extra-large { + font-size: 220px; + line-height: 1; + } +} + +.text-decoration-lines { + position: relative; + overflow: hidden; + width: 100%; +} + +.text-decoration-lines-content { + position: relative; + display: inline-block; + min-width: 170px; + font-size: 12px; + text-transform: uppercase; +} + +.text-decoration-lines-content:before, .text-decoration-lines-content:after { + content: ''; + position: absolute; + height: 1px; + background: #f5f5f5; + top: 50%; + width: 100vw; +} + +.text-decoration-lines-content:before { + left: 0; + transform: translate(-100%, -50%); +} + +.text-decoration-lines-content:after { + right: 0; + transform: translate(100%, -50%); +} + +* + .text-decoration-lines { + margin-top: 25px; +} + +.page { + position: relative; + overflow: hidden; + min-height: 100vh !important; +} + +.page-header { + padding: 0; + margin: 0; + border-bottom: none; +} + +.page-footer { + padding-bottom: 40px; +} + +@media (min-width: 1200px) { + .page-footer { + padding-bottom: 75px; + } +} + +.job-offer { + padding: 23px 27px 20px; + box-shadow: 0 2px 5px rgba(68, 73, 83, 0.12); + border-radius: 6px; + text-align: left; +} + +@media (min-width: 1200px) { + .job-offer { + padding: 37px 48px 44px; + } +} + +.job-offer .list-inline { + margin-left: -7px; + margin-right: -7px; +} + +.job-offer .list-inline li { + padding-left: 7px; + padding-right: 7px; +} + +.job-offer .list-inline li span + span { + margin-left: 5px; +} + +.job-offer-title { + font-size: 24px; + font-family: "Poppins", Helvetica, Arial, sans-serif; + font-weight: 500; + color: #151515; +} + +.job-offer-title:hover { + color: #8f859e; +} + +.page-img-wrap { + position: relative; + display: block; + height: 372px; + max-width: 368px; + margin-left: auto; + margin-right: auto; + overflow: hidden; + box-shadow: 0 11px 32px 0 rgba(107, 127, 142, 0.21); +} + +.page-img-wrap img { + position: absolute; + top: 0; + left: 0; + right: 0; + transition: 3s linear; +} + +.page-img-wrap-coming-soon { + display: block; + box-shadow: 0 11px 32px 0 rgba(107, 127, 142, 0.21); + max-width: 368px; + margin-left: auto; + margin-right: auto; + overflow: hidden; +} + +.page-img-wrap-coming-soon img { + position: relative; + left: 50%; + transform: translateX(-50%); + max-width: none; +} + +.page-img-wrap:hover img { + transform: translate3d(0, calc(-100% + 393px), 0); +} + +.ie-10 .page-img-wrap:hover img, +.ie-11 .page-img-wrap:hover img, +.ie-edge .page-img-wrap:hover img { + top: 393px; + transform: translate3d(0, -100%, 0); +} + +.page .img-wrap-mod-1 { + position: relative; + z-index: 1; +} + +.page .img-wrap-mod-1 figure { + transform: translate(0, 55px); +} + +.page .img-wrap-mod-1 figure:first-of-type { + position: absolute; + top: 0; + left: 0; + z-index: -1; + transform: translate(-10px, -15px); +} + +@media (min-width: 768px) { + .page .img-wrap-mod-1 figure:first-of-type { + transform: translate(-40px, -15px); + } +} + +@media (min-width: 1200px) { + .page .img-wrap-mod-1 figure { + transform: translate(100px, 55px); + } + .page .img-wrap-mod-1 figure:first-of-type { + transform: translate(40px, -75px); + } +} + +.page .img-wrap-mod-3 { + margin-bottom: -7px; +} + +.figure-shadow { + display: inline-block; + box-shadow: 0 11px 32px 0 rgba(107, 127, 142, 0.21); +} + +.fa-hover { + text-align: left; +} + +.fa-hover > * { + padding-right: 10px; +} + +.fa-hover i:before, +.fa-hover [class*='linear-icon-'] { + font-style: normal; + display: inline-block; + min-width: 30px; + color: #8f859e; + font-size: 28px; + line-height: 2; + vertical-align: middle; +} + +.dtp .p10 { + margin-top: 6px; +} + +.text-width-430 { + max-width: 430px; + margin-left: auto; + margin-right: auto; +} + +/* +* +* Components +* ================================================== +*/ +/* +* +* Icons +* -------------------------------------------------- +*/ +.icon { + display: inline-block; + line-height: 24px; +} + +.icon:before { + position: relative; + display: inline-block; + font-weight: 400; + font-style: normal; + speak: none; + text-transform: none; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-primary { + color: #8f859e; +} + +.icon-secondary { + color: #dcd1d5; +} + +.icon-gray-3 { + color: #636e74; +} + +.icon-gray-8 { + color: #434345; +} + +.icon-gray-12 { + color: #4d4d4d; +} + +.icon-white { + color: #fff; +} + +.page a.icon-gray-3, .page a.icon-gray-3:active, .page a.icon-gray-3:focus { + color: #636e74; +} + +.page a.icon-gray-3:hover { + color: #8f859e; +} + +.page a.icon-gray-8, .page a.icon-gray-8:active, .page a.icon-gray-8:focus { + color: #434345; +} + +.page a.icon-gray-8:hover { + color: #8f859e; +} + +.page a.icon-gray-12, .page a.icon-gray-12:active, .page a.icon-gray-12:focus { + color: #4d4d4d; +} + +.page a.icon-gray-12:hover { + color: #dcd1d5; +} + +.page a.icon-white, .page a.icon-white:active, .page a.icon-white:focus { + color: #fff; +} + +.page a.icon-white:hover { + color: #dcd1d5; +} + +.page a.icon-primary, .page a.icon-primary:active, .page a.icon-primary:focus { + color: #8f859e; +} + +.page a.icon-primary:hover { + color: #dcd1d5; +} + +.page a.icon-secondary-5, .page a.icon-secondary-5:active, .page a.icon-secondary-5:focus { + color: #c3cad4; +} + +.page a.icon-secondary-5:hover { + color: #8f859e; +} + +.icon-circle { + border-radius: 50%; +} + +.page .icon { + font-size: 24px; +} + +.page .icon-xs { + font-size: 15px; +} + +.page .icon-sm { + font-size: 20px; +} + +.page .icon-md { + font-size: 42px; +} + +.page .icon-lg { + font-size: 44px; + line-height: 1; +} + +/* +* +* Buttons +* -------------------------------------------------- +*/ +.button { + display: inline-block; + position: relative; + padding: 15px 38px; + font-size: 16px; + line-height: 20px; + border-radius: 4px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + border-style: solid; + text-align: center; + cursor: pointer; + vertical-align: middle; + user-select: none; + transition: 250ms all ease-in-out; + font-family: "Poppins", Helvetica, Arial, sans-serif; + font-weight: 500; + border-width: 0; +} + +.button:focus, .button:active, .button:active:focus { + outline: none; +} + +.button .caret { + margin-left: 8px; +} + +.button.button-effect-ujarak span { + position: relative; + z-index: 2; +} + +.button.button-effect-ujarak:before { + content: ""; + display: inline-block; + position: absolute; + top: -3px; + bottom: -3px; + left: 10%; + right: 10%; + transition: all 250ms ease-in; + opacity: 0; + z-index: 0; +} + +.button.button-effect-ujarak:after { + content: ''; + position: absolute; + top: -3px; + bottom: -3px; + left: -3px; + right: -3px; + z-index: 1; + transition: all 250ms ease-in; +} + +.button.button-effect-ujarak:hover { + background: transparent; +} + +.button.button-effect-ujarak:hover:before { + opacity: 1; + left: -1px; + right: -1px; +} + +.button.button-effect-ujarak:hover:after { + opacity: 0; + left: 10%; + right: 10%; +} + +.button[class*='-outline'] { + padding: 11px 38px; + font-size: 16px; + line-height: 20px; + border-radius: 0; +} + +.button-block { + display: block; + width: 100%; +} + +.button-default { + color: #151515; + background-color: transparent; + border-color: #9b9b9b; +} + +.button-default:hover, .button-default:focus, .button-default:active, .button-default:hover { + color: #fff; + background-color: #151515; + border-color: #151515; +} + +.button-transparent { + color: #151515; + background-color: transparent; + border-color: transparent; +} + +.button-transparent:hover, .button-transparent:focus, .button-transparent:active, .button-transparent:hover { + color: #fff; + background-color: #151515; + border-color: #151515; +} + +.button-default-outline { + border-width: 3px; + color: #151515; + background-color: transparent; + border-color: rgba(0, 0, 0, 0.2); +} + +.button-default-outline:hover, .button-default-outline:focus, .button-default-outline:active, .button-default-outline:hover { + color: #fff; + background-color: #151515; + border-color: #151515; +} + +.button-gray-dark-outline { + border-width: 3px; + color: #151515; + background-color: transparent; + border-color: #151515; +} + +.button-gray-dark-outline:hover, .button-gray-dark-outline:focus, .button-gray-dark-outline:active, .button-gray-dark-outline:hover { + color: #fff; + background-color: #151515; + border-color: #151515; +} + +.button-gray-dark-outline.button-effect-ujarak { + border-width: 0; + padding: 14px 38px; + font-size: 16px; + line-height: 20px; + border-radius: 0; +} + +.button-gray-dark-outline.button-effect-ujarak:before { + background-color: #151515; +} + +.button-gray-dark-outline.button-effect-ujarak:after { + top: 0; + bottom: 0; + left: 0; + right: 0; + border: 3px solid #151515; +} + +.button-gray-dark-outline.button-effect-ujarak:hover { + background: transparent; +} + +.button-white-outline { + border-width: 3px; + color: #fff; + background-color: transparent; + border-color: #fff; +} + +.button-white-outline:hover, .button-white-outline:focus, .button-white-outline:active, .button-white-outline:hover { + color: #fff; + background-color: #8f859e; + border-color: #8f859e; +} + +.button-white-outline.button-effect-ujarak { + border-width: 0; + padding: 14px 38px; + font-size: 16px; + line-height: 20px; + border-radius: 0; +} + +.button-white-outline.button-effect-ujarak:before { + background-color: #8f859e; +} + +.button-white-outline.button-effect-ujarak:after { + top: 0; + bottom: 0; + left: 0; + right: 0; + border: 3px solid #fff; +} + +.button-white-outline.button-effect-ujarak:focus, .button-white-outline.button-effect-ujarak:active { + background: #8f859e; + border-color: #8f859e; +} + +.button-white-outline.button-effect-ujarak:focus:after, .button-white-outline.button-effect-ujarak:active:after { + border: 0; +} + +.button-white-outline.button-effect-ujarak:hover { + background: transparent; +} + +.button-white-outline.button-lg.button-square { + border-radius: 0; +} + +.button-secondary-outline { + border-width: 3px; + color: #151515; + background-color: transparent; + border-color: #dcd1d5; +} + +.button-secondary-outline:hover, .button-secondary-outline:focus, .button-secondary-outline:active, .button-secondary-outline:hover { + color: #fff; + background-color: #8f859e; + border-color: #8f859e; +} + +.button-secondary-outline.button-effect-ujarak { + border-width: 0; + padding: 14px 38px; + font-size: 16px; + line-height: 20px; + border-radius: 0; +} + +.button-secondary-outline.button-effect-ujarak:before { + background-color: #8f859e; +} + +.button-secondary-outline.button-effect-ujarak:after { + top: 0; + bottom: 0; + left: 0; + right: 0; + border: 3px solid #dcd1d5; +} + +.button-secondary-outline.button-effect-ujarak:focus, .button-secondary-outline.button-effect-ujarak:active { + background: #8f859e; + border-color: #8f859e; +} + +.button-secondary-outline.button-effect-ujarak:focus:after, .button-secondary-outline.button-effect-ujarak:active:after { + border: 0; +} + +.button-secondary-outline.button-effect-ujarak:hover { + background: transparent; +} + +.button-secondary-outline.button-lg.button-square { + border-radius: 0; +} + +.button-gray-6-outline { + border-width: 2px; + color: #dcd1d5; + background-color: transparent; + border-color: #ddd; +} + +.button-gray-6-outline:hover, .button-gray-6-outline:focus, .button-gray-6-outline:active, .button-gray-6-outline:hover { + color: #fff; + background-color: #8f859e; + border-color: #8f859e; +} + +.button-gray-6-outline.button-effect-ujarak { + border-width: 0; + padding: 14px 38px; + font-size: 16px; + line-height: 20px; + border-radius: 0; +} + +.button-gray-6-outline.button-effect-ujarak:before { + background-color: #8f859e; +} + +.button-gray-6-outline.button-effect-ujarak:after { + top: 0; + bottom: 0; + left: 0; + right: 0; + border: 2px solid #ddd; +} + +.button-gray-6-outline.button-effect-ujarak:focus, .button-gray-6-outline.button-effect-ujarak:active { + background: #8f859e; + border-color: #8f859e; +} + +.button-gray-6-outline.button-effect-ujarak:focus:after, .button-gray-6-outline.button-effect-ujarak:active:after { + border: 0; +} + +.button-gray-6-outline.button-effect-ujarak:hover { + background: transparent; +} + +.button-gray-6-outline.button-lg.button-square { + border-radius: 0; +} + +.button-primary { + color: #fff; + background-color: #8f859e; + border-color: #8f859e; +} + +.button-primary:hover, .button-primary:focus, .button-primary:active, .button-primary:hover { + color: #fff; + background-color: #dcd1d5; + border-color: #dcd1d5; +} + +.button-primary.button-effect-ujarak:before { + background-color: #dcd1d5; +} + +.button-primary.button-effect-ujarak:after { + background-color: #8f859e; +} + +.button-primary.button-effect-ujarak:hover { + background: transparent; +} + +.button-primary-2 { + color: #fff; + background-color: #8f859e; + border-color: #8f859e; +} + +.button-primary-2:hover, .button-primary-2:focus, .button-primary-2:active, .button-primary-2:hover { + color: #fff; + background-color: #dcd1d5; + border-color: #dcd1d5; +} + +.button-primary-2.button-effect-ujarak:before { + background-color: #dcd1d5; +} + +.button-primary-2.button-effect-ujarak:after { + background-color: #8f859e; +} + +.button-primary-2.button-effect-ujarak:hover { + background: transparent; +} + +.button-secondary { + color: #fff; + background-color: #dcd1d5; + border-color: #dcd1d5; +} + +.button-secondary:hover, .button-secondary:focus, .button-secondary:active, .button-secondary:hover { + color: #fff; + background-color: #8f859e; + border-color: #8f859e; +} + +.button-secondary.button-effect-ujarak:before { + background-color: #8f859e; +} + +.button-secondary.button-effect-ujarak:after { + background-color: #dcd1d5; +} + +.button-secondary.button-effect-ujarak:hover { + background: transparent; +} + +.button-steel-blue { + color: #fff; + background-color: #547ABB; + border-color: #547ABB; +} + +.button-steel-blue:hover, .button-steel-blue:focus, .button-steel-blue:active, .button-steel-blue:hover { + color: #fff; + background-color: #3f629d; + border-color: #3f629d; +} + +.button-cerulean { + color: #fff; + background-color: #00bbf2; + border-color: #00bbf2; +} + +.button-cerulean:hover, .button-cerulean:focus, .button-cerulean:active, .button-cerulean:hover { + color: #fff; + background-color: #00a7d9; + border-color: #00a7d9; +} + +.button-mandy { + color: #fff; + background-color: #e75854; + border-color: #e75854; +} + +.button-mandy:hover, .button-mandy:focus, .button-mandy:active, .button-mandy:hover { + color: #fff; + background-color: #e12c27; + border-color: #e12c27; +} + +.button-shadow { + box-shadow: 0 3px 11px 0 rgba(0, 0, 0, 0.15); +} + +.button-shadow:hover { + box-shadow: 0 3px 5px 0 rgba(0, 0, 0, 0.15); +} + +.button-xs { + padding: 12px 30px; + font-size: 14px; + line-height: 18px; + border-radius: 3px; +} + +.button-xs[class*='-outline'] { + padding: 10px 15px; + font-size: 14px; + line-height: 18px; + border-radius: 3px; + padding-bottom: 7px; +} + +.button-sm { + padding: 13px 22px; + font-size: 14px; + line-height: 16px; + border-radius: 3px; + min-width: auto; +} + +.button-sm[class*='-outline'] { + padding: 13px 22px; + font-size: 14px; + line-height: 16px; + border-radius: 3px; +} + +.button-lg { + padding: 19px 65px; + font-size: 18px; + line-height: 20px; + border-radius: 3px; +} + +.button-lg[class*='-outline'] { + padding: 19px 65px; + font-size: 18px; + line-height: 20px; + border-radius: 3px; +} + +.button-xl { + padding: 25px 70px; + font-size: 24px; + line-height: 24px; + border-radius: 3px; +} + +.button-xl[class*='-outline'] { + padding: 25px 70px; + font-size: 24px; + line-height: 24px; + border-radius: 3px; +} + +.button-circle { + border-radius: 30px; +} + +.button-round { + border-radius: 8px; +} + +.button-square { + border-radius: 0; +} + +.button-ellipse-md { + border-radius: 5px; +} + +.button-ellipse-lg { + border-radius: 10px; +} + +.button.button-icon { + padding-left: 35px; + padding-right: 35px; +} + +.button.button-icon .icon { + line-height: inherit; + vertical-align: middle; + transition: 0s; +} + +.button.button-icon-left .icon { + float: left; + padding-right: 10px; +} + +.button.button-icon-right .icon { + float: right; + padding-left: 10px; +} + +.page .button-tags { + font-size: 12px; + border-width: 1px; + font-weight: 500; + text-transform: uppercase; +} + +.button-link { + font: 700 16px "Poppins", Helvetica, Arial, sans-serif; + color: #dcd1d5; +} + +/* +* +* Form styles +* -------------------------------------------------- +*/ +.rd-mailform { + position: relative; + text-align: left; +} + +html .rd-mailform-inline { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + flex-wrap: wrap; + transform: translateY(-15px); + margin-bottom: -15px; +} + +html .rd-mailform-inline > * { + margin-top: 15px; +} + +html .rd-mailform-inline .form-wrap { + -webkit-flex-grow: 1; + -ms-flex-positive: 1; + flex-grow: 1; +} + +html .rd-mailform-inline .form-input { + min-width: 150px; +} + +html .rd-mailform-inline .button { + margin-top: 15px; + flex: none; +} + +.form-input { + display: block; + width: 100%; + height: 50px; + padding: 12px 15px; + font-size: 14px; + font-weight: 400; + line-height: 22px; + color: #9b9b9b; + background-color: #f5f5f5; + background-image: none; + border: 1px solid #f5f5f5; + border-radius: 0; + -webkit-appearance: none; + letter-spacing: .05em; +} + +.form-input:focus { + outline: 0; +} + +.form-input:-webkit-autofill ~ label, +.form-input:-webkit-autofill ~ .form-validation { + color: #000 !important; +} + +textarea.form-input { + height: 135px; + min-height: 108px; + max-height: 229.5px; + resize: vertical; +} + +.form-wrap { + position: relative; +} + +.form-wrap + .form-wrap { + margin-top: 15px; +} + +* + .form-button, +.form-wrap + .button { + margin-top: 30px; +} + +label { + font-weight: 400; +} + +.form-label { + position: absolute; + top: 25px; + left: 15px; + font-family: "Lato", Helvetica, Arial, sans-serif; + font-size: 14px; + font-weight: 400; + line-height: 22px; + color: #9b9b9b; + pointer-events: none; + z-index: 9; + transition: .3s; + transform: translateY(-50%); +} + +.form-label.focus { + opacity: 0; +} + +.form-label.auto-fill { + color: #9b9b9b; +} + +@media (min-width: 768px) { + .form-label-outside { + position: static; + text-transform: uppercase; + } + .form-label-outside, .form-label-outside.focus, .form-label-outside.auto-fill { + opacity: 1; + transform: none; + color: #9b9b9b; + font-size: 14px; + font-weight: 400; + } + .form-label-outside + .form-input + .form-validation { + top: 34px; + } +} + +.form-validation { + position: absolute; + right: 10px; + top: 3px; + font-size: 11px; + line-height: 11px; + color: #d9534f; + margin-top: 3px; + transition: .3s; + z-index: 11; +} + +.form-validation-top-left .form-validation { + top: 0; + right: auto; + left: 5px; +} + +#form-output-global { + position: fixed; + bottom: 30px; + left: 15px; + visibility: hidden; + transform: translateX(-500px); + transition: .3s all ease; + z-index: 9999999; +} + +#form-output-global.active { + transform: translateX(0); + visibility: visible; +} + +@media (min-width: 480px) { + #form-output-global { + left: 30px; + } +} + +.form-output { + position: absolute; + top: 100%; + left: 0; + font-size: 14px; + line-height: 1.5; + margin-top: 2px; + transition: .3s; + opacity: 0; + visibility: hidden; +} + +.form-output.active { + opacity: 1; + visibility: visible; +} + +.form-output.error { + color: #d9534f; +} + +.form-output.success { + color: #5cb85c; +} + +.radio .radio-custom, +.radio-inline .radio-custom, +.checkbox .checkbox-custom, +.checkbox-inline .checkbox-custom { + opacity: 0; +} + +.radio .radio-custom, .radio .radio-custom-dummy, +.radio-inline .radio-custom, +.radio-inline .radio-custom-dummy, +.checkbox .checkbox-custom, +.checkbox .checkbox-custom-dummy, +.checkbox-inline .checkbox-custom, +.checkbox-inline .checkbox-custom-dummy { + position: absolute; + width: 14px; + height: 14px; + margin-left: -20px; + margin-top: 5px; + outline: none; + cursor: pointer; +} + +.radio .radio-custom-dummy, +.radio-inline .radio-custom-dummy, +.checkbox .checkbox-custom-dummy, +.checkbox-inline .checkbox-custom-dummy { + pointer-events: none; + background: #ebebeb; + box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.15); +} + +.radio .radio-custom-dummy:after, +.radio-inline .radio-custom-dummy:after, +.checkbox .checkbox-custom-dummy:after, +.checkbox-inline .checkbox-custom-dummy:after { + position: absolute; + opacity: 0; +} + +.radio .radio-custom:focus, +.radio-inline .radio-custom:focus, +.checkbox .checkbox-custom:focus, +.checkbox-inline .checkbox-custom:focus { + outline: none; +} + +.radio-custom:checked + .radio-custom-dummy:after, +.checkbox-custom:checked + .checkbox-custom-dummy:after { + opacity: 1; +} + +.radio .radio-custom-dummy, +.radio-inline .radio-custom-dummy { + border-radius: 50%; +} + +.radio .radio-custom-dummy:after, +.radio-inline .radio-custom-dummy:after { + content: ''; + top: 3px; + right: 3px; + bottom: 3px; + left: 3px; + background: #151515; + border-radius: 50%; +} + +.checkbox, +.checkbox-inline { + padding-left: 20px; +} + +.checkbox .checkbox-custom-dummy, +.checkbox-inline .checkbox-custom-dummy { + pointer-events: none; + border-radius: 3px; + margin-left: 0; + left: 0; +} + +.checkbox .checkbox-custom-dummy:after, +.checkbox-inline .checkbox-custom-dummy:after { + content: '\f222'; + font-family: "Material Design Icons"; + font-size: 20px; + line-height: 10px; + position: absolute; + top: 0; + left: 0; + color: #151515; +} + +.form-button-block .button { + width: 100%; +} + +.form-button { + display: flex; + align-items: stretch; + max-height: 70px; +} + +.recaptcha { + transform: scale(0.9); + transform-origin: 0 0; +} + +.page .form-inline { + text-align: center; +} + +.page .form-inline > * + * { + margin-top: 20px; +} + +@media (min-width: 768px) { + .page .form-inline { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -webkit-align-items: stretch; + -ms-flex-align: stretch; + align-items: stretch; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + width: 100%; + } + .page .form-inline > * + * { + margin-top: 0; + margin-left: 30px; + } + .page .form-inline .form-wrap { + -webkit-flex-grow: 1; + -ms-flex-positive: 1; + flex-grow: 1; + } + .page .form-inline .form-input { + width: 100%; + } + .page .form-inline .button { + display: inline-block; + -ms-flex-negative: 0; + -webkit-flex-shrink: 0; + flex-shrink: 0; + } +} + +.form-comment .form-label-outside { + text-transform: none; + color: #151515; +} + +.form-comment .form-input { + background-color: transparent; + border-radius: 4px; + color: #151515; + border-color: #ddd; + /* Firefox 19+ */ + /* Firefox 18- */ +} + +.form-comment .form-input::-webkit-input-placeholder { + color: #151515; +} + +.form-comment .form-input::-moz-placeholder { + color: #151515; +} + +.form-comment .form-input:-moz-placeholder { + color: #151515; +} + +.form-comment .form-input:-ms-input-placeholder { + color: #151515; +} + +.form-comment .button { + font-size: 14px; + min-width: 180px; +} + +h4 + .form-comment { + margin-top: 10px; +} + +.form-search { + position: relative; +} + +.form-search .form-input { + border: 1px solid #ddd; + padding-right: 60px; + color: #000; + background-color: transparent; +} + +.form-search .form-label { + left: 20px; + top: 25px; + color: #9b9b9b; + font-size: 14px; +} + +.form-search-submit { + position: absolute; + font-size: 25px; + right: 20px; + top: 0; + bottom: 0; + padding: 0; + background: none; + border: none; + box-shadow: none; + color: #151515; + transition: .3s all ease; +} + +.form-search-submit:hover, .form-search-submit:focus { + color: #8f859e; + outline: none; +} + +.form-wrap_icon { + position: relative; + width: 100%; +} + +.form-wrap_icon .form-input { + padding-left: 60px; +} + +.form-wrap_icon .form-label { + left: 60px; +} + +.form-wrap_icon::before { + position: absolute; + top: 25px; + left: 22px; + transform: translateY(-50%); + margin-right: 7px; + font-size: 22px; + line-height: 24px; + color: #898989; + z-index: 1; +} + +.form-wrap_icon .select2-container .select2-choice { + padding-left: 0; +} + +.form-wrap_icon .select2-container--bootstrap .select2-selection--single { + padding-left: 60px; +} + +.form-wrap_icon__label-outside:before { + top: auto; + bottom: 25px; + transform: translateY(45%); +} + +.hotel-booking-form { + width: 100%; + text-align: left; + padding: 30px 20px 30px; + color: #000; + background: #e3e3e3; +} + +.hotel-booking-form h3 { + color: inherit; +} + +.hotel-booking-form .form-label { + left: 22px; + letter-spacing: .05em; +} + +.hotel-booking-form .form-input { + padding-left: 22px; + background-color: #fff; +} + +.hotel-booking-form .select2-container .select2-choice { + padding-left: 0; + padding-right: 0; + background: #fff; +} + +.hotel-booking-form .select2-arrow b:before { + color: #cbcbcb; +} + +.hotel-booking-form .button { + margin-top: 10px; +} + +@media (min-width: 480px) { + .hotel-booking-form { + padding: 70px 50px 60px; + } +} + +@media (min-width: 1200px) { + .hotel-booking-form .button { + font-size: 18px; + line-height: 20px; + font-weight: 700; + padding: 19px 30px; + } +} + +.hotel-booking-form * + .rd-mailform { + margin-top: 20px; +} + +.hotel-booking-form * + .form-wrap { + margin-top: 5px; +} + +.form-label-icon > * { + display: inline-block; + vertical-align: middle; +} + +.form-label-icon span + span { + margin-left: 10px; +} + +.table-custom { + border: 1px solid #000000; + box-sizing: border-box; + width: 100%; + max-width: 100%; + font-weight: 400; + letter-spacing: 0; + background: transparent; +} + +.table-custom th, +.table-custom td { + width: 50px; + font-size: 16px; + color: #000; + background: transparent; + border: 1px solid #000000; +} + +.table-custom th { + padding: 25px 24px; + font-weight: 700; + text-transform: uppercase; + white-space: nowrap; +} + +@media (min-width: 768px) { + .table-custom th { + padding: 33px 24px; + } +} + +.table-custom td { + padding: 17px 24px 18px; + border-bottom: 1px solid #b7b7b7; +} + +.table-custom tr:last-of-type td { + font-weight: 700; +} + +.table-custom-primary th { + color: #fff; + background: #8f859e; +} + +.table-custom-light th { + background: #f2f3f8; +} + +.table-custom-light td + td { + border-left: 1px solid #b7b7b7; +} + +.table-custom-bordered { + border: 1px solid #b7b7b7; +} + +.table-custom-bordered td { + border: 1px solid #b7b7b7; +} + +.table-custom-bordered tbody > tr:first-of-type > td { + border-top: 0; +} + +.table-custom-striped tbody tr:nth-of-type(odd) td { + background: transparent; +} + +.table-custom-striped tbody tr:nth-of-type(even) td { + background: #f2f3f8; +} + +.table-custom-striped tbody td { + border: 0; +} + +.table-round { + position: relative; + border-radius: 4px; + overflow: hidden; +} + +.table-custom-responsive { + overflow-x: auto; + min-height: 0.01%; +} + +@media screen and (max-width: 767px) { + .table-custom-responsive { + width: 100%; + margin-bottom: 10px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #b7b7b7; + } + .table-custom-responsive > .table-custom > thead > tr > th, + .table-custom-responsive > .table-custom > thead > tr > td, + .table-custom-responsive > .table-custom > tbody > tr > th, + .table-custom-responsive > .table-custom > tbody > tr > td, + .table-custom-responsive > .table-custom > tfoot > tr > th, + .table-custom-responsive > .table-custom > tfoot > tr > td { + white-space: nowrap; + } +} + +/* +* +* Lists +* -------------------------------------------------- +*/ +ul, +ol { + list-style: none; + padding: 0; + margin: 0; +} + +.list > li + li { + margin-top: 10px; +} + +.list-xl > li + li { + margin-top: 40px; +} + +@media (min-width: 1200px) { + .list-xl > li + li { + margin-top: 90px; + } +} + +.list-inline { + margin-left: -5px; + margin-right: -5px; +} + +.list-inline > li { + padding-left: 5px; + padding-right: 5px; +} + +.list-inline-sm { + margin-left: -15px; + margin-right: -15px; + transform: translateY(-7px); + margin-bottom: -7px; +} + +.list-inline-sm > li { + padding-top: 7px; + padding-left: 15px; + padding-right: 15px; +} + +.list-unstyled li + li { + margin-top: 10px; +} + +dl { + margin: 0; +} + +.list-desc { + display: table; + margin-left: -5px; + margin-right: -5px; +} + +.list-desc > * { + display: table-cell; + vertical-align: top; + padding-left: 5px; + padding-right: 5px; + font-weight: 400; +} + +.list-desc dt { + color: #8f859e; +} + +.list-desc-secondary dt { + color: #dcd1d5; +} + +.list-terms { + margin-top: 35px; +} + +.list-terms dt + dd { + margin-top: 5px; +} + +.list-terms dd + dt { + margin-top: 25px; +} + +.index-list { + counter-reset: li; +} + +.index-list > li .list-index-counter:before { + content: counter(li, decimal-leading-zero); + counter-increment: li; +} + +.marked-list { + text-align: left; +} + +.marked-list > li { + position: relative; + padding-left: 25px; + font: 400 14px/24px "Lato", Helvetica, Arial, sans-serif; + color: #151515; +} + +.marked-list > li:before { + position: absolute; + top: -1px; + left: 0; + content: '\f105'; + font: 400 16px/24px "FontAwesome"; + color: #b7b7b7; +} + +.marked-list > li a, .marked-list > li a:active, .marked-list > li a:focus { + color: inherit; +} + +.marked-list > li a:hover { + color: #8f859e; +} + +.marked-list > li + li { + margin-top: 10px; +} + +.marked-list__mod-1 > li { + padding-bottom: 12px; + border-bottom: 1px solid #ddd; +} + +.marked-list__mod-1 > li:before { + color: #8f859e; +} + +.marked-list-gray-darker > li { + color: #363d41; +} + +.ordered-list { + counter-reset: li; + text-align: left; +} + +.ordered-list li { + position: relative; + padding-left: 25px; + font: 400 14px/24px "Lato", Helvetica, Arial, sans-serif; + color: #151515; +} + +.ordered-list li:before { + position: absolute; + top: 0; + left: 0; + display: inline-block; + width: 15px; + content: counter(li, decimal) "."; + counter-increment: li; + color: #b7b7b7; +} + +.ordered-list li + li { + margin-top: 10px; +} + +.nav-list li.active a { + color: #8f859e; +} + +.list-column-3 { + columns: 2; + column-gap: 30px; +} + +@media (min-width: 768px) { + .list-column-3 { + columns: 3; + column-gap: 60px; + } +} + +.list-bars { + text-align: left; +} + +.list-bars li { + display: block; +} + +.list-bars > li + li { + margin-top: 25px; +} + +.list-bars * + .progress { + margin-top: 19px; +} + +.list-bars-item-header { + color: #9b9b9b; + text-transform: uppercase; +} + +/* +* +* Posts +* -------------------------------------------------- +*/ +.post-box-body { + display: flex; + flex-wrap: wrap; + margin-top: 25px; +} + +.post-box-body h4 + p { + margin-top: 15px; +} + +.author-image { + text-align: center; + color: #151515; + font-weight: 700; +} + +.author-image img { + max-width: 60px; + box-shadow: 0 6px 6px rgba(0, 0, 0, 0.2); +} + +.author-image figcaption { + display: inline-block; +} + +.author-image * + figcaption { + margin-top: 18px; + margin-left: 20px; +} + +.post-box-image { + display: block; + overflow: hidden; +} + +.post-box-image figure { + transition: 750ms ease-in-out; +} + +.post-box-text { + margin-bottom: 20px; + padding-bottom: 20px; + border-bottom: 1px solid #ebebeb; +} + +.post-box-tags { + width: 100%; + margin-top: 15px; +} + +.post-box-tags .icon { + font-size: 14px; +} + +.post-box-tags .icon:before { + font-size: 19px; + color: #151515; + vertical-align: middle; + margin-right: 5px; +} + +.post-classic footer { + margin-top: 40px; +} + +.post-classic footer .heading-5 { + font-weight: 500; +} + +.post-classic + * { + margin-top: 40px; +} + +.post-content { + margin-top: 35px; +} + +.post-content hr { + margin-top: 15px; +} + +.post-content p + p { + margin-top: 15px; +} + +.post-meta { + margin-top: 20px; + margin-left: -15px; + margin-right: -18px; +} + +.post-meta li { + position: relative; + padding-left: 15px; + padding-right: 18px; +} + +.post-meta li:after { + position: absolute; + right: 0; + top: -6px; + font-size: 20px; + content: '|'; + display: inline-block; + color: #eee; +} + +.post-meta li:last-of-type:after { + content: none; +} + +.box-comment .unit__left { + padding-top: 15px; +} + +.box-comment .box-comment { + margin-top: 20px; + margin-left: 20px; +} + +* + .box-comment { + margin-top: 30px; +} + +.box-comment-body { + padding: 18px 18px 20px; + border: 1px solid #ddd; + border-radius: 4px; + color: #151515; +} + +.box-comment-title { + font-size: 16px; + line-height: 1; + font-weight: 700; + text-transform: uppercase; +} + +.box-comment-meta { + font-size: 12px; + color: #9b9b9b; +} + +.box-comment-icon { + font-size: 14px; + padding-left: 5px; + padding-right: 5px; +} + +.box-comment-header { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + margin-left: -15px; + margin-right: -15px; +} + +.box-comment-header-inner { + padding-left: 15px; + padding-right: 15px; +} + +.box-comment-header-inner > * { + display: inline-block; + vertical-align: middle; +} + +.box-comment-header-inner > * + * { + margin-left: 5px; +} + +.box-comment-text { + margin-top: 12px; +} + +.aside-title { + font-size: 16px; + font-weight: 700; + text-transform: uppercase; + color: #151515; +} + +* + .post-minimal { + margin-top: 15px; +} + +.post-minimal-title { + font-size: 18px; + line-height: 1.2; +} + +.post-box-minimal { + max-width: 496px; + margin-left: auto; + margin-right: auto; +} + +.post-box-minimal-caption { + border: 1px solid #ebebeb; +} + +.post-box-minimal-title { + padding: 20px; +} + +.post-box-minimal-title a { + color: #151515; +} + +.post-box-minimal-title a:hover { + color: #8f859e; +} + +.post-box-minimal-meta-bottom { + padding: 10px 20px; + border-top: 1px solid #ebebeb; +} + +.post-box-minimal-meta-bottom a { + color: #9b9b9b; +} + +.post-box-minimal-meta-bottom a:hover { + color: #8f859e; +} + +.post-box-minimal-meta-bottom > * + * { + margin-top: 5px; +} + +.post-box-icon:before { + color: #8f859e; + padding-right: 7px; +} + +.post-box-horizontal { + max-width: 100%; +} + +.post-box-horizontal .post-box-minimal-title, +.post-box-horizontal .post-box-minimal-meta-bottom { + padding-left: 0; + padding-right: 0; +} + +.post-box-horizontal .post-box-minimal-caption { + padding: 0 20px; +} + +.post-box-horizontal .post-box-minimal-meta-bottom time, +.post-box-horizontal .post-box-minimal-meta-bottom a { + color: #151515; +} + +.post-box-horizontal .post-box-minimal-caption, +.post-box-horizontal .post-box-minimal-caption *, +.post-box-horizontal .post-box-icon:before { + transition: 450ms; +} + +.post-box-horizontal:hover .post-box-minimal-caption { + background-color: #8f859e; + border-color: #8f859e; +} + +.post-box-horizontal:hover .post-box-minimal-caption .post-box-minimal-title a { + color: #fff; +} + +.post-box-horizontal:hover .post-box-minimal-caption .post-box-minimal-meta-bottom time, +.post-box-horizontal:hover .post-box-minimal-caption .post-box-minimal-meta-bottom a { + color: #dcd1d5; +} + +.post-box-horizontal:hover .post-box-minimal-caption .post-box-icon:before { + color: #dcd1d5; +} + +.post-box-horizontal:hover .post-box-minimal-caption .post-box-minimal-meta-bottom { + border-top-color: #dcd1d5; +} + +.post-box-horizontal:hover .post-box-minimal-meta-bottom a:hover { + color: #fff; +} + +.post-box-horizontal:hover .post-box-minimal-title a:hover { + color: #dcd1d5; +} + +@media (min-width: 480px) { + .post-box-minimal-caption { + text-align: left; + } + .post-box-minimal-meta-bottom { + display: flex; + justify-content: space-between; + flex-wrap: wrap; + padding: 15px 20px; + } + .post-box-minimal-meta-bottom > * + * { + margin-top: 0; + margin-left: 7px; + } +} + +@media (min-width: 768px) { + .post-box:hover .post-box-image figure { + transform: scale3d(1.04, 1.04, 1.04); + } + .author-image img { + max-width: 100%; + } + .author-image figcaption { + display: block; + margin-left: 0; + } + .post-box-body { + flex-direction: row-reverse; + margin-top: 43px; + justify-content: flex-start; + } + .post-box-body > * { + flex-grow: 1; + } + .author-image { + max-width: 29%; + } + .post-box-tags, + .post-box-text { + width: 80%; + max-width: 80%; + } + .post-box-tags { + margin-top: 0; + } + .post-box-text { + margin-left: 30px; + padding-bottom: 30px; + } + .post-content hr + p { + margin-top: 50px; + } + .box-comment > .box-comment { + margin-left: 100px; + } + .post-box-minimal-title { + padding: 28px 30px; + } + .post-box-minimal-meta-bottom { + padding: 21px 30px; + } + .post-box-horizontal .post-box-minimal-caption { + padding: 0 30px; + } +} + +@media (min-width: 1200px) { + .post-box-horizontal { + display: flex; + align-items: stretch; + } + .post-box-horizontal .post-box-image img { + position: relative; + left: 50%; + transform: translateX(-50%); + width: auto; + height: auto; + max-width: none; + } + .post-box-horizontal .post-box-minimal-caption { + display: flex; + align-items: center; + padding: 0 20px; + } +} + +@media (min-width: 1800px) { + .post-box-horizontal .post-box-minimal-caption { + padding: 0 30px; + } + .post-box-horizontal .post-box-image { + min-width: 280px; + } +} + +.post-video { + position: relative; + overflow: hidden; +} + +.post-video__image img { + width: 100%; +} + +.post-video__body:before { + content: ''; +} + +.ie-10 .post-video__body:after, +.ie-11 .post-video__body:after { + content: ''; + height: inherit; + min-height: inherit; +} + +.link-control { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 95px; + height: 95px; + background-image: url(../images/rd-video-play.png); + background-repeat: no-repeat; + -webkit-background-size: cover; + background-size: cover; + z-index: 2; + border-radius: 50%; + transition: .3s ease-out all; + will-change: transfrom; +} + +.link-control:before { + content: ''; + position: absolute; + top: -6px; + bottom: -6px; + left: -6px; + right: -6px; + background-image: url(../images/rd-video-play-hover.png); + background-repeat: no-repeat; + -webkit-background-size: cover; + background-size: cover; + visibility: hidden; + opacity: 0; + transition: .3s ease-out all; + transform: scale(2); + z-index: -1; + border-radius: 50%; +} + +.link-control:hover { + will-change: transfrom; +} + +.link-control:hover:before { + visibility: visible; + opacity: 1; + z-index: 1; + transform: scale(1); +} + +/* +* +* Thumbnails +* -------------------------------------------------- +*/ +.thumb { + position: relative; + display: inline-block; +} + +.thumb:before { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background-color: rgba(143, 133, 158, 0.4); + z-index: 1; + content: ''; + will-change: opacity; +} + +.thumb:after { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + color: #fff; + font-family: FontAwesome; + font-size: 34px; + content: "\f065"; + z-index: 1; + will-change: transform, opacity; +} + +.thumb:before, .thumb:after { + transition: .3s ease; + opacity: 0; +} + +.thumb:hover:before, .thumb:hover:after { + opacity: 1; +} + +.img-thumbnail-custom { + position: relative; + max-width: 570px; + margin-left: auto; + margin-right: auto; +} + +.img-thumbnail-custom .caption { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + padding: 21px; + background-color: #eee; +} + +.img-thumbnail-custom .caption .button { + padding-left: 15px; + padding-right: 15px; +} + +.img-thumbnail-custom .list-inline li { + line-height: 0; + vertical-align: middle; +} + +.img-thumbnail-custom .button { + font-size: 13px; + text-transform: uppercase; + font-weight: 700; + padding-bottom: 9px; + letter-spacing: .05em; +} + +.img-thumbnail-custom .button-gray-dark-outline.button-effect-ujarak:after { + border-width: 2px; +} + +.img-wrap-mod-2 { + position: relative; + display: inline-block; + width: 100%; + max-width: 130px; + margin-left: auto; + margin-right: auto; +} + +.img-wrap-mod-2:before { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + content: ""; + display: inline-block; + background-color: rgba(0, 0, 0, 0.5); + opacity: 0; + transition: 250ms; +} + +.img-wrap-mod-2 .icon { + position: absolute; + top: 50%; + left: 50%; + opacity: 0; + transform: translate(-50%, -50%) scale(0); + transition: 250ms; +} + +.img-wrap-mod-2:hover:before { + opacity: 1; +} + +.img-wrap-mod-2:hover .icon { + transform: translate(-50%, -50%) scale(1); + opacity: 1; +} + +.thumbnail-classic { + position: relative; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + text-align: center; + overflow: hidden; + width: 100.01%; + will-change: transform; +} + +.thumbnail-classic figure { + width: 100%; + transform: translate3d(0, 0, 0); + transition: .33s all ease-in-out; +} + +.thumbnail-classic img { + position: relative; + left: 50%; + transform: translateX(-50%); + width: auto; + height: auto; + max-width: none; + min-width: 101.5%; +} + +.thumbnail-classic .caption { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + padding: 20px; + transition: .33s all ease-in-out; + pointer-events: none; + background: rgba(41, 41, 41, 0.53); + will-change: transform; +} + +.thumbnail-classic .caption::before, .thumbnail-classic .caption::after { + pointer-events: none; + position: absolute; + top: 30px; + right: 30px; + bottom: 30px; + left: 30px; + content: ''; + opacity: 0; + transition: opacity 0.35s, transform 0.35s; + will-change: opacity; +} + +.thumbnail-classic .caption::before { + border-top: 1px solid #fff; + border-bottom: 1px solid #fff; + transform: scale(0, 1); +} + +.thumbnail-classic .caption::after { + border-right: 1px solid #fff; + border-left: 1px solid #fff; + transform: scale(1, 0); +} + +.thumbnail-classic .caption > * { + position: relative; + z-index: 2; +} + +.thumbnail-classic .caption-title, +.thumbnail-classic .caption-text { + color: #fff; +} + +.thumbnail-classic .caption-title { + position: relative; + font-size: 18px; + line-height: 1.25; + margin-bottom: 0; + padding: 0 15px; +} + +.thumbnail-classic .caption-text { + max-width: 100%; + margin-top: 15px; + padding: 0 15px; + color: #fff; +} + +.thumbnail-classic .caption-text:before { + width: 45px; + margin-left: auto; + margin-right: auto; + border-top: 2px solid; + content: ""; + display: block; + margin-bottom: 15px; +} + +.portfolio-item { + will-change: transform; +} + +.portfolio-item .caption { + flex-direction: row; + will-change: opacity; + background: rgba(143, 133, 158, 0.42); +} + +.portfolio-item .caption::before, .portfolio-item .caption::after { + top: 18px; + right: 18px; + bottom: 18px; + left: 18px; +} + +.portfolio-item .caption::before { + border-top: 1px solid rgba(255, 255, 255, 0.32); + border-bottom: 1px solid rgba(255, 255, 255, 0.32); +} + +.portfolio-item .caption::after { + border-right: 1px solid rgba(255, 255, 255, 0.32); + border-left: 1px solid rgba(255, 255, 255, 0.32); +} + +.portfolio-item .caption > * { + margin-left: 8px; + margin-right: 8px; + color: #fff; + will-change: transform; +} + +.portfolio-item .caption > span.icon { + font-size: 12px; + font-weight: 700; +} + +.portfolio-item .caption > span.icon:before { + padding-right: 5px; + font-size: 17px; + vertical-align: middle; + font-family: "Material Design Icons"; +} + +@media (min-width: 992px) { + .desktop .col-md-3 .caption-text { + max-width: 215px; + } + .desktop .col-md-6 .caption-text, + .desktop .col-md-4 .caption-text { + max-width: 230px; + } + .desktop .thumbnail-classic .caption { + transition: .4s all ease; + opacity: 0; + } + .desktop .thumbnail-classic .caption-title, + .desktop .thumbnail-classic .caption-text { + transition: 300ms 50ms ease-in-out; + transform: scale3d(0.7, 0.7, 0); + } + .desktop .thumbnail-classic:hover figure { + transform: scale3d(1.05, 1.05, 1.05); + } + .desktop .thumbnail-classic:hover .caption { + opacity: 1; + } + .desktop .thumbnail-classic:hover .caption:before, .desktop .thumbnail-classic:hover .caption:after { + opacity: 1; + transform: scale(1); + } + .desktop .thumbnail-classic:hover .caption-title, + .desktop .thumbnail-classic:hover .caption-text { + transform: scale3d(1, 1, 1); + } +} + +@media (max-width: 767px) { + .thumbnail-classic { + max-width: 370px; + margin-left: auto; + margin-right: auto; + } +} + +.thumbnail-instafeed figure { + max-height: 450px; +} + +.thumbnail-instafeed figure img { + max-width: 100%; +} + +.instafeed-link { + color: #151515; + font-weight: 700; +} + +/* +* +* Tooltip Custom +* -------------------------------------------------- +*/ +.tooltip-custom { + color: #b7b7b7; +} + +.tooltip-custom .tooltip { + font-family: "Lato", Helvetica, Arial, sans-serif; + z-index: 998; +} + +.tooltip-custom .tooltip.in { + opacity: 1; +} + +.tooltip-custom .tooltip-inner { + max-width: 253px; + padding: 4px 8px; + font-size: 14px; + border-radius: 0; + background: #8f859e; +} + +.tooltip-custom .tooltip.left .tooltip-arrow { + border-left-color: #8f859e; +} + +.tooltip-custom .tooltip.right .tooltip-arrow { + border-right-color: #8f859e; +} + +.tooltip-custom .tooltip.top .tooltip-arrow { + border-top-color: #8f859e; +} + +.tooltip-custom .tooltip.bottom .tooltip-arrow { + border-bottom-color: #8f859e; +} + +/* +* +* Snackbars +* -------------------------------------------------- +*/ +.snackbars { + max-width: 280px; + padding: 9px 16px; + margin-left: auto; + margin-right: auto; + color: #fff; + text-align: left; + background-color: #151515; + border-radius: 0; + box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.15); + font-size: 14px; +} + +.snackbars .icon-xxs { + font-size: 18px; +} + +.snackbars p span:last-child { + padding-left: 14px; +} + +.snackbars-left { + display: inline-block; + margin-bottom: 0; +} + +.snackbars-right { + display: inline-block; + float: right; + text-transform: uppercase; +} + +.snackbars-right:hover { + text-decoration: underline; +} + +@media (min-width: 480px) { + .snackbars { + max-width: 380px; + padding: 12px 15px; + font-size: 16px; + } +} + +/* +* +* Navigation +* -------------------------------------------------- +*/ +.navigation-pills li a { + display: inline-block; + padding: 3px 9px; + border: 1px solid #8f859e; + border-radius: 5px; + font-size: 16px; + transition: .2s; +} + +.navigation-pills li a.active, .navigation-pills li a:hover, .navigation-pills li a:focus { + background-color: #8f859e; + color: #fff; +} + +/* +* +* Page Loaders +* -------------------------------------------------- +*/ +.page-loader { + position: fixed; + left: 0; + top: 0; + bottom: 0; + right: 0; + float: left; + display: flex; + justify-content: center; + align-items: center; + padding: 20px; + z-index: 9999999; + background: #fff; + transition: .3s all ease; +} + +.page-loader.loaded { + opacity: 0; + visibility: hidden; + z-index: -1; +} + +.page-loader.ending { + display: none; +} + +.page-loader .page-loader-body { + text-align: center; +} + +.page-loader .loader { + color: #fff; + font-size: 24px; +} + +.page-loader .loader span { + display: block; +} + +/* EDITABLE PARAMETERS */ +@keyframes flicker { + 0% { + background: transparent; + } + 50% { + background: white; + } + 100% { + background: transparent; + } +} + +@keyframes neon { + 0% { + text-shadow: none; + } + 50% { + text-shadow: rgba(255, 255, 255, 0.8) 0 0 8px; + } + 100% { + text-shadow: none; + } +} + +.loader { + padding: .5em; + width: 5.5em; + height: 9.5em; + margin: 100px auto; + background: #444444; + position: relative; + box-shadow: #2b2b2b 0 0 20px inset; + border-radius: 4px; +} + +.loader .hotel-sign { + padding: .25em 0; + position: absolute; + right: -1.5em; + width: 1.3em; + content: " "; + text-align: center; + background: #444444; + font-family: sans-serif; + font-weight: 700; + border-radius: 4px; + box-shadow: #2b2b2b 0 0 10px inset; + animation: neon 3s infinite ease; +} + +.loader .hotel-sign span { + line-height: 1; +} + +.loader .window { + background: white; + width: .5em; + height: 1em; + float: left; + margin: 0 .5em .5em 0; + border-radius: 2px; + animation: flicker 1s infinite ease; +} + +.loader .window:nth-of-type(5n) { + margin: 0 0 .5em 0; +} + +.loader .window:nth-child(1) { + animation-delay: 0.5s; + animation-duration: 0.5s; +} + +.loader .window:nth-child(2) { + animation-delay: 1s; + animation-duration: 1s; +} + +.loader .window:nth-child(3) { + animation-delay: 1.5s; + animation-duration: 1.5s; +} + +.loader .window:nth-child(4) { + animation-delay: 2s; + animation-duration: 2s; +} + +.loader .window:nth-child(5) { + animation-delay: 2.5s; + animation-duration: 2.5s; +} + +.loader .window:nth-child(5) { + animation-delay: 1.25s; + animation-duration: 1.25s; +} + +.loader .window:nth-child(6) { + animation-delay: 1.5s; + animation-duration: 1.5s; +} + +.loader .window:nth-child(7) { + animation-delay: 1.75s; + animation-duration: 1.75s; +} + +.loader .window:nth-child(8) { + animation-delay: 2s; + animation-duration: 2s; +} + +.loader .window:nth-child(9) { + animation-delay: 2.25s; + animation-duration: 2.25s; +} + +.loader .window:nth-child(10) { + animation-delay: 2.5s; + animation-duration: 2.5s; +} + +.loader .window:nth-child(10) { + animation-delay: 1s; + animation-duration: 1s; +} + +.loader .window:nth-child(11) { + animation-delay: 1.1s; + animation-duration: 1.1s; +} + +.loader .window:nth-child(12) { + animation-delay: 1.2s; + animation-duration: 1.2s; +} + +.loader .window:nth-child(13) { + animation-delay: 1.3s; + animation-duration: 1.3s; +} + +.loader .window:nth-child(14) { + animation-delay: 1.4s; + animation-duration: 1.4s; +} + +.loader .window:nth-child(15) { + animation-delay: 1.5s; + animation-duration: 1.5s; +} + +.loader .window:nth-child(16) { + animation-delay: 1.6s; + animation-duration: 1.6s; +} + +.loader .window:nth-child(17) { + animation-delay: 1.7s; + animation-duration: 1.7s; +} + +.loader .window:nth-child(18) { + animation-delay: 1.8s; + animation-duration: 1.8s; +} + +.loader .window:nth-child(19) { + animation-delay: 1.9s; + animation-duration: 1.9s; +} + +.loader .window:nth-child(20) { + animation-delay: 2s; + animation-duration: 2s; +} + +.loader .window:nth-child(20) { + animation-delay: 1.33333s; + animation-duration: 1.66667s; +} + +.loader .window:nth-child(21) { + animation-delay: 1.4s; + animation-duration: 1.75s; +} + +.loader .window:nth-child(22) { + animation-delay: 1.46667s; + animation-duration: 1.83333s; +} + +.loader .window:nth-child(23) { + animation-delay: 1.53333s; + animation-duration: 1.91667s; +} + +.loader .window:nth-child(24) { + animation-delay: 1.6s; + animation-duration: 2s; +} + +.loader .window:nth-child(25) { + animation-delay: 1.66667s; + animation-duration: 2.08333s; +} + +.loader .window:nth-child(26) { + animation-delay: 1.73333s; + animation-duration: 2.16667s; +} + +.loader .window:nth-child(27) { + animation-delay: 1.8s; + animation-duration: 2.25s; +} + +.loader .window:nth-child(28) { + animation-delay: 1.86667s; + animation-duration: 2.33333s; +} + +.loader .window:nth-child(29) { + animation-delay: 1.93333s; + animation-duration: 2.41667s; +} + +.loader .window:nth-child(30) { + animation-delay: 2s; + animation-duration: 2.5s; +} + +.loader .door { + background: white; + position: absolute; + bottom: 0; + width: 1em; + height: 1.5em; + left: 50%; + margin-left: -.5em; + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} + +.breadcrumbs-custom { + margin-top: 15px; + position: relative; + vertical-align: middle; +} + +.breadcrumbs-custom a { + display: inline; + vertical-align: middle; +} + +.breadcrumbs-custom a, .breadcrumbs-custom a:active, .breadcrumbs-custom a:focus { + color: #dcd1d5; +} + +.breadcrumbs-custom li { + position: relative; + display: inline-block; + vertical-align: middle; + padding-right: 36px; + font-size: 18px; +} + +.breadcrumbs-custom li:after { + content: ""; + position: absolute; + top: 53%; + right: 9px; + display: inline-block; + color: rgba(255, 255, 255, 0.5); + font: 400 18px/18px 'Material Design Icons'; + transform: translateY(-50%); +} + +.breadcrumbs-custom li:last-child { + padding-right: 0; +} + +.breadcrumbs-custom li:last-child:after { + display: none; +} + +.breadcrumbs-custom a:hover, +.breadcrumbs-custom li.active { + color: #fff; +} + +@media (min-width: 768px) { + .breadcrumbs-custom li { + padding-right: 44px; + } + .breadcrumbs-custom li:after { + right: 13px; + } +} + +.breadcrumbs-01 { + background-image: url(../images/breadcrumbs-01.jpg); +} + +.breadcrumbs-02 { + background-image: url(../images/breadcrumbs-02.jpg); +} + +.panel-group.panel-group-custom { + margin-bottom: 0; +} + +.panel-group.panel-group-custom .panel-heading + .panel-collapse > .panel-body, +.panel-group.panel-group-custom .panel-heading + .panel-collapse > .list-group { + border-top: 0; +} + +.panel-group.panel-group-custom .panel + .panel { + margin-top: 0; +} + +.panel-group.panel-group-corporate .panel + .panel { + margin-top: 30px; +} + +.panel-custom { + margin: 0; + background: inherit; + border: 0; + border-radius: 0; + box-shadow: none; +} + +.panel-custom a { + display: block; +} + +.panel-custom .panel-heading { + padding: 0; + border-bottom: 0; + border-top-radius: 0; +} + +.panel-custom .panel-body { + padding: 0; + border: 0; +} + +* + .panel-group-custom { + margin-top: 30px; +} + +.panel-corporate { + text-align: left; + box-shadow: 0 11px 32px 0 rgba(107, 127, 142, 0.21); +} + +.panel-corporate .panel-title a, +.panel-corporate .panel-collapse { + background: #fff; +} + +.panel-corporate .panel-title a { + position: relative; + z-index: 1; + padding: 21px 82px 21px 32px; + font-weight: 700; + font-size: 16px; + letter-spacing: 0; + color: #151515; + transition: 1.3s all ease; + border-radius: 6px 6px 0 0; + border-bottom: 1px solid #dedede; +} + +.panel-corporate .panel-title a .panel-arrow:after { + opacity: 0; + visibility: hidden; +} + +.panel-corporate .panel-title a.collapsed { + border-radius: 6px; + border-bottom-width: 0; +} + +.panel-corporate .panel-title a.collapsed .panel-arrow { + border-radius: 0 6px 6px 0; +} + +.panel-corporate .panel-title a.collapsed .panel-arrow:after { + opacity: 1; + visibility: visible; +} + +.panel-corporate .panel-arrow { + position: absolute; + top: 0; + bottom: -1px; + right: -1px; + z-index: 2; + width: 70px; + background: #8f859e; + border-radius: 0 6px 0 0; + transition: .33s all ease; +} + +.panel-corporate .panel-arrow:before, .panel-corporate .panel-arrow:after { + content: ''; + position: absolute; + top: 50%; + z-index: 4; + transform: translateY(-50%); + background: #fff; +} + +.panel-corporate .panel-arrow:before { + width: 14px; + height: 2px; + right: 28px; +} + +.panel-corporate .panel-arrow:after { + width: 2px; + height: 14px; + right: 34px; +} + +.panel-corporate .panel-collapse { + position: relative; + z-index: 1; + color: #9b9b9b; + border-radius: 0 0 6px 6px; +} + +.panel-corporate .panel-body { + padding: 25px 44px 25px 32px; +} + +@media (max-width: 767px) { + .panel-corporate .panel-title a, + .panel-corporate .panel-body { + padding-left: 25px; + } +} + +@media (min-width: 768px) { + .panel-corporate .panel-title a { + font-size: 18px; + } +} + +/* +* +* Pagination custom +* -------------------------------------------------- +*/ +.page .pagination-custom { + position: relative; + transform: translateY(-8px); + margin-bottom: -8px; + margin-left: -4px; + margin-right: -4px; +} + +.page .pagination-custom > * { + margin-top: 8px; + padding-left: 4px; + padding-right: 4px; +} + +.pagination-custom { + position: relative; + line-height: 0; + font-size: 0; + text-align: center; +} + +.pagination-custom li { + display: inline-block; + vertical-align: middle; +} + +.pagination-custom li a { + display: block; + width: auto; + min-height: 52px; + min-width: 52px; + height: 52px; + padding: 10px 20px; + border: 1px solid; + border-radius: 6px; + font: 700 14px/24px "Lato", Helvetica, Arial, sans-serif; + vertical-align: middle; +} + +.pagination-custom li a:after { + content: ''; + height: 108%; + width: 0; + display: inline-block; + vertical-align: middle; +} + +.pagination-custom li a, .pagination-custom li a:active, .pagination-custom li a:focus { + color: #151515; + background: #fff; + border-color: #cdcdcd; +} + +.pagination-custom li a:hover { + color: #fff; + background: #8f859e; + border-color: #8f859e; +} + +.pagination-custom li:first-child a, +.pagination-custom li:last-child a { + padding-left: 26px; + padding-right: 26px; + font-size: 12px; + text-transform: uppercase; +} + +.pagination-custom li:first-child a:before { + content: ''; +} + +.pagination-custom li:last-child a:before { + content: ''; +} + +.pagination-custom li.disabled, +.pagination-custom li.active { + pointer-events: none; +} + +.pagination-custom li.active a { + color: #fff; + background: #8f859e; + border-color: #8f859e; +} + +.pagination-custom li.disabled a { + color: rgba(21, 21, 21, 0.5); + background: #fff; + border-color: rgba(205, 205, 205, 0.5); +} + +* + .pagination-custom { + margin-top: 35px; +} + +@media (min-width: 768px) { + * + .pagination-custom { + margin-top: 60px; + } +} + +[class*='quote-'] { + font: inherit; + padding: 0; + border: 0; +} + +[class*='quote-'] q:before, [class*='quote-'] q:after { + content: none; +} + +[class*='quote-'] cite { + font-family: "Poppins", Helvetica, Arial, sans-serif; + font-style: normal; +} + +[class*='quote-'] small:before, +[class*='quote-'] .small:before { + display: none; +} + +@media (min-width: 480px) { + .quote-default p { + text-align: left; + } +} + +.quote-default cite { + font-weight: 700; + font-size: 18px; + letter-spacing: .02em; + color: #151515; +} + +.quote-default .quote-body { + position: relative; + border-top: 1px solid #ebebeb; + border-bottom: 1px solid #ebebeb; +} + +@media (min-width: 480px) { + .quote-default .quote-body { + padding-left: 25px; + } +} + +.quote-default .quote-body .unit { + position: relative; + padding-top: 32px; + padding-bottom: 27px; + background-color: #fff; +} + +.quote-default .quote-body svg { + margin-top: 6px; + fill: #8f859e; +} + +.quote-default .quote-body:before { + position: absolute; + top: calc(100% - 15px); + left: 80px; + content: ""; + width: 0; + height: 0; + border-style: solid; + border-width: 15px 0 15px 19px; + border-color: transparent transparent transparent #ebebeb; +} + +.quote-default .quote-body:after { + left: 81px; + position: absolute; + top: calc(100% - 17px); + content: ""; + width: 0; + height: 0; + border-style: solid; + border-width: 15px 0 15px 20px; + border-color: transparent transparent transparent #fff; +} + +.quote-default .quote-footer { + text-align: left; + padding-left: 25px; +} + +.quote-default * + .quote-footer { + margin-top: 15px; +} + +.quote-default-title { + font-size: 18px; + font-weight: 500; + letter-spacing: 0.02em; + font-style: italic; + color: #363d41; +} + +.quote-modern { + max-width: 335px; + margin-left: auto; + margin-right: auto; + text-align: center; +} + +.quote-modern .quote-header { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; +} + +.quote-modern .quote-header > div { + width: 120%; +} + +.quote-modern .quote-header:before, .quote-modern .quote-header:after { + border-color: #9b9b9b; +} + +.quote-modern .quote-body { + margin-top: 15px; + padding: 0 10px 15px; + color: #000; +} + +@media (min-width: 1200px) { + .quote-modern .quote-body { + padding-bottom: 30px; + } +} + +.quote-modern .quote-body * + p { + margin-top: 10px; +} + +.quote-modern .quote-footer { + position: relative; + padding: 30px 15px 15px; + border-top: 1px solid #9b9b9b; + color: #f2f3f8; + font-weight: 700; +} + +.quote-modern .quote-footer:before { + position: absolute; + top: 0; + left: 50%; + transform: translateX(-50%); + content: ""; + display: inline-block; + width: 0; + height: 0; + border-style: solid; + border-width: 20px 18px 0 18px; + border-color: #9b9b9b transparent transparent transparent; +} + +.quote-modern .quote-footer:after { + content: ''; + position: absolute; + top: -1px; + left: 50%; + transform: translateX(-50%); + display: inline-block; + width: 0; + height: 0; + border-style: solid; + border-width: 20px 18px 0 18px; + border-color: #fff transparent transparent transparent; +} + +.quote-classic .icon { + font-size: 22px; +} + +.quote-classic p + p { + margin-top: 25px; + margin-bottom: 3px; +} + +.quote-secondary { + position: relative; + padding: 18px 15px 20px; + text-align: center; +} + +.quote-secondary q { + font: 300 24px/48px "Poppins", Helvetica, Arial, sans-serif; + color: #dcd1d5; + display: inline-block; + max-width: 90%; +} + +.quote-secondary:before, .quote-secondary:after { + position: absolute; + left: 50%; + transform: translateX(-50%); + content: ""; + width: 50%; + max-width: 250px; + height: 1px; + background: linear-gradient(to right, rgba(0, 0, 0, 0), #ddd 50%, rgba(0, 0, 0, 0)); +} + +.quote-secondary:before { + top: 0; +} + +.quote-secondary:after { + bottom: 0; +} + +.quote-box { + text-align: left; + padding: 25px 15px; + box-shadow: 0 1px 16px rgba(0, 0, 0, 0.21); +} + +.quote-box .quote-box-header img { + width: auto; +} + +.quote-box-title { + font-size: 24px; + line-height: 33px; + font-family: "Poppins", Helvetica, Arial, sans-serif; + font-weight: 700; + margin-top: 10px; + letter-spacing: .05em; +} + +.quote-box-body { + margin-top: 20px; +} + +.quote-box-footer { + margin-top: 28px; +} + +.quote-box-cite { + overflow: hidden; + line-height: 1.2; +} + +.quote-box-cite cite { + color: #8f859e; + text-transform: uppercase; + font-weight: 700; + font-family: "Lato", Helvetica, Arial, sans-serif; +} + +.quote-box-cite span { + font-style: italic; + font-size: 16px; + color: #151515; + padding-left: 7px; + line-height: .8; +} + +@media (min-width: 768px) { + .quote-box { + padding: 35px 30px; + } + .quote-box-title { + margin-top: 0; + margin-left: 20px; + } + .quote-box-header { + display: flex; + align-items: center; + } + .quote-box-footer:before { + content: ""; + display: inline-block; + width: 62px; + height: 1px; + background: #dcd1d5; + margin-right: 27px; + margin-top: 8px; + float: left; + } +} + +@media (min-width: 1200px) { + .quote-box { + padding: 60px 30px 65px 65px; + } + .quote-box-title { + margin-left: 35px; + } +} + +.quote-box-mod-1 { + box-shadow: none; + width: 100%; +} + +.quote-box-mod-1 .quote-box-footer:before { + content: none; +} + +.quote-center { + position: relative; + max-width: 630px; + margin-left: auto; + margin-right: auto; +} + +.quote-center-title h4 { + letter-spacing: .05em; +} + +.quote-center-cite cite { + text-transform: uppercase; + color: #8f859e; + letter-spacing: .05em; + font-family: "Poppins", Helvetica, Arial, sans-serif; + font-weight: 500; +} + +.quote-center-cite span { + padding-left: 7px; + font-style: italic; + font-size: 16px; + letter-spacing: .05em; +} + +* + .quote-center-cite { + margin-top: 20px; +} + +@media (min-width: 1200px) { + .quote-center:before, .quote-center:after { + position: absolute; + top: 0; + } + .quote-center:before { + content: url("data:image/false;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAkCAYAAAD7PHgWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA9VpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wUmlnaHRzPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvcmlnaHRzLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcFJpZ2h0czpNYXJrZWQ9IkZhbHNlIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MDc0OGEzZGQtZjY3MC1hZjQ4LWE3NDAtN2ZiMTI3NWZhMzljIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjg5QzkzNjBGMEZEOTExRTc4MDBCRUI4RDU5OTcxREYwIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjg5QzkzNjBFMEZEOTExRTc4MDBCRUI4RDU5OTcxREYwIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1LjUgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NjMwNzYwODAtYzZiMi03MDQ2LWJmZmQtMDE5M2EwMDY2MWM3IiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6ZmM3ZjY1NDQtYTRlNS0xMWU2LWJiMjYtYTNhMWE4MjZlZDg3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+MyzpLwAAA7FJREFUeNqsWFtsTFEUnRmjBhVkvDUkEpGqDplEqCKtiPcrJBppPyt++iN8+BBC4g9NNPVIhB+URCPxiAihSLwfIx7VqGgpUo8ECTPTMmPt2pPcHufce869dycrp9nnzOq6+7z2PsFsNhtwa6l01xA0w4AI8Mz095F+eXa8URoSdiGqBE01sBwYbukKBjwYeKejWQ+sAEbm/GEDgjiaWmBuwEcDb4x558n6g05TDII+aLYBW4GQzVDTCBLvFmAH/y21sIO4fDSngCWSbvqyh8Ad4KOhuAHAcWCVov8xcBt4H7YRRyQXgdlCVxKo52n54GJWifc8UC7408BBYDc2T4dtBHlaT0vE3QcqQfCKx5mKo2VwQiLuEVAF3mbdKd4FLBZ854AKkCQ97IntwErBdwlYDd5fWpsEUaHddEVY9E3AApB0C2NNxJUCN4SNRuusHLxpZcitAvEP6cB9DkywjOkEikDyVbIUdMX1BZ4AhRbfF2AKeDvtfigeGxsFcWQ1MnGGViOII9vkJK5XBPl6aQMGW/oTQBxEWcVm0hGXz7xRi6+Zo5dx+rE1ghsEcWS1KnEGVi2II9sHZLS2PUUQkSCh7UCBpe8PEUPgd5uzUudYaRWWDX3wCFqDqmRBFsH5gjiyF3biNG2OZE238gbRspzAtZK+Nz7kAhUSn9HtE8I0BTl1Em2gDwKXKY6cgEkEC3lNiDYN4vM8iKOpHSfxFwP9TQTOUvRF+fxyayUK/yBgsy5JmL9IZXsQxYmcclFK9U51Z0osZtO3k6IL7gZKqYAO8P6UHgPJVPqCIt9TGWUeR4FDQLfNuEZKAgx4nzJvPcR2Wad4jOHUUepfx7fMJJtxBYa8NJN7qfhCZIusAoe6XGOTgevAWJsrzo3RkmqCyPEBhxpDx6j6Oqbo83JMUSl7ko7AEF89XqwMWCjx//DIO5POZxL4yYcDeZ3E980H3qpckuDVZLVymw+8pSHOdL3aaIkv4QPvKBJ41QciWU3hB+9vEniXbgiPRG8lPpqZ1x5520Ocdh/wSHRZ8fJQ55U3l1FTtd/i4vTPZd7FXGf898ImqRJ1jT4wHuJ3OkoAKh3uVpXtV4jrqQroqHDJexi6EmJdvIZvhogmyTVgEeBUnNCbXwO/y+gY7YsyCEz1uurgaOQ87pYDQYYfepZqiCM7C8wAbmpM6xGqkUic9OmDIxnkrIWiMzXw7yWVcsfPwD3gDAhaXDwe9WTq/O4T47ucSgB6GHhAD1bgfWkd/FeAAQC6VRaUjlwIRQAAAABJRU5ErkJggg=="); + left: -75px; + } + .quote-center:after { + right: -75px; + content: url("data:image/false;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAkCAYAAAD7PHgWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA9VpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wUmlnaHRzPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvcmlnaHRzLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcFJpZ2h0czpNYXJrZWQ9IkZhbHNlIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MDc0OGEzZGQtZjY3MC1hZjQ4LWE3NDAtN2ZiMTI3NWZhMzljIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjg5QzkzNjEzMEZEOTExRTc4MDBCRUI4RDU5OTcxREYwIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjg5QzkzNjEyMEZEOTExRTc4MDBCRUI4RDU5OTcxREYwIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE1LjUgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NjMwNzYwODAtYzZiMi03MDQ2LWJmZmQtMDE5M2EwMDY2MWM3IiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6ZmM3ZjY1NDQtYTRlNS0xMWU2LWJiMjYtYTNhMWE4MjZlZDg3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+RPfXfgAAA7BJREFUeNqsWEloFEEU7RnHLO5gNKjRiRs6xJC468XtLhIMuOUiJCqKiF6EXAQXcEejNz0qQTG4RIxeYogrCBonaohiwKgxGgcVskwczfi+/B56iqqeru7+8Ojhd83rV7+rq15VIJlMGtaID/6ei0s5sAgYDySAr0AUaMjJzmrhdoZmzAHKgCXABOAP0AO8BO4Cz8GdFP8UMAXigaNwOQtspbzNgx4AO4FXDoXlAqeBbUDQpt1jYJdZgDSBEJeD303AUocP7Qc2AbcytMvi6qx2yBsHKiCyzkyYParREEcxArgGLM/Q7qSGOAoqVC0KtiJVwYH4YCm9/wyvVRUdQBH3XIwI0AoMc8H7icYsKtlPFaxyKY5iBrBdca/SpTiKAmCPWcG3uM423Md7/r/4BdJXX+yB9yNQSBUMG95iJlAiyU/zyDuVvgsSGDK8xxpJLtsPXhLY7QNRqST3xQfeEhL4yAeiQkmu2QfeMAm85APROEmu1gfeiSSwHnjqkWiMJHePVycvEQjyAr0R+O6BqE+Rr2Cj4Tr+L3UQ+QGXVcA7lzy9ivxnYCXwxiXvj5S7gMjXuMwD9vESpbs0qaKdv/LdvKTqRFdA9IMWXziSl5wp7FwqbYiOA/s1jAZNwpOADcAOm7Y1ykkaFe3j3hMaIbgT14OK5lGNqpBVawc/8TaBl4bVKUXbVmUFJRXN5QE/WrHcdei8Owg0eelHF7t3MYqCGoQDirHZqStO4KW9Q4vk1jegLajJl5DkbvswIcumqXqaAnUFTpbkrvggcLokdzVt0+RgDOZx2QOCo54l8YI6Y3AsLjHB3NK0FUabIZ0Klkuc9zk34oRYJ3He50mc4wqil0HeZkYs6Ri7mF6XHwfxBnjyttq1X8SL+z+NDPtUcU2NCLkjbsVZYr3ESx4zxTmqIHqZz9XLs6Tb2OYnPIijeY+W13xxlwiBcXFfrBJHtv26IG6Id4JexA3nfbVVHFWqyirOViDE0Zp5U7I5PwQSLy6cVqQ6dk9p6zl4G5VnM4K4CDvtBcItElxGE6iLwyODt6eXgcVCvgFYC96/Uj9oEVYAnMHPFxJx94HNshMohxP8CT7JEsU9pClMJo4iBEHVbKnoVc5XPOAGsIWOIjREVbOlWgYsVJxe3CHLZcdLJwt2FaFeHQCOij108IrteOlDO0z2TVW5VAVt7tGA3QuCqOFvNDOvI3ctCuzmXd4FEDzzUVQP814Enuj8McT7EJp7YtYZ3IcoZl7aLbrm/SfAAM0MGudoC0HEAAAAAElFTkSuQmCC"); + } +} + +.quote-carousel-wrap { + padding: 40px 15px; + box-shadow: 0 0 29px rgba(0, 0, 0, 0.11); +} + +.quote-carousel-wrap #child-carousel { + max-width: 630px; + margin-left: auto; + margin-right: auto; +} + +.quote-carousel-wrap #child-carousel .slick-list { + padding: 10px 0; +} + +.quote-carousel-wrap #child-carousel .slick-slide { + pointer-events: none; +} + +.quote-carousel-wrap #child-carousel .slick-slide > * { + pointer-events: auto; +} + +.quote-carousel-wrap #child-carousel .slick-slide figure { + transform: scale3d(0.8, 0.8, 0.8); + transition: all 250ms ease-in; +} + +.quote-carousel-wrap #child-carousel .slick-slide figure:hover, +.quote-carousel-wrap #child-carousel .slick-center.slick-current figure { + transform: scale3d(1, 1, 1); +} + +.quote-carousel-wrap #child-carousel .slick-slide figure:hover img, +.quote-carousel-wrap #child-carousel .slick-center.slick-current figure img { + box-shadow: 0 0 0 8px #a387af; +} + +.quote-carousel-wrap figure { + display: inline-block; +} + +.bg-secondary-3 .quote-carousel-wrap { + background-color: #323232; +} + +.bg-primary .quote-carousel-wrap { + background-color: #684876; +} + +* + .quote-carousel-wrap-vertical { + margin-top: 30px; +} + +.quote-carousel-wrap-vertical figure { + display: inline-block; +} + +.quote-carousel-wrap-vertical .carousel-parent { + margin-bottom: 0; + padding: 10px 0; + background-color: #f3f3f3; +} + +.quote-carousel-wrap-vertical .carousel-parent .slick-slide { + display: flex; + align-items: center; +} + +.quote-carousel-wrap-vertical .carousel-parent .quote-box-body { + max-height: 170px; + overflow: hidden; +} + +.quote-carousel-wrap-vertical #child-carousel { + padding-top: 25px; + padding-bottom: 25px; + background-color: #e3e3e3; +} + +.quote-carousel-wrap-vertical #child-carousel img { + max-width: 100px; + transition: 350ms; +} + +.quote-carousel-wrap-vertical #child-carousel .slick-slide { + padding-top: 5px; + padding-bottom: 5px; + pointer-events: none; +} + +.quote-carousel-wrap-vertical #child-carousel .slick-slide > * { + pointer-events: auto; +} + +@media (min-width: 480px) { + .quote-carousel-wrap-vertical .carousel-parent .slick-slide { + height: 380px !important; + } +} + +@media (min-width: 768px) { + .quote-carousel-wrap-vertical { + display: flex; + align-items: stretch; + justify-content: space-between; + } + .quote-carousel-wrap-vertical > * { + width: 30%; + } + .quote-carousel-wrap-vertical .carousel-parent { + width: 70%; + } + .quote-carousel-wrap-vertical .carousel-parent .slick-slide { + height: 360px !important; + } + .quote-carousel-wrap-vertical #child-carousel { + text-align: center; + } + .quote-carousel-wrap-vertical #child-carousel .slick-slide.slick-center img, .quote-carousel-wrap-vertical #child-carousel .slick-slide:hover img { + box-shadow: 0 0 0 4px #8f859e; + } +} + +@media (min-width: 1200px) { + * + .quote-carousel-wrap-vertical { + margin-top: 50px; + } + .quote-carousel-wrap-vertical .quote-box { + padding: 60px 20px 65px 25px; + } +} + +@media (min-width: 1400px) { + .quote-carousel-wrap-vertical .quote-box { + padding: 60px 40px 65px 65px; + } + .quote-carousel-wrap-vertical #child-carousel .slick-slide { + padding-top: 10px; + padding-bottom: 10px; + } +} + +@media (min-width: 1600px) { + .quote-carousel-wrap-vertical .carousel-parent { + padding: 45px 0; + } + .quote-carousel-wrap-vertical #child-carousel { + padding-top: 45px; + padding-bottom: 30px; + } +} + +@media (min-width: 992px) { + .quote-carousel-wrap { + padding: 65px 15px 75px; + } +} + +.box-minimal { + text-align: center; +} + +.box-minimal-icon { + font-size: 50px; + line-height: 50px; + color: #343434; +} + +.box-minimal-icon-big { + font-size: 80px; + line-height: 80px; + color: #000; +} + +.box-minimal-divider { + width: 36px; + height: 4px; + margin-left: auto; + margin-right: auto; + background: #8f859e; +} + +.box-minimal-text { + width: 100%; + max-width: 320px; + margin-left: auto; + margin-right: auto; + color: #000; +} + +* + .box-minimal-title { + margin-top: 13px; +} + +* .box-minimal-divider { + margin-top: 16px; +} + +* .box-minimal-text { + margin-top: 15px; +} + +@media (min-width: 768px) { + .box-outline { + position: relative; + z-index: 1; + display: inline-block; + padding-top: 20px; + } + .box-outline > *:nth-child(1):before { + position: absolute; + top: 0; + bottom: 0; + right: 0; + left: 0; + z-index: -1; + border: 5px solid #dcd1d5; + content: ""; + transform: translate(-22px, -20px); + transition: 550ms ease-in-out; + } + .box-outline-fullwidth { + width: 100%; + } + .box-outline__mod-1 > *:nth-child(1):before { + left: 6px; + } + .box-outline__mod-2 > *:nth-child(1):before { + top: 20px; + right: 40px; + transform: translate(65px, -25px); + } +} + +@media (min-width: 1200px) { + .box-outline__mod-1 > *:nth-child(1) { + margin-left: 27px; + } + .box-outline__mod-1 > *:nth-child(1):before { + left: 17px; + } +} + +.team-box { + max-width: 320px; + margin-left: auto; + margin-right: auto; +} + +.team-box:hover .team-image-caption { + opacity: 1; + transform: scale(1); + filter: blur(0); +} + +.team-box:hover .team-image-caption .icon { + transform: rotateY(0deg); +} + +.team-box.box-outline:hover > *:nth-child(1):before { + transform: translate(-12px, -10px); +} + +.team-image-box { + position: relative; + max-width: 295px; + margin-left: auto; + margin-right: auto; +} + +.team-image-caption { + position: absolute; + top: 0; + bottom: 0; + right: 0; + left: 0; + display: flex; + align-items: center; + justify-content: center; + background-color: rgba(41, 41, 41, 0.38); + pointer-events: none; +} + +.team-image-caption > * { + pointer-events: auto; +} + +@media (min-width: 1200px) { + .desktop .team-image-caption { + filter: blur(5px); + opacity: 0; + transform: scale(1.05); + transition: all 250ms ease-in; + } + .desktop .team-image-caption .icon { + transform: rotateY(90deg); + transition-delay: 250ms; + } +} + +.team-caption { + color: #8f859e; +} + +.team-caption > * { + display: inline-block; +} + +.team-caption > * + *:before { + content: "|"; + font-size: 20px; + display: inline-block; + color: #ddd; + padding-left: 13px; + padding-right: 13px; +} + +* + .team-caption { + margin-top: 20px; +} + +@media (min-width: 768px) { + .team-caption { + text-align: left; + } +} + +@media (min-width: 1200px) { + .team-caption { + padding-left: 27px; + } +} + +.team-title { + font-size: 18px; + font-weight: 700; + color: #151515; +} + +.team-member-position { + color: #9b9b9b; +} + +h3 + .team-member-position { + margin-top: 10px; +} + +.team-member-position:before { + width: 50px; + height: 3px; + background-color: #8f859e; + content: ""; + display: inline-block; + vertical-align: middle; + margin-right: 15px; +} + +@media (min-width: 992px) { + .contact-box { + max-width: 635px; + margin-left: auto; + margin-right: auto; + } +} + +.contact-box-aside .divider { + margin-top: 15px; + margin-bottom: 20px; +} + +.box-custom { + max-width: 320px; + margin-left: auto; + margin-right: auto; +} + +.box-custom-img { + box-shadow: 2px 5px 15px rgba(0, 0, 0, 0.36); +} + +.box-custom-caption { + margin-top: 20px; + font-family: "Poppins", Helvetica, Arial, sans-serif; +} + +.box-custom-caption .subtitle { + font-size: 14px; + text-transform: uppercase; + letter-spacing: .05em; + font-weight: 500; + color: #9b9b9b; +} + +.box-custom-caption .subtitle:hover { + color: #8f859e; +} + +.box-custom-caption .title { + font-size: 18px; + font-weight: 700; + color: #151515; +} + +.box-custom-caption * + .title { + margin-top: 10px; +} + +@media (min-width: 1200px) { + .box-custom-caption { + margin-top: 35px; + } +} + +.services-box { + position: relative; + display: block; + max-width: 530px; + margin: 0 auto; + overflow: hidden; + perspective: 1300px; +} + +.services-box * { + color: #fff; +} + +.services-box figure { + transition: 1800ms ease-in-out; +} + +.services-box-custom { + width: 100%; + max-width: 100%; +} + +.services-box-title { + position: relative; + font: 700 24px/28px "Poppins", Helvetica, Arial, sans-serif; + letter-spacing: 0.05em; +} + +.services-box-title:after { + display: block; + width: 63px; + margin-left: auto; + margin-right: auto; + margin-top: 18px; + border-top: 2px solid; + content: ""; +} + +.services-box-price { + display: inline-block; + margin-top: 18px; + font-style: italic; +} + +.services-box-caption { + position: absolute; + top: 50%; + left: 50%; + transform: translate3d(-50%, -50%, 10px); + width: 90%; + max-width: 350px; + text-align: center; + padding-top: 12%; + padding-bottom: 11%; + perspective: 1300px; + z-index: 1; +} + +.services-box-caption:before { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + content: ""; + display: inline-block; + background-color: rgba(255, 255, 255, 0.26); + transition: 800ms opacity, 250ms transform; +} + +.services-single-box { + text-align: left; + max-width: 615px; +} + +.services-single-title { + font-weight: 500; + font-family: "Poppins", Helvetica, Arial, sans-serif; + line-height: 1; + display: flex; + align-items: center; + flex-grow: 1; +} + +.services-single-title:after { + content: ''; + border-top: 1px solid #ddd; + margin-left: 10px; + margin-right: 10px; + flex-grow: 1; +} + +.services-single-title, +.services-single-price { + font-size: 24px; + color: #151515; +} + +.services-single-header { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; +} + +.services-single-body { + margin-top: 5px; +} + +.services-box-main { + position: relative; + display: block; + max-width: 370px; + margin-left: auto; + margin-right: auto; + padding-bottom: 50px; + margin-bottom: 18px !important; + transition: 550ms ease-in-out; +} + +.services-box-main img { + width: 100%; +} + +.services-box-main:hover { + box-shadow: 1px 1px 13px rgba(0, 0, 0, 0.29); +} + +.services-box-main:hover .services-box-main-caption:before, .services-box-main:hover .services-box-main-caption:after { + border-width: 0 185px 0 185px; +} + +.services-box-main-caption { + position: absolute; + width: 100%; + overflow: hidden; + text-align: center; + padding: 18px 0; + bottom: -18px; + will-change: transform; +} + +.services-box-main-caption-inner { + background-color: #8f859e; + padding: 10px 15px; +} + +.services-box-main-caption-inner h4 { + letter-spacing: .05em; +} + +.services-box-main-caption-inner > * { + color: #fff; +} + +.services-box-main-caption:before, .services-box-main-caption:after { + position: absolute; + left: 50%; + content: ""; + transition: 350ms ease-in-out; + will-change: transform; + pointer-events: none; +} + +.services-box-main-caption:before { + top: 18px; + transform: translate(-50%, -100%); + width: 0; + height: 0; + border-style: solid; + border-width: 0 185px 18px 185px; + border-color: transparent transparent #8f859e transparent; +} + +.services-box-main-caption:after { + bottom: 18px; + transform: translate(-50%, 100%); + width: 0; + height: 0; + border-style: solid; + border-width: 18px 185px 0 185px; + border-color: #8f859e transparent transparent transparent; +} + +.services-box-var-2 { + position: relative; + overflow: hidden; + display: flex; + align-items: stretch; + justify-content: center; + width: 100%; + max-width: 530px; + margin-left: auto; + margin-right: auto; + perspective: 1300px; +} + +.services-box-var-2 * { + position: relative; + color: #fff; +} + +.services-box-var-2 figure { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + transition: 1800ms ease-in-out; +} + +.services-box-var-2 figure img { + position: relative; + left: 50%; + transform: translate3d(-50%, 0, 0); + width: auto; + height: auto; + max-width: none; +} + +@media (min-width: 1200px) { + .services-box-var-2 figure img { + width: 100%; + height: 100%; + } +} + +@media (min-width: 1800px) and (min-height: 750px) { + .services-box-var-2 figure img { + width: auto; + } +} + +.services-box-caption-var-2 { + display: flex; + align-items: center; + justify-content: center; + flex-flow: column wrap; + width: 100%; + padding: 80px 15px; + perspective: 1000px; +} + +.services-box-caption-var-2:before { + position: absolute; + top: 50%; + left: 50%; + width: 90%; + height: 100%; + max-height: 180px; + max-width: 280px; + transform: rotate3d(0, 1, 0, 0deg) translate3d(-50%, -50%, 0); + content: ""; + display: inline-block; + background-color: rgba(255, 255, 255, 0.26); + transition: 800ms opacity, 250ms transform; + transform-origin: left; + will-change: transform; +} + +@media (min-width: 1200px) { + .services-box-caption-var-2 { + padding: 60px 15px; + } +} + +@media (min-width: 992px) { + .services-box:after, + .services-box-var-2:after { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + content: ""; + display: inline-block; + background-color: rgba(137, 137, 137, 0.26); + opacity: 0; + transition: 1200ms opacity; + } + .services-box:hover .services-box-caption:before, + .services-box-var-2:hover .services-box-caption:before { + transform: rotate3d(0, 1, 0, 90deg); + opacity: 0; + } + .services-box:hover:after, + .services-box-var-2:hover:after { + opacity: 1; + } + .services-box:hover figure, + .services-box-var-2:hover figure { + transform: scale3d(1.05, 1.05, 1.05); + } + .services-box:hover .services-box-caption-var-2:before, + .services-box-var-2:hover .services-box-caption-var-2:before { + transform: rotate3d(0, 1, 0, 90deg) translate3d(-50%, -50%, 0); + opacity: 0; + } + .services-box-var-2:after { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + content: ""; + display: inline-block; + background-color: rgba(137, 137, 137, 0.26); + opacity: 0; + transition: 1200ms opacity; + } +} + +.special-box { + position: relative; + display: block; + overflow: hidden; + padding: 15px; + color: #151515; + text-align: center; +} + +.special-box:before { + position: absolute; + top: 15px; + bottom: 15px; + left: 15px; + right: 15px; + content: ""; + display: inline-block; + border: 1px solid #ebebeb; + z-index: 2; +} + +.special-box:after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border: 5px solid #ebebeb; + z-index: 0; +} + +.special-box figure { + display: none; +} + +.special-box:hover { + color: #151515; +} + +.special-box-footer { + border-top: 1px solid #ebebeb; +} + +.special-box-header, +.special-box-footer { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + position: relative; + margin: 0 15px; + padding: 20px 0; +} + +.special-box-header { + justify-content: center; +} + +.special-box-header-inner { + width: 100%; +} + +.special-box-title { + font-size: 16px; +} + +.special-box-offer { + font-size: 24px; + font-weight: 500; + font-family: "Poppins", Helvetica, Arial, sans-serif; +} + +.special-box-offer:before { + content: ""; + display: inline-block; + width: 62px; + height: 4px; + background: #dcd1d5; + vertical-align: middle; + margin-right: 13px; +} + +.special-box-price { + font-size: 45px; + font-weight: 500; + font-family: "Poppins", Helvetica, Arial, sans-serif; +} + +.special-box-price sup { + font-size: 24px; + vertical-align: middle; +} + +@media (min-width: 992px) { + .special-box-footer, + .special-box-header { + margin: 0 28px; + padding: 33px 0 30px; + justify-content: space-between; + position: relative; + z-index: 2; + } + .special-box-header-inner { + width: auto; + } + .special-box-price { + font-size: 60px; + } + .special-box { + text-align: left; + } + .special-box figure { + display: block; + position: absolute; + top: 0; + bottom: 0; + right: 0; + left: 0; + z-index: 1; + opacity: 0; + transform: scale3d(1.1, 1.1, 1.1); + transition: 500ms ease-in-out; + } + .special-box figure img { + width: auto; + height: 100%; + } + .special-box:hover { + color: #fff; + } + .special-box:hover figure { + transform: scale3d(1, 1, 1); + opacity: 1; + } +} + +.services-box-modern { + position: relative; + display: block; + overflow: hidden; + text-align: center; +} + +.services-box-modern-caption { + position: absolute; + padding: 15px; + z-index: 1; + top: 50%; + left: 50%; + transform: translate3d(-50%, -50%, 0); + width: 100%; +} + +@media (min-width: 992px) { + .services-box-modern-caption { + padding: 45px; + } +} + +.services-box-modern-caption hr { + display: block; +} + +.services-box-modern-overlay { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + padding: 20px; + transition: .33s all ease-in-out; + pointer-events: none; + background: rgba(73, 97, 130, 0.59); + will-change: transform; +} + +.services-box-modern-overlay::before, .services-box-modern-overlay::after { + pointer-events: none; + position: absolute; + top: 30px; + right: 30px; + bottom: 30px; + left: 30px; + content: ''; + opacity: 0; + transition: opacity 0.35s, transform 0.35s; +} + +.services-box-modern-overlay::before { + border-top: 1px solid rgba(255, 255, 255, 0.32); + border-bottom: 1px solid rgba(255, 255, 255, 0.32); + transform: scale(0, 1); +} + +.services-box-modern-overlay::after { + border-right: 1px solid rgba(255, 255, 255, 0.32); + border-left: 1px solid rgba(255, 255, 255, 0.32); + transform: scale(1, 0); +} + +.services-box-modern-overlay > * { + position: relative; + z-index: 2; +} + +.services-box-modern-price, .services-box-modern-title { + font-family: "Poppins", Helvetica, Arial, sans-serif; + color: #fff; +} + +.services-box-modern-title { + font-size: 26px; + font-weight: 700; + letter-spacing: .05em; +} + +.services-box-modern-price { + text-transform: uppercase; + letter-spacing: 0.1em; + font-size: 14px; +} + +.services-box-modern figure { + transform: translate3d(0, 0, 0); + transition: .33s all ease-in-out; +} + +@media (min-width: 768px) { + .services-box-modern-title { + font-size: 26px; + } + .services-box-modern-price { + font-size: 16px; + } +} + +@media (min-width: 992px) { + .desktop .services-box-modern-overlay { + transition: .4s all ease; + opacity: 0; + } + .desktop .services-box-modern-title { + font-size: 36px; + } + .desktop .services-box-modern figure img { + width: 100%; + } + .desktop .services-box-modern:hover figure { + transform: scale3d(1.05, 1.05, 1.05); + } + .desktop .services-box-modern:hover .services-box-modern-overlay { + opacity: 1; + } + .desktop .services-box-modern:hover .services-box-modern-overlay:before, .desktop .services-box-modern:hover .services-box-modern-overlay:after { + opacity: 1; + transform: scale(1); + } +} + +.pricing-box { + padding: 30px 15px; + border: 3px solid #ebebeb; +} + +.pricing-box hr { + max-width: 100px; +} + +.pricing-table { + width: 100%; + font-size: 20px; + line-height: 1; + color: #151515; +} + +.pricing-table td { + padding: 14px 0; + vertical-align: middle; +} + +.pricing-table td:first-of-type { + font-family: "Poppins", Helvetica, Arial, sans-serif; + font-size: 16px; + text-align: left; +} + +.pricing-table td:last-of-type { + text-align: right; +} + +* + .pricing-table { + margin-top: 15px; +} + +.pricing-box-title { + color: #8f859e; + text-transform: uppercase; + font: 500 24px/1 "Poppins", Helvetica, Arial, sans-serif; + text-align: center; +} + +@media (min-width: 768px) { + .pricing-box { + padding: 75px 30px 60px; + transition: 350ms; + } + .pricing-box > * { + transition: 350ms; + } + .pricing-box * + hr { + margin-top: 25px; + } + .pricing-box:hover { + background-color: #8f859e; + border-color: #8f859e; + } + .pricing-box:hover > * { + color: #fff; + } + .pricing-table { + font-size: 24px; + } + .pricing-table td:first-of-type { + font-size: 18px; + } + * + .pricing-table { + margin-top: 37px; + } +} + +.box-bordered { + border: 3px solid; + padding: 25px 15px; + max-width: 470px; + margin-left: auto; + margin-right: auto; +} + +.box-bordered h5 + p { + margin-top: 15px; +} + +.box-bordered h5 { + line-height: 1; +} + +.box-bordered .unit + .unit { + margin-top: 25px; +} + +@media (min-width: 768px) { + .box-bordered { + padding: 40px 35px; + } + .box-bordered .unit + .unit { + margin-top: 35px; + } +} + +@media (min-width: 1200px) { + .box-bordered { + padding: 50px 55px 45px; + } + .box-bordered .unit + .unit { + margin-top: 50px; + } +} + +.services-box-main-var-1 { + max-width: 1100px; + margin-left: auto; + margin-right: auto; + border: 3px solid; + padding: 0 15px; + display: flex; + flex-direction: column; +} + +.services-box-main-var-1 .heading-subtitle-divider-wrap:before { + max-width: 63px; +} + +.services-box-main-var-1-inner { + padding: 35px 0; +} + +.services-box-main-var-1-inner + .services-box-main-var-1-inner { + border-top: 1px solid; +} + +.services-box-main-var-1 .inner-wrap { + max-width: 370px; + margin-left: auto; + margin-right: 0; +} + +@media (max-width: 767px) { + .services-box-main-var-1 .inner-wrap h2 + p { + margin-top: 0; + } +} + +@media (min-width: 768px) { + .services-box-main-var-1 { + padding: 45px 0; + flex-direction: row; + } + .services-box-main-var-1-inner { + flex-grow: 1; + width: 100%; + padding: 15px 30px; + } + .services-box-main-var-1-inner + .services-box-main-var-1-inner { + border-top: 0; + border-left: 1px solid; + } +} + +@media (min-width: 1200px) { + .services-box-main-var-1 { + padding: 80px 45px 75px; + } +} + +.object-wrap { + position: relative; + overflow: hidden; +} + +@media (min-width: 992px) { + .object-wrap-md-right > .object-wrap-body { + right: 0; + } + .object-wrap-md-left > .object-wrap-body { + left: 0; + } +} + +@media (min-width: 992px) { + .object-wrap-body { + overflow: hidden; + position: absolute; + top: 0; + bottom: 0; + width: 100vw; + min-width: 1px; + max-width: none; + height: 100%; + min-height: 100%; + max-height: none; + margin: 0; + background: inherit; + z-index: 0; + } + .object-wrap-body + * { + margin-top: 0; + } + .object-wrap-body.object-wrap-map { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + } + .object-wrap-body.object-wrap-map .rd-google-map { + width: 100%; + height: 100%; + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + } +} + +@media (min-width: 992px) { + .sizing-1 { + width: calc(50% - 970px / 2 - 50px + (970px / 12) * 6); + } +} + +@media (min-width: 1200px) { + .sizing-1 { + width: calc(50% - 970px / 2 + (970px / 12) * 5); + } +} + +@media (min-width: 1200px) { + .sizing-1 { + width: calc(50% - 970px / 2 + (970px / 12) * 5); + } +} + +.page-footer-minimal { + position: relative; + background: #f3f3f3; + padding: 40px 0; +} + +.page-footer-minimal .rights a { + text-decoration: underline; +} + +.page-footer-minimal .rights a, .page-footer-minimal .rights a:active, .page-footer-minimal .rights a:focus { + color: #9b9b9b; +} + +.page-footer-minimal .rights a:hover { + color: #8f859e; +} + +.page-footer-minimal .list-desc dt { + color: #8f859e; +} + +.page-footer-minimal h4 + * { + margin-top: 20px; +} + +.page-footer-minimal .icon { + line-height: 1; +} + +.page-footer-minimal .page-footer-minimal-inner { + max-width: 360px; + margin-left: auto; + margin-right: auto; +} + +.page-footer-minimal .page-footer-minimal-inner-subscribe { + max-width: 480px; + margin-left: auto; + margin-right: auto; +} + +.page-footer-minimal .form-input { + background-color: #fff; +} + +@media (min-width: 992px) { + .page-footer-minimal { + padding: 65px 0; + } +} + +.page-footer-corporate { + position: relative; + z-index: 1; + padding: 1px 0; + color: #fff; + background-color: transparent; +} + +.page-footer-corporate:before { + content: ''; + position: absolute; + top: 2px; + left: 0; + right: 0; + bottom: 0; + z-index: 0; + background: #363d41; + pointer-events: none; +} + +@media (min-width: 992px) { + .page-footer-corporate:before { + top: 0; + } +} + +.page-footer-corporate > * { + z-index: 2; +} + +.page-footer-corporate a, .page-footer-corporate a:active, .page-footer-corporate a:focus { + color: inherit; +} + +.page-footer-corporate a:hover { + color: #fff; +} + +.page-footer-corporate a.icon-gray-3:hover { + color: #fff; +} + +.page-footer-corporate h3, +.page-footer-corporate .h3 { + text-transform: none; +} + +.page-footer-corporate .list-desc dt { + color: #636e74; +} + +.page-footer-corporate .list-column-3 { + max-width: 350px; +} + +.page-footer-corporate .rd-mailform + * { + margin-top: 40px; +} + +.page-footer-corporate .rights { + color: #636e74; +} + +.page-footer-corporate-inner { + position: relative; +} + +.page-footer-corporate-inner h5 { + text-transform: uppercase; + letter-spacing: .2em; +} + +.page-footer-corporate-top { + padding: 40px 0; +} + +.page-footer-corporate-top * + h5 { + margin-top: 30px; +} + +@media (min-width: 768px) { + .page-footer-corporate-top * + h5 { + margin-top: 58px; + } +} + +.page-footer-corporate-top hr + * { + margin-top: 23px; +} + +.page-footer-corporate-bottom { + padding: 20px 0; + position: relative; + transform: translateY(-10px); + margin-bottom: -10px; + margin-left: -5px; + margin-right: -5px; + text-align: left; +} + +.page-footer-corporate-bottom > * { + margin-top: 10px; + padding-left: 5px; + padding-right: 5px; +} + +@media (max-width: 767px) { + .page-footer-corporate-inner { + max-width: 400px; + margin-left: auto; + margin-right: auto; + } +} + +@media (min-width: 768px) { + .page-footer-corporate-bottom { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + position: relative; + transform: translateY(0); + margin-bottom: 0; + margin-left: 0; + margin-right: 0; + padding-bottom: 70px; + } + .page-footer-corporate-bottom > * { + margin-top: 0; + padding-left: 0; + padding-right: 0; + } +} + +@media (min-width: 1800px) { + .page-footer-corporate .rd-mailform + * { + margin-top: 70px; + } + .page-footer-corporate-top { + padding: 70px 0 40px; + } + .page-footer-corporate-inner { + padding: 0 50px 0 35px; + } +} + +.one-screen-page { + text-align: center; + background-color: #1b181d; + -webkit-background-size: cover; + background-size: cover; + background-position: center center; +} + +.one-screen-page .page { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: stretch; + -ms-flex-align: stretch; + align-items: stretch; + background-color: transparent; +} + +.one-screen-page-inner { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + min-height: 100vh; + -webkit-flex-grow: 1; + -ms-flex-positive: 1; + flex-grow: 1; +} + +.one-screen-page-inner, +.one-screen-page-inner > * { + width: 100%; +} + +.one-screen-page-inner:before { + content: ''; + display: block; + width: 100%; +} + +.one-screen-page .shell { + width: 100%; +} + +.one-screen-page header { + padding: calc(1em + 3vh) 0 calc(1em + 1.5vh); +} + +.one-screen-page .one-screen-page-content { + padding: calc(1em + 3vh) 0; +} + +.one-screen-page footer { + padding: calc(1em + 1.5vh) 0 calc(1em + 3vh); +} + +.one-screen-page .rights a, .one-screen-page .rights a:active, .one-screen-page .rights a:focus { + color: #fff; +} + +.one-screen-page .rights a:hover { + color: #9b9b9b; +} + +.one-screen-page * + .group-sm { + margin-top: 35px; +} + +@media (min-width: 768px) { + .one-screen-page * + .group-sm { + margin-top: 45px; + } + .one-screen-page * + .h7 { + margin-top: 40px; + } +} + +.ie-10 .one-screen-page, +.ie-11 .one-screen-page { + overflow-x: hidden; + overflow-y: auto; +} + +.footer-default { + padding: 0; +} + +@media (min-width: 768px) { + .footer-default h3 { + font-size: 30px; + } +} + +.footer-default h3 + .post-minimal { + margin-top: 35px; +} + +.footer-default * + .list-desc { + margin-top: 0; +} + +.footer-default * + .post-minimal { + margin-top: 37px; +} + +.footer-default a, .footer-default a:active, .footer-default a:focus { + color: #fff; +} + +.footer-default a:hover { + color: #dcd1d5; +} + +.footer-default .list-desc dt { + color: #dcd1d5; +} + +.footer-default .post-box-icon { + color: #dcd1d5; + font-style: italic; +} + +.footer-default .post-box-icon:before { + font-style: normal; + color: #fff; +} + +.footer-default .rd-mailform { + line-height: 0; +} + +.footer-default .rd-mailform .form-button { + margin-top: 20px; +} + +.footer-default .contact-list li { + position: relative; + padding-top: 15px; + padding-bottom: 15px; +} + +@media (min-width: 768px) { + .footer-default .contact-list li { + padding-top: 30px; + padding-bottom: 30px; + } +} + +.footer-default .contact-list li:first-of-type { + padding-top: 0; +} + +.footer-default .contact-list li + li:before { + content: ""; + display: inline-block; + position: absolute; + bottom: 100%; + left: 0; + right: 0; + max-width: 200px; + border-top: 1px solid #4d4d4d; +} + +.footer-default .rights a { + text-decoration: underline; +} + +.footer-default .rights a, .footer-default .rights a:active, .footer-default .rights a:focus { + color: #fff; +} + +.footer-default .rights a:hover { + color: #9b9b9b; +} + +/* +* +* Helpers +* ================================================== +*/ +/* +* +* Text Alignment +* -------------------------------------------------- +*/ +.text-left { + text-align: left; +} + +.text-center { + text-align: center; +} + +.text-right { + text-align: right; +} + +.text-middle { + vertical-align: middle; +} + +@media (min-width: 480px) { + html:not(.lt-ie10) .text-xs-left { + text-align: left; + } + html:not(.lt-ie10) .text-xs-center { + text-align: center; + } + html:not(.lt-ie10) .text-xs-right { + text-align: right; + } + html:not(.lt-ie10) .text-xs-justify { + text-align: justify; + } +} + +@media (min-width: 768px) { + html:not(.lt-ie10) .text-sm-left { + text-align: left; + } + html:not(.lt-ie10) .text-sm-center { + text-align: center; + } + html:not(.lt-ie10) .text-sm-right { + text-align: right; + } + html:not(.lt-ie10) .text-sm-justify { + text-align: justify; + } +} + +@media (min-width: 992px) { + html:not(.lt-ie10) .text-md-left { + text-align: left; + } + html:not(.lt-ie10) .text-md-center { + text-align: center; + } + html:not(.lt-ie10) .text-md-right { + text-align: right; + } + html:not(.lt-ie10) .text-md-justify { + text-align: justify; + } +} + +@media (min-width: 1200px) { + html:not(.lt-ie10) .text-lg-left { + text-align: left; + } + html:not(.lt-ie10) .text-lg-center { + text-align: center; + } + html:not(.lt-ie10) .text-lg-right { + text-align: right; + } + html:not(.lt-ie10) .text-lg-justify { + text-align: justify; + } +} + +/* +* +* Text styling +* -------------------------------------------------- +*/ +.text-italic { + font-style: italic; +} + +.text-normal { + font-style: normal; +} + +.text-underline { + text-decoration: underline; +} + +.text-strike { + text-decoration: line-through; +} + +.page .text-thin { + font-weight: 100; +} + +.page .text-light { + font-weight: 300; +} + +.page .text-regular { + font-weight: 400; +} + +.page .text-medium { + font-weight: 500; +} + +.page .text-sbold { + font-weight: 600; +} + +.page .text-bold, .page strong { + font-weight: 700; +} + +.page .text-ubold { + font-weight: 900; +} + +.text-spacing-0 { + letter-spacing: 0; +} + +/* +* +* Visibility Responsive +* -------------------------------------------------- +*/ +.reveal-block { + display: block !important; +} + +.reveal-inline-block { + display: inline-block !important; +} + +.reveal-inline { + display: inline !important; +} + +.reveal-flex { + display: -ms-flexbox !important; + display: -webkit-flex !important; + display: flex !important; +} + +.veil { + display: none !important; +} + +@media (min-width: 480px) { + .reveal-xs-block { + display: block !important; + } + .reveal-xs-inline-block { + display: inline-block !important; + } + .reveal-xs-inline { + display: inline !important; + } + .reveal-xs-flex { + display: -ms-flexbox !important; + display: -webkit-flex !important; + display: flex !important; + } + .veil-xs { + display: none !important; + } +} + +@media (min-width: 768px) { + .reveal-sm-block { + display: block !important; + } + .reveal-sm-inline-block { + display: inline-block !important; + } + .reveal-sm-inline { + display: inline !important; + } + .reveal-sm-flex { + display: -ms-flexbox !important; + display: -webkit-flex !important; + display: flex !important; + } + .veil-sm { + display: none !important; + } +} + +@media (min-width: 992px) { + .reveal-md-block { + display: block !important; + } + .reveal-md-inline-block { + display: inline-block !important; + } + .reveal-md-inline { + display: inline !important; + } + .reveal-md-flex { + display: -ms-flexbox !important; + display: -webkit-flex !important; + display: flex !important; + } + .veil-md { + display: none !important; + } +} + +@media (min-width: 1200px) { + .reveal-lg-block { + display: block !important; + } + .reveal-lg-inline-block { + display: inline-block !important; + } + .reveal-lg-inline { + display: inline !important; + } + .reveal-lg-flex { + display: -ms-flexbox !important; + display: -webkit-flex !important; + display: flex !important; + } + .veil-lg { + display: none !important; + } +} + +@media (min-width: 1800px) { + .reveal-xl-block { + display: block !important; + } + .reveal-xl-inline-block { + display: inline-block !important; + } + .reveal-xl-inline { + display: inline !important; + } + .reveal-xl-flex { + display: -ms-flexbox !important; + display: -webkit-flex !important; + display: flex !important; + } + .veil-xl { + display: none !important; + } +} + +/* +* +* Element groups +* -------------------------------------------------- +*/ +html .page .group { + transform: translateY(-20px); + margin-bottom: -20px; + margin-left: -15px; +} + +html .page .group > *, html .page .group > *:first-child { + display: inline-block; + margin-top: 20px; + margin-left: 15px; +} + +html .page .group-xs { + transform: translateY(-5px); + margin-bottom: -5px; + margin-left: -12px; +} + +html .page .group-xs > *, html .page .group-xs > *:first-child { + display: inline-block; + margin-top: 5px; + margin-left: 12px; +} + +html .page .group-sm { + transform: translateY(-10px); + margin-bottom: -10px; + margin-left: -10px; +} + +html .page .group-sm > *, html .page .group-sm > *:first-child { + display: inline-block; + margin-top: 10px; + margin-left: 10px; +} + +html .page .group-lg { + transform: translateY(-10px); + margin-bottom: -10px; + margin-left: -20px; +} + +html .page .group-lg > *, html .page .group-lg > *:first-child { + display: inline-block; + margin-top: 10px; + margin-left: 20px; +} + +html .page .group-xl { + transform: translateY(-27px); + margin-bottom: -27px; + margin-left: -27px; +} + +html .page .group-xl > *, html .page .group-xl > *:first-child { + display: inline-block; + margin-top: 27px; + margin-left: 27px; +} + +@media (min-width: 992px) { + html .page .group-xl { + transform: translateY(-25px); + margin-bottom: -25px; + margin-left: -40px; + } + html .page .group-xl > *, html .page .group-xl > *:first-child { + display: inline-block; + margin-top: 25px; + margin-left: 40px; + } +} + +@media (min-width: 1200px) { + html .page .group-xl { + transform: translateY(-30px); + margin-bottom: -30px; + margin-left: -90px; + } + html .page .group-xl > *, html .page .group-xl > *:first-child { + display: inline-block; + margin-top: 30px; + margin-left: 90px; + } +} + +html .page .group-top > *, html .page .group-top > *:first-child { + vertical-align: top; +} + +html .page .group-middle { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; +} + +html .page .group-center { + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} + +html .page .group-bottom > *, html .page .group-bottom > *:first-child { + vertical-align: bottom; +} + +/* +* +* Contexts +* -------------------------------------------------- +*/ +.bg-gray-dark, .bg-primary, .bg-gray-10, .bg-gray-13, .bg-gray-11, .bg-secondary-3, .bg-half-secondary-3, .one-screen-page, .context-dark { + color: #fff; +} + +.bg-gray-dark h1, .bg-primary h1, .bg-gray-10 h1, .bg-gray-13 h1, .bg-gray-11 h1, .bg-secondary-3 h1, .bg-half-secondary-3 h1, .one-screen-page h1, .context-dark h1, .bg-gray-dark .heading-1, .bg-primary .heading-1, .bg-gray-10 .heading-1, .bg-gray-13 .heading-1, .bg-gray-11 .heading-1, .bg-secondary-3 .heading-1, .bg-half-secondary-3 .heading-1, .one-screen-page .heading-1, .context-dark .heading-1, .bg-gray-dark h2, .bg-primary h2, .bg-gray-10 h2, .bg-gray-13 h2, .bg-gray-11 h2, .bg-secondary-3 h2, .bg-half-secondary-3 h2, .one-screen-page h2, .context-dark h2, .bg-gray-dark .heading-2, .bg-primary .heading-2, .bg-gray-10 .heading-2, .bg-gray-13 .heading-2, .bg-gray-11 .heading-2, .bg-secondary-3 .heading-2, .bg-half-secondary-3 .heading-2, .one-screen-page .heading-2, .context-dark .heading-2, .bg-gray-dark h3, .bg-primary h3, .bg-gray-10 h3, .bg-gray-13 h3, .bg-gray-11 h3, .bg-secondary-3 h3, .bg-half-secondary-3 h3, .one-screen-page h3, .context-dark h3, .bg-gray-dark .heading-3, .bg-primary .heading-3, .bg-gray-10 .heading-3, .bg-gray-13 .heading-3, .bg-gray-11 .heading-3, .bg-secondary-3 .heading-3, .bg-half-secondary-3 .heading-3, .one-screen-page .heading-3, .context-dark .heading-3, .bg-gray-dark h4, .bg-primary h4, .bg-gray-10 h4, .bg-gray-13 h4, .bg-gray-11 h4, .bg-secondary-3 h4, .bg-half-secondary-3 h4, .one-screen-page h4, .context-dark h4, .bg-gray-dark .heading-4, .bg-primary .heading-4, .bg-gray-10 .heading-4, .bg-gray-13 .heading-4, .bg-gray-11 .heading-4, .bg-secondary-3 .heading-4, .bg-half-secondary-3 .heading-4, .one-screen-page .heading-4, .context-dark .heading-4, .bg-gray-dark h5, .bg-primary h5, .bg-gray-10 h5, .bg-gray-13 h5, .bg-gray-11 h5, .bg-secondary-3 h5, .bg-half-secondary-3 h5, .one-screen-page h5, .context-dark h5, .bg-gray-dark .heading-5, .bg-primary .heading-5, .bg-gray-10 .heading-5, .bg-gray-13 .heading-5, .bg-gray-11 .heading-5, .bg-secondary-3 .heading-5, .bg-half-secondary-3 .heading-5, .one-screen-page .heading-5, .context-dark .heading-5, .bg-gray-dark h6, .bg-primary h6, .bg-gray-10 h6, .bg-gray-13 h6, .bg-gray-11 h6, .bg-secondary-3 h6, .bg-half-secondary-3 h6, .one-screen-page h6, .context-dark h6, .bg-gray-dark .heading-6, .bg-primary .heading-6, .bg-gray-10 .heading-6, .bg-gray-13 .heading-6, .bg-gray-11 .heading-6, .bg-secondary-3 .heading-6, .bg-half-secondary-3 .heading-6, .one-screen-page .heading-6, .context-dark .heading-6, .bg-gray-dark, .bg-primary, .bg-gray-10, .bg-gray-13, .bg-gray-11, .bg-secondary-3, .bg-half-secondary-3, .one-screen-page, .context-dark { + color: #fff; +} + +.bg-gray-dark .button-secondary-outline, .bg-primary .button-secondary-outline, .bg-gray-10 .button-secondary-outline, .bg-gray-13 .button-secondary-outline, .bg-gray-11 .button-secondary-outline, .bg-secondary-3 .button-secondary-outline, .bg-half-secondary-3 .button-secondary-outline, .one-screen-page .button-secondary-outline, .context-dark .button-secondary-outline { + color: #fff; + background-color: transparent; + border-color: #dcd1d5; +} + +.bg-gray-dark .button-secondary-outline:hover, .bg-primary .button-secondary-outline:hover, .bg-gray-10 .button-secondary-outline:hover, .bg-gray-13 .button-secondary-outline:hover, .bg-gray-11 .button-secondary-outline:hover, .bg-secondary-3 .button-secondary-outline:hover, .bg-half-secondary-3 .button-secondary-outline:hover, .one-screen-page .button-secondary-outline:hover, .context-dark .button-secondary-outline:hover, .bg-gray-dark .button-secondary-outline:focus, .bg-primary .button-secondary-outline:focus, .bg-gray-10 .button-secondary-outline:focus, .bg-gray-13 .button-secondary-outline:focus, .bg-gray-11 .button-secondary-outline:focus, .bg-secondary-3 .button-secondary-outline:focus, .bg-half-secondary-3 .button-secondary-outline:focus, .one-screen-page .button-secondary-outline:focus, .context-dark .button-secondary-outline:focus, .bg-gray-dark .button-secondary-outline:active, .bg-primary .button-secondary-outline:active, .bg-gray-10 .button-secondary-outline:active, .bg-gray-13 .button-secondary-outline:active, .bg-gray-11 .button-secondary-outline:active, .bg-secondary-3 .button-secondary-outline:active, .bg-half-secondary-3 .button-secondary-outline:active, .one-screen-page .button-secondary-outline:active, .context-dark .button-secondary-outline:active, .bg-gray-dark .button-secondary-outline:hover, .bg-primary .button-secondary-outline:hover, .bg-gray-10 .button-secondary-outline:hover, .bg-gray-13 .button-secondary-outline:hover, .bg-gray-11 .button-secondary-outline:hover, .bg-secondary-3 .button-secondary-outline:hover, .bg-half-secondary-3 .button-secondary-outline:hover, .one-screen-page .button-secondary-outline:hover, .context-dark .button-secondary-outline:hover { + color: #151515; + background-color: #fff; + border-color: #fff; +} + +.bg-gray-dark .button-secondary-outline.button-effect-ujarak:before, .bg-primary .button-secondary-outline.button-effect-ujarak:before, .bg-gray-10 .button-secondary-outline.button-effect-ujarak:before, .bg-gray-13 .button-secondary-outline.button-effect-ujarak:before, .bg-gray-11 .button-secondary-outline.button-effect-ujarak:before, .bg-secondary-3 .button-secondary-outline.button-effect-ujarak:before, .bg-half-secondary-3 .button-secondary-outline.button-effect-ujarak:before, .one-screen-page .button-secondary-outline.button-effect-ujarak:before, .context-dark .button-secondary-outline.button-effect-ujarak:before { + background-color: #fff; +} + +.bg-gray-dark .button-secondary-outline.button-effect-ujarak:after, .bg-primary .button-secondary-outline.button-effect-ujarak:after, .bg-gray-10 .button-secondary-outline.button-effect-ujarak:after, .bg-gray-13 .button-secondary-outline.button-effect-ujarak:after, .bg-gray-11 .button-secondary-outline.button-effect-ujarak:after, .bg-secondary-3 .button-secondary-outline.button-effect-ujarak:after, .bg-half-secondary-3 .button-secondary-outline.button-effect-ujarak:after, .one-screen-page .button-secondary-outline.button-effect-ujarak:after, .context-dark .button-secondary-outline.button-effect-ujarak:after { + border: 3px solid #dcd1d5; +} + +.bg-gray-dark .button-secondary-outline.button-effect-ujarak:focus, .bg-primary .button-secondary-outline.button-effect-ujarak:focus, .bg-gray-10 .button-secondary-outline.button-effect-ujarak:focus, .bg-gray-13 .button-secondary-outline.button-effect-ujarak:focus, .bg-gray-11 .button-secondary-outline.button-effect-ujarak:focus, .bg-secondary-3 .button-secondary-outline.button-effect-ujarak:focus, .bg-half-secondary-3 .button-secondary-outline.button-effect-ujarak:focus, .one-screen-page .button-secondary-outline.button-effect-ujarak:focus, .context-dark .button-secondary-outline.button-effect-ujarak:focus, .bg-gray-dark .button-secondary-outline.button-effect-ujarak:active, .bg-primary .button-secondary-outline.button-effect-ujarak:active, .bg-gray-10 .button-secondary-outline.button-effect-ujarak:active, .bg-gray-13 .button-secondary-outline.button-effect-ujarak:active, .bg-gray-11 .button-secondary-outline.button-effect-ujarak:active, .bg-secondary-3 .button-secondary-outline.button-effect-ujarak:active, .bg-half-secondary-3 .button-secondary-outline.button-effect-ujarak:active, .one-screen-page .button-secondary-outline.button-effect-ujarak:active, .context-dark .button-secondary-outline.button-effect-ujarak:active { + background: #fff; + border-color: #fff; +} + +.bg-gray-dark .button-secondary-outline.button-effect-ujarak:focus:after, .bg-primary .button-secondary-outline.button-effect-ujarak:focus:after, .bg-gray-10 .button-secondary-outline.button-effect-ujarak:focus:after, .bg-gray-13 .button-secondary-outline.button-effect-ujarak:focus:after, .bg-gray-11 .button-secondary-outline.button-effect-ujarak:focus:after, .bg-secondary-3 .button-secondary-outline.button-effect-ujarak:focus:after, .bg-half-secondary-3 .button-secondary-outline.button-effect-ujarak:focus:after, .one-screen-page .button-secondary-outline.button-effect-ujarak:focus:after, .context-dark .button-secondary-outline.button-effect-ujarak:focus:after, .bg-gray-dark .button-secondary-outline.button-effect-ujarak:active:after, .bg-primary .button-secondary-outline.button-effect-ujarak:active:after, .bg-gray-10 .button-secondary-outline.button-effect-ujarak:active:after, .bg-gray-13 .button-secondary-outline.button-effect-ujarak:active:after, .bg-gray-11 .button-secondary-outline.button-effect-ujarak:active:after, .bg-secondary-3 .button-secondary-outline.button-effect-ujarak:active:after, .bg-half-secondary-3 .button-secondary-outline.button-effect-ujarak:active:after, .one-screen-page .button-secondary-outline.button-effect-ujarak:active:after, .context-dark .button-secondary-outline.button-effect-ujarak:active:after { + border-color: #fff; +} + +.bg-gray-dark .button-secondary-outline.button-effect-ujarak:hover, .bg-primary .button-secondary-outline.button-effect-ujarak:hover, .bg-gray-10 .button-secondary-outline.button-effect-ujarak:hover, .bg-gray-13 .button-secondary-outline.button-effect-ujarak:hover, .bg-gray-11 .button-secondary-outline.button-effect-ujarak:hover, .bg-secondary-3 .button-secondary-outline.button-effect-ujarak:hover, .bg-half-secondary-3 .button-secondary-outline.button-effect-ujarak:hover, .one-screen-page .button-secondary-outline.button-effect-ujarak:hover, .context-dark .button-secondary-outline.button-effect-ujarak:hover { + background: transparent; +} + +.bg-gray-dark h1, .bg-primary h1, .bg-gray-10 h1, .bg-gray-13 h1, .bg-gray-11 h1, .bg-secondary-3 h1, .bg-half-secondary-3 h1, .one-screen-page h1, .context-dark h1, .bg-gray-dark h2, .bg-primary h2, .bg-gray-10 h2, .bg-gray-13 h2, .bg-gray-11 h2, .bg-secondary-3 h2, .bg-half-secondary-3 h2, .one-screen-page h2, .context-dark h2, .bg-gray-dark h3, .bg-primary h3, .bg-gray-10 h3, .bg-gray-13 h3, .bg-gray-11 h3, .bg-secondary-3 h3, .bg-half-secondary-3 h3, .one-screen-page h3, .context-dark h3, .bg-gray-dark h4, .bg-primary h4, .bg-gray-10 h4, .bg-gray-13 h4, .bg-gray-11 h4, .bg-secondary-3 h4, .bg-half-secondary-3 h4, .one-screen-page h4, .context-dark h4, .bg-gray-dark h5, .bg-primary h5, .bg-gray-10 h5, .bg-gray-13 h5, .bg-gray-11 h5, .bg-secondary-3 h5, .bg-half-secondary-3 h5, .one-screen-page h5, .context-dark h5, .bg-gray-dark h6, .bg-primary h6, .bg-gray-10 h6, .bg-gray-13 h6, .bg-gray-11 h6, .bg-secondary-3 h6, .bg-half-secondary-3 h6, .one-screen-page h6, .context-dark h6, .bg-gray-dark .heading-1, .bg-primary .heading-1, .bg-gray-10 .heading-1, .bg-gray-13 .heading-1, .bg-gray-11 .heading-1, .bg-secondary-3 .heading-1, .bg-half-secondary-3 .heading-1, .one-screen-page .heading-1, .context-dark .heading-1, .bg-gray-dark .heading-2, .bg-primary .heading-2, .bg-gray-10 .heading-2, .bg-gray-13 .heading-2, .bg-gray-11 .heading-2, .bg-secondary-3 .heading-2, .bg-half-secondary-3 .heading-2, .one-screen-page .heading-2, .context-dark .heading-2, .bg-gray-dark .heading-3, .bg-primary .heading-3, .bg-gray-10 .heading-3, .bg-gray-13 .heading-3, .bg-gray-11 .heading-3, .bg-secondary-3 .heading-3, .bg-half-secondary-3 .heading-3, .one-screen-page .heading-3, .context-dark .heading-3, .bg-gray-dark .heading-4, .bg-primary .heading-4, .bg-gray-10 .heading-4, .bg-gray-13 .heading-4, .bg-gray-11 .heading-4, .bg-secondary-3 .heading-4, .bg-half-secondary-3 .heading-4, .one-screen-page .heading-4, .context-dark .heading-4, .bg-gray-dark .heading-5, .bg-primary .heading-5, .bg-gray-10 .heading-5, .bg-gray-13 .heading-5, .bg-gray-11 .heading-5, .bg-secondary-3 .heading-5, .bg-half-secondary-3 .heading-5, .one-screen-page .heading-5, .context-dark .heading-5, .bg-gray-dark .heading-6, .bg-primary .heading-6, .bg-gray-10 .heading-6, .bg-gray-13 .heading-6, .bg-gray-11 .heading-6, .bg-secondary-3 .heading-6, .bg-half-secondary-3 .heading-6, .one-screen-page .heading-6, .context-dark .heading-6 { + color: #fff; +} + +.bg-gray-dark .divider, .bg-primary .divider, .bg-gray-10 .divider, .bg-gray-13 .divider, .bg-gray-11 .divider, .bg-secondary-3 .divider, .bg-half-secondary-3 .divider, .one-screen-page .divider, .context-dark .divider { + background-color: #636e74; +} + +.bg-gray-dark .divider-secondary, .bg-primary .divider-secondary, .bg-gray-10 .divider-secondary, .bg-gray-13 .divider-secondary, .bg-gray-11 .divider-secondary, .bg-secondary-3 .divider-secondary, .bg-half-secondary-3 .divider-secondary, .one-screen-page .divider-secondary, .context-dark .divider-secondary { + background-color: #dcd1d5; +} + +.bg-gray-dark .rd-mailform .form-input, .bg-primary .rd-mailform .form-input, .bg-gray-10 .rd-mailform .form-input, .bg-gray-13 .rd-mailform .form-input, .bg-gray-11 .rd-mailform .form-input, .bg-secondary-3 .rd-mailform .form-input, .bg-half-secondary-3 .rd-mailform .form-input, .one-screen-page .rd-mailform .form-input, .context-dark .rd-mailform .form-input, +.bg-gray-dark .rd-mailform .form-label, +.bg-primary .rd-mailform .form-label, +.bg-gray-10 .rd-mailform .form-label, +.bg-gray-13 .rd-mailform .form-label, +.bg-gray-11 .rd-mailform .form-label, +.bg-secondary-3 .rd-mailform .form-label, +.bg-half-secondary-3 .rd-mailform .form-label, +.one-screen-page .rd-mailform .form-label, +.context-dark .rd-mailform .form-label, +.bg-gray-dark .rd-mailform .form-label-outside, +.bg-primary .rd-mailform .form-label-outside, +.bg-gray-10 .rd-mailform .form-label-outside, +.bg-gray-13 .rd-mailform .form-label-outside, +.bg-gray-11 .rd-mailform .form-label-outside, +.bg-secondary-3 .rd-mailform .form-label-outside, +.bg-half-secondary-3 .rd-mailform .form-label-outside, +.one-screen-page .rd-mailform .form-label-outside, +.context-dark .rd-mailform .form-label-outside, +.bg-gray-dark .rd-mailform .form-validation, +.bg-primary .rd-mailform .form-validation, +.bg-gray-10 .rd-mailform .form-validation, +.bg-gray-13 .rd-mailform .form-validation, +.bg-gray-11 .rd-mailform .form-validation, +.bg-secondary-3 .rd-mailform .form-validation, +.bg-half-secondary-3 .rd-mailform .form-validation, +.one-screen-page .rd-mailform .form-validation, +.context-dark .rd-mailform .form-validation { + color: #fff; +} + +.bg-gray-dark .rd-mailform .form-input, .bg-primary .rd-mailform .form-input, .bg-gray-10 .rd-mailform .form-input, .bg-gray-13 .rd-mailform .form-input, .bg-gray-11 .rd-mailform .form-input, .bg-secondary-3 .rd-mailform .form-input, .bg-half-secondary-3 .rd-mailform .form-input, .one-screen-page .rd-mailform .form-input, .context-dark .rd-mailform .form-input { + background: rgba(255, 255, 255, 0.47); + border: 0; +} + +.bg-gray-dark .form-wrap_icon::before, .bg-primary .form-wrap_icon::before, .bg-gray-10 .form-wrap_icon::before, .bg-gray-13 .form-wrap_icon::before, .bg-gray-11 .form-wrap_icon::before, .bg-secondary-3 .form-wrap_icon::before, .bg-half-secondary-3 .form-wrap_icon::before, .one-screen-page .form-wrap_icon::before, .context-dark .form-wrap_icon::before { + color: #fff; +} + +.bg-gray-dark .counter-box, .bg-primary .counter-box, .bg-gray-10 .counter-box, .bg-gray-13 .counter-box, .bg-gray-11 .counter-box, .bg-secondary-3 .counter-box, .bg-half-secondary-3 .counter-box, .one-screen-page .counter-box, .context-dark .counter-box, +.bg-gray-dark .counter-box .counter-box-header, +.bg-primary .counter-box .counter-box-header, +.bg-gray-10 .counter-box .counter-box-header, +.bg-gray-13 .counter-box .counter-box-header, +.bg-gray-11 .counter-box .counter-box-header, +.bg-secondary-3 .counter-box .counter-box-header, +.bg-half-secondary-3 .counter-box .counter-box-header, +.one-screen-page .counter-box .counter-box-header, +.context-dark .counter-box .counter-box-header { + color: #fff; +} + +.bg-gray-dark .counter-box-minimal .counter, .bg-primary .counter-box-minimal .counter, .bg-gray-10 .counter-box-minimal .counter, .bg-gray-13 .counter-box-minimal .counter, .bg-gray-11 .counter-box-minimal .counter, .bg-secondary-3 .counter-box-minimal .counter, .bg-half-secondary-3 .counter-box-minimal .counter, .one-screen-page .counter-box-minimal .counter, .context-dark .counter-box-minimal .counter, +.bg-gray-dark .counter-box-minimal .counter-box-title, +.bg-primary .counter-box-minimal .counter-box-title, +.bg-gray-10 .counter-box-minimal .counter-box-title, +.bg-gray-13 .counter-box-minimal .counter-box-title, +.bg-gray-11 .counter-box-minimal .counter-box-title, +.bg-secondary-3 .counter-box-minimal .counter-box-title, +.bg-half-secondary-3 .counter-box-minimal .counter-box-title, +.one-screen-page .counter-box-minimal .counter-box-title, +.context-dark .counter-box-minimal .counter-box-title { + color: #fff; +} + +.bg-gray-dark .quote-circle cite, .bg-primary .quote-circle cite, .bg-gray-10 .quote-circle cite, .bg-gray-13 .quote-circle cite, .bg-gray-11 .quote-circle cite, .bg-secondary-3 .quote-circle cite, .bg-half-secondary-3 .quote-circle cite, .one-screen-page .quote-circle cite, .context-dark .quote-circle cite, +.bg-gray-dark .quote-circle .quote-text, +.bg-primary .quote-circle .quote-text, +.bg-gray-10 .quote-circle .quote-text, +.bg-gray-13 .quote-circle .quote-text, +.bg-gray-11 .quote-circle .quote-text, +.bg-secondary-3 .quote-circle .quote-text, +.bg-half-secondary-3 .quote-circle .quote-text, +.one-screen-page .quote-circle .quote-text, +.context-dark .quote-circle .quote-text, +.bg-gray-dark .quote-circle .quote-boxed-meta, +.bg-primary .quote-circle .quote-boxed-meta, +.bg-gray-10 .quote-circle .quote-boxed-meta, +.bg-gray-13 .quote-circle .quote-boxed-meta, +.bg-gray-11 .quote-circle .quote-boxed-meta, +.bg-secondary-3 .quote-circle .quote-boxed-meta, +.bg-half-secondary-3 .quote-circle .quote-boxed-meta, +.one-screen-page .quote-circle .quote-boxed-meta, +.context-dark .quote-circle .quote-boxed-meta { + color: #fff; +} + +.bg-gray-dark .list-nav-marked > li, .bg-primary .list-nav-marked > li, .bg-gray-10 .list-nav-marked > li, .bg-gray-13 .list-nav-marked > li, .bg-gray-11 .list-nav-marked > li, .bg-secondary-3 .list-nav-marked > li, .bg-half-secondary-3 .list-nav-marked > li, .one-screen-page .list-nav-marked > li, .context-dark .list-nav-marked > li { + color: #fff; +} + +.bg-gray-dark .terms-list-inline dt:after, .bg-primary .terms-list-inline dt:after, .bg-gray-10 .terms-list-inline dt:after, .bg-gray-13 .terms-list-inline dt:after, .bg-gray-11 .terms-list-inline dt:after, .bg-secondary-3 .terms-list-inline dt:after, .bg-half-secondary-3 .terms-list-inline dt:after, .one-screen-page .terms-list-inline dt:after, .context-dark .terms-list-inline dt:after, +.bg-gray-dark .terms-list-inline dd, +.bg-primary .terms-list-inline dd, +.bg-gray-10 .terms-list-inline dd, +.bg-gray-13 .terms-list-inline dd, +.bg-gray-11 .terms-list-inline dd, +.bg-secondary-3 .terms-list-inline dd, +.bg-half-secondary-3 .terms-list-inline dd, +.one-screen-page .terms-list-inline dd, +.context-dark .terms-list-inline dd { + color: #fff; +} + +.bg-gray-dark .link, .bg-primary .link, .bg-gray-10 .link, .bg-gray-13 .link, .bg-gray-11 .link, .bg-secondary-3 .link, .bg-half-secondary-3 .link, .one-screen-page .link, .context-dark .link, .bg-gray-dark .link:active, .bg-primary .link:active, .bg-gray-10 .link:active, .bg-gray-13 .link:active, .bg-gray-11 .link:active, .bg-secondary-3 .link:active, .bg-half-secondary-3 .link:active, .one-screen-page .link:active, .context-dark .link:active, .bg-gray-dark .link:focus, .bg-primary .link:focus, .bg-gray-10 .link:focus, .bg-gray-13 .link:focus, .bg-gray-11 .link:focus, .bg-secondary-3 .link:focus, .bg-half-secondary-3 .link:focus, .one-screen-page .link:focus, .context-dark .link:focus { + color: #fff; +} + +.bg-gray-dark .link:hover, .bg-primary .link:hover, .bg-gray-10 .link:hover, .bg-gray-13 .link:hover, .bg-gray-11 .link:hover, .bg-secondary-3 .link:hover, .bg-half-secondary-3 .link:hover, .one-screen-page .link:hover, .context-dark .link:hover { + color: #8f859e; +} + +.bg-gray-dark .terms-list dd, .bg-primary .terms-list dd, .bg-gray-10 .terms-list dd, .bg-gray-13 .terms-list dd, .bg-gray-11 .terms-list dd, .bg-secondary-3 .terms-list dd, .bg-half-secondary-3 .terms-list dd, .one-screen-page .terms-list dd, .context-dark .terms-list dd { + color: #fff; +} + +.bg-gray-dark .button-gray-dark-outline, .bg-primary .button-gray-dark-outline, .bg-gray-10 .button-gray-dark-outline, .bg-gray-13 .button-gray-dark-outline, .bg-gray-11 .button-gray-dark-outline, .bg-secondary-3 .button-gray-dark-outline, .bg-half-secondary-3 .button-gray-dark-outline, .one-screen-page .button-gray-dark-outline, .context-dark .button-gray-dark-outline { + color: #fff; + background-color: transparent; + border-color: #fff; +} + +.bg-gray-dark .button-gray-dark-outline:hover, .bg-primary .button-gray-dark-outline:hover, .bg-gray-10 .button-gray-dark-outline:hover, .bg-gray-13 .button-gray-dark-outline:hover, .bg-gray-11 .button-gray-dark-outline:hover, .bg-secondary-3 .button-gray-dark-outline:hover, .bg-half-secondary-3 .button-gray-dark-outline:hover, .one-screen-page .button-gray-dark-outline:hover, .context-dark .button-gray-dark-outline:hover, .bg-gray-dark .button-gray-dark-outline:focus, .bg-primary .button-gray-dark-outline:focus, .bg-gray-10 .button-gray-dark-outline:focus, .bg-gray-13 .button-gray-dark-outline:focus, .bg-gray-11 .button-gray-dark-outline:focus, .bg-secondary-3 .button-gray-dark-outline:focus, .bg-half-secondary-3 .button-gray-dark-outline:focus, .one-screen-page .button-gray-dark-outline:focus, .context-dark .button-gray-dark-outline:focus, .bg-gray-dark .button-gray-dark-outline:active, .bg-primary .button-gray-dark-outline:active, .bg-gray-10 .button-gray-dark-outline:active, .bg-gray-13 .button-gray-dark-outline:active, .bg-gray-11 .button-gray-dark-outline:active, .bg-secondary-3 .button-gray-dark-outline:active, .bg-half-secondary-3 .button-gray-dark-outline:active, .one-screen-page .button-gray-dark-outline:active, .context-dark .button-gray-dark-outline:active, .bg-gray-dark .button-gray-dark-outline:hover, .bg-primary .button-gray-dark-outline:hover, .bg-gray-10 .button-gray-dark-outline:hover, .bg-gray-13 .button-gray-dark-outline:hover, .bg-gray-11 .button-gray-dark-outline:hover, .bg-secondary-3 .button-gray-dark-outline:hover, .bg-half-secondary-3 .button-gray-dark-outline:hover, .one-screen-page .button-gray-dark-outline:hover, .context-dark .button-gray-dark-outline:hover { + color: #151515; + background-color: #fff; + border-color: #fff; +} + +.bg-gray-dark .button-gray-dark-outline.button-effect-ujarak:before, .bg-primary .button-gray-dark-outline.button-effect-ujarak:before, .bg-gray-10 .button-gray-dark-outline.button-effect-ujarak:before, .bg-gray-13 .button-gray-dark-outline.button-effect-ujarak:before, .bg-gray-11 .button-gray-dark-outline.button-effect-ujarak:before, .bg-secondary-3 .button-gray-dark-outline.button-effect-ujarak:before, .bg-half-secondary-3 .button-gray-dark-outline.button-effect-ujarak:before, .one-screen-page .button-gray-dark-outline.button-effect-ujarak:before, .context-dark .button-gray-dark-outline.button-effect-ujarak:before { + background-color: #fff; +} + +.bg-gray-dark .button-gray-dark-outline.button-effect-ujarak:after, .bg-primary .button-gray-dark-outline.button-effect-ujarak:after, .bg-gray-10 .button-gray-dark-outline.button-effect-ujarak:after, .bg-gray-13 .button-gray-dark-outline.button-effect-ujarak:after, .bg-gray-11 .button-gray-dark-outline.button-effect-ujarak:after, .bg-secondary-3 .button-gray-dark-outline.button-effect-ujarak:after, .bg-half-secondary-3 .button-gray-dark-outline.button-effect-ujarak:after, .one-screen-page .button-gray-dark-outline.button-effect-ujarak:after, .context-dark .button-gray-dark-outline.button-effect-ujarak:after { + border: 3px solid #fff; +} + +.bg-gray-dark .button-gray-dark-outline.button-effect-ujarak:hover, .bg-primary .button-gray-dark-outline.button-effect-ujarak:hover, .bg-gray-10 .button-gray-dark-outline.button-effect-ujarak:hover, .bg-gray-13 .button-gray-dark-outline.button-effect-ujarak:hover, .bg-gray-11 .button-gray-dark-outline.button-effect-ujarak:hover, .bg-secondary-3 .button-gray-dark-outline.button-effect-ujarak:hover, .bg-half-secondary-3 .button-gray-dark-outline.button-effect-ujarak:hover, .one-screen-page .button-gray-dark-outline.button-effect-ujarak:hover, .context-dark .button-gray-dark-outline.button-effect-ujarak:hover { + background: transparent; +} + +.bg-gray-dark .box-bordered, .bg-primary .box-bordered, .bg-gray-10 .box-bordered, .bg-gray-13 .box-bordered, .bg-gray-11 .box-bordered, .bg-secondary-3 .box-bordered, .bg-half-secondary-3 .box-bordered, .one-screen-page .box-bordered, .context-dark .box-bordered, +.bg-gray-dark .services-box-main-var-1, +.bg-primary .services-box-main-var-1, +.bg-gray-10 .services-box-main-var-1, +.bg-gray-13 .services-box-main-var-1, +.bg-gray-11 .services-box-main-var-1, +.bg-secondary-3 .services-box-main-var-1, +.bg-half-secondary-3 .services-box-main-var-1, +.one-screen-page .services-box-main-var-1, +.context-dark .services-box-main-var-1, +.bg-gray-dark .services-box-main-var-1-inner, +.bg-primary .services-box-main-var-1-inner, +.bg-gray-10 .services-box-main-var-1-inner, +.bg-gray-13 .services-box-main-var-1-inner, +.bg-gray-11 .services-box-main-var-1-inner, +.bg-secondary-3 .services-box-main-var-1-inner, +.bg-half-secondary-3 .services-box-main-var-1-inner, +.one-screen-page .services-box-main-var-1-inner, +.context-dark .services-box-main-var-1-inner { + border-color: rgba(255, 255, 255, 0.22); +} + +.bg-gray-dark .btn-primary, .bg-primary .btn-primary, .bg-gray-10 .btn-primary, .bg-gray-13 .btn-primary, .bg-gray-11 .btn-primary, .bg-secondary-3 .btn-primary, .bg-half-secondary-3 .btn-primary, .one-screen-page .btn-primary, .context-dark .btn-primary { + color: #8f859e; + background-color: #fff; + border-color: #fff; +} + +.bg-gray-dark .btn-primary:hover, .bg-primary .btn-primary:hover, .bg-gray-10 .btn-primary:hover, .bg-gray-13 .btn-primary:hover, .bg-gray-11 .btn-primary:hover, .bg-secondary-3 .btn-primary:hover, .bg-half-secondary-3 .btn-primary:hover, .one-screen-page .btn-primary:hover, .context-dark .btn-primary:hover, .bg-gray-dark .btn-primary:focus, .bg-primary .btn-primary:focus, .bg-gray-10 .btn-primary:focus, .bg-gray-13 .btn-primary:focus, .bg-gray-11 .btn-primary:focus, .bg-secondary-3 .btn-primary:focus, .bg-half-secondary-3 .btn-primary:focus, .one-screen-page .btn-primary:focus, .context-dark .btn-primary:focus, .bg-gray-dark .btn-primary:active, .bg-primary .btn-primary:active, .bg-gray-10 .btn-primary:active, .bg-gray-13 .btn-primary:active, .bg-gray-11 .btn-primary:active, .bg-secondary-3 .btn-primary:active, .bg-half-secondary-3 .btn-primary:active, .one-screen-page .btn-primary:active, .context-dark .btn-primary:active, .bg-gray-dark .btn-primary:hover, .bg-primary .btn-primary:hover, .bg-gray-10 .btn-primary:hover, .bg-gray-13 .btn-primary:hover, .bg-gray-11 .btn-primary:hover, .bg-secondary-3 .btn-primary:hover, .bg-half-secondary-3 .btn-primary:hover, .one-screen-page .btn-primary:hover, .context-dark .btn-primary:hover { + color: #8f859e; + background-color: #f2f2f2; + border-color: #f2f2f2; +} + +.bg-gray-dark .select2-container--bootstrap .select2-selection--single .select2-selection__rendered, .bg-primary .select2-container--bootstrap .select2-selection--single .select2-selection__rendered, .bg-gray-10 .select2-container--bootstrap .select2-selection--single .select2-selection__rendered, .bg-gray-13 .select2-container--bootstrap .select2-selection--single .select2-selection__rendered, .bg-gray-11 .select2-container--bootstrap .select2-selection--single .select2-selection__rendered, .bg-secondary-3 .select2-container--bootstrap .select2-selection--single .select2-selection__rendered, .bg-half-secondary-3 .select2-container--bootstrap .select2-selection--single .select2-selection__rendered, .one-screen-page .select2-container--bootstrap .select2-selection--single .select2-selection__rendered, .context-dark .select2-container--bootstrap .select2-selection--single .select2-selection__rendered { + color: #fff; +} + +.page .bg-gray-dark .text-secondary, .page .bg-primary .text-secondary, .page .bg-gray-10 .text-secondary, .page .bg-gray-13 .text-secondary, .page .bg-gray-11 .text-secondary, .page .bg-secondary-3 .text-secondary, .page .bg-half-secondary-3 .text-secondary, .page .one-screen-page .text-secondary, .page .context-dark .text-secondary { + color: #dcd1d5; +} + +.page .bg-gray-dark a.text-secondary:hover, .page .bg-primary a.text-secondary:hover, .page .bg-gray-10 a.text-secondary:hover, .page .bg-gray-13 a.text-secondary:hover, .page .bg-gray-11 a.text-secondary:hover, .page .bg-secondary-3 a.text-secondary:hover, .page .bg-half-secondary-3 a.text-secondary:hover, .page .one-screen-page a.text-secondary:hover, .page .context-dark a.text-secondary:hover, +.page .bg-gray-dark a.text-secondary:focus, +.page .bg-primary a.text-secondary:focus, +.page .bg-gray-10 a.text-secondary:focus, +.page .bg-gray-13 a.text-secondary:focus, +.page .bg-gray-11 a.text-secondary:focus, +.page .bg-secondary-3 a.text-secondary:focus, +.page .bg-half-secondary-3 a.text-secondary:focus, +.page .one-screen-page a.text-secondary:focus, +.page .context-dark a.text-secondary:focus { + color: #c6b4bb; +} + +.bg-primary .list-desc dt { + color: #dcd1d5; +} + +.bg-gray-11 .rd-mailform .form-input { + background: #4d4d4d; + border: 0; +} + +.bg-gray-11 .select2-container .select2-choice { + background-color: #4d4d4d; + border: 1px solid #4d4d4d; + color: #fff; +} + +.bg-gray-11 .select2-container.select2-dropdown-open .select2-choice { + border-color: #4d4d4d; +} + +.context-light h1, .layout-panel-wrap h1, .context-light .heading-1, .layout-panel-wrap .heading-1, .context-light h2, .layout-panel-wrap h2, .context-light .heading-2, .layout-panel-wrap .heading-2, .context-light h3, .layout-panel-wrap h3, .context-light .heading-3, .layout-panel-wrap .heading-3, .context-light h4, .layout-panel-wrap h4, .context-light .heading-4, .layout-panel-wrap .heading-4, .context-light h5, .layout-panel-wrap h5, .context-light .heading-5, .layout-panel-wrap .heading-5, .context-light h6, .layout-panel-wrap h6, .context-light .heading-6, .layout-panel-wrap .heading-6, .context-light, .layout-panel-wrap { + color: #000; +} + +/* +* +* Sections +* -------------------------------------------------- +*/ +.section-xxs { + padding-top: 30px; + padding-bottom: 30px; +} + +.section-sm { + padding-top: 50px; + padding-bottom: 60px; +} + +.section-md { + padding-top: 65px; + padding-bottom: 75px; +} + +.section-md-top { + padding-top: 65px; +} + +.section-lg { + padding-top: 100px; + padding-bottom: 100px; +} + +@media (min-width: 768px) { + .section-sm { + padding-top: 80px; + padding-bottom: 90px; + } + .section-md { + padding-top: 95px; + padding-bottom: 110px; + } + .section-md-top { + padding-top: 95px; + } + .section-lg { + padding-top: 150px; + padding-bottom: 155px; + } +} + +.section-relative { + position: relative; + z-index: 1; +} + +.section-wrap-content-var-1 { + display: flex; + align-items: center; + justify-content: center; + flex-grow: 1; + padding: 30px; +} + +.section-wrap-content-var-1-inner { + max-width: 420px; +} + +@media (max-width: 480px) { + .section-grid-demonstration [class^="col"] { + padding: 5px; + } +} + +.section-grid-demonstration .grid-demonstration-item { + background: #ebebeb; +} + +@media (min-width: 768px) { + .section-grid-demonstration .grid-demonstration-item { + padding: 35px 30px; + text-align: left; + } +} + +@media (max-width: 1199px) { + .section-grid-demonstration .grid-demonstration-item h3 { + font-size: 16px; + line-height: 16px; + } + .section-grid-demonstration .grid-demonstration-item p { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + width: 100%; + } +} + +.section-grid-demonstration .divider + .row { + margin-top: 35px; +} + +/** +* Custom sections +*/ +.section-wrap { + position: relative; + padding: 1px 0; + overflow: hidden; +} + +.section-wrap .section-wrap-inner { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + position: relative; + transform: translateY(-35px); + margin-bottom: -35px; + pointer-events: none; + width: 100%; +} + +.section-wrap .section-wrap-inner > *:before { + content: ''; + display: table; + width: 0; +} + +.section-wrap .section-wrap-inner > * { + margin-top: 35px; + pointer-events: auto; +} + +.section-wrap .section-wrap-inner > * { + width: 100%; +} + +.section-wrap .section-wrap-aside { + bottom: -1px; +} + +.section-wrap .google-map { + width: 100%; + max-width: none; +} + +.section-wrap .box-minimal { + width: 100%; + max-width: none; +} + +.section-wrap .section-wrap-image { + position: relative; + top: -1px; + overflow: hidden; + height: 300px; +} + +.section-wrap .section-wrap-image img { + position: absolute; + height: auto; + min-width: 100%; + min-height: 100%; + max-width: none; + top: 30%; + left: 50%; + transform: translate(-50%, -30%); +} + +@supports (object-fit: cover) { + .section-wrap .section-wrap-image img { + top: 0; + left: 0; + transform: none; + height: 100%; + width: 100%; + object-fit: cover; + object-position: center center; + } +} + +@media (min-width: 768px) { + .section-wrap .section-wrap-image { + height: 500px; + } +} + +@media (min-width: 768px) and (max-width: 991px) { + .section-wrap .box-width-small { + margin-left: auto; + margin-right: auto; + } +} + +@media (min-width: 992px) { + .section-wrap .section-wrap-aside { + position: absolute; + top: -4px; + right: 0; + bottom: -4px; + height: auto; + width: calc(50% - 190px); + } + .section-wrap .section-wrap-aside.section-wrap-aside-custom { + width: 50%; + } + .section-wrap .section-wrap-aside .jp-video-single { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + } + .section-wrap .section-wrap-aside .jp-video .jp-jplayer { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + width: auto !important; + height: auto !important; + } + .section-wrap .section-wrap-aside .jp-video .jp-jplayer img, .section-wrap .section-wrap-aside .jp-video .jp-jplayer video { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + object-fit: cover; + object-position: center; + width: 100% !important; + height: 100% !important; + } + .section-wrap .section-wrap-aside .google-map { + height: calc(100% + 1px); + } + .section-wrap .section-wrap-aside img { + height: 100%; + width: 100%; + } + .section-wrap .section-wrap-aside.section-wrap-image-right img { + position: relative; + left: auto; + top: auto; + transform: none; + object-position: 90% center; + } + .ie-10 .section-wrap .section-wrap-aside.section-wrap-image-right img, + .ie-11 .section-wrap .section-wrap-aside.section-wrap-image-right img { + left: 90%; + transform: translate(-90%, -50%); + } + .ie-10 .section-wrap .section-wrap-aside .jp-video .jp-jplayer img, + .ie-10 .section-wrap .section-wrap-aside img, + .ie-11 .section-wrap .section-wrap-aside .jp-video .jp-jplayer img, + .ie-11 .section-wrap .section-wrap-aside img { + position: absolute; + top: 50%; + left: 50%; + width: auto; + height: auto; + transform: translate(-50%, -50%); + } + .ie-10 .section-wrap .section-wrap-aside .jp-video .jp-jplayer video, + .ie-11 .section-wrap .section-wrap-aside .jp-video .jp-jplayer video { + left: 50%; + transform: translateX(-50%); + width: 110% !important; + height: 100% !important; + } + .section-wrap .section-wrap-content { + max-width: 620px; + } +} + +@media (min-width: 992px) { + .section-wrap.section-wrap-sm .section-wrap-aside { + width: 41.6%; + } + .section-wrap.section-wrap-bigger .section-wrap-aside { + width: 50%; + } + .section-wrap.section-wrap-equal .section-wrap-aside { + width: 50%; + } + .section-wrap.section-wrap-equal .section-wrap-aside .section-wrap-content { + max-width: 630px; + } +} + +@media (min-width: 992px) and (max-width: 1199px) { + .section-wrap.section-wrap-lg .section-wrap-aside { + position: relative; + top: 1px; + width: 100%; + height: 500px; + } + .section-wrap.section-wrap-lg.section-reverse .section-wrap-inner { + -ms-flex-flow: row wrap; + flex-flow: row wrap; + } +} + +@media (min-width: 1200px) { + .section-wrap .section-wrap-aside { + width: calc(50% - 160px); + } + .section-wrap .section-wrap-aside.section-wrap-aside-custom { + width: calc(50% - 30px); + } + .section-wrap.section-wrap-bigger .section-wrap-aside { + width: calc(50% + 100px); + } + .section-wrap.section-wrap-equal .section-wrap-aside { + width: 50%; + } + .section-wrap .section-wrap-content { + max-width: 770px; + } +} + +@media (min-width: 1800px) { + .section-wrap .section-wrap-aside { + width: calc(50% - 360px); + } + .section-wrap .section-wrap-aside.section-wrap-aside-custom { + width: 50%; + } + .section-wrap.section-wrap-bigger .section-wrap-aside { + width: calc(50% + 180px); + } + .section-wrap .section-wrap-content { + max-width: 880px; + } +} + +.section-wrap.section-reverse .section-wrap-inner { + -ms-flex-flow: row-reverse wrap-reverse; + flex-flow: row-reverse wrap-reverse; +} + +.section-wrap.section-reverse .range { + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; +} + +.section-wrap.section-reverse .section-wrap-aside { + left: 0; + right: auto; +} + +@media (min-width: 992px) { + .section-wrap.section-md-reverse .section-wrap-inner { + -ms-flex-flow: row-reverse wrap-reverse; + flex-flow: row-reverse wrap-reverse; + } + .section-wrap.section-md-reverse .section-wrap-aside { + left: 0; + right: auto; + } +} + +.banner img { + width: 100%; +} + +.footer-banner { + padding-top: 0; +} + +.banner-top { + display: none; +} + +@media (min-width: 1200px) { + .banner-top { + display: block; + } +} + +/* +* +* Offsets +* -------------------------------------------------- +*/ +* + p { + margin-top: 20px; +} + +* + hr { + margin-top: 10px; +} + +p + p { + margin-top: 24px; +} + +h3 + * { + margin-top: 35px; +} + +h1 + h2 { + margin-top: 32px; +} + +h2 + h3 { + margin-top: 32px; +} + +h3 + h4 { + margin-top: 32px; +} + +h4 + h5 { + margin-top: 40px; +} + +h5 + h6 { + margin-top: 40px; +} + +h1 + p { + margin-top: 5px; +} + +h2 + p { + margin-top: 20px; +} + +h3 + p { + margin-top: 20px; +} + +h4 + p { + margin-top: 20px; +} + +h5 + p { + margin-top: 20px; +} + +h6 + p { + margin-top: 20px; +} + +p + h2 { + margin-top: 45px; +} + +p + h3 { + margin-top: 45px; +} + +p + h4 { + margin-top: 45px; +} + +p + h5 { + margin-top: 45px; +} + +p + h6 { + margin-top: 45px; +} + +img + p { + margin-top: 15px; +} + +h3 + img { + margin-top: 42px; +} + +h3 + hr { + margin-top: 15px; +} + +p + .list-marked { + margin-top: 10px; +} + +p + .marked-list { + margin-top: 15px; +} + +p + .ordered-list { + margin-top: 15px; +} + +h4 + .box-comment { + margin-top: 40px; +} + +h3 + .divider { + margin-top: 25px; +} + +p + .group { + margin-top: 15px; +} + +hr + .list { + margin-top: 25px; +} + +.list + h4 { + margin-top: 30px; +} + +* + .rd-mailform { + margin-top: 30px; +} + +* + .list-desc { + margin-top: 15px; +} + +* + .list-unstyled { + margin-top: 23px; +} + +* + .group-xl { + margin-top: 45px; +} + +* + .group-sm { + margin-top: 45px; +} + +* + .quote-default { + margin-top: 45px; +} + +* + .quote-secondary { + margin-top: 45px; +} + +* + .rd-search-results { + margin-top: 45px; +} + +* + .services-single-box { + margin-top: 35px; +} + +* + .button { + margin-top: 25px; +} + +* + .isotope-wrap { + margin-top: 35px; +} + +* + .list-bars { + margin-top: 50px; +} + +.quote-secondary + * { + margin-top: 45px; +} + +.aside-title + * { + margin-top: 22px; +} + +.extra-large + * { + margin-top: 30px; +} + +.range + h3 { + margin-top: 80px; +} + +.subtitle + h3 { + margin-top: 15px; +} + +.quote-default + p { + margin-top: 30px; +} + +.range + hr { + margin-top: 20px; +} + +.shell + .shell { + margin-top: 60px; +} + +.range + .range { + margin-top: 60px; +} + +@media (min-width: 768px) { + * + .button { + margin-top: 40px; + } + p + .group { + margin-top: 25px; + } +} + +@media (min-width: 992px) { + * + .isotope-wrap { + margin-top: 50px; + } + .list + h4 { + margin-top: 60px; + } +} + +.inset-left-25 { + padding-left: 25px; +} + +html .range-75, +html .range-90 { + position: relative; + transform: translateY(-50px); + margin-bottom: -50px; + pointer-events: none; +} + +html .range-75 > *:before, +html .range-90 > *:before { + content: ''; + display: table; + width: 0; +} + +html .range-75 > *, +html .range-90 > * { + margin-top: 50px; + pointer-events: auto; +} + +html .range-60 { + position: relative; + transform: translateY(-60px); + margin-bottom: -60px; + pointer-events: none; +} + +html .range-60 > *:before { + content: ''; + display: table; + width: 0; +} + +html .range-60 > * { + margin-top: 60px; + pointer-events: auto; +} + +html .range-50 { + position: relative; + transform: translateY(-50px); + margin-bottom: -50px; + pointer-events: none; +} + +html .range-50 > *:before { + content: ''; + display: table; + width: 0; +} + +html .range-50 > * { + margin-top: 50px; + pointer-events: auto; +} + +html .range-40 { + position: relative; + transform: translateY(-40px); + margin-bottom: -40px; + pointer-events: none; +} + +html .range-40 > *:before { + content: ''; + display: table; + width: 0; +} + +html .range-40 > * { + margin-top: 40px; + pointer-events: auto; +} + +html .range-30 { + position: relative; + transform: translateY(-30px); + margin-bottom: -30px; + pointer-events: none; +} + +html .range-30 > *:before { + content: ''; + display: table; + width: 0; +} + +html .range-30 > * { + margin-top: 30px; + pointer-events: auto; +} + +html .range-15 { + position: relative; + transform: translateY(-15px); + margin-bottom: -15px; + pointer-events: none; +} + +html .range-15 > *:before { + content: ''; + display: table; + width: 0; +} + +html .range-15 > * { + margin-top: 15px; + pointer-events: auto; +} + +html .range-0 { + position: relative; + transform: translateY(0); + margin-bottom: 0; + pointer-events: none; +} + +html .range-0 > *:before { + content: ''; + display: table; + width: 0; +} + +html .range-0 > * { + margin-top: 0; + pointer-events: auto; +} + +html .spacing-20 { + position: relative; + transform: translateY(-20px); + margin-bottom: -20px; + pointer-events: none; +} + +html .spacing-20 > *:before { + content: ''; + display: table; + width: 0; +} + +html .spacing-20 > * { + margin-top: 20px; + pointer-events: auto; +} + +@media (min-width: 992px) { + html .range-md-30 { + transform: translateY(-30px); + margin-bottom: -30px; + } + html .range-md-30 > * { + margin-top: 30px; + } + html .range-75 { + position: relative; + transform: translateY(-75px); + margin-bottom: -75px; + pointer-events: none; + } + html .range-75 > *:before { + content: ''; + display: table; + width: 0; + } + html .range-75 > * { + margin-top: 75px; + pointer-events: auto; + } + html .range-90 { + position: relative; + transform: translateY(-90px); + margin-bottom: -90px; + pointer-events: none; + } + html .range-90 > *:before { + content: ''; + display: table; + width: 0; + } + html .range-90 > * { + margin-top: 90px; + pointer-events: auto; + } +} + +.range.spacing-20 { + margin-left: -5px; + margin-right: -5px; +} + +.range.spacing-20 [class*='cell'] { + padding-left: 10px; + padding-right: 10px; +} + +/* +* +* Modules +* ================================================== +*/ +/* +* +* Flex Grid system +* -------------------------------------------------- +*/ +.shell, +.shell-wide, +.shell-fluid { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} + +.shell, +.shell-wide { + min-width: 300px; + max-width: 480px; +} + +@media (min-width: 768px) { + .shell, + .shell-wide { + max-width: 750px; + } +} + +@media (min-width: 992px) { + .shell, + .shell-wide { + max-width: 970px; + } +} + +@media (min-width: 1200px) { + .shell, + .shell-wide { + max-width: 1200px; + } +} + +@media (min-width: 1200px) { + .shell-wide { + max-width: 1800px; + } +} + +@media (min-width: 1200px) { + .shell-fluid-inset-lg-50 { + padding-left: 50px; + padding-right: 50px; + } +} + +.range { + margin-left: -15px; + margin-right: -15px; +} + +.range > .range { + margin-left: 0; + margin-right: 0; +} + +.range-center { + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; +} + +.range-left { + -webkit-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; +} + +.range-right { + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; +} + +.range-justify { + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.range-around { + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; +} + +.range-top { + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; +} + +.range-reverse { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; +} + +.range-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; +} + +.range-bottom { + -webkit-align-items: flex-end; + -ms-flex-align: end; + align-items: flex-end; +} + +.range-spacer { + -webkit-flex-basis: 100%; + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100%; +} + +[class*="cell-"] { + padding-left: 15px; + padding-right: 15px; +} + +html.lt-ie-10 * + .range, +* + .range { + margin-top: 50px; +} + +html.lt-ie-10 * + [class*='cell-'], +* + [class*='cell-'], +html.lt-ie-10 * + .range-sm, +* + .range-sm { + margin-top: 30px; +} + +html.lt-ie-10 * + .range-lg, +* + .range-lg { + margin-top: 66px; +} + +html.lt-ie-10 .range-condensed, +.range-condensed { + margin-left: 0; + margin-right: 0; +} + +html.lt-ie-10 .range-condensed > [class*='cell'], +.range-condensed > [class*='cell'] { + padding-left: 0; + padding-right: 0; +} + +html.lt-ie-10 .range-condensed > * + [class*='cell'], +.range-condensed > * + [class*='cell'] { + margin-top: 0; +} + +html.lt-ie-10 .range-narrow, +.range-narrow { + margin-left: -5px; + margin-right: -5px; +} + +html.lt-ie-10 .range-narrow > [class*='cell'], +.range-narrow > [class*='cell'] { + padding-left: 5px; + padding-right: 5px; +} + +html.lt-ie-10 .range-narrow > * + [class*='cell'], +.range-narrow > * + [class*='cell'] { + padding-left: 5px; + padding-right: 5px; +} + +.range { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -ms-flex: 0 1 auto; + -webkit-flex: 0 1 auto; + flex: 0 1 auto; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} + +.range > .range { + -webkit-flex-basis: 100%; + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100%; +} + +.range-vertical { + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.range > [class*='cell'] { + -ms-flex: 0 0 auto; + -webkit-flex: 0 0 auto; + flex: 0 0 auto; + -webkit-flex-basis: 100%; + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100%; +} + +@media (min-width: 480px) { + * + [class*='cell-xs-'] { + margin-top: 0; + } + .range-xs-center { + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + } + .range-xs-left { + -webkit-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; + } + .range-xs-right { + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; + } + .range-xs-justify { + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + } + .range-xs-around { + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; + } + .range-xs-top { + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; + } + .range-xs { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + .range-xs-reverse { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .range-xs-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + .range-xs-bottom { + -webkit-align-items: flex-end; + -ms-flex-align: end; + align-items: flex-end; + } + .cell-xs-top { + -webkit-align-self: flex-start; + -ms-flex-item-align: start; + align-self: flex-start; + } + .cell-xs-middle { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + } + .cell-xs-bottom { + -webkit-align-self: flex-end; + -ms-flex-item-align: end; + align-self: flex-end; + } + .range > .cell-xs-preffix-0 { + margin-left: 0%; + } + .range > .cell-xs-1 { + -webkit-flex-basis: 8.33333%; + -ms-flex-preferred-size: 8.33333%; + flex-basis: 8.33333%; + max-width: 8.33333%; + } + .range > .cell-xs-preffix-1 { + margin-left: 8.33333%; + } + .range > .cell-xs-2 { + -webkit-flex-basis: 16.66667%; + -ms-flex-preferred-size: 16.66667%; + flex-basis: 16.66667%; + max-width: 16.66667%; + } + .range > .cell-xs-preffix-2 { + margin-left: 16.66667%; + } + .range > .cell-xs-3 { + -webkit-flex-basis: 25%; + -ms-flex-preferred-size: 25%; + flex-basis: 25%; + max-width: 25%; + } + .range > .cell-xs-preffix-3 { + margin-left: 25%; + } + .range > .cell-xs-4 { + -webkit-flex-basis: 33.33333%; + -ms-flex-preferred-size: 33.33333%; + flex-basis: 33.33333%; + max-width: 33.33333%; + } + .range > .cell-xs-preffix-4 { + margin-left: 33.33333%; + } + .range > .cell-xs-5 { + -webkit-flex-basis: 41.66667%; + -ms-flex-preferred-size: 41.66667%; + flex-basis: 41.66667%; + max-width: 41.66667%; + } + .range > .cell-xs-preffix-5 { + margin-left: 41.66667%; + } + .range > .cell-xs-6 { + -webkit-flex-basis: 50%; + -ms-flex-preferred-size: 50%; + flex-basis: 50%; + max-width: 50%; + } + .range > .cell-xs-preffix-6 { + margin-left: 50%; + } + .range > .cell-xs-7 { + -webkit-flex-basis: 58.33333%; + -ms-flex-preferred-size: 58.33333%; + flex-basis: 58.33333%; + max-width: 58.33333%; + } + .range > .cell-xs-preffix-7 { + margin-left: 58.33333%; + } + .range > .cell-xs-8 { + -webkit-flex-basis: 66.66667%; + -ms-flex-preferred-size: 66.66667%; + flex-basis: 66.66667%; + max-width: 66.66667%; + } + .range > .cell-xs-preffix-8 { + margin-left: 66.66667%; + } + .range > .cell-xs-9 { + -webkit-flex-basis: 75%; + -ms-flex-preferred-size: 75%; + flex-basis: 75%; + max-width: 75%; + } + .range > .cell-xs-preffix-9 { + margin-left: 75%; + } + .range > .cell-xs-10 { + -webkit-flex-basis: 83.33333%; + -ms-flex-preferred-size: 83.33333%; + flex-basis: 83.33333%; + max-width: 83.33333%; + } + .range > .cell-xs-preffix-10 { + margin-left: 83.33333%; + } + .range > .cell-xs-11 { + -webkit-flex-basis: 91.66667%; + -ms-flex-preferred-size: 91.66667%; + flex-basis: 91.66667%; + max-width: 91.66667%; + } + .range > .cell-xs-preffix-11 { + margin-left: 91.66667%; + } + .range > .cell-xs-12 { + -webkit-flex-basis: 100%; + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100%; + } + .range > .cell-xs-preffix-12 { + margin-left: 100%; + } + .range > .cell-xs-1-5 { + -webkit-flex-basis: 20%; + -ms-flex-preferred-size: 20%; + flex-basis: 20%; + max-width: 20%; + } +} + +@media (min-width: 768px) { + * + [class*='cell-sm-'] { + margin-top: 0; + } + .range-sm-center { + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + } + .range-sm-left { + -webkit-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; + } + .range-sm-right { + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; + } + .range-sm-justify { + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + } + .range-sm-around { + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; + } + .range-sm-top { + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; + } + .range-sm { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + .range-sm-reverse { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .range-sm-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + .range-sm-bottom { + -webkit-align-items: flex-end; + -ms-flex-align: end; + align-items: flex-end; + } + .cell-sm-top { + -webkit-align-self: flex-start; + -ms-flex-item-align: start; + align-self: flex-start; + } + .cell-sm-middle { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + } + .cell-sm-bottom { + -webkit-align-self: flex-end; + -ms-flex-item-align: end; + align-self: flex-end; + } + .range > .cell-sm-preffix-0 { + margin-left: 0%; + } + .range > .cell-sm-1 { + -webkit-flex-basis: 8.33333%; + -ms-flex-preferred-size: 8.33333%; + flex-basis: 8.33333%; + max-width: 8.33333%; + } + .range > .cell-sm-preffix-1 { + margin-left: 8.33333%; + } + .range > .cell-sm-2 { + -webkit-flex-basis: 16.66667%; + -ms-flex-preferred-size: 16.66667%; + flex-basis: 16.66667%; + max-width: 16.66667%; + } + .range > .cell-sm-preffix-2 { + margin-left: 16.66667%; + } + .range > .cell-sm-3 { + -webkit-flex-basis: 25%; + -ms-flex-preferred-size: 25%; + flex-basis: 25%; + max-width: 25%; + } + .range > .cell-sm-preffix-3 { + margin-left: 25%; + } + .range > .cell-sm-4 { + -webkit-flex-basis: 33.33333%; + -ms-flex-preferred-size: 33.33333%; + flex-basis: 33.33333%; + max-width: 33.33333%; + } + .range > .cell-sm-preffix-4 { + margin-left: 33.33333%; + } + .range > .cell-sm-5 { + -webkit-flex-basis: 41.66667%; + -ms-flex-preferred-size: 41.66667%; + flex-basis: 41.66667%; + max-width: 41.66667%; + } + .range > .cell-sm-preffix-5 { + margin-left: 41.66667%; + } + .range > .cell-sm-6 { + -webkit-flex-basis: 50%; + -ms-flex-preferred-size: 50%; + flex-basis: 50%; + max-width: 50%; + } + .range > .cell-sm-preffix-6 { + margin-left: 50%; + } + .range > .cell-sm-7 { + -webkit-flex-basis: 58.33333%; + -ms-flex-preferred-size: 58.33333%; + flex-basis: 58.33333%; + max-width: 58.33333%; + } + .range > .cell-sm-preffix-7 { + margin-left: 58.33333%; + } + .range > .cell-sm-8 { + -webkit-flex-basis: 66.66667%; + -ms-flex-preferred-size: 66.66667%; + flex-basis: 66.66667%; + max-width: 66.66667%; + } + .range > .cell-sm-preffix-8 { + margin-left: 66.66667%; + } + .range > .cell-sm-9 { + -webkit-flex-basis: 75%; + -ms-flex-preferred-size: 75%; + flex-basis: 75%; + max-width: 75%; + } + .range > .cell-sm-preffix-9 { + margin-left: 75%; + } + .range > .cell-sm-10 { + -webkit-flex-basis: 83.33333%; + -ms-flex-preferred-size: 83.33333%; + flex-basis: 83.33333%; + max-width: 83.33333%; + } + .range > .cell-sm-preffix-10 { + margin-left: 83.33333%; + } + .range > .cell-sm-11 { + -webkit-flex-basis: 91.66667%; + -ms-flex-preferred-size: 91.66667%; + flex-basis: 91.66667%; + max-width: 91.66667%; + } + .range > .cell-sm-preffix-11 { + margin-left: 91.66667%; + } + .range > .cell-sm-12 { + -webkit-flex-basis: 100%; + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100%; + } + .range > .cell-sm-preffix-12 { + margin-left: 100%; + } + .range > .cell-sm-1-5 { + -webkit-flex-basis: 20%; + -ms-flex-preferred-size: 20%; + flex-basis: 20%; + max-width: 20%; + } +} + +@media (min-width: 992px) { + * + [class*='cell-md-'] { + margin-top: 0; + } + .range-md-center { + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + } + .range-md-left { + -webkit-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; + } + .range-md-right { + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; + } + .range-md-justify { + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + } + .range-md-around { + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; + } + .range-md-top { + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; + } + .range-md { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + .range-md-reverse { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .range-md-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + .range-md-bottom { + -webkit-align-items: flex-end; + -ms-flex-align: end; + align-items: flex-end; + } + .cell-md-top { + -webkit-align-self: flex-start; + -ms-flex-item-align: start; + align-self: flex-start; + } + .cell-md-middle { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + } + .cell-md-bottom { + -webkit-align-self: flex-end; + -ms-flex-item-align: end; + align-self: flex-end; + } + .range > .cell-md-preffix-0 { + margin-left: 0%; + } + .range > .cell-md-1 { + -webkit-flex-basis: 8.33333%; + -ms-flex-preferred-size: 8.33333%; + flex-basis: 8.33333%; + max-width: 8.33333%; + } + .range > .cell-md-preffix-1 { + margin-left: 8.33333%; + } + .range > .cell-md-2 { + -webkit-flex-basis: 16.66667%; + -ms-flex-preferred-size: 16.66667%; + flex-basis: 16.66667%; + max-width: 16.66667%; + } + .range > .cell-md-preffix-2 { + margin-left: 16.66667%; + } + .range > .cell-md-3 { + -webkit-flex-basis: 25%; + -ms-flex-preferred-size: 25%; + flex-basis: 25%; + max-width: 25%; + } + .range > .cell-md-preffix-3 { + margin-left: 25%; + } + .range > .cell-md-4 { + -webkit-flex-basis: 33.33333%; + -ms-flex-preferred-size: 33.33333%; + flex-basis: 33.33333%; + max-width: 33.33333%; + } + .range > .cell-md-preffix-4 { + margin-left: 33.33333%; + } + .range > .cell-md-5 { + -webkit-flex-basis: 41.66667%; + -ms-flex-preferred-size: 41.66667%; + flex-basis: 41.66667%; + max-width: 41.66667%; + } + .range > .cell-md-preffix-5 { + margin-left: 41.66667%; + } + .range > .cell-md-6 { + -webkit-flex-basis: 50%; + -ms-flex-preferred-size: 50%; + flex-basis: 50%; + max-width: 50%; + } + .range > .cell-md-preffix-6 { + margin-left: 50%; + } + .range > .cell-md-7 { + -webkit-flex-basis: 58.33333%; + -ms-flex-preferred-size: 58.33333%; + flex-basis: 58.33333%; + max-width: 58.33333%; + } + .range > .cell-md-preffix-7 { + margin-left: 58.33333%; + } + .range > .cell-md-8 { + -webkit-flex-basis: 66.66667%; + -ms-flex-preferred-size: 66.66667%; + flex-basis: 66.66667%; + max-width: 66.66667%; + } + .range > .cell-md-preffix-8 { + margin-left: 66.66667%; + } + .range > .cell-md-9 { + -webkit-flex-basis: 75%; + -ms-flex-preferred-size: 75%; + flex-basis: 75%; + max-width: 75%; + } + .range > .cell-md-preffix-9 { + margin-left: 75%; + } + .range > .cell-md-10 { + -webkit-flex-basis: 83.33333%; + -ms-flex-preferred-size: 83.33333%; + flex-basis: 83.33333%; + max-width: 83.33333%; + } + .range > .cell-md-preffix-10 { + margin-left: 83.33333%; + } + .range > .cell-md-11 { + -webkit-flex-basis: 91.66667%; + -ms-flex-preferred-size: 91.66667%; + flex-basis: 91.66667%; + max-width: 91.66667%; + } + .range > .cell-md-preffix-11 { + margin-left: 91.66667%; + } + .range > .cell-md-12 { + -webkit-flex-basis: 100%; + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100%; + } + .range > .cell-md-preffix-12 { + margin-left: 100%; + } + .range > .cell-md-1-5 { + -webkit-flex-basis: 20%; + -ms-flex-preferred-size: 20%; + flex-basis: 20%; + max-width: 20%; + } +} + +@media (min-width: 1200px) { + * + [class*='cell-lg-'] { + margin-top: 0; + } + .range-lg-center { + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + } + .range-lg-left { + -webkit-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; + } + .range-lg-right { + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; + } + .range-lg-justify { + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + } + .range-lg-around { + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; + } + .range-lg-top { + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; + } + .range-lg { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + .range-lg-reverse { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .range-lg-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + .range-lg-bottom { + -webkit-align-items: flex-end; + -ms-flex-align: end; + align-items: flex-end; + } + .cell-lg-top { + -webkit-align-self: flex-start; + -ms-flex-item-align: start; + align-self: flex-start; + } + .cell-lg-middle { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + } + .cell-lg-bottom { + -webkit-align-self: flex-end; + -ms-flex-item-align: end; + align-self: flex-end; + } + .range > .cell-lg-preffix-0 { + margin-left: 0%; + } + .range > .cell-lg-1 { + -webkit-flex-basis: 8.33333%; + -ms-flex-preferred-size: 8.33333%; + flex-basis: 8.33333%; + max-width: 8.33333%; + } + .range > .cell-lg-preffix-1 { + margin-left: 8.33333%; + } + .range > .cell-lg-2 { + -webkit-flex-basis: 16.66667%; + -ms-flex-preferred-size: 16.66667%; + flex-basis: 16.66667%; + max-width: 16.66667%; + } + .range > .cell-lg-preffix-2 { + margin-left: 16.66667%; + } + .range > .cell-lg-3 { + -webkit-flex-basis: 25%; + -ms-flex-preferred-size: 25%; + flex-basis: 25%; + max-width: 25%; + } + .range > .cell-lg-preffix-3 { + margin-left: 25%; + } + .range > .cell-lg-4 { + -webkit-flex-basis: 33.33333%; + -ms-flex-preferred-size: 33.33333%; + flex-basis: 33.33333%; + max-width: 33.33333%; + } + .range > .cell-lg-preffix-4 { + margin-left: 33.33333%; + } + .range > .cell-lg-5 { + -webkit-flex-basis: 41.66667%; + -ms-flex-preferred-size: 41.66667%; + flex-basis: 41.66667%; + max-width: 41.66667%; + } + .range > .cell-lg-preffix-5 { + margin-left: 41.66667%; + } + .range > .cell-lg-6 { + -webkit-flex-basis: 50%; + -ms-flex-preferred-size: 50%; + flex-basis: 50%; + max-width: 50%; + } + .range > .cell-lg-preffix-6 { + margin-left: 50%; + } + .range > .cell-lg-7 { + -webkit-flex-basis: 58.33333%; + -ms-flex-preferred-size: 58.33333%; + flex-basis: 58.33333%; + max-width: 58.33333%; + } + .range > .cell-lg-preffix-7 { + margin-left: 58.33333%; + } + .range > .cell-lg-8 { + -webkit-flex-basis: 66.66667%; + -ms-flex-preferred-size: 66.66667%; + flex-basis: 66.66667%; + max-width: 66.66667%; + } + .range > .cell-lg-preffix-8 { + margin-left: 66.66667%; + } + .range > .cell-lg-9 { + -webkit-flex-basis: 75%; + -ms-flex-preferred-size: 75%; + flex-basis: 75%; + max-width: 75%; + } + .range > .cell-lg-preffix-9 { + margin-left: 75%; + } + .range > .cell-lg-10 { + -webkit-flex-basis: 83.33333%; + -ms-flex-preferred-size: 83.33333%; + flex-basis: 83.33333%; + max-width: 83.33333%; + } + .range > .cell-lg-preffix-10 { + margin-left: 83.33333%; + } + .range > .cell-lg-11 { + -webkit-flex-basis: 91.66667%; + -ms-flex-preferred-size: 91.66667%; + flex-basis: 91.66667%; + max-width: 91.66667%; + } + .range > .cell-lg-preffix-11 { + margin-left: 91.66667%; + } + .range > .cell-lg-12 { + -webkit-flex-basis: 100%; + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100%; + } + .range > .cell-lg-preffix-12 { + margin-left: 100%; + } + .range > .cell-lg-1-5 { + -webkit-flex-basis: 20%; + -ms-flex-preferred-size: 20%; + flex-basis: 20%; + max-width: 20%; + } +} + +@media (min-width: 1800px) { + * + [class*='cell-xl-'] { + margin-top: 0; + } + .range-xl-center { + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + } + .range-xl-left { + -webkit-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; + } + .range-xl-right { + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; + } + .range-xl-justify { + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + } + .range-xl-around { + -webkit-justify-content: space-around; + -ms-flex-pack: distribute; + justify-content: space-around; + } + .range-xl-top { + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; + } + .range-xl { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + .range-xl-reverse { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .range-xl-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + .range-xl-bottom { + -webkit-align-items: flex-end; + -ms-flex-align: end; + align-items: flex-end; + } + .cell-xl-top { + -webkit-align-self: flex-start; + -ms-flex-item-align: start; + align-self: flex-start; + } + .cell-xl-middle { + -webkit-align-self: center; + -ms-flex-item-align: center; + align-self: center; + } + .cell-xl-bottom { + -webkit-align-self: flex-end; + -ms-flex-item-align: end; + align-self: flex-end; + } + .range > .cell-xl-preffix-0 { + margin-left: 0%; + } + .range > .cell-xl-1 { + -webkit-flex-basis: 8.33333%; + -ms-flex-preferred-size: 8.33333%; + flex-basis: 8.33333%; + max-width: 8.33333%; + } + .range > .cell-xl-preffix-1 { + margin-left: 8.33333%; + } + .range > .cell-xl-2 { + -webkit-flex-basis: 16.66667%; + -ms-flex-preferred-size: 16.66667%; + flex-basis: 16.66667%; + max-width: 16.66667%; + } + .range > .cell-xl-preffix-2 { + margin-left: 16.66667%; + } + .range > .cell-xl-3 { + -webkit-flex-basis: 25%; + -ms-flex-preferred-size: 25%; + flex-basis: 25%; + max-width: 25%; + } + .range > .cell-xl-preffix-3 { + margin-left: 25%; + } + .range > .cell-xl-4 { + -webkit-flex-basis: 33.33333%; + -ms-flex-preferred-size: 33.33333%; + flex-basis: 33.33333%; + max-width: 33.33333%; + } + .range > .cell-xl-preffix-4 { + margin-left: 33.33333%; + } + .range > .cell-xl-5 { + -webkit-flex-basis: 41.66667%; + -ms-flex-preferred-size: 41.66667%; + flex-basis: 41.66667%; + max-width: 41.66667%; + } + .range > .cell-xl-preffix-5 { + margin-left: 41.66667%; + } + .range > .cell-xl-6 { + -webkit-flex-basis: 50%; + -ms-flex-preferred-size: 50%; + flex-basis: 50%; + max-width: 50%; + } + .range > .cell-xl-preffix-6 { + margin-left: 50%; + } + .range > .cell-xl-7 { + -webkit-flex-basis: 58.33333%; + -ms-flex-preferred-size: 58.33333%; + flex-basis: 58.33333%; + max-width: 58.33333%; + } + .range > .cell-xl-preffix-7 { + margin-left: 58.33333%; + } + .range > .cell-xl-8 { + -webkit-flex-basis: 66.66667%; + -ms-flex-preferred-size: 66.66667%; + flex-basis: 66.66667%; + max-width: 66.66667%; + } + .range > .cell-xl-preffix-8 { + margin-left: 66.66667%; + } + .range > .cell-xl-9 { + -webkit-flex-basis: 75%; + -ms-flex-preferred-size: 75%; + flex-basis: 75%; + max-width: 75%; + } + .range > .cell-xl-preffix-9 { + margin-left: 75%; + } + .range > .cell-xl-10 { + -webkit-flex-basis: 83.33333%; + -ms-flex-preferred-size: 83.33333%; + flex-basis: 83.33333%; + max-width: 83.33333%; + } + .range > .cell-xl-preffix-10 { + margin-left: 83.33333%; + } + .range > .cell-xl-11 { + -webkit-flex-basis: 91.66667%; + -ms-flex-preferred-size: 91.66667%; + flex-basis: 91.66667%; + max-width: 91.66667%; + } + .range > .cell-xl-preffix-11 { + margin-left: 91.66667%; + } + .range > .cell-xl-12 { + -webkit-flex-basis: 100%; + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + max-width: 100%; + } + .range > .cell-xl-preffix-12 { + margin-left: 100%; + } + .range > .cell-xl-1-5 { + -webkit-flex-basis: 20%; + -ms-flex-preferred-size: 20%; + flex-basis: 20%; + max-width: 20%; + } +} + +html.lt-ie-10 .range > .cell-xs-1 { + margin-left: auto; + margin-right: auto; + max-width: 8.33333%; +} + +html.lt-ie-10 .range > .cell-xs-2 { + margin-left: auto; + margin-right: auto; + max-width: 16.66667%; +} + +html.lt-ie-10 .range > .cell-xs-3 { + margin-left: auto; + margin-right: auto; + max-width: 25%; +} + +html.lt-ie-10 .range > .cell-xs-4 { + margin-left: auto; + margin-right: auto; + max-width: 33.33333%; +} + +html.lt-ie-10 .range > .cell-xs-5 { + margin-left: auto; + margin-right: auto; + max-width: 41.66667%; +} + +html.lt-ie-10 .range > .cell-xs-6 { + margin-left: auto; + margin-right: auto; + max-width: 50%; +} + +html.lt-ie-10 .range > .cell-xs-7 { + margin-left: auto; + margin-right: auto; + max-width: 58.33333%; +} + +html.lt-ie-10 .range > .cell-xs-8 { + margin-left: auto; + margin-right: auto; + max-width: 66.66667%; +} + +html.lt-ie-10 .range > .cell-xs-9 { + margin-left: auto; + margin-right: auto; + max-width: 75%; +} + +html.lt-ie-10 .range > .cell-xs-10 { + margin-left: auto; + margin-right: auto; + max-width: 83.33333%; +} + +html.lt-ie-10 .range > .cell-xs-11 { + margin-left: auto; + margin-right: auto; + max-width: 91.66667%; +} + +html.lt-ie-10 .range > .cell-xs-12 { + margin-left: auto; + margin-right: auto; + max-width: 100%; +} + +html.lt-ie-10 .range > .cell-xs-1-5 { + margin-left: auto; + margin-right: auto; + max-width: 20%; +} + +html.lt-ie-10 .range > .cell-sm-1 { + margin-left: auto; + margin-right: auto; + max-width: 8.33333%; +} + +html.lt-ie-10 .range > .cell-sm-2 { + margin-left: auto; + margin-right: auto; + max-width: 16.66667%; +} + +html.lt-ie-10 .range > .cell-sm-3 { + margin-left: auto; + margin-right: auto; + max-width: 25%; +} + +html.lt-ie-10 .range > .cell-sm-4 { + margin-left: auto; + margin-right: auto; + max-width: 33.33333%; +} + +html.lt-ie-10 .range > .cell-sm-5 { + margin-left: auto; + margin-right: auto; + max-width: 41.66667%; +} + +html.lt-ie-10 .range > .cell-sm-6 { + margin-left: auto; + margin-right: auto; + max-width: 50%; +} + +html.lt-ie-10 .range > .cell-sm-7 { + margin-left: auto; + margin-right: auto; + max-width: 58.33333%; +} + +html.lt-ie-10 .range > .cell-sm-8 { + margin-left: auto; + margin-right: auto; + max-width: 66.66667%; +} + +html.lt-ie-10 .range > .cell-sm-9 { + margin-left: auto; + margin-right: auto; + max-width: 75%; +} + +html.lt-ie-10 .range > .cell-sm-10 { + margin-left: auto; + margin-right: auto; + max-width: 83.33333%; +} + +html.lt-ie-10 .range > .cell-sm-11 { + margin-left: auto; + margin-right: auto; + max-width: 91.66667%; +} + +html.lt-ie-10 .range > .cell-sm-12 { + margin-left: auto; + margin-right: auto; + max-width: 100%; +} + +html.lt-ie-10 .range > .cell-sm-1-5 { + margin-left: auto; + margin-right: auto; + max-width: 20%; +} + +html.lt-ie-10 .range > .cell-md-1 { + margin-left: auto; + margin-right: auto; + max-width: 8.33333%; +} + +html.lt-ie-10 .range > .cell-md-2 { + margin-left: auto; + margin-right: auto; + max-width: 16.66667%; +} + +html.lt-ie-10 .range > .cell-md-3 { + margin-left: auto; + margin-right: auto; + max-width: 25%; +} + +html.lt-ie-10 .range > .cell-md-4 { + margin-left: auto; + margin-right: auto; + max-width: 33.33333%; +} + +html.lt-ie-10 .range > .cell-md-5 { + margin-left: auto; + margin-right: auto; + max-width: 41.66667%; +} + +html.lt-ie-10 .range > .cell-md-6 { + margin-left: auto; + margin-right: auto; + max-width: 50%; +} + +html.lt-ie-10 .range > .cell-md-7 { + margin-left: auto; + margin-right: auto; + max-width: 58.33333%; +} + +html.lt-ie-10 .range > .cell-md-8 { + margin-left: auto; + margin-right: auto; + max-width: 66.66667%; +} + +html.lt-ie-10 .range > .cell-md-9 { + margin-left: auto; + margin-right: auto; + max-width: 75%; +} + +html.lt-ie-10 .range > .cell-md-10 { + margin-left: auto; + margin-right: auto; + max-width: 83.33333%; +} + +html.lt-ie-10 .range > .cell-md-11 { + margin-left: auto; + margin-right: auto; + max-width: 91.66667%; +} + +html.lt-ie-10 .range > .cell-md-12 { + margin-left: auto; + margin-right: auto; + max-width: 100%; +} + +html.lt-ie-10 .range > .cell-md-1-5 { + margin-left: auto; + margin-right: auto; + max-width: 20%; +} + +html.lt-ie-10 .range > .cell-lg-1 { + margin-left: auto; + margin-right: auto; + max-width: 8.33333%; +} + +html.lt-ie-10 .range > .cell-lg-2 { + margin-left: auto; + margin-right: auto; + max-width: 16.66667%; +} + +html.lt-ie-10 .range > .cell-lg-3 { + margin-left: auto; + margin-right: auto; + max-width: 25%; +} + +html.lt-ie-10 .range > .cell-lg-4 { + margin-left: auto; + margin-right: auto; + max-width: 33.33333%; +} + +html.lt-ie-10 .range > .cell-lg-5 { + margin-left: auto; + margin-right: auto; + max-width: 41.66667%; +} + +html.lt-ie-10 .range > .cell-lg-6 { + margin-left: auto; + margin-right: auto; + max-width: 50%; +} + +html.lt-ie-10 .range > .cell-lg-7 { + margin-left: auto; + margin-right: auto; + max-width: 58.33333%; +} + +html.lt-ie-10 .range > .cell-lg-8 { + margin-left: auto; + margin-right: auto; + max-width: 66.66667%; +} + +html.lt-ie-10 .range > .cell-lg-9 { + margin-left: auto; + margin-right: auto; + max-width: 75%; +} + +html.lt-ie-10 .range > .cell-lg-10 { + margin-left: auto; + margin-right: auto; + max-width: 83.33333%; +} + +html.lt-ie-10 .range > .cell-lg-11 { + margin-left: auto; + margin-right: auto; + max-width: 91.66667%; +} + +html.lt-ie-10 .range > .cell-lg-12 { + margin-left: auto; + margin-right: auto; + max-width: 100%; +} + +html.lt-ie-10 .range > .cell-lg-1-5 { + margin-left: auto; + margin-right: auto; + max-width: 20%; +} + +html.lt-ie-10 .range > [class*="cell-xs-preffix-"], +html.lt-ie-10 .range > [class*="cell-sm-preffix-"], +html.lt-ie-10 .range > [class*="cell-md-preffix-"], +html.lt-ie-10 .range > [class*="cell-lg-preffix-"] { + margin-left: auto; +} + +/* +* +* Responsive unit +* -------------------------------------------------- +*/ +.unit { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -ms-flex: 0 1 100%; + -webkit-flex: 0 1 100%; + flex: 0 1 100%; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.unit__body { + -ms-flex: 0 1 auto; + -webkit-flex: 0 1 auto; + flex: 0 1 auto; +} + +.unit__left, +.unit__right { + -ms-flex: 0 0 auto; + -webkit-flex: 0 0 auto; + flex: 0 0 auto; + max-width: 100%; +} + +.unit-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; +} + +.unit, +.unit-vertical { + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.unit > [class*='unit-']:first-child, +.unit-vertical > [class*='unit-']:first-child { + padding-top: 0; +} + +.unit > .unit__left + .unit__right, +.unit > .unit__left + .unit__body, +.unit-vertical > .unit__left + .unit__right, +.unit-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 20px; +} + +.unit > .unit__body + .unit__right, +.unit-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 20px; +} + +.unit-horizontal { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; +} + +.unit-horizontal > .unit__left + .unit__right, +.unit-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; +} + +.unit-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; +} + +.unit--inverse { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; +} + +.unit--inverse, .unit--inverse.unit-vertical { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; +} + +.unit--inverse > [class*='unit-']:first-child, .unit--inverse.unit-vertical > [class*='unit-']:first-child { + padding-top: 20px; +} + +.unit--inverse > [class*='unit-']:last-child, .unit--inverse.unit-vertical > [class*='unit-']:last-child { + padding-top: 0; +} + +.unit--inverse.unit-horizontal { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; +} + +.unit--inverse.unit-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; +} + +.unit--inverse.unit-horizontal > [class*='unit-']:last-child { + padding-left: 0; +} + +@media (min-width: 480px) { + .unit-xs-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + .unit-xs, + .unit-xs-vertical { + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + } + .unit-xs > [class*='unit-']:first-child, + .unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-xs > .unit__left + .unit__right, + .unit-xs > .unit__left + .unit__body, + .unit-xs-vertical > .unit__left + .unit__right, + .unit-xs-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 20px; + } + .unit-xs > .unit__body + .unit__right, + .unit-xs-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 20px; + } + .unit-xs-horizontal { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + .unit-xs-horizontal > .unit__left + .unit__right, + .unit-xs-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; + } + .unit-xs-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; + } + .unit-xs--inverse { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .unit-xs--inverse, .unit-xs--inverse.unit-xs-vertical { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .unit-xs--inverse > [class*='unit-']:first-child, .unit-xs--inverse.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 20px; + } + .unit-xs--inverse > [class*='unit-']:last-child, .unit-xs--inverse.unit-xs-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-xs--inverse.unit-xs-horizontal { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; + } + .unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 768px) { + .unit-sm-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + .unit-sm, + .unit-sm-vertical { + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + } + .unit-sm > [class*='unit-']:first-child, + .unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-sm > .unit__left + .unit__right, + .unit-sm > .unit__left + .unit__body, + .unit-sm-vertical > .unit__left + .unit__right, + .unit-sm-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 20px; + } + .unit-sm > .unit__body + .unit__right, + .unit-sm-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 20px; + } + .unit-sm-horizontal { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + .unit-sm-horizontal > .unit__left + .unit__right, + .unit-sm-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; + } + .unit-sm-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; + } + .unit-sm--inverse { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .unit-sm--inverse, .unit-sm--inverse.unit-sm-vertical { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .unit-sm--inverse > [class*='unit-']:first-child, .unit-sm--inverse.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 20px; + } + .unit-sm--inverse > [class*='unit-']:last-child, .unit-sm--inverse.unit-sm-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-sm--inverse.unit-sm-horizontal { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; + } + .unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 992px) { + .unit-md-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + .unit-md, + .unit-md-vertical { + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + } + .unit-md > [class*='unit-']:first-child, + .unit-md-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-md > .unit__left + .unit__right, + .unit-md > .unit__left + .unit__body, + .unit-md-vertical > .unit__left + .unit__right, + .unit-md-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 20px; + } + .unit-md > .unit__body + .unit__right, + .unit-md-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 20px; + } + .unit-md-horizontal { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + .unit-md-horizontal > .unit__left + .unit__right, + .unit-md-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; + } + .unit-md-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; + } + .unit-md--inverse { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .unit-md--inverse, .unit-md--inverse.unit-md-vertical { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .unit-md--inverse > [class*='unit-']:first-child, .unit-md--inverse.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 20px; + } + .unit-md--inverse > [class*='unit-']:last-child, .unit-md--inverse.unit-md-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-md--inverse.unit-md-horizontal { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .unit-md--inverse.unit-md-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; + } + .unit-md--inverse.unit-md-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1200px) { + .unit-lg-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + .unit-lg, + .unit-lg-vertical { + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + } + .unit-lg > [class*='unit-']:first-child, + .unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-lg > .unit__left + .unit__right, + .unit-lg > .unit__left + .unit__body, + .unit-lg-vertical > .unit__left + .unit__right, + .unit-lg-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 20px; + } + .unit-lg > .unit__body + .unit__right, + .unit-lg-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 20px; + } + .unit-lg-horizontal { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + .unit-lg-horizontal > .unit__left + .unit__right, + .unit-lg-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; + } + .unit-lg-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; + } + .unit-lg--inverse { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .unit-lg--inverse, .unit-lg--inverse.unit-lg-vertical { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .unit-lg--inverse > [class*='unit-']:first-child, .unit-lg--inverse.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 20px; + } + .unit-lg--inverse > [class*='unit-']:last-child, .unit-lg--inverse.unit-lg-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-lg--inverse.unit-lg-horizontal { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; + } + .unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) { + .unit-xl-middle { + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + } + .unit-xl, + .unit-xl-vertical { + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + } + .unit-xl > [class*='unit-']:first-child, + .unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-xl > .unit__left + .unit__right, + .unit-xl > .unit__left + .unit__body, + .unit-xl-vertical > .unit__left + .unit__right, + .unit-xl-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 20px; + } + .unit-xl > .unit__body + .unit__right, + .unit-xl-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 20px; + } + .unit-xl-horizontal { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + } + .unit-xl-horizontal > .unit__left + .unit__right, + .unit-xl-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; + } + .unit-xl-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; + } + .unit-xl--inverse { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .unit-xl--inverse, .unit-xl--inverse.unit-xl-vertical { + -webkit-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + flex-direction: column-reverse; + } + .unit-xl--inverse > [class*='unit-']:first-child, .unit-xl--inverse.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 20px; + } + .unit-xl--inverse > [class*='unit-']:last-child, .unit-xl--inverse.unit-xl-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-xl--inverse.unit-xl-horizontal { + -webkit-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + flex-direction: row-reverse; + } + .unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; + } + .unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +.unit-spacing-xxs.unit > [class*='unit-']:first-child, .unit-spacing-xxs.unit-vertical > [class*='unit-']:first-child { + padding-top: 0; +} + +.unit-spacing-xxs.unit > .unit__left + .unit__right, +.unit-spacing-xxs.unit > .unit__left + .unit__body, .unit-spacing-xxs.unit-vertical > .unit__left + .unit__right, +.unit-spacing-xxs.unit-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 4px; +} + +.unit-spacing-xxs.unit > .unit__body + .unit__right, .unit-spacing-xxs.unit-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 4px; +} + +.unit-spacing-xxs.unit-horizontal > .unit__left + .unit__right, +.unit-spacing-xxs.unit-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 4px; +} + +.unit-spacing-xxs.unit-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 4px; +} + +.unit-spacing-xxs.unit--inverse > [class*='unit-']:first-child, .unit-spacing-xxs.unit--inverse.unit-vertical > [class*='unit-']:first-child { + padding-top: 4px; +} + +.unit-spacing-xxs.unit--inverse > [class*='unit-']:last-child, .unit-spacing-xxs.unit--inverse.unit-vertical > [class*='unit-']:last-child { + padding-top: 0; +} + +.unit-spacing-xxs.unit--inverse.unit-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 4px; +} + +.unit-spacing-xxs.unit--inverse.unit-horizontal > [class*='unit-']:last-child { + padding-left: 0; +} + +@media (min-width: 480px) { + .unit-spacing-xxs.unit-xs > [class*='unit-']:first-child, .unit-spacing-xxs.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxs.unit-xs > .unit__left + .unit__right, + .unit-spacing-xxs.unit-xs > .unit__left + .unit__body, .unit-spacing-xxs.unit-xs-vertical > .unit__left + .unit__right, + .unit-spacing-xxs.unit-xs-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 4px; + } + .unit-spacing-xxs.unit-xs > .unit__body + .unit__right, .unit-spacing-xxs.unit-xs-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 4px; + } + .unit-spacing-xxs.unit-xs-horizontal > .unit__left + .unit__right, + .unit-spacing-xxs.unit-xs-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-xs-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-xs--inverse > [class*='unit-']:first-child, .unit-spacing-xxs.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 4px; + } + .unit-spacing-xxs.unit-xs--inverse > [class*='unit-']:last-child, .unit-spacing-xxs.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxs.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 768px) { + .unit-spacing-xxs.unit-sm > [class*='unit-']:first-child, .unit-spacing-xxs.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxs.unit-sm > .unit__left + .unit__right, + .unit-spacing-xxs.unit-sm > .unit__left + .unit__body, .unit-spacing-xxs.unit-sm-vertical > .unit__left + .unit__right, + .unit-spacing-xxs.unit-sm-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 4px; + } + .unit-spacing-xxs.unit-sm > .unit__body + .unit__right, .unit-spacing-xxs.unit-sm-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 4px; + } + .unit-spacing-xxs.unit-sm-horizontal > .unit__left + .unit__right, + .unit-spacing-xxs.unit-sm-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-sm-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-sm--inverse > [class*='unit-']:first-child, .unit-spacing-xxs.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 4px; + } + .unit-spacing-xxs.unit-sm--inverse > [class*='unit-']:last-child, .unit-spacing-xxs.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxs.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 992px) { + .unit-spacing-xxs.unit-md > [class*='unit-']:first-child, .unit-spacing-xxs.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxs.unit-md > .unit__left + .unit__right, + .unit-spacing-xxs.unit-md > .unit__left + .unit__body, .unit-spacing-xxs.unit-md-vertical > .unit__left + .unit__right, + .unit-spacing-xxs.unit-md-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 4px; + } + .unit-spacing-xxs.unit-md > .unit__body + .unit__right, .unit-spacing-xxs.unit-md-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 4px; + } + .unit-spacing-xxs.unit-md-horizontal > .unit__left + .unit__right, + .unit-spacing-xxs.unit-md-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-md-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-md--inverse > [class*='unit-']:first-child, .unit-spacing-xxs.unit-md--inverse.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 4px; + } + .unit-spacing-xxs.unit-md--inverse > [class*='unit-']:last-child, .unit-spacing-xxs.unit-md--inverse.unit-md-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxs.unit-md--inverse.unit-md-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-md--inverse.unit-md-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1200px) { + .unit-spacing-xxs.unit-lg > [class*='unit-']:first-child, .unit-spacing-xxs.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxs.unit-lg > .unit__left + .unit__right, + .unit-spacing-xxs.unit-lg > .unit__left + .unit__body, .unit-spacing-xxs.unit-lg-vertical > .unit__left + .unit__right, + .unit-spacing-xxs.unit-lg-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 4px; + } + .unit-spacing-xxs.unit-lg > .unit__body + .unit__right, .unit-spacing-xxs.unit-lg-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 4px; + } + .unit-spacing-xxs.unit-lg-horizontal > .unit__left + .unit__right, + .unit-spacing-xxs.unit-lg-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-lg-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-lg--inverse > [class*='unit-']:first-child, .unit-spacing-xxs.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 4px; + } + .unit-spacing-xxs.unit-lg--inverse > [class*='unit-']:last-child, .unit-spacing-xxs.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxs.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) { + .unit-spacing-xxs.unit-xl > [class*='unit-']:first-child, .unit-spacing-xxs.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxs.unit-xl > .unit__left + .unit__right, + .unit-spacing-xxs.unit-xl > .unit__left + .unit__body, .unit-spacing-xxs.unit-xl-vertical > .unit__left + .unit__right, + .unit-spacing-xxs.unit-xl-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 4px; + } + .unit-spacing-xxs.unit-xl > .unit__body + .unit__right, .unit-spacing-xxs.unit-xl-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 4px; + } + .unit-spacing-xxs.unit-xl-horizontal > .unit__left + .unit__right, + .unit-spacing-xxs.unit-xl-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-xl-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-xl--inverse > [class*='unit-']:first-child, .unit-spacing-xxs.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 4px; + } + .unit-spacing-xxs.unit-xl--inverse > [class*='unit-']:last-child, .unit-spacing-xxs.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxs.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 4px; + } + .unit-spacing-xxs.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +.unit-spacing-xs.unit > [class*='unit-']:first-child, .unit-spacing-xs.unit-vertical > [class*='unit-']:first-child { + padding-top: 0; +} + +.unit-spacing-xs.unit > .unit__left + .unit__right, +.unit-spacing-xs.unit > .unit__left + .unit__body, .unit-spacing-xs.unit-vertical > .unit__left + .unit__right, +.unit-spacing-xs.unit-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 7px; +} + +.unit-spacing-xs.unit > .unit__body + .unit__right, .unit-spacing-xs.unit-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 7px; +} + +.unit-spacing-xs.unit-horizontal > .unit__left + .unit__right, +.unit-spacing-xs.unit-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 10px; +} + +.unit-spacing-xs.unit-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 10px; +} + +.unit-spacing-xs.unit--inverse > [class*='unit-']:first-child, .unit-spacing-xs.unit--inverse.unit-vertical > [class*='unit-']:first-child { + padding-top: 7px; +} + +.unit-spacing-xs.unit--inverse > [class*='unit-']:last-child, .unit-spacing-xs.unit--inverse.unit-vertical > [class*='unit-']:last-child { + padding-top: 0; +} + +.unit-spacing-xs.unit--inverse.unit-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 10px; +} + +.unit-spacing-xs.unit--inverse.unit-horizontal > [class*='unit-']:last-child { + padding-left: 0; +} + +@media (min-width: 480px) { + .unit-spacing-xs.unit-xs > [class*='unit-']:first-child, .unit-spacing-xs.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xs.unit-xs > .unit__left + .unit__right, + .unit-spacing-xs.unit-xs > .unit__left + .unit__body, .unit-spacing-xs.unit-xs-vertical > .unit__left + .unit__right, + .unit-spacing-xs.unit-xs-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 7px; + } + .unit-spacing-xs.unit-xs > .unit__body + .unit__right, .unit-spacing-xs.unit-xs-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 7px; + } + .unit-spacing-xs.unit-xs-horizontal > .unit__left + .unit__right, + .unit-spacing-xs.unit-xs-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-xs-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-xs--inverse > [class*='unit-']:first-child, .unit-spacing-xs.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 7px; + } + .unit-spacing-xs.unit-xs--inverse > [class*='unit-']:last-child, .unit-spacing-xs.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xs.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 768px) { + .unit-spacing-xs.unit-sm > [class*='unit-']:first-child, .unit-spacing-xs.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xs.unit-sm > .unit__left + .unit__right, + .unit-spacing-xs.unit-sm > .unit__left + .unit__body, .unit-spacing-xs.unit-sm-vertical > .unit__left + .unit__right, + .unit-spacing-xs.unit-sm-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 7px; + } + .unit-spacing-xs.unit-sm > .unit__body + .unit__right, .unit-spacing-xs.unit-sm-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 7px; + } + .unit-spacing-xs.unit-sm-horizontal > .unit__left + .unit__right, + .unit-spacing-xs.unit-sm-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-sm-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-sm--inverse > [class*='unit-']:first-child, .unit-spacing-xs.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 7px; + } + .unit-spacing-xs.unit-sm--inverse > [class*='unit-']:last-child, .unit-spacing-xs.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xs.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 992px) { + .unit-spacing-xs.unit-md > [class*='unit-']:first-child, .unit-spacing-xs.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xs.unit-md > .unit__left + .unit__right, + .unit-spacing-xs.unit-md > .unit__left + .unit__body, .unit-spacing-xs.unit-md-vertical > .unit__left + .unit__right, + .unit-spacing-xs.unit-md-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 7px; + } + .unit-spacing-xs.unit-md > .unit__body + .unit__right, .unit-spacing-xs.unit-md-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 7px; + } + .unit-spacing-xs.unit-md-horizontal > .unit__left + .unit__right, + .unit-spacing-xs.unit-md-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-md-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-md--inverse > [class*='unit-']:first-child, .unit-spacing-xs.unit-md--inverse.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 7px; + } + .unit-spacing-xs.unit-md--inverse > [class*='unit-']:last-child, .unit-spacing-xs.unit-md--inverse.unit-md-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xs.unit-md--inverse.unit-md-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-md--inverse.unit-md-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1200px) { + .unit-spacing-xs.unit-lg > [class*='unit-']:first-child, .unit-spacing-xs.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xs.unit-lg > .unit__left + .unit__right, + .unit-spacing-xs.unit-lg > .unit__left + .unit__body, .unit-spacing-xs.unit-lg-vertical > .unit__left + .unit__right, + .unit-spacing-xs.unit-lg-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 7px; + } + .unit-spacing-xs.unit-lg > .unit__body + .unit__right, .unit-spacing-xs.unit-lg-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 7px; + } + .unit-spacing-xs.unit-lg-horizontal > .unit__left + .unit__right, + .unit-spacing-xs.unit-lg-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-lg-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-lg--inverse > [class*='unit-']:first-child, .unit-spacing-xs.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 7px; + } + .unit-spacing-xs.unit-lg--inverse > [class*='unit-']:last-child, .unit-spacing-xs.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xs.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) { + .unit-spacing-xs.unit-xl > [class*='unit-']:first-child, .unit-spacing-xs.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xs.unit-xl > .unit__left + .unit__right, + .unit-spacing-xs.unit-xl > .unit__left + .unit__body, .unit-spacing-xs.unit-xl-vertical > .unit__left + .unit__right, + .unit-spacing-xs.unit-xl-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 7px; + } + .unit-spacing-xs.unit-xl > .unit__body + .unit__right, .unit-spacing-xs.unit-xl-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 7px; + } + .unit-spacing-xs.unit-xl-horizontal > .unit__left + .unit__right, + .unit-spacing-xs.unit-xl-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-xl-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-xl--inverse > [class*='unit-']:first-child, .unit-spacing-xs.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 7px; + } + .unit-spacing-xs.unit-xl--inverse > [class*='unit-']:last-child, .unit-spacing-xs.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xs.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 10px; + } + .unit-spacing-xs.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +.unit-spacing-sm.unit > [class*='unit-']:first-child, .unit-spacing-sm.unit-vertical > [class*='unit-']:first-child { + padding-top: 0; +} + +.unit-spacing-sm.unit > .unit__left + .unit__right, +.unit-spacing-sm.unit > .unit__left + .unit__body, .unit-spacing-sm.unit-vertical > .unit__left + .unit__right, +.unit-spacing-sm.unit-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; +} + +.unit-spacing-sm.unit > .unit__body + .unit__right, .unit-spacing-sm.unit-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; +} + +.unit-spacing-sm.unit-horizontal > .unit__left + .unit__right, +.unit-spacing-sm.unit-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 15px; +} + +.unit-spacing-sm.unit-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 15px; +} + +.unit-spacing-sm.unit--inverse > [class*='unit-']:first-child, .unit-spacing-sm.unit--inverse.unit-vertical > [class*='unit-']:first-child { + padding-top: 15px; +} + +.unit-spacing-sm.unit--inverse > [class*='unit-']:last-child, .unit-spacing-sm.unit--inverse.unit-vertical > [class*='unit-']:last-child { + padding-top: 0; +} + +.unit-spacing-sm.unit--inverse.unit-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 15px; +} + +.unit-spacing-sm.unit--inverse.unit-horizontal > [class*='unit-']:last-child { + padding-left: 0; +} + +@media (min-width: 480px) { + .unit-spacing-sm.unit-xs > [class*='unit-']:first-child, .unit-spacing-sm.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-sm.unit-xs > .unit__left + .unit__right, + .unit-spacing-sm.unit-xs > .unit__left + .unit__body, .unit-spacing-sm.unit-xs-vertical > .unit__left + .unit__right, + .unit-spacing-sm.unit-xs-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-sm.unit-xs > .unit__body + .unit__right, .unit-spacing-sm.unit-xs-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-sm.unit-xs-horizontal > .unit__left + .unit__right, + .unit-spacing-sm.unit-xs-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-xs-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-xs--inverse > [class*='unit-']:first-child, .unit-spacing-sm.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 15px; + } + .unit-spacing-sm.unit-xs--inverse > [class*='unit-']:last-child, .unit-spacing-sm.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-sm.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 768px) { + .unit-spacing-sm.unit-sm > [class*='unit-']:first-child, .unit-spacing-sm.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-sm.unit-sm > .unit__left + .unit__right, + .unit-spacing-sm.unit-sm > .unit__left + .unit__body, .unit-spacing-sm.unit-sm-vertical > .unit__left + .unit__right, + .unit-spacing-sm.unit-sm-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-sm.unit-sm > .unit__body + .unit__right, .unit-spacing-sm.unit-sm-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-sm.unit-sm-horizontal > .unit__left + .unit__right, + .unit-spacing-sm.unit-sm-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-sm-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-sm--inverse > [class*='unit-']:first-child, .unit-spacing-sm.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 15px; + } + .unit-spacing-sm.unit-sm--inverse > [class*='unit-']:last-child, .unit-spacing-sm.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-sm.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 992px) { + .unit-spacing-sm.unit-md > [class*='unit-']:first-child, .unit-spacing-sm.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-sm.unit-md > .unit__left + .unit__right, + .unit-spacing-sm.unit-md > .unit__left + .unit__body, .unit-spacing-sm.unit-md-vertical > .unit__left + .unit__right, + .unit-spacing-sm.unit-md-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-sm.unit-md > .unit__body + .unit__right, .unit-spacing-sm.unit-md-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-sm.unit-md-horizontal > .unit__left + .unit__right, + .unit-spacing-sm.unit-md-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-md-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-md--inverse > [class*='unit-']:first-child, .unit-spacing-sm.unit-md--inverse.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 15px; + } + .unit-spacing-sm.unit-md--inverse > [class*='unit-']:last-child, .unit-spacing-sm.unit-md--inverse.unit-md-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-sm.unit-md--inverse.unit-md-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-md--inverse.unit-md-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1200px) { + .unit-spacing-sm.unit-lg > [class*='unit-']:first-child, .unit-spacing-sm.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-sm.unit-lg > .unit__left + .unit__right, + .unit-spacing-sm.unit-lg > .unit__left + .unit__body, .unit-spacing-sm.unit-lg-vertical > .unit__left + .unit__right, + .unit-spacing-sm.unit-lg-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-sm.unit-lg > .unit__body + .unit__right, .unit-spacing-sm.unit-lg-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-sm.unit-lg-horizontal > .unit__left + .unit__right, + .unit-spacing-sm.unit-lg-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-lg-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-lg--inverse > [class*='unit-']:first-child, .unit-spacing-sm.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 15px; + } + .unit-spacing-sm.unit-lg--inverse > [class*='unit-']:last-child, .unit-spacing-sm.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-sm.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) { + .unit-spacing-sm.unit-xl > [class*='unit-']:first-child, .unit-spacing-sm.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-sm.unit-xl > .unit__left + .unit__right, + .unit-spacing-sm.unit-xl > .unit__left + .unit__body, .unit-spacing-sm.unit-xl-vertical > .unit__left + .unit__right, + .unit-spacing-sm.unit-xl-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-sm.unit-xl > .unit__body + .unit__right, .unit-spacing-sm.unit-xl-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-sm.unit-xl-horizontal > .unit__left + .unit__right, + .unit-spacing-sm.unit-xl-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-xl-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-xl--inverse > [class*='unit-']:first-child, .unit-spacing-sm.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 15px; + } + .unit-spacing-sm.unit-xl--inverse > [class*='unit-']:last-child, .unit-spacing-sm.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-sm.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 15px; + } + .unit-spacing-sm.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +.unit-spacing-md.unit > [class*='unit-']:first-child, .unit-spacing-md.unit-vertical > [class*='unit-']:first-child { + padding-top: 0; +} + +.unit-spacing-md.unit > .unit__left + .unit__right, +.unit-spacing-md.unit > .unit__left + .unit__body, .unit-spacing-md.unit-vertical > .unit__left + .unit__right, +.unit-spacing-md.unit-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; +} + +.unit-spacing-md.unit > .unit__body + .unit__right, .unit-spacing-md.unit-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; +} + +.unit-spacing-md.unit-horizontal > .unit__left + .unit__right, +.unit-spacing-md.unit-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; +} + +.unit-spacing-md.unit-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; +} + +.unit-spacing-md.unit--inverse > [class*='unit-']:first-child, .unit-spacing-md.unit--inverse.unit-vertical > [class*='unit-']:first-child { + padding-top: 15px; +} + +.unit-spacing-md.unit--inverse > [class*='unit-']:last-child, .unit-spacing-md.unit--inverse.unit-vertical > [class*='unit-']:last-child { + padding-top: 0; +} + +.unit-spacing-md.unit--inverse.unit-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; +} + +.unit-spacing-md.unit--inverse.unit-horizontal > [class*='unit-']:last-child { + padding-left: 0; +} + +@media (min-width: 480px) { + .unit-spacing-md.unit-xs > [class*='unit-']:first-child, .unit-spacing-md.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-md.unit-xs > .unit__left + .unit__right, + .unit-spacing-md.unit-xs > .unit__left + .unit__body, .unit-spacing-md.unit-xs-vertical > .unit__left + .unit__right, + .unit-spacing-md.unit-xs-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-md.unit-xs > .unit__body + .unit__right, .unit-spacing-md.unit-xs-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-md.unit-xs-horizontal > .unit__left + .unit__right, + .unit-spacing-md.unit-xs-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-xs-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-xs--inverse > [class*='unit-']:first-child, .unit-spacing-md.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 15px; + } + .unit-spacing-md.unit-xs--inverse > [class*='unit-']:last-child, .unit-spacing-md.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-md.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 768px) { + .unit-spacing-md.unit-sm > [class*='unit-']:first-child, .unit-spacing-md.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-md.unit-sm > .unit__left + .unit__right, + .unit-spacing-md.unit-sm > .unit__left + .unit__body, .unit-spacing-md.unit-sm-vertical > .unit__left + .unit__right, + .unit-spacing-md.unit-sm-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-md.unit-sm > .unit__body + .unit__right, .unit-spacing-md.unit-sm-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-md.unit-sm-horizontal > .unit__left + .unit__right, + .unit-spacing-md.unit-sm-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-sm-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-sm--inverse > [class*='unit-']:first-child, .unit-spacing-md.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 15px; + } + .unit-spacing-md.unit-sm--inverse > [class*='unit-']:last-child, .unit-spacing-md.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-md.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 992px) { + .unit-spacing-md.unit-md > [class*='unit-']:first-child, .unit-spacing-md.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-md.unit-md > .unit__left + .unit__right, + .unit-spacing-md.unit-md > .unit__left + .unit__body, .unit-spacing-md.unit-md-vertical > .unit__left + .unit__right, + .unit-spacing-md.unit-md-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-md.unit-md > .unit__body + .unit__right, .unit-spacing-md.unit-md-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-md.unit-md-horizontal > .unit__left + .unit__right, + .unit-spacing-md.unit-md-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-md-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-md--inverse > [class*='unit-']:first-child, .unit-spacing-md.unit-md--inverse.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 15px; + } + .unit-spacing-md.unit-md--inverse > [class*='unit-']:last-child, .unit-spacing-md.unit-md--inverse.unit-md-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-md.unit-md--inverse.unit-md-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-md--inverse.unit-md-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1200px) { + .unit-spacing-md.unit-lg > [class*='unit-']:first-child, .unit-spacing-md.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-md.unit-lg > .unit__left + .unit__right, + .unit-spacing-md.unit-lg > .unit__left + .unit__body, .unit-spacing-md.unit-lg-vertical > .unit__left + .unit__right, + .unit-spacing-md.unit-lg-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-md.unit-lg > .unit__body + .unit__right, .unit-spacing-md.unit-lg-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-md.unit-lg-horizontal > .unit__left + .unit__right, + .unit-spacing-md.unit-lg-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-lg-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-lg--inverse > [class*='unit-']:first-child, .unit-spacing-md.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 15px; + } + .unit-spacing-md.unit-lg--inverse > [class*='unit-']:last-child, .unit-spacing-md.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-md.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) { + .unit-spacing-md.unit-xl > [class*='unit-']:first-child, .unit-spacing-md.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-md.unit-xl > .unit__left + .unit__right, + .unit-spacing-md.unit-xl > .unit__left + .unit__body, .unit-spacing-md.unit-xl-vertical > .unit__left + .unit__right, + .unit-spacing-md.unit-xl-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-md.unit-xl > .unit__body + .unit__right, .unit-spacing-md.unit-xl-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 15px; + } + .unit-spacing-md.unit-xl-horizontal > .unit__left + .unit__right, + .unit-spacing-md.unit-xl-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-xl-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-xl--inverse > [class*='unit-']:first-child, .unit-spacing-md.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 15px; + } + .unit-spacing-md.unit-xl--inverse > [class*='unit-']:last-child, .unit-spacing-md.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-md.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 30px; + } + .unit-spacing-md.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +.unit-spacing-xl.unit > [class*='unit-']:first-child, .unit-spacing-xl.unit-vertical > [class*='unit-']:first-child { + padding-top: 0; +} + +.unit-spacing-xl.unit > .unit__left + .unit__right, +.unit-spacing-xl.unit > .unit__left + .unit__body, .unit-spacing-xl.unit-vertical > .unit__left + .unit__right, +.unit-spacing-xl.unit-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 50px; +} + +.unit-spacing-xl.unit > .unit__body + .unit__right, .unit-spacing-xl.unit-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 50px; +} + +.unit-spacing-xl.unit-horizontal > .unit__left + .unit__right, +.unit-spacing-xl.unit-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 50px; +} + +.unit-spacing-xl.unit-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 50px; +} + +.unit-spacing-xl.unit--inverse > [class*='unit-']:first-child, .unit-spacing-xl.unit--inverse.unit-vertical > [class*='unit-']:first-child { + padding-top: 50px; +} + +.unit-spacing-xl.unit--inverse > [class*='unit-']:last-child, .unit-spacing-xl.unit--inverse.unit-vertical > [class*='unit-']:last-child { + padding-top: 0; +} + +.unit-spacing-xl.unit--inverse.unit-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 50px; +} + +.unit-spacing-xl.unit--inverse.unit-horizontal > [class*='unit-']:last-child { + padding-left: 0; +} + +@media (min-width: 480px) { + .unit-spacing-xl.unit-xs > [class*='unit-']:first-child, .unit-spacing-xl.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xl.unit-xs > .unit__left + .unit__right, + .unit-spacing-xl.unit-xs > .unit__left + .unit__body, .unit-spacing-xl.unit-xs-vertical > .unit__left + .unit__right, + .unit-spacing-xl.unit-xs-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 50px; + } + .unit-spacing-xl.unit-xs > .unit__body + .unit__right, .unit-spacing-xl.unit-xs-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 50px; + } + .unit-spacing-xl.unit-xs-horizontal > .unit__left + .unit__right, + .unit-spacing-xl.unit-xs-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-xs-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-xs--inverse > [class*='unit-']:first-child, .unit-spacing-xl.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 50px; + } + .unit-spacing-xl.unit-xs--inverse > [class*='unit-']:last-child, .unit-spacing-xl.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xl.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 768px) { + .unit-spacing-xl.unit-sm > [class*='unit-']:first-child, .unit-spacing-xl.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xl.unit-sm > .unit__left + .unit__right, + .unit-spacing-xl.unit-sm > .unit__left + .unit__body, .unit-spacing-xl.unit-sm-vertical > .unit__left + .unit__right, + .unit-spacing-xl.unit-sm-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 50px; + } + .unit-spacing-xl.unit-sm > .unit__body + .unit__right, .unit-spacing-xl.unit-sm-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 50px; + } + .unit-spacing-xl.unit-sm-horizontal > .unit__left + .unit__right, + .unit-spacing-xl.unit-sm-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-sm-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-sm--inverse > [class*='unit-']:first-child, .unit-spacing-xl.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 50px; + } + .unit-spacing-xl.unit-sm--inverse > [class*='unit-']:last-child, .unit-spacing-xl.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xl.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 992px) { + .unit-spacing-xl.unit-md > [class*='unit-']:first-child, .unit-spacing-xl.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xl.unit-md > .unit__left + .unit__right, + .unit-spacing-xl.unit-md > .unit__left + .unit__body, .unit-spacing-xl.unit-md-vertical > .unit__left + .unit__right, + .unit-spacing-xl.unit-md-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 50px; + } + .unit-spacing-xl.unit-md > .unit__body + .unit__right, .unit-spacing-xl.unit-md-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 50px; + } + .unit-spacing-xl.unit-md-horizontal > .unit__left + .unit__right, + .unit-spacing-xl.unit-md-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-md-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-md--inverse > [class*='unit-']:first-child, .unit-spacing-xl.unit-md--inverse.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 50px; + } + .unit-spacing-xl.unit-md--inverse > [class*='unit-']:last-child, .unit-spacing-xl.unit-md--inverse.unit-md-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xl.unit-md--inverse.unit-md-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-md--inverse.unit-md-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1200px) { + .unit-spacing-xl.unit-lg > [class*='unit-']:first-child, .unit-spacing-xl.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xl.unit-lg > .unit__left + .unit__right, + .unit-spacing-xl.unit-lg > .unit__left + .unit__body, .unit-spacing-xl.unit-lg-vertical > .unit__left + .unit__right, + .unit-spacing-xl.unit-lg-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 50px; + } + .unit-spacing-xl.unit-lg > .unit__body + .unit__right, .unit-spacing-xl.unit-lg-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 50px; + } + .unit-spacing-xl.unit-lg-horizontal > .unit__left + .unit__right, + .unit-spacing-xl.unit-lg-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-lg-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-lg--inverse > [class*='unit-']:first-child, .unit-spacing-xl.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 50px; + } + .unit-spacing-xl.unit-lg--inverse > [class*='unit-']:last-child, .unit-spacing-xl.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xl.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) { + .unit-spacing-xl.unit-xl > [class*='unit-']:first-child, .unit-spacing-xl.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xl.unit-xl > .unit__left + .unit__right, + .unit-spacing-xl.unit-xl > .unit__left + .unit__body, .unit-spacing-xl.unit-xl-vertical > .unit__left + .unit__right, + .unit-spacing-xl.unit-xl-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 50px; + } + .unit-spacing-xl.unit-xl > .unit__body + .unit__right, .unit-spacing-xl.unit-xl-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 50px; + } + .unit-spacing-xl.unit-xl-horizontal > .unit__left + .unit__right, + .unit-spacing-xl.unit-xl-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-xl-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-xl--inverse > [class*='unit-']:first-child, .unit-spacing-xl.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 50px; + } + .unit-spacing-xl.unit-xl--inverse > [class*='unit-']:last-child, .unit-spacing-xl.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xl.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 50px; + } + .unit-spacing-xl.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +.unit-spacing-xxl.unit > [class*='unit-']:first-child, .unit-spacing-xxl.unit-vertical > [class*='unit-']:first-child { + padding-top: 0; +} + +.unit-spacing-xxl.unit > .unit__left + .unit__right, +.unit-spacing-xxl.unit > .unit__left + .unit__body, .unit-spacing-xxl.unit-vertical > .unit__left + .unit__right, +.unit-spacing-xxl.unit-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 40px; +} + +.unit-spacing-xxl.unit > .unit__body + .unit__right, .unit-spacing-xxl.unit-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 40px; +} + +.unit-spacing-xxl.unit-horizontal > .unit__left + .unit__right, +.unit-spacing-xxl.unit-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 40px; +} + +.unit-spacing-xxl.unit-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 40px; +} + +.unit-spacing-xxl.unit--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit--inverse.unit-vertical > [class*='unit-']:first-child { + padding-top: 40px; +} + +.unit-spacing-xxl.unit--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit--inverse.unit-vertical > [class*='unit-']:last-child { + padding-top: 0; +} + +.unit-spacing-xxl.unit--inverse.unit-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 40px; +} + +.unit-spacing-xxl.unit--inverse.unit-horizontal > [class*='unit-']:last-child { + padding-left: 0; +} + +@media (min-width: 480px) { + .unit-spacing-xxl.unit-xs > [class*='unit-']:first-child, .unit-spacing-xxl.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-xs > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xs > .unit__left + .unit__body, .unit-spacing-xxl.unit-xs-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xs-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 40px; + } + .unit-spacing-xxl.unit-xs > .unit__body + .unit__right, .unit-spacing-xxl.unit-xs-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 40px; + } + .unit-spacing-xxl.unit-xs-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xs-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-xs-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-xs--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 40px; + } + .unit-spacing-xxl.unit-xs--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 768px) { + .unit-spacing-xxl.unit-sm > [class*='unit-']:first-child, .unit-spacing-xxl.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-sm > .unit__left + .unit__right, + .unit-spacing-xxl.unit-sm > .unit__left + .unit__body, .unit-spacing-xxl.unit-sm-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-sm-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 40px; + } + .unit-spacing-xxl.unit-sm > .unit__body + .unit__right, .unit-spacing-xxl.unit-sm-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 40px; + } + .unit-spacing-xxl.unit-sm-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-sm-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-sm-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-sm--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 40px; + } + .unit-spacing-xxl.unit-sm--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 992px) { + .unit-spacing-xxl.unit-md > [class*='unit-']:first-child, .unit-spacing-xxl.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-md > .unit__left + .unit__right, + .unit-spacing-xxl.unit-md > .unit__left + .unit__body, .unit-spacing-xxl.unit-md-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-md-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 40px; + } + .unit-spacing-xxl.unit-md > .unit__body + .unit__right, .unit-spacing-xxl.unit-md-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 40px; + } + .unit-spacing-xxl.unit-md-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-md-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-md-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-md--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit-md--inverse.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 40px; + } + .unit-spacing-xxl.unit-md--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit-md--inverse.unit-md-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-md--inverse.unit-md-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-md--inverse.unit-md-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1200px) { + .unit-spacing-xxl.unit-lg > [class*='unit-']:first-child, .unit-spacing-xxl.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-lg > .unit__left + .unit__right, + .unit-spacing-xxl.unit-lg > .unit__left + .unit__body, .unit-spacing-xxl.unit-lg-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-lg-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 40px; + } + .unit-spacing-xxl.unit-lg > .unit__body + .unit__right, .unit-spacing-xxl.unit-lg-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 40px; + } + .unit-spacing-xxl.unit-lg-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-lg-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-lg-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-lg--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 40px; + } + .unit-spacing-xxl.unit-lg--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) { + .unit-spacing-xxl.unit-xl > [class*='unit-']:first-child, .unit-spacing-xxl.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-xl > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xl > .unit__left + .unit__body, .unit-spacing-xxl.unit-xl-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xl-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 40px; + } + .unit-spacing-xxl.unit-xl > .unit__body + .unit__right, .unit-spacing-xxl.unit-xl-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 40px; + } + .unit-spacing-xxl.unit-xl-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xl-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-xl-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-xl--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 40px; + } + .unit-spacing-xxl.unit-xl--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 40px; + } + .unit-spacing-xxl.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) { + .unit-spacing-xxl.unit > [class*='unit-']:first-child, .unit-spacing-xxl.unit-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit > .unit__left + .unit__right, + .unit-spacing-xxl.unit > .unit__left + .unit__body, .unit-spacing-xxl.unit-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit > .unit__body + .unit__right, .unit-spacing-xxl.unit-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit--inverse.unit-vertical > [class*='unit-']:first-child { + padding-top: 60px; + } + .unit-spacing-xxl.unit--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit--inverse.unit-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit--inverse.unit-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit--inverse.unit-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) and (min-width: 480px) { + .unit-spacing-xxl.unit-xs > [class*='unit-']:first-child, .unit-spacing-xxl.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-xs > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xs > .unit__left + .unit__body, .unit-spacing-xxl.unit-xs-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xs-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-xs > .unit__body + .unit__right, .unit-spacing-xxl.unit-xs-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-xs-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xs-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-xs-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-xs--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:first-child { + padding-top: 60px; + } + .unit-spacing-xxl.unit-xs--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit-xs--inverse.unit-xs-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-xs--inverse.unit-xs-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) and (min-width: 768px) { + .unit-spacing-xxl.unit-sm > [class*='unit-']:first-child, .unit-spacing-xxl.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-sm > .unit__left + .unit__right, + .unit-spacing-xxl.unit-sm > .unit__left + .unit__body, .unit-spacing-xxl.unit-sm-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-sm-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-sm > .unit__body + .unit__right, .unit-spacing-xxl.unit-sm-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-sm-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-sm-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-sm-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-sm--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:first-child { + padding-top: 60px; + } + .unit-spacing-xxl.unit-sm--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit-sm--inverse.unit-sm-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-sm--inverse.unit-sm-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) and (min-width: 992px) { + .unit-spacing-xxl.unit-md > [class*='unit-']:first-child, .unit-spacing-xxl.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-md > .unit__left + .unit__right, + .unit-spacing-xxl.unit-md > .unit__left + .unit__body, .unit-spacing-xxl.unit-md-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-md-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-md > .unit__body + .unit__right, .unit-spacing-xxl.unit-md-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-md-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-md-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-md-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-md--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit-md--inverse.unit-md-vertical > [class*='unit-']:first-child { + padding-top: 60px; + } + .unit-spacing-xxl.unit-md--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit-md--inverse.unit-md-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-md--inverse.unit-md-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-md--inverse.unit-md-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) and (min-width: 1200px) { + .unit-spacing-xxl.unit-lg > [class*='unit-']:first-child, .unit-spacing-xxl.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-lg > .unit__left + .unit__right, + .unit-spacing-xxl.unit-lg > .unit__left + .unit__body, .unit-spacing-xxl.unit-lg-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-lg-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-lg > .unit__body + .unit__right, .unit-spacing-xxl.unit-lg-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-lg-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-lg-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-lg-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-lg--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:first-child { + padding-top: 60px; + } + .unit-spacing-xxl.unit-lg--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit-lg--inverse.unit-lg-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-lg--inverse.unit-lg-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +@media (min-width: 1800px) and (min-width: 1800px) { + .unit-spacing-xxl.unit-xl > [class*='unit-']:first-child, .unit-spacing-xxl.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-xl > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xl > .unit__left + .unit__body, .unit-spacing-xxl.unit-xl-vertical > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xl-vertical > .unit__left + .unit__body { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-xl > .unit__body + .unit__right, .unit-spacing-xxl.unit-xl-vertical > .unit__body + .unit__right { + padding-left: 0; + padding-top: 60px; + } + .unit-spacing-xxl.unit-xl-horizontal > .unit__left + .unit__right, + .unit-spacing-xxl.unit-xl-horizontal > .unit__left + .unit__body { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-xl-horizontal > .unit__body + .unit__right { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-xl--inverse > [class*='unit-']:first-child, .unit-spacing-xxl.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:first-child { + padding-top: 60px; + } + .unit-spacing-xxl.unit-xl--inverse > [class*='unit-']:last-child, .unit-spacing-xxl.unit-xl--inverse.unit-xl-vertical > [class*='unit-']:last-child { + padding-top: 0; + } + .unit-spacing-xxl.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:first-child { + padding-top: 0; + padding-left: 60px; + } + .unit-spacing-xxl.unit-xl--inverse.unit-xl-horizontal > [class*='unit-']:last-child { + padding-left: 0; + } +} + +.row-no-gutter { + margin-left: 0; + margin-right: 0; +} + +.row-no-gutter > [class*='col'] { + padding-left: 0; + padding-right: 0; +} + +@media (max-width: 1199px) { + .row-gutter-custom { + margin-left: -8px; + margin-right: -8px; + } + .row-gutter-custom > [class*='col'] { + padding-left: 8px; + padding-right: 8px; + } +} + +@media (max-width: 479px) { + .container [class*='col'] { + padding-left: 8px; + padding-right: 8px; + } +} + +.grid-element { + padding: 12px 8px; + font-weight: 400; + letter-spacing: 0; + text-align: left; +} + +@media (max-width: 1199px) { + .grid-element p { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +} + +@media (min-width: 768px) { + .container-fullwidth .grid-element { + padding: 15px 10px; + } +} + +@media (min-width: 992px) { + .container-fullwidth .grid-element { + padding: 25px 15px; + } +} + +@media (min-width: 1200px) { + .container-fullwidth .grid-element { + padding: 30px 15px 30px 30px; + } +} + +@media (min-width: 1400px) { + .container-fullwidth .grid-element { + padding: 40px 70px; + } +} + +.grid-system-bordered .grid-system-row { + border-bottom: 1px solid #f2f3f8; +} + +.grid-system-bordered .grid-system-row:last-child { + border-bottom: 0; +} + +.grid-system-bordered .grid-element { + padding-top: 15px; + padding-bottom: 15px; +} + +@media (min-width: 768px) { + .grid-system-bordered .grid-element { + padding-top: 25px; + padding-bottom: 25px; + } +} + +@media (min-width: 1200px) { + .grid-system-bordered .grid-element { + padding-top: 45px; + padding-bottom: 45px; + } +} + +.grid-system-outline .grid-system-row { + border: 1px solid #f2f3f8; + border-width: 1px 0 0 1px; +} + +.grid-system-outline .grid-system-row:last-child { + border-bottom-width: 1px; +} + +.grid-system-outline [class*='col']:not(:first-child) .grid-element { + border-left: 1px solid #f2f3f8; +} + +* + .grid-system-row { + margin-top: 45px; +} + +.grid-system-row + .grid-system-row { + margin-top: 0; +} + +.range-custom-bordered [class*='cell'] { + border-style: solid; + border-color: #b1aabb; + border-width: 0; +} + +.range-custom-bordered [class*='cell']:nth-child(n + 2) { + border-width: 1px 0 0 0; +} + +@media (min-width: 480px) { + .range-custom-bordered .cell-xs-6:nth-child(odd) { + border-width: 0 1px 1px 0; + } + .range-custom-bordered .cell-xs-6:nth-child(even) { + border-width: 0 0 1px 0; + } +} + +@media (min-width: 768px) { + .range-custom-bordered .cell-sm-3:first-child { + border-width: 0 1px 0 1px; + } + .range-custom-bordered .cell-sm-3:nth-child(n + 2) { + border-width: 0 1px 0 0; + } + .range-custom-bordered .cell-sm-4:nth-child(n) { + border-width: 0; + } + .range-custom-bordered .cell-sm-4:nth-child(n + 2) { + border-width: 0 0 0 1px; + } +} + +.range-custom-bordered-mod [class*='cell']:first-of-type { + border-left: 0; +} + +.range-custom-bordered-mod [class*='cell']:last-of-type { + border-right: 0; +} + +@media (min-width: 768px) { + .range-custom-bordered-mod .counter-box { + padding-top: 0; + padding-bottom: 0; + } +} + +.row.flickr { + display: inline-block; + margin-left: -5px; + margin-right: -5px; + width: 100%; + max-width: 315px; +} + +.row.flickr [class*='col'] { + padding-left: 5px; + padding-right: 5px; +} + +* + .row.flickr { + margin-top: 14px; +} + +.one-screen-page { + text-align: center; + max-height: 100vh; + overflow-y: auto; + overflow-x: hidden; +} + +.one-screen-page .one-screen-page-inner { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + flex-grow: 1; + height: 100vh; + width: 100%; +} + +.one-screen-page .one-screen-page-inner > * { + width: 100%; + flex-shrink: 0; +} + +.one-screen-page .page-head, +.one-screen-page .page-foot { + background-color: transparent; +} + +.one-screen-page .rd-navbar-brand { + display: block; +} + +.one-screen-page *:not(.button) { + color: #fff; +} + +.one-screen-page *:not(.button) .progress-header > div:first-child span { + color: #f2f3f8; +} + +.one-screen-page .rd-mailform { + max-width: 670px; + margin-left: auto; + margin-right: auto; +} + +.one-screen-page .countdown-wrap + p { + margin-top: 50px; +} + +.one-screen-page * + .rd-mailform { + margin-top: 40px; +} + +.one-screen-page h3 + * { + margin-top: 55px; +} + +.one-screen-page .rd-mailform .form-input { + background: rgba(255, 255, 255, 0.47); +} + +.one-screen-page .time_circles > div > h4 { + color: #f2f3f8; +} + +.one-screen-page .progress-linear { + max-width: 430px; + margin: auto; + margin-top: 50px; +} + +.one-screen-page .progress-linear .progress-value { + color: #fff; +} + +.one-screen-page .page-head { + padding: calc(1em + 4vh) 0 calc(1em + 2vh); +} + +.one-screen-page .page-head .brand svg text { + fill: #fff; +} + +.one-screen-page .page-head .brand svg path { + fill: #8f859e; +} + +.one-screen-page .page-content { + padding: calc(1em + 4vh) 0; +} + +.one-screen-page .page-subtitle { + letter-spacing: 0; +} + +.one-screen-page .page-title { + font-weight: 900; + color: #dcd1d5; +} + +.one-screen-page .page-description { + margin-top: 15px; +} + +.one-screen-page .group-xl { + margin-top: 40px; +} + +.one-screen-page .page-foot { + padding: calc(1em + 2vh) 0 calc(1em + 2vh); +} + +.one-screen-page .copyright { + color: #f2f3f8; +} + +.one-screen-page .copyright span { + color: #f2f3f8; +} + +.one-screen-page .copyright a { + transition: .3s; +} + +.one-screen-page .copyright a, .one-screen-page .copyright a:active, .one-screen-page .copyright a:focus { + color: #f2f3f8; +} + +.one-screen-page .copyright a:hover { + color: #8f859e; +} + +.one-screen-page .form-subscribe .form-control { + background-color: transparent; +} + +@media (min-width: 480px) { + .one-screen-page .page { + text-align: center; + } +} + +@media (min-width: 1800px) { + .one-screen-page .page-head { + padding: 58px 0 20px; + } + .one-screen-page .page-content { + padding: 10px 0 35px; + } + .one-screen-page .page-foot { + padding: 20px 0 30px; + } + .one-screen-page .page-description { + margin-top: 37px; + } + .one-screen-page .progress-linear { + margin-top: 50px; + } + .one-screen-page .group-xl { + margin-top: 90px; + } +} + +[data-x-mode="design-mode"] .one-screen-page { + max-height: none; + overflow-x: visible; + overflow-y: visible; +} + +[data-x-mode="design-mode"] .one-screen-page-inner { + min-height: 100vh; + height: auto; +} + +.overlay-dark { + position: relative; +} + +.overlay-dark .one-screen-page-inner { + position: relative; +} + +.overlay-dark:before { + position: absolute; + content: ''; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: rgba(0, 0, 0, 0.3); + z-index: 0; +} + +/* +* +* Plugins +* ================================================== +*/ +/* +* +* Animate.css +* -------------------------------------------------- +*/ +.animated { + -webkit-animation-duration: .7s; + animation-duration: .7s; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + opacity: 1; +} + +.animated.infinite { + -webkit-animation-iteration-count: infinite; + animation-iteration-count: infinite; +} + +.animated.hinge { + -webkit-animation-duration: 2s; + animation-duration: 2s; +} + +html:not(.lt-ie10) .not-animated { + opacity: 0; +} + +/** +* FadeIn Keyframes Animation +*/ +@-webkit-keyframes fadeIn { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +@keyframes fadeIn { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +.fadeIn { + -webkit-animation-name: fadeIn; + animation-name: fadeIn; +} + +/** +* FadeInUp Keyframes Animation +*/ +@-webkit-keyframes fadeInUp { + 0% { + opacity: 0; + -webkit-transform: translate3d(0, 40px, 0); + transform: translate3d(0, 40px, 0); + } + 100% { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInUp { + 0% { + opacity: 0; + -webkit-transform: translate3d(0, 40px, 0); + transform: translate3d(0, 40px, 0); + } + 100% { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInUp { + -webkit-animation-name: fadeInUp; + animation-name: fadeInUp; +} + +/** +* FadeInDown Keyframes Animation +*/ +@-webkit-keyframes fadeInDown { + 0% { + opacity: 0; + -webkit-transform: translate3d(0, -40px, 0); + transform: translate3d(0, -40px, 0); + } + 100% { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInDown { + 0% { + opacity: 0; + -webkit-transform: translate3d(0, -40px, 0); + transform: translate3d(0, -40px, 0); + } + 100% { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInDown { + -webkit-animation-name: fadeInDown; + animation-name: fadeInDown; +} + +/** +* FadeInLeft Keyframes Animation +*/ +@-webkit-keyframes fadeInLeft { + 0% { + opacity: 0; + -webkit-transform: translate3d(-40px, 0, 0); + transform: translate3d(-40px, 0, 0); + } + 100% { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInLeft { + 0% { + opacity: 0; + -webkit-transform: translate3d(-40px, 0, 0); + transform: translate3d(-40px, 0, 0); + } + 100% { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInLeft { + -webkit-animation-name: fadeInLeft; + animation-name: fadeInLeft; +} + +/** +* FadeInRight Keyframes Animation +*/ +@-webkit-keyframes fadeInRight { + 0% { + opacity: 0; + -webkit-transform: translate3d(40px, 0, 0); + transform: translate3d(40px, 0, 0); + } + 100% { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +@keyframes fadeInRight { + 0% { + opacity: 0; + -webkit-transform: translate3d(40px, 0, 0); + transform: translate3d(40px, 0, 0); + } + 100% { + opacity: 1; + -webkit-transform: none; + transform: none; + } +} + +.fadeInRight { + -webkit-animation-name: fadeInRight; + animation-name: fadeInRight; +} + +/* +** +* FadeOut Keyframes Animation +*/ +@-webkit-keyframes fadeOut { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} + +@keyframes fadeOut { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} + +.fadeOut { + -webkit-animation-name: fadeOut; + animation-name: fadeOut; +} + +/** +* SlideInDown Keyframes Animation +*/ +@-webkit-keyframes slideInDown { + 0% { + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + visibility: visible; + } + 100% { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +@keyframes slideInDown { + 0% { + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + visibility: visible; + } + 100% { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +.slideInDown { + -webkit-animation-name: slideInDown; + animation-name: slideInDown; +} + +/** +* SlideInLeft Keyframes Animation +*/ +@-webkit-keyframes slideInLeft { + 0% { + -webkit-transform: translate3d(-50%, 0, 0); + transform: translate3d(-50%, 0, 0); + visibility: visible; + } + 100% { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +@keyframes slideInLeft { + 0% { + -webkit-transform: translate3d(-50%, 0, 0); + transform: translate3d(-50%, 0, 0); + visibility: visible; + } + 100% { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +.slideInLeft { + -webkit-animation-name: slideInLeft; + animation-name: slideInLeft; +} + +/** +* SlideInRight Keyframes Animation +*/ +@-webkit-keyframes slideInRight { + 0% { + -webkit-transform: translate3d(40%, 0, 0); + transform: translate3d(40%, 0, 0); + visibility: visible; + } + 100% { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +@keyframes slideInRight { + 0% { + -webkit-transform: translate3d(40%, 0, 0); + transform: translate3d(40%, 0, 0); + visibility: visible; + } + 100% { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +.slideInRight { + -webkit-animation-name: slideInRight; + animation-name: slideInRight; +} + +/** +* SlideOutDown Keyframes Animation +*/ +@-webkit-keyframes slideOutDown { + 0% { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + 100% { + visibility: hidden; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +@keyframes slideOutDown { + 0% { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + 100% { + visibility: hidden; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} + +.slideOutDown { + -webkit-animation-name: slideOutDown; + animation-name: slideOutDown; +} + +.rotate-custom { + transform-style: preserve-3d; + animation-duration: 2s; +} + +.rotate-custom-left { + -webkit-animation-name: rotate-custom-left; + animation-name: rotate-custom-left; +} + +.rotate-custom-right { + -webkit-animation-name: rotate-custom-right; + animation-name: rotate-custom-right; +} + +@-webkit-keyframes rotate-custom-left { + 0% { + transform: perspective(1000px) rotate3d(0, 1, 0, 50deg) translateY(15%); + opacity: 0; + } + 100% { + transform: perspective(1000px) rotate3d(0, 1, 0, 0deg) translateY(0); + opacity: 1; + } +} + +@keyframes rotate-custom-left { + 0% { + transform: perspective(1000px) rotate3d(0, 1, 0, 50deg) translateY(15%); + opacity: 0; + } + 100% { + transform: perspective(1000px) rotate3d(0, 1, 0, 0deg) translateY(0); + opacity: 1; + } +} + +@-webkit-keyframes rotate-custom-right { + 0% { + transform: perspective(1000px) rotate3d(0, 1, 0, -50deg) translateY(15%); + opacity: 0; + } + 100% { + transform: perspective(1000px) rotate3d(0, 1, 0, 0deg) translateY(0); + opacity: 1; + } +} + +@keyframes rotate-custom-right { + 0% { + transform: perspective(1000px) rotate3d(0, 1, 0, -50deg) translateY(15%); + opacity: 0; + } + 100% { + transform: perspective(1000px) rotate3d(0, 1, 0, 0deg) translateY(0); + opacity: 1; + } +} + +@-webkit-keyframes blurIn { + 0% { + opacity: 0; + filter: blur(7px); + transform: scale3d(1.2, 1.2, 1.2); + } + 100% { + opacity: 1; + filter: blur(0); + transform: scale3d(1, 1, 1); + } +} + +@keyframes blurIn { + 0% { + opacity: 0; + filter: blur(7px); + transform: scale3d(1.2, 1.2, 1.2); + } + 100% { + opacity: 1; + filter: blur(0); + transform: scale3d(1, 1, 1); + } +} + +.blurIn { + -webkit-animation-name: blurIn; + animation-name: blurIn; + animation-duration: 1.1s; +} + +.page [data-isotope-layout] { + margin-bottom: -30px; +} + +[data-isotope-layout] { + position: relative; + transform: translateY(-30px); + display: block; + transition: .4s all ease; + min-height: 160px; +} + +[data-isotope-layout]:after { + content: ''; + position: absolute; + margin-top: 15px; + width: 64px; + height: 64px; + top: 50%; + left: 50%; + background-image: url("../images/isotope-loader.png"); + background-position: -1152px 0; + animation: 0.7s sprite-animation steps(18) infinite; + transition: .4s all ease; + transform: translate(-50%, -50%); +} + +[data-isotope-layout] [class*="col-"] { + display: block; + margin-top: 30px; + opacity: 0; + transition: .4s opacity ease; +} + +[data-isotope-layout].isotope--loaded [class*="col-"] { + opacity: 1; +} + +[data-isotope-layout].isotope--loaded:after { + opacity: 0; + visibility: hidden; +} + +[data-isotope-layout].row-no-gutter { + margin-top: 60px; +} + +[data-isotope-layout].row-no-gutter [class*="col-"] { + margin-top: 0; +} + +.isotope-filters > * { + margin-top: 0; + vertical-align: middle; +} + +.isotope-filters .inline-list { + position: relative; + transform: translateY(-10px); + margin: 0; +} + +.isotope-filters .inline-list li { + display: inline-block; + margin-top: 10px; +} + +.isotope-filters .inline-list a { + position: relative; + transition: .3s; + color: #9b9b9b; + font-size: 18px; + font-weight: 400; +} + +@media (min-width: 992px) { + .isotope-filters .isotope-filters-trigger { + display: none; + } +} + +@media (min-width: 992px) { + .isotope-filters .inline-list { + margin-left: -20px; + margin-right: -20px; + } + .isotope-filters .inline-list > li { + padding: 0 20px; + } + .isotope-filters .inline-list { + word-spacing: 0; + } + .isotope-filters .inline-list > li:not(:last-child) { + margin-right: 5px; + } + .isotope-filters .inline-list a { + padding: 5px 0; + font-weight: 700; + } + .isotope-filters .inline-list a, .isotope-filters .inline-list a::before { + transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1); + } + .isotope-filters .inline-list a::before { + content: ''; + position: absolute; + top: 100%; + left: 0; + right: 100%; + opacity: 0; + border-bottom: 2px solid #dcd1d5; + transform: scale3d(0.7, 1, 1); + transition: transform 0.4s, opacity 0.4s; + transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1); + background: transparent; + } + .isotope-filters .inline-list a, .isotope-filters .inline-list a:active, .isotope-filters .inline-list a:focus { + color: #151515; + } + .isotope-filters .inline-list a:hover, .isotope-filters .inline-list a.active { + color: #151515; + border-color: #dcd1d5; + } + .isotope-filters .inline-list a:hover::before, .isotope-filters .inline-list a.active::before { + opacity: 1; + right: 0; + transform: translate3d(0, 0, 0) scale3d(1, 1, 1); + } +} + +.isotope-filters-responsive { + position: relative; + z-index: 10; +} + +.isotope-filters-responsive *:focus { + outline: none; +} + +@media (max-width: 767px) { + .isotope-filters-responsive { + max-width: 370px; + margin-left: auto; + margin-right: auto; + } +} + +@media (max-width: 991px) { + .isotope-filters-responsive { + vertical-align: middle; + } + .isotope-filters-responsive .isotope-filters-toggle { + padding: 8px 15px; + } + .isotope-filters-responsive .isotope-filters-toggle .caret { + margin-left: 5px; + } + .isotope-filters-responsive > li { + position: relative; + vertical-align: middle; + padding: 0; + } + .isotope-filters-responsive > li:first-child { + margin-right: 8px; + } + .isotope-filters-responsive > li + li { + margin-top: 8px; + } + .isotope-filters-responsive .isotope-filters { + position: absolute; + top: 49px; + left: 50%; + transform: translateX(-50%); + z-index: 10; + width: 200px; + padding: 15px; + background: #fff; + border-radius: 3px; + text-align: left; + visibility: hidden; + opacity: 0; + transition: .33s all ease; + border: 1px solid #f2f2f2; + } + .isotope-filters-responsive .isotope-filters.active { + visibility: visible; + opacity: 1; + } + .isotope-filters-responsive .isotope-filters .inline-list { + width: 100%; + } + .isotope-filters-responsive .isotope-filters .inline-list a { + display: inline-block; + width: 100%; + padding: 3px 8px; + font-size: 12px; + color: #000; + border: 0; + background-color: transparent; + } + .isotope-filters-responsive .isotope-filters .inline-list a.active, .isotope-filters-responsive .isotope-filters .inline-list a:hover { + color: #8f859e; + background-color: rgba(143, 133, 158, 0.1); + } + .isotope-filters-responsive .isotope-filters li { + display: block; + width: 100%; + } + .isotope-filters-responsive .isotope-filters li + li { + margin-top: 6px; + } +} + +@media (max-width: 991px) and (min-width: 480px) { + .isotope-filters-responsive > li { + display: inline-block; + margin: 0; + } + .isotope-filters-responsive > li + li { + margin-top: 0; + } +} + +@media (max-width: 991px) and (min-width: 768px) { + .isotope-filters-responsive .isotope-filters { + width: 250px; + } + .isotope-filters-responsive .isotope-filters .inline-list a { + padding: 5px 10px; + } +} + +@media (min-width: 992px) { + .isotope-filters-responsive > li:first-child { + display: none; + } +} + +* + .isotope, +* + .isotope-filters-responsive { + margin-top: 40px; +} + +.isotope-filters-toggle { + display: block; + border: 0; + outline: 0; + margin-left: auto; + margin-right: auto; +} + +@media (min-width: 992px) { + .isotope-filters-toggle { + display: none; + } +} + +/* +* +* Owl Carousel +* -------------------------------------------------- +*/ +.owl-carousel .animated { + -webkit-animation-duration: 1000ms; + animation-duration: 1000ms; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} + +.owl-carousel .owl-animated-in { + z-index: 0; +} + +.owl-carousel .owl-animated-out { + z-index: 1; +} + +.owl-carousel .fadeOut { + -webkit-animation-name: fadeOut; + animation-name: fadeOut; +} + +@-webkit-keyframes fadeOut { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} + +@keyframes fadeOut { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} + +/* + * Owl Carousel - Auto Height Plugin + */ +.owl-height { + transition: height 500ms ease-in-out; +} + +/* + * Core Owl Carousel CSS File + */ +.owl-carousel { + display: none; + width: 100%; + -webkit-tap-highlight-color: transparent; + /* position relative and z-index fix webkit rendering fonts issue */ + position: relative; + z-index: 1; +} + +* + .owl-carousel { + margin-top: 30px; +} + +.owl-carousel .owl-stage { + position: relative; + -ms-touch-action: pan-Y; +} + +.owl-carousel .owl-stage:after { + content: "."; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; +} + +.owl-carousel .owl-stage-outer { + position: relative; + overflow: hidden; + /* fix for flashing background */ + -webkit-transform: translate3d(0px, 0px, 0px); +} + +.owl-carousel .owl-controls .owl-nav .owl-prev, +.owl-carousel .owl-controls .owl-nav .owl-next, +.owl-carousel .owl-controls .owl-dot { + cursor: pointer; + user-select: none; +} + +.owl-carousel.owl-loaded { + display: block; +} + +.owl-carousel.owl-loading { + opacity: 0; + display: block; +} + +.owl-carousel.owl-hidden { + opacity: 0; +} + +.owl-carousel .owl-refresh .owl-item { + display: none; +} + +.owl-carousel .owl-item { + position: relative; + min-height: 1px; + float: left; + -webkit-backface-visibility: hidden; + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; +} + +.owl-carousel .owl-grab { + cursor: move; + cursor: -webkit-grab; + cursor: grab; +} + +.owl-carousel.owl-rtl { + direction: rtl; +} + +.owl-carousel.owl-rtl .owl-item { + float: right; +} + +/* No Js */ +.no-js .owl-carousel { + display: block; +} + +/* + * Owl Carousel - Lazy Load Plugin + */ +.owl-carousel .owl-item .owl-lazy { + opacity: 0; + transition: opacity 400ms ease; +} + +/* + * Owl Carousel - Video Plugin + */ +.owl-carousel .owl-video-wrapper { + position: relative; + height: 100%; + background: #000; +} + +.owl-carousel .owl-video-play-icon { + position: absolute; + height: 80px; + width: 80px; + left: 50%; + top: 50%; + margin-left: -40px; + margin-top: -40px; + font: 400 40px/80px 'FontAwesome'; + cursor: pointer; + z-index: 1; + -webkit-backface-visibility: hidden; + transition: scale 100ms ease; +} + +.owl-carousel .owl-video-play-icon:before { + content: '\f144'; +} + +.owl-carousel .owl-video-play-icon:hover { + -webkit-transform: scale(1.3); + transform: scale(1.3); +} + +.owl-carousel .owl-video-playing .owl-video-tn, +.owl-carousel .owl-video-playing .owl-video-play-icon { + display: none; +} + +.owl-carousel .owl-video-tn { + opacity: 0; + height: 100%; + background-position: center center; + background-repeat: no-repeat; + background-size: contain; + transition: opacity 400ms ease; +} + +.owl-carousel .owl-video-frame { + position: relative; + z-index: 1; +} + +/* + * Owl Navigation + */ +.owl-prev, .owl-next { + position: absolute; + top: 50%; + transform: translateY(-50%); + font: 400 46px/50px 'FontAwesome'; + color: #fff; + pointer-events: auto; +} + +.owl-prev:hover, .owl-next:hover { + color: #8f859e; +} + +.owl-prev { + left: 10px; +} + +.owl-prev:before { + content: '\f104'; +} + +.owl-next { + right: 10px; +} + +.owl-next:before { + content: '\f105'; +} + +/* + * Owl Pagination + */ +.owl-dots { + text-align: center; + margin-top: 10px; +} + +.owl-dot { + position: relative; + width: 7px; + height: 7px; + display: inline-block; + border-radius: 100%; + background: #bdbdbd; + transition: .2s; + text-align: center; + outline: none; + cursor: pointer; +} + +.owl-dot:before { + position: absolute; + top: 0; + bottom: 0; + right: 0; + left: 0; + content: ""; + display: inline-block; + border: 2px solid #dcd1d5; + border-radius: 50%; + opacity: 0; + transition: 250ms; +} + +.owl-dot:hover:before, .owl-dot:focus:before { + top: -7px; + bottom: -7px; + right: -7px; + left: -7px; + opacity: 1; +} + +.owl-dot.active:before { + top: -7px; + bottom: -7px; + right: -7px; + left: -7px; + opacity: 1; +} + +.owl-dot + .owl-dot { + margin-left: 20px; +} + +.owl-carousel.owl-carousel-light-dots .owl-dot { + border-color: #fff; +} + +.owl-carousel.owl-carousel-light-dots .owl-dot:hover, .owl-carousel.owl-carousel-light-dots .owl-dot:focus { + background-color: #fff; +} + +.owl-carousel.owl-carousel-light-dots .owl-dot.active { + background-color: #fff; +} + +.owl-carousel .owl-nav { + position: absolute; + top: 50%; + width: 100%; + left: 50%; + display: flex; + justify-content: space-between; + transform: translate(-50%, -50%); + pointer-events: none; +} + +.owl-carousel .owl-button-next, +.owl-carousel .owl-button-prev { + display: flex; + align-items: center; + justify-content: center; + width: 60px; + height: 60px; + border-radius: 50%; + background-color: #8f859e; + font-size: 21px; + transition: 350ms; + cursor: pointer; + color: #fff; + pointer-events: auto; +} + +.owl-carousel .owl-button-next:hover, +.owl-carousel .owl-button-prev:hover { + background-color: #dcd1d5; +} + +.owl-carousel .owl-button-next:before { + position: relative; + right: -1px; +} + +.owl-carousel .owl-button-prev:before { + position: relative; + left: -1px; +} + +.owl-centered { + margin-top: 20px; +} + +.owl-centered.owl-carousel .owl-stage-outer { + padding-top: 50px; + padding-bottom: 50px; +} + +.owl-centered .owl-item { + will-change: transform; +} + +.owl-centered .owl-item .portfolio-item { + transition: 550ms; +} + +.owl-centered .owl-nav { + max-width: 370px; +} + +@media (min-width: 480px) { + .owl-centered .owl-nav { + max-width: 430px; + } +} + +@media (min-width: 768px) { + .owl-centered .owl-item.active.center { + z-index: 2; + } + .owl-centered .owl-item.active.center .portfolio-item { + transform: scale3d(1.1, 1.1, 1.1); + box-shadow: 0 0 13px rgba(0, 0, 0, 0.29); + } + .owl-centered .owl-nav { + width: calc(100vw / 3 + 100px); + max-width: 100%; + } +} + +* + .owl-carousel-stagePadding { + margin-top: 30px; +} + +@media (min-width: 1200px) { + * + .owl-carousel-stagePadding { + margin-top: 50px; + } +} + +@media (min-width: 1800px) { + .owl-carousel-stagePadding .owl-controls { + display: none; + } +} + +.owl-carousel-condensed .owl-item { + will-color: transform; +} + +.owl-carousel-condensed .owl-controls .owl-nav { + padding: 0 20px; +} + +@media (min-width: 1200px) { + .owl-carousel-condensed .owl-controls { + display: none; + } +} + +.owl-testimonials .owl-stage-outer { + padding-top: 20px; + padding-bottom: 20px; +} + +.owl-testimonials .owl-dots { + margin-top: 15px; +} + +/* +* +* RD Navbar +* -------------------------------------------------- +*/ +@keyframes rd-navbar-slide-down { + 0% { + transform: translateY(-100%); + } + 100% { + transform: translateY(0); + } +} + +@keyframes rd-navbar-slide-up { + 0% { + transform: translateY(0); + } + 100% { + transform: translateY(-100%); + } +} + +.rd-navbar-wrap, .rd-navbar, +.rd-navbar-dropdown, +.rd-navbar-megamenu, +.rd-navbar-nav, +.rd-navbar-panel, .rd-navbar-static .rd-navbar-dropdown, +.rd-navbar-static .rd-navbar-megamenu, +.rd-navbar-fullwidth .rd-navbar-dropdown, +.rd-navbar-fullwidth .rd-navbar-megamenu, .rd-navbar-fixed .rd-navbar-nav-wrap, .rd-navbar-fixed .rd-navbar-submenu, main, .rd-navbar-sidebar .rd-navbar-sidebar-toggle-custom, .rd-navbar-sidebar .rd-navbar-nav-wrap, .rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-submenu { + transition: 0.35s all cubic-bezier(0.65, 0.05, 0.36, 1); +} + +.rd-navbar, .rd-navbar.rd-navbar--is-clone { + display: none; +} + +.rd-navbar-fixed, +.rd-navbar-static, +.rd-navbar-fullwidth, +.rd-navbar-sidebar { + display: block; +} + +.rd-navbar--no-transition, .rd-navbar--no-transition * { + transition: none !important; +} + +.rd-navbar-collapse-toggle { + display: inline-block; + position: relative; + width: 55px; + height: 55px; + line-height: 55px; + cursor: pointer; + color: #151515; + display: none; +} + +.rd-navbar-collapse-toggle span { + top: 50%; + margin-top: -3.4375px; +} + +.rd-navbar-collapse-toggle span, .rd-navbar-collapse-toggle span:before, .rd-navbar-collapse-toggle span:after { + position: absolute; + width: 6.875px; + height: 6.875px; + line-height: 6.875px; + text-align: center; + background: #151515; + left: 50%; + margin-left: -3.4375px; + border-radius: 50%; + transition: .3s all ease; +} + +.rd-navbar-collapse-toggle span:before, .rd-navbar-collapse-toggle span:after { + content: ''; +} + +.rd-navbar-collapse-toggle span:before { + bottom: 100%; + margin-bottom: 3.4375px; +} + +.rd-navbar-collapse-toggle span:after { + top: 100%; + margin-top: 3.4375px; +} + +.rd-navbar-collapse-toggle.active span { + transform: scale(0.7); +} + +.rd-navbar-collapse-toggle.active span:before { + transform: translateY(20.625px); +} + +.rd-navbar-collapse-toggle.active span:after { + transform: translateY(-20.625px); +} + +.rd-navbar--is-stuck { + box-shadow: 0 0 22px -4px rgba(0, 0, 0, 0.17); +} + +.rd-navbar.rd-navbar-fixed + .rd-navbar.rd-navbar--is-clone, +.rd-navbar.rd-navbar-sidebar + .rd-navbar.rd-navbar--is-clone { + display: none; +} + +/* +* Navbar components +*/ +.rd-navbar { + display: none; + background: #fff; +} + +.rd-navbar-toggle, +.rd-navbar-sidebar-toggle-custom { + display: inline-block; + position: relative; + width: 55px; + height: 55px; + line-height: 55px; + cursor: pointer; + color: #c0c0c0; + text-align: right; + background-color: transparent; + border: none; + display: none; + line-height: 0; + padding-left: 5px; + padding-right: 5px; +} + +.rd-navbar-toggle span, +.rd-navbar-sidebar-toggle-custom span { + position: relative; + display: inline-block; + transition: .3s all ease; + width: 21px; +} + +.rd-navbar-toggle span:after, .rd-navbar-toggle span:before, +.rd-navbar-sidebar-toggle-custom span:after, +.rd-navbar-sidebar-toggle-custom span:before { + content: ""; + position: absolute; + right: 0; + top: -12.5px; + transition: .3s all ease; +} + +.rd-navbar-toggle span:after, +.rd-navbar-sidebar-toggle-custom span:after { + width: 31.5px; + top: 12.5px; +} + +.rd-navbar-toggle span:before, +.rd-navbar-sidebar-toggle-custom span:before { + width: 42px; +} + +.rd-navbar-toggle span:after, .rd-navbar-toggle span:before, .rd-navbar-toggle span, +.rd-navbar-sidebar-toggle-custom span:after, +.rd-navbar-sidebar-toggle-custom span:before, +.rd-navbar-sidebar-toggle-custom span { + height: 3px; + background-color: #c0c0c0; + border-radius: 0; +} + +.rd-navbar-toggle span:before, .rd-navbar-toggle span:after, +.rd-navbar-sidebar-toggle-custom span:before, +.rd-navbar-sidebar-toggle-custom span:after { + -webkit-transition-duration: 0.3s, 0.3s, .3s; + transition-duration: 0.3s, 0.3s, .3s; + -webkit-transition-delay: 0.3s, 0s, .3s; + transition-delay: 0.3s, 0s, .3s; + -webkit-transition-property: top, -webkit-transform, width; + transition-property: top, transform, width; + transform-origin: center; +} + +.rd-navbar-toggle.active span, +.rd-navbar-sidebar-toggle-custom.active span { + right: 0; + left: auto; + transition: background .3s 0s ease; + background: transparent; +} + +.rd-navbar-toggle.active span:before, .rd-navbar-toggle.active span:after, +.rd-navbar-sidebar-toggle-custom.active span:before, +.rd-navbar-sidebar-toggle-custom.active span:after { + top: 0; + right: 0; + left: auto; + width: 42px; + -webkit-transition-delay: 0s, 0.3s; + transition-delay: 0s, 0.3s; +} + +.rd-navbar-toggle.active span:before, +.rd-navbar-sidebar-toggle-custom.active span:before { + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); +} + +.rd-navbar-toggle.active span:after, +.rd-navbar-sidebar-toggle-custom.active span:after { + -webkit-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + transform: rotate(-45deg); +} + +.desktop .rd-navbar-toggle:hover span, .desktop .rd-navbar-toggle:hover span:before, .desktop .rd-navbar-toggle:hover span:after, .desktop +.rd-navbar-sidebar-toggle-custom:hover span, .desktop +.rd-navbar-sidebar-toggle-custom:hover span:before, .desktop +.rd-navbar-sidebar-toggle-custom:hover span:after { + width: 42px; +} + +.rd-navbar-toggle:focus, +.rd-navbar-sidebar-toggle-custom:focus { + outline: none; +} + +.rd-navbar-toggle b, +.rd-navbar-sidebar-toggle-custom b { + position: absolute; + top: 50%; + transform: translateY(-50%); + left: 0; + margin-right: 10px; + text-transform: uppercase; + color: #363d41; + letter-spacing: .05em; + display: none; +} + +.rd-navbar-brand a { + display: inline-block; +} + +.rd-navbar-top-panel .contact-info [href*='callto:'] { + font-size: 18px; +} + +.rd-navbar-dropdown { + display: none; +} + +/* +* @subsection Hybrid Styles +*/ +.rd-navbar-nav > li > a { + line-height: 1.2; + font-size: 14px; + text-transform: uppercase; + letter-spacing: .05em; +} + +.rd-megamenu-header { + color: #c3cad4; + font-weight: 700; + text-transform: uppercase; + font-family: "Poppins", Helvetica, Arial, sans-serif; +} + +.rd-navbar-static .contact-info, +.rd-navbar-fullwidth .contact-info { + font-size: 16px; +} + +.rd-navbar-static .rd-navbar-nav > li, +.rd-navbar-fullwidth .rd-navbar-nav > li { + display: inline-block; + transition: .25s; +} + +.rd-navbar-static .rd-navbar-nav > li > a, +.rd-navbar-fullwidth .rd-navbar-nav > li > a { + position: relative; + display: inline-block; + color: #151515; + line-height: 1.2; + font-size: 14px; + text-transform: uppercase; + letter-spacing: .05em; + transition: .25s; +} + +.rd-navbar-static .rd-navbar-nav > li > a:hover, +.rd-navbar-fullwidth .rd-navbar-nav > li > a:hover { + color: #8f859e; +} + +.rd-navbar-static .rd-navbar-nav > li > .rd-navbar-submenu-toggle, +.rd-navbar-fullwidth .rd-navbar-nav > li > .rd-navbar-submenu-toggle { + margin-left: 4px; + font-family: "Material Design Icons"; + font-size: 16px; + cursor: pointer; + position: relative; +} + +.rd-navbar-static .rd-navbar-nav > li > .rd-navbar-submenu-toggle:hover, +.rd-navbar-fullwidth .rd-navbar-nav > li > .rd-navbar-submenu-toggle:hover { + color: #8f859e; +} + +.rd-navbar-static .rd-navbar-nav > li > .rd-navbar-submenu-toggle:before, +.rd-navbar-fullwidth .rd-navbar-nav > li > .rd-navbar-submenu-toggle:before { + content: '\f236'; +} + +.rd-navbar-static .rd-navbar-nav > li.focus > a, .rd-navbar-static .rd-navbar-nav > li.opened > a, +.rd-navbar-fullwidth .rd-navbar-nav > li.focus > a, +.rd-navbar-fullwidth .rd-navbar-nav > li.opened > a { + color: #8f859e; + background: transparent; +} + +.rd-navbar-static .rd-navbar-nav > li.focus > .rd-navbar-submenu-toggle, .rd-navbar-static .rd-navbar-nav > li.opened > .rd-navbar-submenu-toggle, +.rd-navbar-fullwidth .rd-navbar-nav > li.focus > .rd-navbar-submenu-toggle, +.rd-navbar-fullwidth .rd-navbar-nav > li.opened > .rd-navbar-submenu-toggle { + color: #8f859e; +} + +.rd-navbar-static .rd-navbar-nav > li.active > a, +.rd-navbar-fullwidth .rd-navbar-nav > li.active > a { + color: #8f859e; + background: transparent; +} + +.rd-navbar-static .rd-navbar-nav > li.active > .rd-navbar-submenu-toggle, +.rd-navbar-fullwidth .rd-navbar-nav > li.active > .rd-navbar-submenu-toggle { + color: #8f859e; +} + +.rd-navbar-static .rd-navbar-inner, +.rd-navbar-fullwidth .rd-navbar-inner { + position: relative; + max-width: 1200px; + padding-left: 15px; + padding-right: 15px; + margin-left: auto; + margin-right: auto; +} + +.rd-navbar-static .rd-navbar-top-panel, +.rd-navbar-fullwidth .rd-navbar-top-panel { + padding-top: 10px; + padding-bottom: 10px; + color: #151515; +} + +.rd-navbar-static .rd-navbar-top-panel-inner, +.rd-navbar-fullwidth .rd-navbar-top-panel-inner { + display: flex; + justify-content: space-between; + align-items: center; + max-width: 1200px; + padding-left: 15px; + padding-right: 15px; + margin-left: auto; + margin-right: auto; +} + +.rd-navbar-static .rd-navbar-search, +.rd-navbar-fullwidth .rd-navbar-search { + position: relative; + display: inline-flex; + margin-left: 30px; +} + +.rd-navbar-static .rd-navbar-search.active .rd-search, +.rd-navbar-fullwidth .rd-navbar-search.active .rd-search { + visibility: visible; + opacity: 1; +} + +.rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle { + display: inline-flex; + color: #151515; +} + +.rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle:hover, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle:hover { + color: #8f859e; +} + +.rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle span, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle span { + display: inline-block; + position: relative; + width: 32px; + height: 32px; + font-size: 26px; + line-height: 32px; + text-align: center; + cursor: pointer; + background: none; + border: none; + outline: none; + padding: 0; +} + +.rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle span, .rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle span:before, .rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle span:after, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle span, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle span:before, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle span:after { + transition: .3s all ease-in-out; +} + +.rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle span:before, .rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle span:after, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle span:before, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle span:after { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +.rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle span:before, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle span:before { + content: ""; + transform: rotate(0deg) scale(1); + opacity: 1; + visibility: visible; + font-family: "Material Design Icons"; +} + +.rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle span:after, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle span:after { + content: ""; + transform: rotate(-90deg) scale(0.4); + opacity: 0; + visibility: hidden; + font-family: "Material Design Icons"; +} + +.rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle.active span:before, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle.active span:before { + opacity: 0; + visibility: hidden; + transform: rotate(90deg) scale(0.4); +} + +.rd-navbar-static .rd-navbar-search .rd-navbar-search-toggle.active span:after, +.rd-navbar-fullwidth .rd-navbar-search .rd-navbar-search-toggle.active span:after { + transform: rotate(0deg) scale(1); + opacity: 1; + visibility: visible; +} + +.rd-navbar-static .rd-navbar-search .form-wrap, +.rd-navbar-fullwidth .rd-navbar-search .form-wrap { + margin-bottom: 0; +} + +.rd-navbar-static .rd-navbar-search .form-input, +.rd-navbar-fullwidth .rd-navbar-search .form-input { + padding-right: 50px; +} + +.rd-navbar-static .rd-navbar-search .rd-search, +.rd-navbar-fullwidth .rd-navbar-search .rd-search { + position: absolute; + top: calc(100% + 10px); + right: 0; + width: 270px; + opacity: 0; + visibility: hidden; + transition: .3s; + z-index: 2; +} + +.rd-navbar-static .rd-navbar-search .rd-search-form-submit, +.rd-navbar-fullwidth .rd-navbar-search .rd-search-form-submit { + position: absolute; + top: 0; + bottom: 0; + right: 0; + width: 50px; + padding: 0; + border: none; + background-color: transparent; + color: #000; +} + +.rd-navbar-static .rd-navbar-search .rd-search-form-submit:hover, +.rd-navbar-fullwidth .rd-navbar-search .rd-search-form-submit:hover { + color: #8f859e; +} + +.rd-navbar-static .rd-navbar-nav > li > .rd-navbar-dropdown, +.rd-navbar-fullwidth .rd-navbar-nav > li > .rd-navbar-dropdown { + position: absolute; + left: 0; + width: 270px; + background: #fff; + z-index: 5; +} + +.rd-navbar-static .rd-navbar-nav li.focus > .rd-navbar-dropdown, +.rd-navbar-static .rd-navbar-nav li.focus > .rd-navbar-megamenu, +.rd-navbar-static .rd-navbar-nav li.opened > .rd-navbar-dropdown, +.rd-navbar-static .rd-navbar-nav li.opened > .rd-navbar-megamenu, +.rd-navbar-fullwidth .rd-navbar-nav li.focus > .rd-navbar-dropdown, +.rd-navbar-fullwidth .rd-navbar-nav li.focus > .rd-navbar-megamenu, +.rd-navbar-fullwidth .rd-navbar-nav li.opened > .rd-navbar-dropdown, +.rd-navbar-fullwidth .rd-navbar-nav li.opened > .rd-navbar-megamenu { + opacity: 1; + visibility: visible; + transform: translate(0, 0); +} + +.rd-navbar-static .rd-navbar-nav li.focus > .rd-navbar-megamenu, +.rd-navbar-static .rd-navbar-nav li.opened > .rd-navbar-megamenu, +.rd-navbar-fullwidth .rd-navbar-nav li.focus > .rd-navbar-megamenu, +.rd-navbar-fullwidth .rd-navbar-nav li.opened > .rd-navbar-megamenu { + transform: translate(-50%, 0); +} + +.rd-navbar-static .rd-navbar-nav > li > .rd-navbar-dropdown, +.rd-navbar-static .rd-navbar-nav > li > .rd-navbar-megamenu, +.rd-navbar-fullwidth .rd-navbar-nav > li > .rd-navbar-dropdown, +.rd-navbar-fullwidth .rd-navbar-nav > li > .rd-navbar-megamenu { + z-index: 15; +} + +.rd-navbar-static .rd-navbar-nav > li > .rd-navbar-dropdown .rd-navbar-dropdown, +.rd-navbar-fullwidth .rd-navbar-nav > li > .rd-navbar-dropdown .rd-navbar-dropdown { + left: 100%; + top: 0; + margin-top: -8px; + margin-left: 8px; + z-index: 2; + transform: translate(30px, 0); +} + +.rd-navbar-static .rd-navbar-nav > li > .rd-navbar-dropdown > li.focus > .rd-navbar-dropdown, +.rd-navbar-static .rd-navbar-nav > li > .rd-navbar-dropdown > li.opened > .rd-navbar-dropdown, +.rd-navbar-fullwidth .rd-navbar-nav > li > .rd-navbar-dropdown > li.focus > .rd-navbar-dropdown, +.rd-navbar-fullwidth .rd-navbar-nav > li > .rd-navbar-dropdown > li.opened > .rd-navbar-dropdown { + opacity: 1; + visibility: visible; + transform: translate(0, 0); +} + +.rd-navbar-static .rd-navbar-dropdown, +.rd-navbar-static .rd-navbar-megamenu, +.rd-navbar-fullwidth .rd-navbar-dropdown, +.rd-navbar-fullwidth .rd-navbar-megamenu { + position: absolute; + display: block; + padding: 8px 0; + margin-top: 30px; + transform: translateY(30px); + visibility: hidden; + opacity: 0; + text-align: left; + box-shadow: 0 0 22px -4px rgba(0, 0, 0, 0.17); +} + +.rd-navbar-static .rd-navbar-dropdown li > a, +.rd-navbar-static .rd-navbar-megamenu li > a, +.rd-navbar-fullwidth .rd-navbar-dropdown li > a, +.rd-navbar-fullwidth .rd-navbar-megamenu li > a { + font-size: 16px; + transition: .15s ease-in-out; +} + +.rd-navbar-static .rd-navbar-dropdown li > a:before, +.rd-navbar-static .rd-navbar-megamenu li > a:before, +.rd-navbar-fullwidth .rd-navbar-dropdown li > a:before, +.rd-navbar-fullwidth .rd-navbar-megamenu li > a:before { + content: '\f238'; + font-family: "Material Design Icons"; + margin-left: -10px; + transition: opacity .15s ease-in-out, .15s margin ease-in-out; + opacity: 0; +} + +.rd-navbar-static .rd-navbar-dropdown li.focus > a:before, +.rd-navbar-static .rd-navbar-dropdown li.opened > a:before, +.rd-navbar-static .rd-navbar-dropdown li > a:hover:before, +.rd-navbar-static .rd-navbar-megamenu li.focus > a:before, +.rd-navbar-static .rd-navbar-megamenu li.opened > a:before, +.rd-navbar-static .rd-navbar-megamenu li > a:hover:before, +.rd-navbar-fullwidth .rd-navbar-dropdown li.focus > a:before, +.rd-navbar-fullwidth .rd-navbar-dropdown li.opened > a:before, +.rd-navbar-fullwidth .rd-navbar-dropdown li > a:hover:before, +.rd-navbar-fullwidth .rd-navbar-megamenu li.focus > a:before, +.rd-navbar-fullwidth .rd-navbar-megamenu li.opened > a:before, +.rd-navbar-fullwidth .rd-navbar-megamenu li > a:hover:before { + margin-left: 0; + opacity: 1; +} + +.rd-navbar-static .rd-navbar-dropdown, +.rd-navbar-fullwidth .rd-navbar-dropdown { + width: 270px; + background: #fff; +} + +.rd-navbar-static .rd-navbar-dropdown > li > a, +.rd-navbar-fullwidth .rd-navbar-dropdown > li > a { + display: block; + padding: 8px 20px; + color: #000; + background: transparent; +} + +.rd-navbar-static .rd-navbar-dropdown > li > a:hover, +.rd-navbar-fullwidth .rd-navbar-dropdown > li > a:hover { + color: #8f859e; + background: transparent; +} + +.rd-navbar-static .rd-navbar-dropdown > li.focus > a, .rd-navbar-static .rd-navbar-dropdown > li.opened > a, +.rd-navbar-fullwidth .rd-navbar-dropdown > li.focus > a, +.rd-navbar-fullwidth .rd-navbar-dropdown > li.opened > a { + color: #8f859e; + background: transparent; +} + +.rd-navbar-static .rd-navbar-megamenu, +.rd-navbar-fullwidth .rd-navbar-megamenu { + left: 50%; + transform: translate(-50%, 30px); + display: flex; + width: 100%; + max-width: 1800px; + padding: 30px 40px; + background: #fff; +} + +.rd-navbar-static .rd-navbar-megamenu > li, +.rd-navbar-fullwidth .rd-navbar-megamenu > li { + width: 25%; +} + +.rd-navbar-static .rd-navbar-megamenu > li > ul, +.rd-navbar-fullwidth .rd-navbar-megamenu > li > ul { + margin-top: 20px; +} + +.rd-navbar-static .rd-navbar-megamenu > li > ul li + li, +.rd-navbar-fullwidth .rd-navbar-megamenu > li > ul li + li { + margin-top: 15px; +} + +.rd-navbar-static .rd-navbar-megamenu > li > ul a, +.rd-navbar-fullwidth .rd-navbar-megamenu > li > ul a { + display: inline-block; + color: #000; + background: transparent; +} + +.rd-navbar-static .rd-navbar-megamenu > li > ul a:hover, +.rd-navbar-fullwidth .rd-navbar-megamenu > li > ul a:hover { + color: #8f859e; + background: transparent; +} + +.rd-navbar-static .rd-navbar-megamenu > li + li, +.rd-navbar-fullwidth .rd-navbar-megamenu > li + li { + padding-left: 20px; +} + +.rd-navbar-static .rd-navbar-megamenu .rd-megamenu-header, +.rd-navbar-fullwidth .rd-navbar-megamenu .rd-megamenu-header { + display: block; + position: relative; + font-size: 18px; + padding-bottom: 8px; +} + +.rd-navbar-static .rd-navbar-megamenu .rd-megamenu-header:after, +.rd-navbar-fullwidth .rd-navbar-megamenu .rd-megamenu-header:after { + position: absolute; + top: 100%; + left: 0; + width: 70%; + border-bottom: 1px solid #ebebeb; + content: ''; +} + +.rd-navbar-static.rd-navbar--is-clone, +.rd-navbar-fullwidth.rd-navbar--is-clone { + display: block; + transform: translateY(-100%); +} + +.rd-navbar-static.rd-navbar--is-clone.rd-navbar--is-stuck, +.rd-navbar-fullwidth.rd-navbar--is-clone.rd-navbar--is-stuck { + transform: translateY(0%); +} + +.rd-navbar-static.rd-navbar--is-stuck, .rd-navbar-static.rd-navbar--is-clone, +.rd-navbar-fullwidth.rd-navbar--is-stuck, +.rd-navbar-fullwidth.rd-navbar--is-clone { + position: fixed; + left: 0; + top: 0; + right: 0; + z-index: 999; + background: #fff; +} + +.rd-navbar-static.rd-navbar--is-stuck .rd-navbar-top-panel, .rd-navbar-static.rd-navbar--is-clone .rd-navbar-top-panel, +.rd-navbar-fullwidth.rd-navbar--is-stuck .rd-navbar-top-panel, +.rd-navbar-fullwidth.rd-navbar--is-clone .rd-navbar-top-panel { + display: none; +} + +.rd-navbar-static .rd-navbar--has-dropdown, +.rd-navbar-fullwidth .rd-navbar--has-dropdown { + position: relative; +} + +.rd-navbar-fixed .rd-navbar-nav-wrap, +.rd-navbar-sidebar .rd-navbar-sidebar-inner { + width: 270px; + height: 100%; + left: 0; + top: 0; + overflow-y: auto; + overflow-x: hidden; + -webkit-overflow-scrolling: touch; + font-size: 16px; + line-height: 34px; + color: #151515; + background: #fff; + box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.25); + z-index: 998; +} + +.rd-navbar-fixed .rd-navbar-nav-wrap:before, .rd-navbar-fixed .rd-navbar-nav-wrap:after, +.rd-navbar-sidebar .rd-navbar-sidebar-inner:before, +.rd-navbar-sidebar .rd-navbar-sidebar-inner:after { + content: ''; + display: block; + height: 56px; +} + +.rd-navbar-fixed .rd-navbar-nav-wrap::-webkit-scrollbar, +.rd-navbar-sidebar .rd-navbar-sidebar-inner::-webkit-scrollbar { + width: 4px; +} + +.rd-navbar-fixed .rd-navbar-nav-wrap::-webkit-scrollbar-thumb, +.rd-navbar-sidebar .rd-navbar-sidebar-inner::-webkit-scrollbar-thumb { + background: #c3becb; + border: none; + border-radius: 0; + opacity: .2; +} + +.rd-navbar-fixed .rd-navbar-nav-wrap::-webkit-scrollbar-track, +.rd-navbar-sidebar .rd-navbar-sidebar-inner::-webkit-scrollbar-track { + background: #8f859e; + border: none; + border-radius: 0; +} + +.rd-navbar-fixed .rd-navbar-nav .rd-navbar-dropdown > li > a, +.rd-navbar-sidebar .rd-navbar-nav .rd-navbar-dropdown > li > a { + padding-left: 20px; +} + +.rd-navbar-fixed .rd-navbar-nav .rd-navbar-dropdown ul > li > a, +.rd-navbar-sidebar .rd-navbar-nav .rd-navbar-dropdown ul > li > a { + padding-left: 25px; +} + +/* +* Static Layout +*/ +.rd-navbar-static { + display: block; +} + +.rd-navbar-static .rd-navbar-inner { + display: flex; + align-items: center; + justify-content: space-between; + padding-top: 20px; + padding-bottom: 20px; +} + +.rd-navbar-static .rd-navbar-aside-right { + display: flex; +} + +.rd-navbar-static .rd-navbar-top-panel { + text-align: left; +} + +.rd-navbar-static .rd-navbar-nav > li + li { + margin-left: 63px; +} + +.rd-navbar-static.rd-navbar--is-stuck .rd-navbar-inner, .rd-navbar-static.rd-navbar--is-clone .rd-navbar-inner { + padding-top: 10px; + padding-bottom: 10px; +} + +/* +* Fullwidth Layout +*/ +.rd-navbar-fullwidth { + display: block; +} + +.rd-navbar-fullwidth .rd-navbar-inner { + padding-top: 20px; + padding-bottom: 20px; +} + +.rd-navbar-fullwidth .rd-navbar-aside-right { + display: flex; + align-items: center; + justify-content: center; +} + +.rd-navbar-fullwidth .rd-navbar-nav > li + li { + margin-left: 30px; +} + +@media (min-width: 1200px) { + .rd-navbar-fullwidth .rd-navbar-nav > li + li { + margin-left: 63px; + } +} + +.rd-navbar-fullwidth.rd-navbar--is-stuck .rd-navbar-aside-right, .rd-navbar-fullwidth.rd-navbar--is-clone .rd-navbar-aside-right { + margin-top: 0; +} + +.rd-navbar-fullwidth.rd-navbar--is-stuck .rd-navbar-panel, .rd-navbar-fullwidth.rd-navbar--is-clone .rd-navbar-panel { + display: none; +} + +/* +* Fixed Layout +*/ +.rd-navbar-fixed { + display: block; +} + +.rd-navbar-fixed .rd-navbar-toggle, +.rd-navbar-fixed .rd-navbar-sidebar-toggle-custom { + display: inline-block; +} + +.rd-navbar-fixed .rd-navbar-brand { + position: relative; + margin-left: 6px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + text-align: left; + font-size: 22px; + line-height: 30px; +} + +.rd-navbar-fixed .rd-navbar-brand img { + max-width: 210px; + height: auto; +} + +.rd-navbar-fixed .rd-navbar-panel { + display: flex; + align-items: center; + position: fixed; + left: 0; + top: 0; + right: 0; + padding: 0.5px; + height: 56px; + color: #000; + z-index: 999; +} + +.rd-navbar-fixed .rd-navbar-panel:before { + content: ''; + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.25); + background: #fff; +} + +.rd-navbar-fixed .rd-navbar-panel > * { + z-index: 1; +} + +.rd-navbar-fixed .rd-navbar-search { + position: fixed; + right: 46px; + top: 0.5px; + display: inline-flex; + z-index: 1000; +} + +.rd-navbar-fixed .rd-navbar-search .rd-search { + position: absolute; + right: 4px; + top: calc(100% + 12px); + width: 240px; + opacity: 0; + visibility: hidden; + transition: .3s; + transform: translateX(-10px); +} + +.rd-navbar-fixed .rd-navbar-search .rd-search-results-live { + display: none; +} + +.rd-navbar-fixed .rd-navbar-search .form-input { + padding-right: 50px; +} + +.rd-navbar-fixed .rd-navbar-search .rd-search-form-submit { + position: absolute; + top: 0; + bottom: 0; + right: 0; + width: 50px; + padding: 0; + border: none; + background-color: transparent; + color: #000; +} + +.rd-navbar-fixed .rd-navbar-search .rd-search-form-submit:hover { + color: #8f859e; +} + +.rd-navbar-fixed .rd-navbar-search.active .rd-search { + opacity: 1; + visibility: visible; + transform: none; +} + +.rd-navbar-fixed .rd-navbar-search-toggle { + display: inline-flex; + color: #151515; +} + +.rd-navbar-fixed .rd-navbar-search-toggle:hover { + color: #8f859e; +} + +.rd-navbar-fixed .rd-navbar-search-toggle span { + display: inline-block; + position: relative; + width: 48px; + height: 48px; + font-size: 26px; + line-height: 48px; + text-align: center; + cursor: pointer; + background: none; + border: none; + outline: none; + padding: 0; +} + +.rd-navbar-fixed .rd-navbar-search-toggle span, .rd-navbar-fixed .rd-navbar-search-toggle span:before, .rd-navbar-fixed .rd-navbar-search-toggle span:after { + transition: .3s all ease-in-out; +} + +.rd-navbar-fixed .rd-navbar-search-toggle span:before, .rd-navbar-fixed .rd-navbar-search-toggle span:after { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +.rd-navbar-fixed .rd-navbar-search-toggle span:before { + content: ""; + transform: rotate(0deg) scale(1); + opacity: 1; + visibility: visible; + font-family: "Material Design Icons"; +} + +.rd-navbar-fixed .rd-navbar-search-toggle span:after { + content: ""; + transform: rotate(-90deg) scale(0.4); + opacity: 0; + visibility: hidden; + font-family: "Material Design Icons"; +} + +.rd-navbar-fixed .rd-navbar-search-toggle.active span:before { + opacity: 0; + visibility: hidden; + transform: rotate(90deg) scale(0.4); +} + +.rd-navbar-fixed .rd-navbar-search-toggle.active span:after { + transform: rotate(0deg) scale(1); + opacity: 1; + visibility: visible; +} + +.rd-navbar-fixed .rd-navbar-nav-wrap { + position: fixed; + left: 0; + bottom: 0; + top: 0; + color: #151515; + background: #fff; + transform: translateX(-120%); +} + +.rd-navbar-fixed .rd-navbar-nav-wrap.active { + transform: translateX(0); +} + +.rd-navbar-fixed .rd-navbar-nav { + display: block; + font-size: 16px; + line-height: 26px; + text-align: left; +} + +.rd-navbar-fixed .rd-navbar-nav:before, .rd-navbar-fixed .rd-navbar-nav:after { + content: ''; + display: block; + height: 8px; +} + +.rd-navbar-fixed .rd-navbar-nav li > a { + display: block; + padding: 16px 56px 16px 16px; + color: #151515; +} + +.rd-navbar-fixed .rd-navbar-nav li > a:first-letter { + text-transform: uppercase; +} + +.rd-navbar-fixed .rd-navbar-nav li:hover > a, .rd-navbar-fixed .rd-navbar-nav li.active > a, .rd-navbar-fixed .rd-navbar-nav li.opened > a { + background: #8f859e; + color: #fff; +} + +.rd-navbar-fixed .rd-navbar-nav li:hover > .rd-navbar-submenu-toggle, .rd-navbar-fixed .rd-navbar-nav li.active > .rd-navbar-submenu-toggle, .rd-navbar-fixed .rd-navbar-nav li.opened > .rd-navbar-submenu-toggle { + color: #fff; +} + +.rd-navbar-fixed .rd-navbar-nav li.opened > .rd-navbar-submenu-toggle:after { + transform: rotate(180deg); +} + +.rd-navbar-fixed .rd-navbar-nav li + li { + margin-top: 4px; +} + +.rd-navbar-fixed .rd-navbar-nav .rd-navbar-submenu-toggle { + cursor: pointer; + color: #151515; +} + +.rd-navbar-fixed .rd-navbar-nav .rd-navbar-submenu-toggle::after { + content: '\f236'; + position: absolute; + top: 22px; + right: 0; + margin-top: -22px; + width: 65px; + height: 48px; + font: 400 28px "Material Design Icons"; + line-height: 48px; + text-align: center; + transition: 0.3s transform ease; + z-index: 2; +} + +.rd-navbar-fixed .rd-navbar-dropdown, +.rd-navbar-fixed .rd-navbar-megamenu { + display: none; + margin-top: 4px; +} + +.rd-navbar-fixed .rd-navbar-dropdown .rd-megamenu-header, +.rd-navbar-fixed .rd-navbar-megamenu .rd-megamenu-header { + font-size: 16px; + padding-left: 30px; + margin-top: 10px; + margin-bottom: 0; +} + +.rd-navbar-fixed .rd-navbar-dropdown li a, +.rd-navbar-fixed .rd-navbar-megamenu li a { + padding: 10px 56px 10px 46px; +} + +.rd-navbar-fixed .rd-navbar-submenu { + position: relative; +} + +.rd-navbar-fixed .rd-navbar-submenu .rd-navbar-dropdown > li > a { + padding-left: 30px; +} + +.rd-navbar-fixed .rd-navbar-submenu .rd-navbar-dropdown li li > a, +.rd-navbar-fixed .rd-navbar-submenu .rd-navbar-megamenu ul li li > a { + padding-left: 48px; +} + +.rd-navbar-fixed .rd-navbar-submenu.opened > .rd-navbar-dropdown, +.rd-navbar-fixed .rd-navbar-submenu.opened > .rd-navbar-megamenu { + display: block; +} + +.rd-navbar-fixed .rd-navbar-collapse { + position: fixed; + right: 4px; + top: 64px; + transform: translateX(-10px); + padding: 20px; + width: 280px; + border-radius: 3px; + background-color: #fff; + box-shadow: 0 0 22px -4px rgba(0, 0, 0, 0.17); + text-align: left; + font-size: 14px; + opacity: 0; + visibility: hidden; + z-index: 999; + transition: .3s; +} + +.rd-navbar-fixed .rd-navbar-collapse .rd-navbar-top-panel-inner > * + * { + margin-top: 10px; +} + +.rd-navbar-fixed .rd-navbar-collapse.active { + transform: none; + opacity: 1; + visibility: visible; +} + +.rd-navbar-fixed .rd-navbar-collapse-toggle { + position: fixed; + top: 0.5px; + right: 0.5px; + width: 55px; + display: inline-block; + outline: 0; + border: 0; + background-color: transparent; + z-index: 1000; +} + +.rd-navbar-fixed .rd-navbar-collapse { + color: #151515; +} + +.rd-navbar-fixed.active .rd-navbar-nav { + transform: translateX(0); +} + +.rd-navbar-fixed.rd-navbar--is-clone { + display: none; +} + +.rd-navbar-fixed .rd-navbar-fixed--visible { + display: block; +} + +.rd-navbar-fixed .rd-navbar-fixed--hidden { + display: none; +} + +html.rd-navbar-fixed-linked .page { + padding-top: 55px; +} + +/* +* Sidebar Layout +*/ +.rd-navbar-sidebar { + display: block; + position: relative; + top: 0; + left: 0; + right: 0; + z-index: 1080; + width: 100%; +} + +.rd-navbar-sidebar .rd-navbar-toggle { + display: none; + visibility: hidden; + z-index: -99; +} + +.rd-navbar-sidebar .rd-navbar-sidebar-toggle-custom { + display: block; + z-index: 999; + margin-left: 80px; + width: 105px; +} + +.rd-navbar-sidebar .rd-navbar-sidebar-toggle-custom b { + display: block; +} + +.ie-10 .rd-navbar-sidebar .rd-navbar-sidebar-toggle-custom, +.ie-11 .rd-navbar-sidebar .rd-navbar-sidebar-toggle-custom, +.ie-edge .rd-navbar-sidebar .rd-navbar-sidebar-toggle-custom { + width: 110px; +} + +.ie-10 .rd-navbar-sidebar .rd-navbar-sidebar-toggle-custom b, +.ie-11 .rd-navbar-sidebar .rd-navbar-sidebar-toggle-custom b, +.ie-edge .rd-navbar-sidebar .rd-navbar-sidebar-toggle-custom b { + left: 10px; +} + +.rd-navbar-sidebar .contact-info { + font-size: 16px; +} + +.rd-navbar-sidebar .rd-navbar-inner { + max-width: 1200px; + margin-left: auto; + margin-right: auto; + padding: 30px 15px; + transition: all 250ms ease-in; +} + +.rd-navbar-sidebar .rd-navbar-panel { + display: flex; + align-items: center; + justify-content: space-between; +} + +.rd-navbar-sidebar .rd-navbar-megamenu { + columns: 2; +} + +.rd-navbar-sidebar .rd-navbar-megamenu li { + -webkit-column-break-inside: avoid; + break-inside: avoid; +} + +.rd-navbar-sidebar .rd-navbar-brand { + flex-grow: 1; + text-align: left; +} + +.rd-navbar-sidebar.rd-navbar--is-stuck { + position: fixed; +} + +.rd-navbar-sidebar.rd-navbar--is-stuck .rd-navbar-inner { + padding: 10px 15px; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap { + position: fixed; + right: 0; + top: 0; + bottom: 0; + display: flex; + flex-direction: column; + padding-top: 185px; + transform: translateX(100%); + background: #fff; + width: 535px; + z-index: 998; + max-height: 100vh; + overflow-y: auto; + overflow-x: hidden; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap.active { + transform: translateX(0); + box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.25); +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-search { + display: inline-flex; + margin-top: 10px; + padding: 0 10px; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-search .rd-search { + position: relative; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-search .form-input { + padding-right: 50px; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-search .rd-search-form-submit { + position: absolute; + top: 0; + bottom: 0; + right: 0; + width: 50px; + padding: 0; + border: none; + background-color: transparent; + color: #000; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-search .rd-search-form-submit:hover { + color: #8f859e; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-search .rd-search-results-live { + display: none; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav { + display: block; + font-size: 16px; + line-height: 26px; + text-align: left; + border-top: 1px solid #ebebeb; + border-bottom: 1px solid #ebebeb; + overflow-y: auto; + overflow-x: hidden; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav::-webkit-scrollbar { + width: 4px; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav::-webkit-scrollbar-thumb { + background: #c3becb; + border: none; + border-radius: 0; + opacity: .2; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav::-webkit-scrollbar-track { + background: #8f859e; + border: none; + border-radius: 0; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav li > a { + display: block; + padding: 20px 56px 20px 43px; + color: #151515; + text-transform: none; + font-family: "Poppins", Helvetica, Arial, sans-serif; + font-size: 18px; + letter-spacing: .05em; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav li:hover > a, .rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav li.active > a, .rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav li.opened > a { + background: transparent; + color: #8f859e; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav li:hover > .rd-navbar-submenu-toggle, .rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav li.active > .rd-navbar-submenu-toggle, .rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav li.opened > .rd-navbar-submenu-toggle { + color: #8f859e; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav li.opened > .rd-navbar-submenu-toggle:after { + transform: rotate(180deg); +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav li + li { + border-top: 1px solid #ebebeb; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav .rd-navbar-submenu-toggle { + cursor: pointer; + color: #898989; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-nav .rd-navbar-submenu-toggle::after { + content: '\f236'; + position: absolute; + top: 22px; + right: 0; + margin-top: -22px; + width: 65px; + height: 61px; + font: 400 24px "Material Design Icons"; + display: flex; + align-items: center; + justify-content: center; + transition: 0.3s transform ease; + z-index: 2; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-dropdown, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-megamenu { + display: none; + margin-top: 4px; + padding-bottom: 25px; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-dropdown li + li, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-megamenu li + li { + border: 0; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-dropdown .rd-megamenu-list, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-megamenu .rd-megamenu-list { + padding-left: 30px; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-dropdown .rd-megamenu-list li, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-megamenu .rd-megamenu-list li { + border: 0; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-dropdown .rd-megamenu-list li.focus > a:before, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-dropdown .rd-megamenu-list li.opened > a:before, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-dropdown .rd-megamenu-list li > a:hover:before, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-megamenu .rd-megamenu-list li.focus > a:before, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-megamenu .rd-megamenu-list li.opened > a:before, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-megamenu .rd-megamenu-list li > a:hover:before { + margin-left: 0; + opacity: 1; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-dropdown .rd-megamenu-list li a, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-megamenu .rd-megamenu-list li a { + padding: 10px; + font-size: 16px; + font-family: "Lato", Helvetica, Arial, sans-serif; + background: transparent; + transition: .15s ease-in-out; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-dropdown .rd-megamenu-list li a:before, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-megamenu .rd-megamenu-list li a:before { + content: '\f238'; + font-family: "Material Design Icons"; + margin-left: -10px; + transition: opacity .15s ease-in-out, .15s margin ease-in-out; + opacity: 0; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-dropdown .rd-megamenu-list li a:hover, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-megamenu .rd-megamenu-list li a:hover { + color: #8f859e; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-submenu { + position: relative; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-submenu .rd-navbar-dropdown > li > a { + padding: 10px; + padding-left: 60px; + font-size: 16px; + font-family: "Lato", Helvetica, Arial, sans-serif; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-submenu .rd-navbar-dropdown li li > a, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-submenu .rd-navbar-megamenu ul li li > a { + padding-left: 48px; +} + +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-submenu.opened > .rd-navbar-dropdown, +.rd-navbar-sidebar .rd-navbar-nav-wrap .rd-navbar-submenu.opened > .rd-navbar-megamenu { + display: block; +} + +.rd-navbar-sidebar.rd-navbar--is-stuck .rd-navbar-nav-wrap { + padding-top: 112px; +} + +.rd-navbar-default-with-top-panel .mobile-brand, +.rd-navbar-default-with-top-panel .fullwidth-brand { + display: none; +} + +.rd-navbar-default-with-top-panel .contact-info { + font-size: 18px; +} + +.rd-navbar-default-with-top-panel .contact-info a, .rd-navbar-default-with-top-panel .contact-info a:active, .rd-navbar-default-with-top-panel .contact-info a:focus { + color: #151515; +} + +.rd-navbar-default-with-top-panel .contact-info a:hover { + color: #8f859e; +} + +.rd-navbar-default-with-top-panel.rd-navbar-fixed .mobile-brand { + display: block; +} + +.rd-navbar-default-with-top-panel.rd-navbar-static, .rd-navbar-default-with-top-panel.rd-navbar-fullwidth { + padding-left: 15px; + padding-right: 15px; +} + +.rd-navbar-default-with-top-panel.rd-navbar-static .fullwidth-brand, .rd-navbar-default-with-top-panel.rd-navbar-fullwidth .fullwidth-brand { + display: block; +} + +.rd-navbar-default-with-top-panel.rd-navbar-static .rd-navbar-top-panel-inner, +.rd-navbar-default-with-top-panel.rd-navbar-static .rd-navbar-inner, .rd-navbar-default-with-top-panel.rd-navbar-fullwidth .rd-navbar-top-panel-inner, +.rd-navbar-default-with-top-panel.rd-navbar-fullwidth .rd-navbar-inner { + max-width: 940px; + padding-left: 0; + padding-right: 0; +} + +@media (min-width: 1200px) { + .rd-navbar-default-with-top-panel.rd-navbar-static .rd-navbar-top-panel-inner, + .rd-navbar-default-with-top-panel.rd-navbar-static .rd-navbar-inner, .rd-navbar-default-with-top-panel.rd-navbar-fullwidth .rd-navbar-top-panel-inner, + .rd-navbar-default-with-top-panel.rd-navbar-fullwidth .rd-navbar-inner { + max-width: 1770px; + } +} + +.rd-navbar-default-with-top-panel.rd-navbar-static .rd-navbar-inner, .rd-navbar-default-with-top-panel.rd-navbar-fullwidth .rd-navbar-inner { + border-top: 1px solid #ebebeb; + border-bottom: 1px solid #ebebeb; +} + +.rd-navbar-default-with-top-panel.rd-navbar-static.rd-navbar-default-with-top-panel-gray-nav .rd-navbar-inner, .rd-navbar-default-with-top-panel.rd-navbar-fullwidth.rd-navbar-default-with-top-panel-gray-nav .rd-navbar-inner { + border-top: 0; + border-bottom: 0; +} + +.rd-navbar-default-with-top-panel.rd-navbar-static.rd-navbar-default-with-top-panel-gray-nav .rd-navbar-inner:before, .rd-navbar-default-with-top-panel.rd-navbar-fullwidth.rd-navbar-default-with-top-panel-gray-nav .rd-navbar-inner:before { + position: absolute; + width: 100vw; + top: 0; + bottom: 0; + left: 50%; + transform: translateX(-50%); + content: ""; + display: inline-block; + background-color: #f2f3f8; +} + +@media (min-width: 1200px) { + .rd-navbar-default-with-top-panel.rd-navbar-static .rd-navbar-top-panel, .rd-navbar-default-with-top-panel.rd-navbar-fullwidth .rd-navbar-top-panel { + padding-top: 30px; + padding-bottom: 26px; + } + .rd-navbar-default-with-top-panel.rd-navbar-static .rd-navbar-top-panel .button-bold, .rd-navbar-default-with-top-panel.rd-navbar-fullwidth .rd-navbar-top-panel .button-bold { + font-size: 18px; + font-weight: 700; + letter-spacing: .05em; + } +} + +ul ul, +ul ol, +ol ul, +ol ol { + padding-left: 0; +} + +.rd-navbar-default-sidebar.rd-navbar-fixed .rd-navbar-panel { + flex-direction: row-reverse; + justify-content: flex-end; +} + +/* +* +* RD Parallax +* -------------------------------------------------- +*/ +.rd-parallax-inner { + position: relative; + overflow: hidden; + transform: translate3d(0px, 0px, 0px); + clip: rect(0, auto, auto, 0); + pointer-events: none; +} + +.rd-parallax-layer[data-type="media"] { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + height: 100%; +} + +.rd-parallax-layer[data-type="media"] iframe { + width: 100%; + height: 100%; +} + +.rd-parallax-layer-holder { + pointer-events: all; +} + +.rd-parallax-layer[data-url] { + -webkit-background-size: cover; + background-size: cover; + background-position: center center; +} + +.rd-parallax-swiper { + z-index: 1 !important; +} + +/* +* +* RD Google Map +* -------------------------------------------------- +*/ +.google-map-container { + width: 100%; +} + +.google-map { + color: #000; + height: 200px; +} + +.google-map img { + max-width: none !important; +} + +@media (min-width: 480px) { + .google-map { + height: 250px; + } +} + +@media (min-width: 1200px) { + .google-map { + height: 100%; + } +} + +.map_locations { + display: none; +} + +/* +* +* Search Results +* -------------------------------------------------- +*/ +.search_list { + text-align: left; + padding-left: 20px; + font-size: 18px; + list-style-type: none; + counter-reset: li; + overflow: hidden; +} + +.search_list li + li { + margin-top: 25px; +} + +.search_list h5 + * { + margin-top: 8px; +} + +.search_list p + p { + margin-bottom: 8px; +} + +.search_list li:only-child::before { + display: none; +} + +.search_list .result-item + .result-item { + margin-top: 40px; +} + +.result-item { + color: #363d41; +} + +.result-item .search_title { + color: #000; +} + +.result-item .search_title:before { + content: counter(li, decimal) ". "; + counter-increment: li; +} + +.match { + font-size: 12px; + text-transform: uppercase; + letter-spacing: 0.08em; + color: #8f859e; +} + +.match em { + font-style: normal; +} + +.search { + background: #8f859e; + color: #fff; +} + +#rd-search-results-live { + position: absolute; + top: 100%; + left: 0; + right: 0; + margin-top: 5px; + text-align: left; +} + +#rd-search-results-live #search-results { + background: #fff; + box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.15); + padding: 20px; + opacity: 0; + visibility: hidden; + transition: 0.35s ease-in; + max-height: calc(100vh - 200px); + overflow-y: auto; +} + +#rd-search-results-live #search-results.active { + visibility: visible; + opacity: 1; +} + +#rd-search-results-live #search-results .search_title { + font-size: 18px; +} + +#rd-search-results-live #search-results p.match { + display: none; +} + +#rd-search-results-live #search-results .result-item + .result-item { + margin-top: 20px; +} + +#rd-search-results-live #search-results .search_all { + margin-top: 20px; +} + +#rd-search-results-live #search-results .search_all a { + display: block; + padding: 2px 4px; + background-color: #f2f2f2; + text-align: center; +} + +#rd-search-results-live #search-results .search_all a:hover { + text-decoration: underline; +} + +#rd-search-results-live #search-results .search_list { + margin-top: 10px; + padding-left: 0; + padding-bottom: 10px; + font-size: 16px; +} + +/* +* +* ToTop +* -------------------------------------------------- +*/ +.ui-to-top { + width: 50px; + height: 50px; + font-size: 24px !important; + line-height: 46px; + color: #FFF; + background: #8f859e; + position: fixed; + right: 15px; + bottom: 15px; + overflow: hidden; + text-align: center; + text-decoration: none; + z-index: 20; + transition: .45s all ease-in-out; + transform: translateY(100px); +} + +.ui-to-top:focus { + color: #fff; +} + +.ui-to-top:hover { + color: #fff; + background: #756a86; + text-decoration: none; +} + +.ui-to-top.active { + color: #fff; + transform: translateY(0); +} + +html.mobile .ui-to-top, +html.tablet .ui-to-top { + display: none !important; +} + +@media (min-width: 480px) { + .ui-to-top { + right: 40px; + bottom: 40px; + } +} + +.tabs-custom { + text-align: left; +} + +.tabs-custom .nav-tabs { + font-size: 0; + line-height: 0; + word-spacing: 0; + border: 0; +} + +.tabs-custom .nav-tabs:before, .tabs-custom .nav-tabs:after { + display: none; +} + +.tabs-custom .nav-tabs li { + float: none; + border: 0; + cursor: default; + transition: .33s all ease; +} + +.tabs-custom .nav-tabs li.active { + cursor: default; +} + +.tabs-custom .nav-tabs a { + margin: 0; + cursor: pointer; +} + +.page .tabs-custom.tabs-centered .nav-tabs, +.page .tabs-custom.tabs-centered .tab-content { + text-align: center; +} + +.page .tabs-custom.tabs-centered .tab-content { + padding-left: 0; + padding-right: 0; +} + +.tabs-custom.tabs-left .nav-tabs { + text-align: left; + margin-left: 0; +} + +* + .tabs-horizontal.tabs-corporate { + margin-top: 25px; +} + +* + .tabs-horizontal.tabs-line { + margin-top: 30px; +} + +* + .tabs-vertical.tabs-corporate { + margin-top: 40px; +} + +* + .tabs-complex { + margin-top: 40px; +} + +@media (min-width: 768px) { + * + .tabs-vertical.tabs-corporate { + margin-top: 65px; + } +} + +@media (min-width: 1200px) { + * + .tabs-horizontal.tabs-line { + margin-top: 10px; + } +} + +.tabs-corporate .nav-tabs { + position: relative; + border: 1px solid #e5e7e9; +} + +.tabs-corporate .nav-tabs li { + margin: -1px; +} + +.tabs-corporate .nav-tabs li a { + padding: 7px 10px; + text-transform: uppercase; + font-size: 14px; + font-weight: 700; + line-height: 1.4; + color: #9b9b9b; + background: transparent; + border-bottom: 1px solid #e5e7e9; + text-align: center; + vertical-align: middle; + border-radius: 0; +} + +.tabs-corporate .nav-tabs li a:first-child { + border-top: 1px solid #e5e7e9; +} + +.tabs-corporate .nav-tabs li a:hover, +.tabs-corporate .nav-tabs li.active a { + color: #fff; + background: #8f859e; + border-color: #8f859e; +} + +.tabs-corporate .tab-content { + padding: 30px 0 0; +} + +.tabs-line .nav-tabs { + position: relative; + border: 2px solid #8f859e; +} + +.tabs-line .nav-tabs li { + margin: -2px -1px; +} + +.tabs-line .nav-tabs li a { + padding: 7px 10px; + text-transform: uppercase; + font-size: 14px; + font-weight: 700; + line-height: 1.4; + letter-spacing: .05em; + color: #9b9b9b; + background: transparent; + border-bottom: 2px solid #8f859e; + text-align: center; + vertical-align: middle; +} + +.tabs-line .nav-tabs li a:first-child { + border-top: 1px solid #8f859e; +} + +.tabs-line .nav-tabs li a:hover, +.tabs-line .nav-tabs li.active a { + color: #fff; + background: #8f859e; + border-color: #8f859e; +} + +.tabs-line .tab-content { + padding: 25px 10px 0 0; + color: #151515; +} + +.tabs-line.tabs-line-secondary .nav-tabs { + border: 2px solid #dcd1d5; +} + +.tabs-line.tabs-line-secondary .nav-tabs li a { + border-bottom: 2px solid #dcd1d5; +} + +.tabs-line.tabs-line-secondary .nav-tabs li a:first-child { + border-top: 1px solid #dcd1d5; +} + +.tabs-line.tabs-line-secondary .nav-tabs li a:hover, +.tabs-line.tabs-line-secondary .nav-tabs li.active a { + background: #dcd1d5; + border-color: #dcd1d5; +} + +@media (max-width: 767px) { + .tabs-custom .nav-tabs { + max-width: 300px; + margin-left: auto; + margin-right: auto; + } +} + +@media (min-width: 768px) { + .tabs-horizontal.tabs-corporate .nav-tabs { + position: relative; + width: 100%; + display: block; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + text-align: center; + position: relative; + transform: translateY(-10px); + margin-bottom: -10px; + margin-left: -5px; + margin-right: -5px; + border: 0; + will-change: transform; + } + .tabs-horizontal.tabs-corporate .nav-tabs > * { + margin-top: 10px; + padding-left: 5px; + padding-right: 5px; + } + .tabs-horizontal.tabs-corporate .nav-tabs li { + display: inline-block; + will-change: transform; + -webkit-flex-grow: 1; + -ms-flex-positive: 1; + flex-grow: 1; + -ms-flex-negative: 0; + -webkit-flex-shrink: 0; + flex-shrink: 0; + } + .tabs-horizontal.tabs-corporate .nav-tabs li a { + display: block; + position: relative; + z-index: 1; + min-width: 130px; + letter-spacing: .075em; + padding: 12px 20px 12px; + border: 2px solid #e5e7e9; + } + .tabs-horizontal.tabs-corporate .nav-tabs li a, .tabs-horizontal.tabs-corporate .nav-tabs li a::before { + transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1); + } + .tabs-horizontal.tabs-corporate .nav-tabs li a::before { + content: ''; + position: absolute; + top: -1px; + left: -1px; + width: calc(100% + 2px); + height: calc(100% + 2px); + background: #fff; + z-index: -1; + opacity: 0; + transform: scale3d(0.7, 1, 1); + transition: transform 0.4s, opacity 0.4s; + transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1); + background: #8f859e; + } + .tabs-horizontal.tabs-corporate .nav-tabs li.active a, + .tabs-horizontal.tabs-corporate .nav-tabs li a:hover { + color: #fff; + border-color: #8f859e; + background-color: transparent; + } + .tabs-horizontal.tabs-corporate .nav-tabs li.active a::before, + .tabs-horizontal.tabs-corporate .nav-tabs li a:hover::before { + opacity: 1; + transform: translate3d(0, 0, 0) scale3d(1, 1, 1); + } + .tabs-horizontal.tabs-line .nav-tabs { + display: block; + width: 100%; + position: relative; + transform: translateY(-5px); + margin-bottom: -5px; + margin-left: -18px; + margin-right: -18px; + border: 0; + will-change: transform; + text-align: left; + } + .tabs-horizontal.tabs-line .nav-tabs > * { + margin-top: 5px; + padding-left: 18px; + padding-right: 18px; + } + .tabs-horizontal.tabs-line .nav-tabs li { + display: inline-block; + will-change: transform; + -webkit-flex-grow: 1; + -ms-flex-positive: 1; + flex-grow: 1; + -ms-flex-negative: 0; + -webkit-flex-shrink: 0; + flex-shrink: 0; + } + .tabs-horizontal.tabs-line .nav-tabs li a { + display: block; + padding: 0 0 7px 0; + position: relative; + z-index: 1; + border: 0; + } + .tabs-horizontal.tabs-line .nav-tabs li a:before { + content: ''; + position: absolute; + left: 0; + bottom: 0; + height: 2px; + max-width: 100%; + width: 0; + background: #8f859e; + transition: .33s width ease; + } + .tabs-horizontal.tabs-line .nav-tabs li a:hover { + color: #151515; + background-color: transparent; + } + .tabs-horizontal.tabs-line .nav-tabs li.active a { + color: #151515; + background-color: transparent; + } + .tabs-horizontal.tabs-line .nav-tabs li.active a:before { + width: 100%; + } + .tabs-horizontal.tabs-line .tab-content { + padding: 48px 50px 0 0; + } + .tabs-horizontal.tabs-line.tabs-line-secondary .nav-tabs li a { + border: 0; + } + .tabs-horizontal.tabs-line.tabs-line-secondary .nav-tabs li a:before { + background: #dcd1d5; + } + .tabs-vertical { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -webkit-align-items: flex-start; + -ms-flex-align: start; + align-items: flex-start; + } + .tabs-vertical .nav-tabs { + display: -ms-flexbox; + display: -webkit-flex; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + -webkit-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -webkit-align-items: stretch; + -ms-flex-align: stretch; + align-items: stretch; + -ms-flex-negative: 0; + -webkit-flex-shrink: 0; + flex-shrink: 0; + max-width: 50%; + } + .tabs-vertical .nav-tabs li { + border: 0; + width: 100%; + text-align: left; + } + .tabs-vertical .nav-tabs li a { + font-size: 14px; + } + .tabs-vertical .nav-tabs li.active a, + .tabs-vertical .nav-tabs a:hover { + box-shadow: 0 9px 21px 0 rgba(30, 30, 30, 0.13); + } + .tabs-vertical .tab-content { + -webkit-flex-grow: 1; + -ms-flex-positive: 1; + flex-grow: 1; + } + .tabs-vertical.tabs-corporate .nav-tabs { + width: auto; + min-width: 260px; + border: 0; + } + .tabs-vertical.tabs-corporate .nav-tabs li { + margin: 0; + } + .tabs-vertical.tabs-corporate .nav-tabs li a { + position: relative; + padding: 14px 30px; + border: 0; + overflow: hidden; + text-align: left; + } + .tabs-vertical.tabs-corporate .nav-tabs > li + li { + margin-top: 2px; + } + .tabs-vertical.tabs-corporate .tab-content { + padding: 0 0 0 30px; + } +} + +@media (min-width: 992px) { + .tabs-horizontal.tabs-corporate .tab-content { + padding-top: 50px; + } + .tabs-vertical.tabs-corporate .tab-content { + padding: 0 0 0 45px; + } + .tabs-vertical.tabs-wide .tab-content { + padding-right: 50px; + } +} + +@media (min-width: 1200px) { + .tabs-vertical.tabs-wide .tab-content { + padding-right: 100px; + } +} + +[data-content-to] { + display: none; + opacity: 0; + transition: opacity .15s linear; +} + +[data-content-to].show { + display: block; + opacity: 1; +} + +.tabs-modern .nav-tabs { + max-width: 100%; +} + +.tabs-modern .nav-tabs > li a { + display: flex; + align-items: center; + justify-content: center; + padding: 20px; + font-size: 14px; + text-transform: uppercase; + font-weight: 500; + letter-spacing: .2em; + border: 0; + border-radius: 0; + background-color: #f3f3f3; + color: #151515; +} + +.tabs-modern .nav-tabs > li a:hover { + background-color: #dcd1d5; + color: #fff; + box-shadow: none; +} + +.tabs-modern .nav-tabs > li.active a, +.tabs-modern .nav-tabs > li.active a:hover { + background-color: #dcd1d5; + color: #fff; + border: 0; + box-shadow: none; +} + +.tabs-modern .nav-tabs > li + li { + margin-top: 5px; +} + +.tabs-modern .tab-content .tab-pane { + padding: 15px; + background-color: #f3f3f3; +} + +@media (min-width: 768px) { + .tabs-modern .nav-tabs > li { + flex-grow: 1; + display: flex; + } + .tabs-modern .nav-tabs > li a { + position: relative; + width: 100%; + font-size: 18px; + } + .tabs-modern .nav-tabs > li a:before { + position: absolute; + top: calc(50% - 12px); + right: 100%; + content: ''; + opacity: 0; + transition: 450ms; + width: 0; + height: 0; + border-style: solid; + border-width: 12px 0 12px 0; + border-color: transparent #dcd1d5 transparent transparent; + } + .tabs-modern .nav-tabs > li a:hover:before, + .tabs-modern .nav-tabs > li.active a:before, + .tabs-modern .nav-tabs > li.active a:hover:before { + border-width: 12px 12px 12px 0; + opacity: 1; + } + .tabs-modern .nav-tabs > li + li { + margin-top: 15px; + } + .tabs-modern .tab-content .tab-pane { + padding: 20px 25px; + } + .tabs-modern.tabs-vertical { + flex-direction: row-reverse; + align-items: stretch; + } +} + +@media (min-width: 1200px) { + .tabs-modern .nav-tabs > li + li { + margin-top: 22px; + } + .tabs-modern .tab-content .tab-pane { + padding: 40px 50px; + } +} + +@media (min-width: 1600px) { + .tabs-modern .tab-content .tab-pane { + padding: 55px 64px; + } +} + +.tabs-complex .tabs-complex-title + hr { + margin-top: 15px; +} + +.tabs-complex .nav-tabs { + margin-top: 20px; + max-width: 100%; +} + +.tabs-complex .nav-tabs > li a { + display: flex; + align-items: center; + justify-content: center; + padding: 20px; + font-size: 14px; + text-transform: uppercase; + font-weight: 400; + border: 0; + border-radius: 0; + background-color: #f3f3f3; + color: #151515; +} + +.tabs-complex .nav-tabs > li a:hover { + background-color: #dcd1d5; + color: #fff; + box-shadow: none; +} + +.tabs-complex .nav-tabs > li.active a, +.tabs-complex .nav-tabs > li.active a:hover { + background-color: #dcd1d5; + color: #fff; + border: 0; + box-shadow: none; +} + +.tabs-complex .nav-tabs > li + li { + margin-top: 5px; +} + +.tabs-complex .tab-content { + margin-top: 10px; + overflow: hidden; +} + +.tabs-complex .tab-content .tab-pane { + padding: 15px; + background-color: #f3f3f3; +} + +.tabs-complex .tab-content .services-single-box { + max-width: 100%; +} + +.tabs-complex .tabs-complex-title { + text-align: center; +} + +@media (min-width: 768px) { + .tabs-complex .nav-tabs { + margin-top: 0; + } + .tabs-complex .nav-tabs > li { + display: inline-block; + } + .tabs-complex .nav-tabs > li a { + background: transparent; + color: #9b9b9b; + padding-top: 0; + padding-bottom: 0; + } + .tabs-complex .nav-tabs > li a:hover { + color: #8f859e; + background: transparent; + } + .tabs-complex .nav-tabs > li.active a, + .tabs-complex .nav-tabs > li.active a:hover { + color: #8f859e; + background: transparent; + } + .tabs-complex .tabs-complex-title { + display: flex; + align-items: center; + justify-content: space-between; + text-align: left; + } + .tabs-complex .tabs-complex-title > * + * { + margin-left: 20px; + } + .tabs-complex .tab-content { + margin-top: 30px; + overflow: hidden; + } + .tabs-complex .tab-content .tab-pane { + padding: 20px 25px; + } +} + +@media (min-width: 1200px) { + .tabs-complex .tab-content { + margin-top: 50px; + } + .tabs-complex .tab-content .tab-pane { + padding: 40px 50px; + } + .tabs-complex .tab-content .services-single-box { + max-width: 765px; + } +} + +@media (min-width: 1600px) { + .tabs-complex .tab-content .tab-pane { + padding: 55px 64px; + } +} + +/* +* +* Photoswipe +* -------------------------------------------------- +*/ +.pswp { + display: none; + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + overflow: hidden; + -ms-touch-action: none; + touch-action: none; + z-index: 999999; + -webkit-text-size-adjust: 100%; + /* create separate layer, to avoid paint on window.onscroll in webkit/blink */ + -webkit-backface-visibility: hidden; + outline: none; +} + +.pswp * { + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.pswp img { + max-width: none; +} + +/* style is added when JS option showHideOpacity is set to true */ +.pswp--animate_opacity { + /* 0.001, because opacity:0 doesn't trigger Paint action, which causes lag at start of transition */ + opacity: 0.001; + will-change: opacity; + /* for open/close transition */ + -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); + transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); +} + +.pswp--open { + display: block; +} + +.pswp--zoom-allowed .pswp__img { + /* autoprefixer: off */ + cursor: -webkit-zoom-in; + cursor: -moz-zoom-in; + cursor: zoom-in; +} + +.pswp--zoomed-in .pswp__img { + /* autoprefixer: off */ + cursor: -webkit-grab; + cursor: -moz-grab; + cursor: grab; +} + +.pswp--dragging .pswp__img { + /* autoprefixer: off */ + cursor: -webkit-grabbing; + cursor: -moz-grabbing; + cursor: grabbing; +} + +/* + Background is added as a separate element. + As animating opacity is much faster than animating rgba() background-color. +*/ +.pswp__bg { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + background: #000; + opacity: 0; + -webkit-backface-visibility: hidden; + will-change: opacity; +} + +.pswp__scroll-wrap { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: hidden; +} + +.pswp__container, +.pswp__zoom-wrap { + -ms-touch-action: none; + touch-action: none; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; +} + +/* Prevent selection and tap highlights */ +.pswp__container, +.pswp__img { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; +} + +.pswp__zoom-wrap { + position: absolute; + width: 100%; + -webkit-transform-origin: left top; + -ms-transform-origin: left top; + transform-origin: left top; + /* for open/close transition */ + -webkit-transition: -webkit-transform 333ms cubic-bezier(0.4, 0, 0.22, 1); + transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); +} + +.pswp__bg { + will-change: opacity; + /* for open/close transition */ + -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); + transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); +} + +.pswp--animated-in .pswp__bg, +.pswp--animated-in .pswp__zoom-wrap { + -webkit-transition: none; + transition: none; +} + +.pswp__container, +.pswp__zoom-wrap { + -webkit-backface-visibility: hidden; +} + +.pswp__item { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + overflow: hidden; +} + +.pswp__item .video-warp, +.pswp__item .post-video-warp { + position: absolute; + top: 50%; + width: 600px; + max-width: 100%; + left: 50%; + transform: translate(-50%, -50%); +} + +.pswp__img { + position: absolute; + width: auto; + height: auto; + top: 0; + left: 0; +} + +/* + stretched thumbnail or div placeholder element (see below) + style is added to avoid flickering in webkit/blink when layers overlap +*/ +.pswp__img--placeholder { + -webkit-backface-visibility: hidden; +} + +/* + div element that matches size of large image + large image loads on top of it +*/ +.pswp__img--placeholder--blank { + background: #222; +} + +.pswp--ie .pswp__img { + width: 100% !important; + height: auto !important; + left: 0; + top: 0; +} + +/* + Error message appears when image is not loaded + (JS option errorMsg controls markup) +*/ +.pswp__error-msg { + position: absolute; + left: 0; + top: 50%; + width: 100%; + text-align: center; + font-size: 14px; + line-height: 16px; + margin-top: -8px; + color: #CCC; +} + +.pswp__error-msg a { + color: #CCC; + text-decoration: underline; +} + +[data-photo-swipe] [data-inner-html] iframe { + pointer-events: none; +} + +/*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */ +/* + + Contents: + + 1. Buttons + 2. Share modal and links + 3. Index indicator ("1 of X" counter) + 4. Caption + 5. Loading indicator + 6. Additional styles (root element, top bar, idle state, hidden state, etc.) + +*/ +/* + + 1. Buttons + + */ +/* + + + +
+
+
+
+
+
+
+ +
+
+
+ + +
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/code/views/head.ejs b/code/views/head.ejs new file mode 100644 index 0000000..dde2822 --- /dev/null +++ b/code/views/head.ejs @@ -0,0 +1,137 @@ + + + + + <%= pageTitle %> + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/views/head2.ejs b/code/views/head2.ejs new file mode 100644 index 0000000..7fd2a0e --- /dev/null +++ b/code/views/head2.ejs @@ -0,0 +1,15 @@ +
+ + diff --git a/code/views/images/(2).jpg b/code/views/images/(2).jpg new file mode 100644 index 0000000..a10805e Binary files /dev/null and b/code/views/images/(2).jpg differ diff --git a/code/views/images/(3).jpg b/code/views/images/(3).jpg new file mode 100644 index 0000000..a10805e Binary files /dev/null and b/code/views/images/(3).jpg differ diff --git a/code/views/images/(4).jpg b/code/views/images/(4).jpg new file mode 100644 index 0000000..2310741 Binary files /dev/null and b/code/views/images/(4).jpg differ diff --git a/code/views/images/(5).jpg b/code/views/images/(5).jpg new file mode 100644 index 0000000..2310741 Binary files /dev/null and b/code/views/images/(5).jpg differ diff --git a/code/views/images/(6).jpg b/code/views/images/(6).jpg new file mode 100644 index 0000000..2310741 Binary files /dev/null and b/code/views/images/(6).jpg differ diff --git a/code/views/images/.jpg b/code/views/images/.jpg new file mode 100644 index 0000000..a10805e Binary files /dev/null and b/code/views/images/.jpg differ diff --git a/code/views/images/_blank.png b/code/views/images/_blank.png new file mode 100644 index 0000000..999ed73 Binary files /dev/null and b/code/views/images/_blank.png differ diff --git a/code/views/images/about-01-546x516.jpg b/code/views/images/about-01-546x516.jpg new file mode 100644 index 0000000..14943b4 Binary files /dev/null and b/code/views/images/about-01-546x516.jpg differ diff --git a/code/views/images/about-02-100x100.jpg b/code/views/images/about-02-100x100.jpg new file mode 100644 index 0000000..6ed6084 Binary files /dev/null and b/code/views/images/about-02-100x100.jpg differ diff --git a/code/views/images/about-04-100x100.jpg b/code/views/images/about-04-100x100.jpg new file mode 100644 index 0000000..b53714d Binary files /dev/null and b/code/views/images/about-04-100x100.jpg differ diff --git a/code/views/images/about-05-100x100.jpg b/code/views/images/about-05-100x100.jpg new file mode 100644 index 0000000..132f2a1 Binary files /dev/null and b/code/views/images/about-05-100x100.jpg differ diff --git a/code/views/images/ajax-loader.gif b/code/views/images/ajax-loader.gif new file mode 100644 index 0000000..c122391 Binary files /dev/null and b/code/views/images/ajax-loader.gif differ diff --git a/code/views/images/bgr.jpg b/code/views/images/bgr.jpg new file mode 100644 index 0000000..ce8dc92 Binary files /dev/null and b/code/views/images/bgr.jpg differ diff --git a/code/views/images/breadcrumbs-01.jpg b/code/views/images/breadcrumbs-01.jpg new file mode 100644 index 0000000..2e628b1 Binary files /dev/null and b/code/views/images/breadcrumbs-01.jpg differ diff --git a/code/views/images/favicon.ico b/code/views/images/favicon.ico new file mode 100644 index 0000000..4bea5a9 Binary files /dev/null and b/code/views/images/favicon.ico differ diff --git a/code/views/images/gallery-1-420x584.jpg b/code/views/images/gallery-1-420x584.jpg new file mode 100644 index 0000000..a0bf221 Binary files /dev/null and b/code/views/images/gallery-1-420x584.jpg differ diff --git a/code/views/images/gallery-1-533x800_original.jpg b/code/views/images/gallery-1-533x800_original.jpg new file mode 100644 index 0000000..7aa7571 Binary files /dev/null and b/code/views/images/gallery-1-533x800_original.jpg differ diff --git a/code/views/images/gallery-2-1199x800_original.jpg b/code/views/images/gallery-2-1199x800_original.jpg new file mode 100644 index 0000000..0d9c74e Binary files /dev/null and b/code/views/images/gallery-2-1199x800_original.jpg differ diff --git a/code/views/images/gallery-2-420x278.jpg b/code/views/images/gallery-2-420x278.jpg new file mode 100644 index 0000000..80d7780 Binary files /dev/null and b/code/views/images/gallery-2-420x278.jpg differ diff --git a/code/views/images/gallery-3-420x584.jpg b/code/views/images/gallery-3-420x584.jpg new file mode 100644 index 0000000..a0bf221 Binary files /dev/null and b/code/views/images/gallery-3-420x584.jpg differ diff --git a/code/views/images/gallery-3-584x800_original.jpg b/code/views/images/gallery-3-584x800_original.jpg new file mode 100644 index 0000000..b844ca0 Binary files /dev/null and b/code/views/images/gallery-3-584x800_original.jpg differ diff --git a/code/views/images/gallery-4-1200x800_original.jpg b/code/views/images/gallery-4-1200x800_original.jpg new file mode 100644 index 0000000..209541f Binary files /dev/null and b/code/views/images/gallery-4-1200x800_original.jpg differ diff --git a/code/views/images/gallery-4-420x278.jpg b/code/views/images/gallery-4-420x278.jpg new file mode 100644 index 0000000..80d7780 Binary files /dev/null and b/code/views/images/gallery-4-420x278.jpg differ diff --git a/code/views/images/gallery-5-1200x800_original.jpg b/code/views/images/gallery-5-1200x800_original.jpg new file mode 100644 index 0000000..209541f Binary files /dev/null and b/code/views/images/gallery-5-1200x800_original.jpg differ diff --git a/code/views/images/gallery-5-420x278.jpg b/code/views/images/gallery-5-420x278.jpg new file mode 100644 index 0000000..80d7780 Binary files /dev/null and b/code/views/images/gallery-5-420x278.jpg differ diff --git a/code/views/images/gallery-6-1200x798_original.jpg b/code/views/images/gallery-6-1200x798_original.jpg new file mode 100644 index 0000000..ded2f06 Binary files /dev/null and b/code/views/images/gallery-6-1200x798_original.jpg differ diff --git a/code/views/images/gallery-6-420x278.jpg b/code/views/images/gallery-6-420x278.jpg new file mode 100644 index 0000000..80d7780 Binary files /dev/null and b/code/views/images/gallery-6-420x278.jpg differ diff --git a/code/views/images/gmap_marker.png b/code/views/images/gmap_marker.png new file mode 100644 index 0000000..b53b3ad Binary files /dev/null and b/code/views/images/gmap_marker.png differ diff --git a/code/views/images/gmap_marker_active.png b/code/views/images/gmap_marker_active.png new file mode 100644 index 0000000..3f6a7b5 Binary files /dev/null and b/code/views/images/gmap_marker_active.png differ diff --git a/code/views/images/grid-gallery-1-1200x800_original.jpg b/code/views/images/grid-gallery-1-1200x800_original.jpg new file mode 100644 index 0000000..31caf3c Binary files /dev/null and b/code/views/images/grid-gallery-1-1200x800_original.jpg differ diff --git a/code/views/images/grid-gallery-1-370x276.jpg b/code/views/images/grid-gallery-1-370x276.jpg new file mode 100644 index 0000000..31caf3c Binary files /dev/null and b/code/views/images/grid-gallery-1-370x276.jpg differ diff --git a/code/views/images/grid-gallery-1-640x426.jpg b/code/views/images/grid-gallery-1-640x426.jpg new file mode 100644 index 0000000..31caf3c Binary files /dev/null and b/code/views/images/grid-gallery-1-640x426.jpg differ diff --git a/code/views/images/grid-gallery-2-1200x800_original.jpg b/code/views/images/grid-gallery-2-1200x800_original.jpg new file mode 100644 index 0000000..4a4bad5 Binary files /dev/null and b/code/views/images/grid-gallery-2-1200x800_original.jpg differ diff --git a/code/views/images/grid-gallery-2-370x276.jpg b/code/views/images/grid-gallery-2-370x276.jpg new file mode 100644 index 0000000..4a4bad5 Binary files /dev/null and b/code/views/images/grid-gallery-2-370x276.jpg differ diff --git a/code/views/images/grid-gallery-2-640x426.jpg b/code/views/images/grid-gallery-2-640x426.jpg new file mode 100644 index 0000000..4a4bad5 Binary files /dev/null and b/code/views/images/grid-gallery-2-640x426.jpg differ diff --git a/code/views/images/grid-gallery-3-1200x800_original.jpg b/code/views/images/grid-gallery-3-1200x800_original.jpg new file mode 100644 index 0000000..29adba4 Binary files /dev/null and b/code/views/images/grid-gallery-3-1200x800_original.jpg differ diff --git a/code/views/images/grid-gallery-3-370x276.jpg b/code/views/images/grid-gallery-3-370x276.jpg new file mode 100644 index 0000000..29adba4 Binary files /dev/null and b/code/views/images/grid-gallery-3-370x276.jpg differ diff --git a/code/views/images/grid-gallery-3-640x426.jpg b/code/views/images/grid-gallery-3-640x426.jpg new file mode 100644 index 0000000..29adba4 Binary files /dev/null and b/code/views/images/grid-gallery-3-640x426.jpg differ diff --git a/code/views/images/grid-gallery-4-1200x800_original.jpg b/code/views/images/grid-gallery-4-1200x800_original.jpg new file mode 100644 index 0000000..45a7482 Binary files /dev/null and b/code/views/images/grid-gallery-4-1200x800_original.jpg differ diff --git a/code/views/images/grid-gallery-4-370x276.jpg b/code/views/images/grid-gallery-4-370x276.jpg new file mode 100644 index 0000000..45a7482 Binary files /dev/null and b/code/views/images/grid-gallery-4-370x276.jpg differ diff --git a/code/views/images/grid-gallery-4-640x426.jpg b/code/views/images/grid-gallery-4-640x426.jpg new file mode 100644 index 0000000..45a7482 Binary files /dev/null and b/code/views/images/grid-gallery-4-640x426.jpg differ diff --git a/code/views/images/handle.png b/code/views/images/handle.png new file mode 100644 index 0000000..2d410ee Binary files /dev/null and b/code/views/images/handle.png differ diff --git a/code/views/images/ie8-panel/warning_bar_0000_us.jpg b/code/views/images/ie8-panel/warning_bar_0000_us.jpg new file mode 100644 index 0000000..73fdca7 Binary files /dev/null and b/code/views/images/ie8-panel/warning_bar_0000_us.jpg differ diff --git a/code/views/images/isotope-loader.png b/code/views/images/isotope-loader.png new file mode 100644 index 0000000..baf00e1 Binary files /dev/null and b/code/views/images/isotope-loader.png differ diff --git a/code/views/images/layout-2-blog-01-460x369.jpg b/code/views/images/layout-2-blog-01-460x369.jpg new file mode 100644 index 0000000..32ba8cb Binary files /dev/null and b/code/views/images/layout-2-blog-01-460x369.jpg differ diff --git a/code/views/images/layout-2-blog-02-460x369.jpg b/code/views/images/layout-2-blog-02-460x369.jpg new file mode 100644 index 0000000..32ba8cb Binary files /dev/null and b/code/views/images/layout-2-blog-02-460x369.jpg differ diff --git a/code/views/images/layout-2-blog-03-460x369.jpg b/code/views/images/layout-2-blog-03-460x369.jpg new file mode 100644 index 0000000..32ba8cb Binary files /dev/null and b/code/views/images/layout-2-blog-03-460x369.jpg differ diff --git a/code/views/images/loading.gif b/code/views/images/loading.gif new file mode 100644 index 0000000..bbc3e71 Binary files /dev/null and b/code/views/images/loading.gif differ diff --git a/code/views/images/logo-default-314x48.png b/code/views/images/logo-default-314x48.png new file mode 100644 index 0000000..30b0c20 Binary files /dev/null and b/code/views/images/logo-default-314x48.png differ diff --git a/code/views/images/logo-inverse-280x48.png b/code/views/images/logo-inverse-280x48.png new file mode 100644 index 0000000..332e0e3 Binary files /dev/null and b/code/views/images/logo-inverse-280x48.png differ diff --git a/code/views/images/mCSB_buttons.png b/code/views/images/mCSB_buttons.png new file mode 100644 index 0000000..32f519a Binary files /dev/null and b/code/views/images/mCSB_buttons.png differ diff --git a/code/views/images/masonry-gallery-1-270x375.jpg b/code/views/images/masonry-gallery-1-270x375.jpg new file mode 100644 index 0000000..947079c Binary files /dev/null and b/code/views/images/masonry-gallery-1-270x375.jpg differ diff --git a/code/views/images/masonry-gallery-2-570x375.jpg b/code/views/images/masonry-gallery-2-570x375.jpg new file mode 100644 index 0000000..3a3b5b6 Binary files /dev/null and b/code/views/images/masonry-gallery-2-570x375.jpg differ diff --git a/code/views/images/masonry-gallery-3-270x229.jpg b/code/views/images/masonry-gallery-3-270x229.jpg new file mode 100644 index 0000000..c70325e Binary files /dev/null and b/code/views/images/masonry-gallery-3-270x229.jpg differ diff --git a/code/views/images/masonry-gallery-4-270x229.jpg b/code/views/images/masonry-gallery-4-270x229.jpg new file mode 100644 index 0000000..c70325e Binary files /dev/null and b/code/views/images/masonry-gallery-4-270x229.jpg differ diff --git a/code/views/images/masonry-gallery-5-570x264.jpg b/code/views/images/masonry-gallery-5-570x264.jpg new file mode 100644 index 0000000..b1d6a72 Binary files /dev/null and b/code/views/images/masonry-gallery-5-570x264.jpg differ diff --git a/code/views/images/masonry-gallery-6-270x264.jpg b/code/views/images/masonry-gallery-6-270x264.jpg new file mode 100644 index 0000000..af4714f Binary files /dev/null and b/code/views/images/masonry-gallery-6-270x264.jpg differ diff --git a/code/views/images/masonry-gallery-7-270x445.jpg b/code/views/images/masonry-gallery-7-270x445.jpg new file mode 100644 index 0000000..b9f3c64 Binary files /dev/null and b/code/views/images/masonry-gallery-7-270x445.jpg differ diff --git a/code/views/images/masonry-gallery-8-270x264.jpg b/code/views/images/masonry-gallery-8-270x264.jpg new file mode 100644 index 0000000..af4714f Binary files /dev/null and b/code/views/images/masonry-gallery-8-270x264.jpg differ diff --git a/code/views/images/masonry-gallery-9-570x264.jpg b/code/views/images/masonry-gallery-9-570x264.jpg new file mode 100644 index 0000000..b1d6a72 Binary files /dev/null and b/code/views/images/masonry-gallery-9-570x264.jpg differ diff --git a/code/views/images/post-01-870x412.jpg b/code/views/images/post-01-870x412.jpg new file mode 100644 index 0000000..2054aec Binary files /dev/null and b/code/views/images/post-01-870x412.jpg differ diff --git a/code/views/images/preloader.gif b/code/views/images/preloader.gif new file mode 100644 index 0000000..03c09e1 Binary files /dev/null and b/code/views/images/preloader.gif differ diff --git a/code/views/images/preloader.png b/code/views/images/preloader.png new file mode 100644 index 0000000..79ef86e Binary files /dev/null and b/code/views/images/preloader.png differ diff --git a/code/views/images/progress.png b/code/views/images/progress.png new file mode 100644 index 0000000..bae025d Binary files /dev/null and b/code/views/images/progress.png differ diff --git a/code/views/images/progress_sprite.jpg b/code/views/images/progress_sprite.jpg new file mode 100644 index 0000000..945563e Binary files /dev/null and b/code/views/images/progress_sprite.jpg differ diff --git a/code/views/images/quote-img-01-49x45.jpg b/code/views/images/quote-img-01-49x45.jpg new file mode 100644 index 0000000..2750062 Binary files /dev/null and b/code/views/images/quote-img-01-49x45.jpg differ diff --git a/code/views/images/quote-img-01-49x45.png b/code/views/images/quote-img-01-49x45.png new file mode 100644 index 0000000..f142e37 Binary files /dev/null and b/code/views/images/quote-img-01-49x45.png differ diff --git a/code/views/images/rd-video-play-hover.png b/code/views/images/rd-video-play-hover.png new file mode 100644 index 0000000..283323d Binary files /dev/null and b/code/views/images/rd-video-play-hover.png differ diff --git a/code/views/images/rd-video-play.png b/code/views/images/rd-video-play.png new file mode 100644 index 0000000..37f593c Binary files /dev/null and b/code/views/images/rd-video-play.png differ diff --git a/code/views/images/rooms-1-570x380.jpg b/code/views/images/rooms-1-570x380.jpg new file mode 100644 index 0000000..0230d06 Binary files /dev/null and b/code/views/images/rooms-1-570x380.jpg differ diff --git a/code/views/images/services-05-546x516.jpg b/code/views/images/services-05-546x516.jpg new file mode 100644 index 0000000..9e51e57 Binary files /dev/null and b/code/views/images/services-05-546x516.jpg differ diff --git a/code/views/images/slide-01.jpg b/code/views/images/slide-01.jpg new file mode 100644 index 0000000..bc6c2e4 Binary files /dev/null and b/code/views/images/slide-01.jpg differ diff --git a/code/views/images/slide-02.jpg b/code/views/images/slide-02.jpg new file mode 100644 index 0000000..14943b4 Binary files /dev/null and b/code/views/images/slide-02.jpg differ diff --git a/code/views/images/slide-03.jpg b/code/views/images/slide-03.jpg new file mode 100644 index 0000000..4a4bad5 Binary files /dev/null and b/code/views/images/slide-03.jpg differ diff --git a/code/views/images/sprite.png b/code/views/images/sprite.png new file mode 100644 index 0000000..ee75494 Binary files /dev/null and b/code/views/images/sprite.png differ diff --git a/code/views/images/team-01-295x282.jpg b/code/views/images/team-01-295x282.jpg new file mode 100644 index 0000000..c9b8806 Binary files /dev/null and b/code/views/images/team-01-295x282.jpg differ diff --git a/code/views/images/team-02-295x282.jpg b/code/views/images/team-02-295x282.jpg new file mode 100644 index 0000000..6f7f8d8 Binary files /dev/null and b/code/views/images/team-02-295x282.jpg differ diff --git a/code/views/images/team-03-295x282.jpg b/code/views/images/team-03-295x282.jpg new file mode 100644 index 0000000..bebf779 Binary files /dev/null and b/code/views/images/team-03-295x282.jpg differ diff --git a/code/views/images/typography-1-770x485.jpg b/code/views/images/typography-1-770x485.jpg new file mode 100644 index 0000000..152c246 Binary files /dev/null and b/code/views/images/typography-1-770x485.jpg differ diff --git a/code/views/images/typography-2-350x220.jpg b/code/views/images/typography-2-350x220.jpg new file mode 100644 index 0000000..9409627 Binary files /dev/null and b/code/views/images/typography-2-350x220.jpg differ diff --git a/code/views/images/video-bg-1020x525.jpg b/code/views/images/video-bg-1020x525.jpg new file mode 100644 index 0000000..9f6ed51 Binary files /dev/null and b/code/views/images/video-bg-1020x525.jpg differ diff --git a/code/views/images/video-play.png b/code/views/images/video-play.png new file mode 100644 index 0000000..9218a12 Binary files /dev/null and b/code/views/images/video-play.png differ diff --git a/code/views/images/vimeo-play.png b/code/views/images/vimeo-play.png new file mode 100644 index 0000000..decbfab Binary files /dev/null and b/code/views/images/vimeo-play.png differ diff --git a/code/views/images/volume.png b/code/views/images/volume.png new file mode 100644 index 0000000..0cb99aa Binary files /dev/null and b/code/views/images/volume.png differ diff --git a/code/views/images/youtube-play.png b/code/views/images/youtube-play.png new file mode 100644 index 0000000..c784fbd Binary files /dev/null and b/code/views/images/youtube-play.png differ diff --git a/code/views/index.ejs b/code/views/index.ejs new file mode 100644 index 0000000..eed656a --- /dev/null +++ b/code/views/index.ejs @@ -0,0 +1,82 @@ +<%- include('head') %> +
+
+
+
+ +
+ +
+
+
+
+
+

Your Ideal Retreat

+
+
+

Enjoy the world of relaxation

+

and tranquility!

+
learn more +
+
+
+
+
+
+

Relax & Unwind

+
+
+

Experience the luxurious level

+

of our spa treatments

+
learn more +
+
+
+
+
+
+

Revitalize & Relax

+
+
+

Indulge in our top-notch

+

spa resort

+
learn more +
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+

About Us

+

Committed to everyone seeking energy and excitement, we offer endless possibilities to unwind and reenergize.

+
+
+
Weekdays:
+
8:00–20:00
+
+
+
Weekends:
+
9:00–18:00
+
+
+
+
+
+
+
+
+<%- include('foot') %> \ No newline at end of file diff --git a/code/views/js/core.min.js b/code/views/js/core.min.js new file mode 100644 index 0000000..ad82589 --- /dev/null +++ b/code/views/js/core.min.js @@ -0,0 +1,277 @@ +/** + * jQuery + * @see http://jquery.com/ + * @license MIT license + */ +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t="length"in e&&e.length,n=it.type(e);return"function"===n||it.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(it.isFunction(t))return it.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return it.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ft.test(t))return it.filter(t,e,n);t=it.filter(t,e)}return it.grep(e,function(e){return it.inArray(e,t)>=0!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t=xt[e]={};return it.each(e.match(bt)||[],function(e,n){t[n]=!0}),t}function a(){ht.addEventListener?(ht.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1)):(ht.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(ht.addEventListener||"load"===event.type||"complete"===ht.readyState)&&(a(),it.ready())}function u(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(Et,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Nt.test(n)?it.parseJSON(n):n}catch(i){}it.data(e,t,n)}else n=void 0}return n}function l(e){var t;for(t in e)if(("data"!==t||!it.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(it.acceptData(e)){var i,o,a=it.expando,s=e.nodeType,u=s?it.cache:e,l=s?e[a]:e[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof t)return l||(l=s?e[a]=J.pop()||it.guid++:a),u[l]||(u[l]=s?{}:{toJSON:it.noop}),("object"==typeof t||"function"==typeof t)&&(r?u[l]=it.extend(u[l],t):u[l].data=it.extend(u[l].data,t)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[it.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[it.camelCase(t)])):i=o,i}}function d(e,t,n){if(it.acceptData(e)){var r,i,o=e.nodeType,a=o?it.cache:e,s=o?e[it.expando]:it.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){it.isArray(t)?t=t.concat(it.map(t,it.camelCase)):t in r?t=[t]:(t=it.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!l(r):!it.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?it.cleanData([e],!0):nt.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}function f(){return!0}function p(){return!1}function h(){try{return ht.activeElement}catch(e){}}function m(e){var t=Ft.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function g(e,t){var n,r,i=0,o=typeof e.getElementsByTagName!==Ct?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==Ct?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||it.nodeName(r,t)?o.push(r):it.merge(o,g(r,t));return void 0===t||t&&it.nodeName(e,t)?it.merge([e],o):o}function v(e){jt.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t){return it.nodeName(e,"table")&&it.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function b(e){return e.type=(null!==it.find.attr(e,"type"))+"/"+e.type,e}function x(e){var t=Vt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,r=0;null!=(n=e[r]);r++)it._data(n,"globalEval",!t||it._data(t[r],"globalEval"))}function T(e,t){if(1===t.nodeType&&it.hasData(e)){var n,r,i,o=it._data(e),a=it._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)it.event.add(t,n,s[n][r])}a.data&&(a.data=it.extend({},a.data))}}function C(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!nt.noCloneEvent&&t[it.expando]){i=it._data(t);for(r in i.events)it.removeEvent(t,r,i.handle);t.removeAttribute(it.expando)}"script"===n&&t.text!==e.text?(b(t).text=e.text,x(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),nt.html5Clone&&e.innerHTML&&!it.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&jt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function N(t,n){var r,i=it(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:it.css(i[0],"display");return i.detach(),o}function E(e){var t=ht,n=Zt[e];return n||(n=N(e,t),"none"!==n&&n||(Kt=(Kt||it("':"vimeo"===g.type&&(c=''),f.addClass("owl-video-playing"),this._playing=f,d=a('
'+c+"
"),e.after(d)},d.prototype.isInFullScreen=function(){var d=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return d&&a(d).parent().hasClass("owl-video-frame")&&(this._core.speed(0),this._fullscreen=!0),d&&this._fullscreen&&this._playing?!1:this._fullscreen?(this._fullscreen=!1,!1):this._playing&&this._core.state.orientation!==b.orientation?(this._core.state.orientation=b.orientation,!1):!0},d.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=d}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){this.swapping="translated"==a.type},this),"translate.owl.carousel":a.proxy(function(){this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&this.core.support3d){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c)),f&&e.addClass("animated owl-animated-in").addClass(f).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",c))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.transitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c){var d=function(b){this.core=b,this.core.options=a.extend({},d.Defaults,this.core.options),this.handlers={"translated.owl.carousel refreshed.owl.carousel":a.proxy(function(){this.autoplay() +},this),"play.owl.autoplay":a.proxy(function(a,b,c){this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(){this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this.core.settings.autoplayHoverPause&&this.autoplay()},this)},this.core.$element.on(this.handlers)};d.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},d.prototype.autoplay=function(){this.core.settings.autoplay&&!this.core.state.videoPlay?(b.clearInterval(this.interval),this.interval=b.setInterval(a.proxy(function(){this.play()},this),this.core.settings.autoplayTimeout)):b.clearInterval(this.interval)},d.prototype.play=function(){return c.hidden===!0||this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion?void 0:this.core.settings.autoplay===!1?void b.clearInterval(this.interval):void this.core.next(this.core.settings.autoplaySpeed)},d.prototype.stop=function(){b.clearInterval(this.interval)},d.prototype.pause=function(){b.clearInterval(this.interval)},d.prototype.destroy=function(){var a,c;b.clearInterval(this.interval);for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=d}(window.Zepto||window.jQuery,window,document),function(a){"use strict";var b=function(c){this._core=c,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.push(a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"add.owl.carousel":a.proxy(function(b){this._core.settings.dotsData&&this._templates.splice(b.position,0,a(b.content).find("[data-dot]").andSelf("[data-dot]").attr("data-dot"))},this),"remove.owl.carousel prepared.owl.carousel":a.proxy(function(a){this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"change.owl.carousel":a.proxy(function(a){if("position"==a.property.name&&!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){var b=this._core.current(),c=this._core.maximum(),d=this._core.minimum();a.data=a.property.value>c?b>=c?d:c:a.property.value").addClass(d.dotClass).append(a("")).prop("outerHTML")]),d.navContainer&&d.dotsContainer||(this._controls.$container=a("
").addClass(d.controlsClass).appendTo(this.$element)),this._controls.$indicators=d.dotsContainer?a(d.dotsContainer):a("
").hide().addClass(d.dotsClass).appendTo(this._controls.$container),this._controls.$indicators.on("click","div",a.proxy(function(b){var c=a(b.target).parent().is(this._controls.$indicators)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(c,d.dotsSpeed)},this)),b=d.navContainer?a(d.navContainer):a("
").addClass(d.navContainerClass).prependTo(this._controls.$container),this._controls.$next=a("<"+d.navElement+">"),this._controls.$previous=this._controls.$next.clone(),this._controls.$previous.addClass(d.navClass[0]).html(d.navText[0]).hide().prependTo(b).on("click",a.proxy(function(){this.prev(d.navSpeed)},this)),this._controls.$next.addClass(d.navClass[1]).html(d.navText[1]).hide().appendTo(b).on("click",a.proxy(function(){this.next(d.navSpeed)},this));for(c in this._overrides)this._core[c]=a.proxy(this[c],this)},b.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},b.prototype.update=function(){var a,b,c,d=this._core.settings,e=this._core.clones().length/2,f=e+this._core.items().length,g=d.center||d.autoWidth||d.dotData?1:d.dotsEach||d.items;if("page"!==d.slideBy&&(d.slideBy=Math.min(d.slideBy,d.items)),d.dots||"page"==d.slideBy)for(this._pages=[],a=e,b=0,c=0;f>a;a++)(b>=g||0===b)&&(this._pages.push({start:a-e,end:a-e+g-1}),b=0,++c),b+=this._core.mergers(this._core.relative(a))},b.prototype.draw=function(){var b,c,d="",e=this._core.settings,f=(this._core.$stage.children(),this._core.relative(this._core.current()));if(!e.nav||e.loop||e.navRewind||(this._controls.$previous.toggleClass("disabled",0>=f),this._controls.$next.toggleClass("disabled",f>=this._core.maximum())),this._controls.$previous.toggle(e.nav),this._controls.$next.toggle(e.nav),e.dots){if(b=this._pages.length-this._controls.$indicators.children().length,e.dotData&&0!==b){for(c=0;c0?(d=new Array(b+1).join(this._templates[0]),this._controls.$indicators.append(d)):0>b&&this._controls.$indicators.children().slice(b).remove();this._controls.$indicators.find(".active").removeClass("active"),this._controls.$indicators.children().eq(a.inArray(this.current(),this._pages)).addClass("active")}this._controls.$indicators.toggle(e.dots)},b.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotData?1:c.dotsEach||c.items)}},b.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,function(a){return a.start<=b&&a.end>=b}).pop()},b.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},b.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},b.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},b.prototype.to=function(b,c,d){var e;d?a.proxy(this._overrides.to,this._core)(b,c):(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c))},a.fn.owlCarousel.Constructor.Plugins.Navigation=b}(window.Zepto||window.jQuery,window,document),function(a,b){"use strict";var c=function(d){this._core=d,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(){"URLHash"==this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){var c=a(b.content).find("[data-hash]").andSelf("[data-hash]").attr("data-hash");this._hashes[c]=b.content},this)},this._core.options=a.extend({},c.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(){var a=b.location.hash.substring(1),c=this._core.$stage.children(),d=this._hashes[a]&&c.index(this._hashes[a])||0;return a?void this._core.to(d,!1,!0):!1},this))};c.Defaults={URLhashListener:!1},c.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=c}(window.Zepto||window.jQuery,window,document); +/** + * @module Isotope PACKAGED + * @version v2.2.2 + * @license GPLv3 + * @see http://isotope.metafizzy.co + */ +!function(a){function b(){}function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(window),function(){"use strict";function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;be;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a,b){function c(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}function d(){}function e(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=h.length;c>b;b++){var d=h[b];a[d]=0}return a}function f(b){function d(){if(!m){m=!0;var d=a.getComputedStyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentStyle};return function(b){var c=a(b);return c||g("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=b("boxSizing")){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[k]="border-box";var f=document.body||document.documentElement;f.appendChild(e);var h=j(e);l=200===c(h.width),f.removeChild(e)}}}function f(a){if(d(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var b=j(a);if("none"===b.display)return e();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var g=f.isBorderBox=!(!k||!b[k]||"border-box"!==b[k]),m=0,n=h.length;n>m;m++){var o=h[m],p=b[o];p=i(a,p);var q=parseFloat(p);f[o]=isNaN(q)?0:q}var r=f.paddingLeft+f.paddingRight,s=f.paddingTop+f.paddingBottom,t=f.marginLeft+f.marginRight,u=f.marginTop+f.marginBottom,v=f.borderLeftWidth+f.borderRightWidth,w=f.borderTopWidth+f.borderBottomWidth,x=g&&l,y=c(b.width);y!==!1&&(f.width=y+(x?0:r+v));var z=c(b.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerWidth=f.width-(r+v),f.innerHeight=f.height-(s+w),f.outerWidth=f.width+t,f.outerHeight=f.height+u,f}}function i(b,c){if(a.getComputedStyle||-1===c.indexOf("%"))return c;var d=b.style,e=d.left,f=b.runtimeStyle,g=f&&f.left;return g&&(f.left=b.currentStyle.left),d.left=c,c=d.pixelLeft,d.left=e,g&&(f.left=g),c}var j,k,l,m=!1;return f}var g="undefined"==typeof console?d:function(a){console.error(a)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],f):"object"==typeof exports?module.exports=f(require("desandro-get-style-property")):a.getSize=f(a.getStyleProperty)}(window),function(a){function b(a){"function"==typeof a&&(b.isReady?a():g.push(a))}function c(a){var c="readystatechange"===a.type&&"complete"!==f.readyState;b.isReady||c||d()}function d(){b.isReady=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}}function e(e){return"complete"===f.readyState?d():(e.bind(f,"DOMContentLoaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)),b}var f=a.document,g=[];b.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docReady=e(a.eventie)}(window),function(a){"use strict";function b(a,b){return a[g](b)}function c(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}function d(a,b){c(a);for(var d=a.parentNode.querySelectorAll(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1}function e(a,d){return c(a),b(a,d)}var f,g=function(){if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"MatchesSelector";if(a[f])return f}}();if(g){var h=document.createElement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesSelector=f}(Element.prototype),function(a,b){"use strict";"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.docReady,a.matchesSelector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=Object.prototype.toString;d.isArray=function(a){return"[object Array]"==e.call(a)},d.makeArray=function(a){var b=[];if(d.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexOf=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},d.removeFrom=function(a,b){var c=d.indexOf(a,b);-1!=c&&a.splice(c,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1==a.nodeType&&"string"==typeof a.nodeName},d.setText=function(){function a(a,c){b=b||(void 0!==document.documentElement.textContent?"textContent":"innerText"),a[b]=c}var b;return a}(),d.getParent=function(a,b){for(;a!=document.body;)if(a=a.parentNode,c(a,b))return a},d.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},d.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterFindElements=function(a,b){a=d.makeArray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.isElement(h))if(b){c(h,b)&&e.push(h);for(var i=h.querySelectorAll(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)}return e},d.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var f=a.console;return d.htmlInit=function(c,e){b(function(){for(var b=d.toDashed(e),g=document.querySelectorAll(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getAttribute(h);try{k=m&&JSON.parse(m)}catch(n){f&&f.error("Error parsing "+h+" on "+l.nodeName.toLowerCase()+(l.id?"#"+l.id:"")+": "+n);continue}var o=new c(l,k),p=a.jQuery;p&&p.data(l,e,o)}})},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.Outlayer={},a.Outlayer.Item=b(a,a.EventEmitter,a.getSize,a.getStyleProperty,a.fizzyUIUtils))}(window,function(a,b,c,d,e){"use strict";function f(a){for(var b in a)return!1;return b=null,!0}function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}function h(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}var i=a.getComputedStyle,j=i?function(a){return i(a,null)}:function(a){return a.currentStyle},k=d("transition"),l=d("transform"),m=k&&l,n=!!d("perspective"),o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[k],p=["transform","transition","transitionDuration","transitionProperty"],q=function(){for(var a={},b=0,c=p.length;c>b;b++){var e=p[b],f=d(e);f&&f!==e&&(a[e]=f)}return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getSize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=q[c]||c;b[d]=a[c]}},g.prototype.getPosition=function(){var a=j(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=a[c?"left":"right"],f=a[d?"top":"bottom"],g=this.layout.size,h=-1!=e.indexOf("%")?parseFloat(e)/100*g.width:parseInt(e,10),i=-1!=f.indexOf("%")?parseFloat(f)/100*g.height:parseInt(f,10);h=isNaN(h)?0:h,i=isNaN(i)?0:i,h-=c?g.paddingLeft:g.paddingRight,i-=d?g.paddingTop:g.paddingBottom,this.position.x=h,this.position.y=i},g.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isOriginLeft?"paddingLeft":"paddingRight",e=b.isOriginLeft?"left":"right",f=b.isOriginLeft?"right":"left",g=this.position.x+a[d];c[e]=this.getXValue(g),c[f]="";var h=b.isOriginTop?"paddingTop":"paddingBottom",i=b.isOriginTop?"top":"bottom",j=b.isOriginTop?"bottom":"top",k=this.position.y+a[h];c[i]=this.getYValue(k),c[j]="",this.css(c),this.emitEvent("layout",[this])},g.prototype.getXValue=function(a){var b=this.layout.options;return b.percentPosition&&!b.isHorizontal?a/this.layout.size.width*100+"%":a+"px"},g.prototype.getYValue=function(a){var b=this.layout.options;return b.percentPosition&&b.isHorizontal?a/this.layout.size.height*100+"%":a+"px"},g.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={};j.transform=this.getTranslate(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},g.prototype.getTranslate=function(a,b){var c=this.layout.options;return a=c.isOriginLeft?a:-a,b=c.isOriginTop?b:-b,n?"translate3d("+a+"px, "+b+"px, 0)":"translate("+a+"px, "+b+"px)"},g.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},g.prototype.moveTo=m?g.prototype._transitionTo:g.prototype.goTo,g.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},g.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},g.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var r="opacity,"+h(q.transform||"transform");g.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:r,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(o,this,!1))},g.prototype.transition=g.prototype[k?"_transition":"_nonTransition"],g.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyName]||a.propertyName;if(delete b.ingProperties[c],f(b.ingProperties)&&this.disableTransition(),c in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[c]),c in b.onEnd){var d=b.onEnd[c];d.call(this),delete b.onEnd[c]}this.emitEvent("transitionEnd",[this])}},g.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},g.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionProperty:"",transitionDuration:""};return g.prototype.removeTransitionStyles=function(){this.css(t)},g.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},g.prototype.remove=function(){if(!k||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.once("transitionEnd",function(){a.removeElem()}),this.hide()},g.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("visibleStyle");b[c]=this.onRevealTransitionEnd,this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},g.prototype.getHideRevealTransitionEndProperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("hiddenStyle");b[c]=this.onHideTransitionEnd,this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.Outlayer=b(a,a.eventie,a.EventEmitter,a.getSize,a.fizzyUIUtils,a.Outlayer.Item)}(window,function(a,b,c,d,e,f){"use strict";function g(a,b){var c=e.getQueryElement(a);if(!c)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerGUID=d,l[d]=this,this._create(),this.options.isInitLayout&&this.layout()}var h=a.console,i=a.jQuery,j=function(){},k=0,l={};return g.namespace="outlayer",g.Item=f,g.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},g.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},g.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}return d},g.prototype._filterFindItemElements=function(a){return e.filterFindElements(a,this.options.itemSelector)},g.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.getSize()},g.prototype.getSize=function(){this.size=d(this.element)},g.prototype._getMeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.querySelector(f):e.isElement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},g.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}return b},g.prototype._layoutItems=function(a,b){if(this._emitCompleteOnItems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getItemLayoutPosition(f);g.item=f,g.isInstant=b||f.isLayoutInstant,c.push(g)}this._processLayoutQueue(c)}},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},g.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},g.prototype._postLayout=function(){this.resizeContainer()},g.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},g.prototype._getContainerSize=j,g.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},g.prototype._emitCompleteOnItems=function(a,b){function c(){e.dispatchEvent(a+"Complete",null,[b])}function d(){g++,g===f&&c()}var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.dispatchEvent=function(a,b,c){var d=b?[b].concat(c):c;if(this.emitEvent(a,d),i)if(this.$element=this.$element||i(this.element),b){var e=i.Event(b);e.type=a,this.$element.trigger(e,c)}else this.$element.trigger(a,c)},g.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},g.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored},g.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removeFrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=e.makeArray(a)):void 0},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},g.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},g.prototype._manageStamp=j,g.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,e=d(a),f={left:b.left-c.left-e.marginLeft,top:b.top-c.top-e.marginTop,right:c.right-b.right-e.marginRight,bottom:c.bottom-b.bottom-e.marginBottom};return f},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindResize=function(){this.isResizeBound||(b.bind(a,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){this.isResizeBound&&b.unbind(a,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},g.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},g.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},g.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},g.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},g.prototype.reveal=function(a){this._emitCompleteOnItems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitCompleteOnItems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealItemElements=function(a){var b=this.getItems(a);this.reveal(b)},g.prototype.hideItemElements=function(a){var b=this.getItems(a);this.hide(b)},g.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},g.prototype.getItems=function(a){a=e.makeArray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getItem(f);g&&b.push(g)}return b},g.prototype.remove=function(a){var b=this.getItems(a);if(this._emitCompleteOnItems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removeFrom(this.items,f)}},g.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}this.unbindResize();var e=this.element.outlayerGUID;delete l[e],delete this.element.outlayerGUID,i&&i.removeData(this.element,this.constructor.namespace)},g.data=function(a){a=e.getQueryElement(a);var b=a&&a.outlayerGUID;return b&&l[b]},g.create=function(a,b){function c(){g.apply(this,arguments)}return Object.create?c.prototype=Object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.Item=function(){f.apply(this,arguments)},c.Item.prototype=new f,e.htmlInit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.Item=f,g}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],b):"object"==typeof exports?module.exports=b(require("outlayer")):(a.Isotope=a.Isotope||{},a.Isotope.Item=b(a.Outlayer))}(window,function(a){"use strict";function b(){a.Item.apply(this,arguments)}b.prototype=new a.Item,b.prototype._create=function(){this.id=this.layout.itemGUID++,a.Item.prototype._create.call(this),this.sortData={}},b.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var a=this.layout.options.getSortData,b=this.layout._sorters;for(var c in a){var d=b[c];this.sortData[c]=d(this.element,this)}}};var c=b.prototype.destroy;return b.prototype.destroy=function(){c.apply(this,arguments),this.css({display:""})},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],b):"object"==typeof exports?module.exports=b(require("get-size"),require("outlayer")):(a.Isotope=a.Isotope||{},a.Isotope.LayoutMode=b(a.getSize,a.Outlayer))}(window,function(a,b){"use strict";function c(a){this.isotope=a,a&&(this.options=a.options[this.namespace],this.element=a.element,this.items=a.filteredItems,this.size=a.size)}return function(){function a(a){return function(){return b.prototype[a].apply(this.isotope,arguments)}}for(var d=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],e=0,f=d.length;f>e;e++){var g=d[e];c.prototype[g]=a(g)}}(),c.prototype.needsVerticalResizeLayout=function(){var b=a(this.isotope.element),c=this.isotope.size&&b;return c&&b.innerHeight!=this.isotope.size.innerHeight},c.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},c.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},c.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},c.prototype.getSegmentSize=function(a,b){var c=a+b,d="outer"+b;if(this._getMeasurement(c,d),!this[c]){var e=this.getFirstItemSize();this[c]=e&&e[d]||this.isotope.size["inner"+b]}},c.prototype.getFirstItemSize=function(){var b=this.isotope.filteredItems[0];return b&&b.element&&a(b.element)},c.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},c.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},c.modes={},c.create=function(a,b){function d(){c.apply(this,arguments)}return d.prototype=new c,b&&(d.options=b),d.prototype.namespace=a,c.modes[a]=d,d},c}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.Masonry=b(a.Outlayer,a.getSize,a.fizzyUIUtils)}(window,function(a,b,c){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}var d=this.columnWidth+=this.gutter,e=this.containerWidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=Math[h](f),this.cols=Math.max(f,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c.indexOf(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],b):"object"==typeof exports?module.exports=b(require("../layout-mode"),require("masonry-layout")):b(a.Isotope.LayoutMode,a.Masonry)}(window,function(a,b){"use strict";function c(a,b){for(var c in b)a[c]=b[c];return a}var d=a.create("masonry"),e=d.prototype._getElementOffset,f=d.prototype.layout,g=d.prototype._getMeasurement; + c(d.prototype,b.prototype),d.prototype._getElementOffset=e,d.prototype.layout=f,d.prototype._getMeasurement=g;var h=d.prototype.measureColumns;d.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,h.call(this)};var i=d.prototype._manageStamp;return d.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,i.apply(this,arguments)},d}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],b):"object"==typeof exports?module.exports=b(require("../layout-mode")):b(a.Isotope.LayoutMode)}(window,function(a){"use strict";var b=a.create("fitRows");return b.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},b.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth+this.gutter,c=this.isotope.size.innerWidth+this.gutter;0!==this.x&&b+this.x>c&&(this.x=0,this.y=this.maxY);var d={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+a.size.outerHeight),this.x+=b,d},b.prototype._getContainerSize=function(){return{height:this.maxY}},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],b):"object"==typeof exports?module.exports=b(require("../layout-mode")):b(a.Isotope.LayoutMode)}(window,function(a){"use strict";var b=a.create("vertical",{horizontalAlignment:0});return b.prototype._resetLayout=function(){this.y=0},b.prototype._getItemLayoutPosition=function(a){a.getSize();var b=(this.isotope.size.innerWidth-a.size.outerWidth)*this.options.horizontalAlignment,c=this.y;return this.y+=a.size.outerHeight,{x:b,y:c}},b.prototype._getContainerSize=function(){return{height:this.y}},b}),function(a,b){"use strict";"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","fizzy-ui-utils/utils","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],function(c,d,e,f,g,h){return b(a,c,d,e,f,g,h)}):"object"==typeof exports?module.exports=b(a,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("./item"),require("./layout-mode"),require("./layout-modes/masonry"),require("./layout-modes/fit-rows"),require("./layout-modes/vertical")):a.Isotope=b(a,a.Outlayer,a.getSize,a.matchesSelector,a.fizzyUIUtils,a.Isotope.Item,a.Isotope.LayoutMode)}(window,function(a,b,c,d,e,f,g){function h(a,b){return function(c,d){for(var e=0,f=a.length;f>e;e++){var g=a[e],h=c.sortData[g],i=d.sortData[g];if(h>i||i>h){var j=void 0!==b[g]?b[g]:b,k=j?1:-1;return(h>i?1:-1)*k}}return 0}}var i=a.jQuery,j=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^\s+|\s+$/g,"")},k=document.documentElement,l=k.textContent?function(a){return a.textContent}:function(a){return a.innerText},m=b.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});m.Item=f,m.LayoutMode=g,m.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),b.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var a in g.modes)this._initLayoutMode(a)},m.prototype.reloadItems=function(){this.itemGUID=0,b.prototype.reloadItems.call(this)},m.prototype._itemize=function(){for(var a=b.prototype._itemize.apply(this,arguments),c=0,d=a.length;d>c;c++){var e=a[c];e.id=this.itemGUID++}return this._updateItemsSortData(a),a},m.prototype._initLayoutMode=function(a){var b=g.modes[a],c=this.options[a]||{};this.options[a]=b.options?e.extend(b.options,c):c,this.modes[a]=new b(this)},m.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?void this.arrange():void this._layout()},m.prototype._layout=function(){var a=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,a),this._isLayoutInited=!0},m.prototype.arrange=function(a){function b(){d.reveal(c.needReveal),d.hide(c.needHide)}this.option(a),this._getIsInstant();var c=this._filter(this.items);this.filteredItems=c.matches;var d=this;this._bindArrangeComplete(),this._isInstant?this._noTransition(b):b(),this._sort(),this._layout()},m.prototype._init=m.prototype.arrange,m.prototype._getIsInstant=function(){var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=a,a},m.prototype._bindArrangeComplete=function(){function a(){b&&c&&d&&e.dispatchEvent("arrangeComplete",null,[e.filteredItems])}var b,c,d,e=this;this.once("layoutComplete",function(){b=!0,a()}),this.once("hideComplete",function(){c=!0,a()}),this.once("revealComplete",function(){d=!0,a()})},m.prototype._filter=function(a){var b=this.options.filter;b=b||"*";for(var c=[],d=[],e=[],f=this._getFilterTest(b),g=0,h=a.length;h>g;g++){var i=a[g];if(!i.isIgnored){var j=f(i);j&&c.push(i),j&&i.isHidden?d.push(i):j||i.isHidden||e.push(i)}}return{matches:c,needReveal:d,needHide:e}},m.prototype._getFilterTest=function(a){return i&&this.options.isJQueryFiltering?function(b){return i(b.element).is(a)}:"function"==typeof a?function(b){return a(b.element)}:function(b){return d(b.element,a)}},m.prototype.updateSortData=function(a){var b;a?(a=e.makeArray(a),b=this.getItems(a)):b=this.items,this._getSorters(),this._updateItemsSortData(b)},m.prototype._getSorters=function(){var a=this.options.getSortData;for(var b in a){var c=a[b];this._sorters[b]=n(c)}},m.prototype._updateItemsSortData=function(a){for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.updateSortData()}};var n=function(){function a(a){if("string"!=typeof a)return a;var c=j(a).split(" "),d=c[0],e=d.match(/^\[(.+)\]$/),f=e&&e[1],g=b(f,d),h=m.sortDataParsers[c[1]];return a=h?function(a){return a&&h(g(a))}:function(a){return a&&g(a)}}function b(a,b){var c;return c=a?function(b){return b.getAttribute(a)}:function(a){var c=a.querySelector(b);return c&&l(c)}}return a}();m.sortDataParsers={parseInt:function(a){return parseInt(a,10)},parseFloat:function(a){return parseFloat(a)}},m.prototype._sort=function(){var a=this.options.sortBy;if(a){var b=[].concat.apply(a,this.sortHistory),c=h(b,this.options.sortAscending);this.filteredItems.sort(c),a!=this.sortHistory[0]&&this.sortHistory.unshift(a)}},m.prototype._mode=function(){var a=this.options.layoutMode,b=this.modes[a];if(!b)throw new Error("No layout mode: "+a);return b.options=this.options[a],b},m.prototype._resetLayout=function(){b.prototype._resetLayout.call(this),this._mode()._resetLayout()},m.prototype._getItemLayoutPosition=function(a){return this._mode()._getItemLayoutPosition(a)},m.prototype._manageStamp=function(a){this._mode()._manageStamp(a)},m.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},m.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},m.prototype.appended=function(a){var b=this.addItems(a);if(b.length){var c=this._filterRevealAdded(b);this.filteredItems=this.filteredItems.concat(c)}},m.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){this._resetLayout(),this._manageStamps();var c=this._filterRevealAdded(b);this.layoutItems(this.filteredItems),this.filteredItems=c.concat(this.filteredItems),this.items=b.concat(this.items)}},m.prototype._filterRevealAdded=function(a){var b=this._filter(a);return this.hide(b.needHide),this.reveal(b.matches),this.layoutItems(b.matches,!0),b.matches},m.prototype.insert=function(a){var b=this.addItems(a);if(b.length){var c,d,e=b.length;for(c=0;e>c;c++)d=b[c],this.element.appendChild(d.element);var f=this._filter(b).matches;for(c=0;e>c;c++)b[c].isLayoutInstant=!0;for(this.arrange(),c=0;e>c;c++)delete b[c].isLayoutInstant;this.reveal(f)}};var o=m.prototype.remove;return m.prototype.remove=function(a){a=e.makeArray(a);var b=this.getItems(a);o.call(this,a);var c=b&&b.length;if(c)for(var d=0;c>d;d++){var f=b[d];e.removeFrom(this.filteredItems,f)}},m.prototype.shuffle=function(){for(var a=0,b=this.items.length;b>a;a++){var c=this.items[a];c.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},m.prototype._noTransition=function(a){var b=this.options.transitionDuration;this.options.transitionDuration=0;var c=a.call(this);return this.options.transitionDuration=b,c},m.prototype.getFilteredItemElements=function(){for(var a=[],b=0,c=this.filteredItems.length;c>b;b++)a.push(this.filteredItems[b].element);return a},m}); +/** + * @module PhotoSwipe + * @author Dmitry Semenov + * @see http://photoswipe.com + * @version 4.1.1 + */ +!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.PhotoSwipe=b()}(this,function(){"use strict";var a=function(a,b,c,d){var e={features:null,bind:function(a,b,c,d){var e=(d?"remove":"add")+"EventListener";b=b.split(" ");for(var f=0;f0&&(g=parseInt(g[1],10),g>=1&&8>g&&(d.isOldIOSPhone=!0))}var h=f.match(/Android\s([0-9\.]*)/),i=h?h[1]:0;i=parseFloat(i),i>=1&&(4.4>i&&(d.isOldAndroid=!0),d.androidVersion=i),d.isMobileOpera=/opera mini|opera mobi/i.test(f)}for(var j,k,l=["transform","perspective","animationName"],m=["","webkit","Moz","ms","O"],n=0;4>n;n++){c=m[n];for(var o=0;3>o;o++)j=l[o],k=c+(c?j.charAt(0).toUpperCase()+j.slice(1):j),!d[j]&&k in b&&(d[j]=k);c&&!d.raf&&(c=c.toLowerCase(),d.raf=window[c+"RequestAnimationFrame"],d.raf&&(d.caf=window[c+"CancelAnimationFrame"]||window[c+"CancelRequestAnimationFrame"]))}if(!d.raf){var p=0;d.raf=function(a){var b=(new Date).getTime(),c=Math.max(0,16-(b-p)),d=window.setTimeout(function(){a(b+c)},c);return p=b+c,d},d.caf=function(a){clearTimeout(a)}}return d.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,e.features=d,d}};e.detectFeatures(),e.features.oldIE&&(e.bind=function(a,b,c,d){b=b.split(" ");for(var e,f=(d?"detach":"attach")+"Event",g=function(){c.handleEvent.call(c)},h=0;hb-1?a-b:0>a?b+a:a},Aa={},Ba=function(a,b){return Aa[a]||(Aa[a]=[]),Aa[a].push(b)},Ca=function(a){var b=Aa[a];if(b){var c=Array.prototype.slice.call(arguments);c.shift();for(var d=0;df.currItem.fitRatio?xa||(lc(f.currItem,!1,!0),xa=!0):xa&&(lc(f.currItem),xa=!1)),Fa(da,oa.x,oa.y,s))},Ha=function(a){a.container&&Fa(a.container.style,a.initialPosition.x,a.initialPosition.y,a.initialZoomLevel,a)},Ia=function(a,b){b[E]=u+a+"px, 0px"+v},Ja=function(a,b){if(!i.loop&&b){var c=m+(sa.x*qa-a)/sa.x,d=Math.round(a-sb.x);(0>c&&d>0||c>=_b()-1&&0>d)&&(a=sb.x+d*i.mainScrollEndFriction)}sb.x=a,Ia(a,n)},Ka=function(a,b){var c=tb[a]-ra[a];return na[a]+ma[a]+c-c*(b/t)},La=function(a,b){a.x=b.x,a.y=b.y,b.id&&(a.id=b.id)},Ma=function(a){a.x=Math.round(a.x),a.y=Math.round(a.y)},Na=null,Oa=function(){Na&&(e.unbind(document,"mousemove",Oa),e.addClass(a,"pswp--has_mouse"),i.mouseUsed=!0,Ca("mouseUsed")),Na=setTimeout(function(){Na=null},100)},Pa=function(){e.bind(document,"keydown",f),N.transform&&e.bind(f.scrollWrap,"click",f),i.mouseUsed||e.bind(document,"mousemove",Oa),e.bind(window,"resize scroll",f),Ca("bindEvents")},Qa=function(){e.unbind(window,"resize",f),e.unbind(window,"scroll",r.scroll),e.unbind(document,"keydown",f),e.unbind(document,"mousemove",Oa),N.transform&&e.unbind(f.scrollWrap,"click",f),U&&e.unbind(window,p,f),Ca("unbindEvents")},Ra=function(a,b){var c=hc(f.currItem,pa,a);return b&&(ca=c),c},Sa=function(a){return a||(a=f.currItem),a.initialZoomLevel},Ta=function(a){return a||(a=f.currItem),a.w>0?i.maxSpreadZoom:1},Ua=function(a,b,c,d){return d===f.currItem.initialZoomLevel?(c[a]=f.currItem.initialPosition[a],!0):(c[a]=Ka(a,d),c[a]>b.min[a]?(c[a]=b.min[a],!0):c[a]1?1:a.fitRatio,c=a.container.style,d=b*a.w,e=b*a.h;c.width=d+"px",c.height=e+"px",c.left=a.initialPosition.x+"px",c.top=a.initialPosition.y+"px"},Ga=function(){if(da){var a=da,b=f.currItem,c=b.fitRatio>1?1:b.fitRatio,d=c*b.w,e=c*b.h;a.width=d+"px",a.height=e+"px",a.left=oa.x+"px",a.top=oa.y+"px"}}},Wa=function(a){var b="";i.escKey&&27===a.keyCode?b="close":i.arrowKeys&&(37===a.keyCode?b="prev":39===a.keyCode&&(b="next")),b&&(a.ctrlKey||a.altKey||a.shiftKey||a.metaKey||(a.preventDefault?a.preventDefault():a.returnValue=!1,f[b]()))},Xa=function(a){a&&(X||W||ea||S)&&(a.preventDefault(),a.stopPropagation())},Ya=function(){f.setScrollOffset(0,e.getScrollY())},Za={},$a=0,_a=function(a){Za[a]&&(Za[a].raf&&I(Za[a].raf),$a--,delete Za[a])},ab=function(a){Za[a]&&_a(a),Za[a]||($a++,Za[a]={})},bb=function(){for(var a in Za)Za.hasOwnProperty(a)&&_a(a)},cb=function(a,b,c,d,e,f,g){var h,i=Da();ab(a);var j=function(){if(Za[a]){if(h=Da()-i,h>=d)return _a(a),f(c),void(g&&g());f((c-b)*e(h/d)+b),Za[a].raf=H(j)}};j()},db={shout:Ca,listen:Ba,viewportSize:pa,options:i,isMainScrollAnimating:function(){return ea},getZoomLevel:function(){return s},getCurrentIndex:function(){return m},isDragging:function(){return U},isZooming:function(){return _},setScrollOffset:function(a,b){ra.x=a,M=ra.y=b,Ca("updateScrollOffset",ra)},applyZoomPan:function(a,b,c,d){oa.x=b,oa.y=c,s=a,Ga(d)},init:function(){if(!j&&!k){var c;f.framework=e,f.template=a,f.bg=e.getChildByClass(a,"pswp__bg"),J=a.className,j=!0,N=e.detectFeatures(),H=N.raf,I=N.caf,E=N.transform,L=N.oldIE,f.scrollWrap=e.getChildByClass(a,"pswp__scroll-wrap"),f.container=e.getChildByClass(f.scrollWrap,"pswp__container"),n=f.container.style,f.itemHolders=y=[{el:f.container.children[0],wrap:0,index:-1},{el:f.container.children[1],wrap:0,index:-1},{el:f.container.children[2],wrap:0,index:-1}],y[0].el.style.display=y[2].el.style.display="none",Va(),r={resize:f.updateSize,scroll:Ya,keydown:Wa,click:Xa};var d=N.isOldIOSPhone||N.isOldAndroid||N.isMobileOpera;for(N.animationName&&N.transform&&!d||(i.showAnimationDuration=i.hideAnimationDuration=0),c=0;cm||m>=_b())&&(m=0),f.currItem=$b(m),(N.isOldIOSPhone||N.isOldAndroid)&&(ua=!1),a.setAttribute("aria-hidden","false"),i.modal&&(ua?a.style.position="fixed":(a.style.position="absolute",a.style.top=e.getScrollY()+"px")),void 0===M&&(Ca("initialLayout"),M=K=e.getScrollY());var l="pswp--open ";for(i.mainClass&&(l+=i.mainClass+" "),i.showHideOpacity&&(l+="pswp--animate_opacity "),l+=G?"pswp--touch":"pswp--notouch",l+=N.animationName?" pswp--css_animation":"",l+=N.svg?" pswp--svg":"",e.addClass(a,l),f.updateSize(),o=-1,ta=null,c=0;h>c;c++)Ia((c+o)*sa.x,y[c].el.style);L||e.bind(f.scrollWrap,q,f),Ba("initialZoomInEnd",function(){f.setContent(y[0],m-1),f.setContent(y[2],m+1),y[0].el.style.display=y[2].el.style.display="block",i.focus&&a.focus(),Pa()}),f.setContent(y[1],m),f.updateCurrItem(),Ca("afterInit"),ua||(w=setInterval(function(){$a||U||_||s!==f.currItem.initialZoomLevel||f.updateSize()},1e3)),e.addClass(a,"pswp--visible")}},close:function(){j&&(j=!1,k=!0,Ca("close"),Qa(),bc(f.currItem,null,!0,f.destroy))},destroy:function(){Ca("destroy"),Wb&&clearTimeout(Wb),a.setAttribute("aria-hidden","true"),a.className=J,w&&clearInterval(w),e.unbind(f.scrollWrap,q,f),e.unbind(window,"scroll",f),yb(),bb(),Aa=null},panTo:function(a,b,c){c||(a>ca.min.x?a=ca.min.x:aca.min.y?b=ca.min.y:ba;a++)y[a].item&&(y[a].item.needsUpdate=!0)},updateCurrItem:function(a){if(0!==ta){var b,c=Math.abs(ta);if(!(a&&2>c)){f.currItem=$b(m),xa=!1,Ca("beforeChange",ta),c>=h&&(o+=ta+(ta>0?-h:h),c=h);for(var d=0;c>d;d++)ta>0?(b=y.shift(),y[h-1]=b,o++,Ia((o+2)*sa.x,b.el.style),f.setContent(b,m-c+d+1+1)):(b=y.pop(),y.unshift(b),o--,Ia(o*sa.x,b.el.style),f.setContent(b,m+c-d-1-1));if(da&&1===Math.abs(ta)){var e=$b(z);e.initialZoomLevel!==s&&(hc(e,pa),lc(e),Ha(e))}ta=0,f.updateCurrZoomItem(),z=m,Ca("afterChange")}}},updateSize:function(b){if(!ua&&i.modal){var c=e.getScrollY();if(M!==c&&(a.style.top=c+"px",M=c),!b&&wa.x===window.innerWidth&&wa.y===window.innerHeight)return;wa.x=window.innerWidth,wa.y=window.innerHeight,a.style.height=wa.y+"px"}if(pa.x=f.scrollWrap.clientWidth,pa.y=f.scrollWrap.clientHeight,Ya(),sa.x=pa.x+Math.round(pa.x*i.spacing),sa.y=pa.y,Ja(sa.x*qa),Ca("beforeResize"),void 0!==o){for(var d,g,j,k=0;h>k;k++)d=y[k],Ia((k+o)*sa.x,d.el.style),j=m+k-1,i.loop&&_b()>2&&(j=za(j)),g=$b(j),g&&(x||g.needsUpdate||!g.bounds)?(f.cleanSlide(g),f.setContent(d,j),1===k&&(f.currItem=g,f.updateCurrZoomItem(!0)),g.needsUpdate=!1):-1===d.index&&j>=0&&f.setContent(d,j),g&&g.container&&(hc(g,pa),lc(g),Ha(g));x=!1}t=s=f.currItem.initialZoomLevel,ca=f.currItem.bounds,ca&&(oa.x=ca.center.x,oa.y=ca.center.y,Ga(!0)),Ca("resize")},zoomTo:function(a,b,c,d,f){b&&(t=s,tb.x=Math.abs(b.x)-oa.x,tb.y=Math.abs(b.y)-oa.y,La(na,oa));var g=Ra(a,!1),h={};Ua("x",g,h,a),Ua("y",g,h,a);var i=s,j={x:oa.x,y:oa.y};Ma(h);var k=function(b){1===b?(s=a,oa.x=h.x,oa.y=h.y):(s=(a-i)*b+i,oa.x=(h.x-j.x)*b+j.x,oa.y=(h.y-j.y)*b+j.y),f&&f(b),Ga(1===b)};c?cb("customZoomTo",0,1,c,d||e.easing.sine.inOut,k):k(1)}},eb=30,fb=10,gb={},hb={},ib={},jb={},kb={},lb=[],mb={},nb=[],ob={},pb=0,qb=la(),rb=0,sb=la(),tb=la(),ub=la(),vb=function(a,b){return a.x===b.x&&a.y===b.y},wb=function(a,b){return Math.abs(a.x-b.x)-1?!1:b(a)?a:Bb(a.parentNode,b):!1},Cb={},Db=function(a,b){return Cb.prevent=!Bb(a.target,i.isClickableElement),Ca("preventDragEvent",a,b,Cb),Cb.prevent},Eb=function(a,b){return b.x=a.pageX,b.y=a.pageY,b.id=a.identifier,b},Fb=function(a,b,c){c.x=.5*(a.x+b.x),c.y=.5*(a.y+b.y)},Gb=function(a,b,c){if(a-P>50){var d=nb.length>2?nb.shift():{};d.x=b,d.y=c,nb.push(d),P=a}},Hb=function(){var a=oa.y-f.currItem.initialPosition.y;return 1-Math.abs(a/(pa.y/2))},Ib={},Jb={},Kb=[],Lb=function(a){for(;Kb.length>0;)Kb.pop();return F?(ka=0,lb.forEach(function(a){0===ka?Kb[0]=a:1===ka&&(Kb[1]=a),ka++})):a.type.indexOf("touch")>-1?a.touches&&a.touches.length>0&&(Kb[0]=Eb(a.touches[0],Ib),a.touches.length>1&&(Kb[1]=Eb(a.touches[1],Jb))):(Ib.x=a.pageX,Ib.y=a.pageY,Ib.id="",Kb[0]=Ib),Kb},Mb=function(a,b){var c,d,e,g,h=0,j=oa[a]+b[a],k=b[a]>0,l=sb.x+b.x,m=sb.x-mb.x;return c=j>ca.min[a]||jca.min[a]&&(c=i.panEndFriction,h=ca.min[a]-j,d=ca.min[a]-na[a]),(0>=d||0>m)&&_b()>1?(g=l,0>m&&l>mb.x&&(g=mb.x)):ca.min.x!==ca.max.x&&(e=j)):(j=d||m>0)&&_b()>1?(g=l,m>0&&lf.currItem.fitRatio&&(oa[a]+=b[a]*c)):(void 0!==g&&(Ja(g,!0),Z=g===mb.x?!1:!0),ca.min.x!==ca.max.x&&(void 0!==e?oa.x=e:Z||(oa.x+=b.x*c)),void 0!==g)},Nb=function(a){if(!("mousedown"===a.type&&a.button>0)){if(Zb)return void a.preventDefault();if(!T||"mousedown"!==a.type){if(Db(a,!0)&&a.preventDefault(),Ca("pointerDown"),F){var b=e.arraySearch(lb,a.pointerId,"id");0>b&&(b=lb.length),lb[b]={x:a.pageX,y:a.pageY,id:a.pointerId}}var c=Lb(a),d=c.length;$=null,bb(),U&&1!==d||(U=ga=!0,e.bind(window,p,f),R=ja=ha=S=Z=X=V=W=!1,fa=null,Ca("firstTouchStart",c),La(na,oa),ma.x=ma.y=0,La(jb,c[0]),La(kb,jb),mb.x=sa.x*qa,nb=[{x:jb.x,y:jb.y}],P=O=Da(),Ra(s,!0),yb(),zb()),!_&&d>1&&!ea&&!Z&&(t=s,W=!1,_=V=!0,ma.y=ma.x=0,La(na,oa),La(gb,c[0]),La(hb,c[1]),Fb(gb,hb,ub),tb.x=Math.abs(ub.x)-oa.x,tb.y=Math.abs(ub.y)-oa.y,aa=ba=xb(gb,hb))}}},Ob=function(a){if(a.preventDefault(),F){var b=e.arraySearch(lb,a.pointerId,"id");if(b>-1){var c=lb[b];c.x=a.pageX,c.y=a.pageY}}if(U){var d=Lb(a);if(fa||X||_)$=d;else if(sb.x!==sa.x*qa)fa="h";else{var f=Math.abs(d[0].x-jb.x)-Math.abs(d[0].y-jb.y);Math.abs(f)>=fb&&(fa=f>0?"h":"v",$=d)}}},Pb=function(){if($){var a=$.length;if(0!==a)if(La(gb,$[0]),ib.x=gb.x-jb.x,ib.y=gb.y-jb.y,_&&a>1){if(jb.x=gb.x,jb.y=gb.y,!ib.x&&!ib.y&&vb($[1],hb))return;La(hb,$[1]),W||(W=!0,Ca("zoomGestureStarted"));var b=xb(gb,hb),c=Ub(b);c>f.currItem.initialZoomLevel+f.currItem.initialZoomLevel/15&&(ja=!0);var d=1,e=Sa(),g=Ta();if(e>c)if(i.pinchToClose&&!ja&&t<=f.currItem.initialZoomLevel){var h=e-c,j=1-h/(e/1.2);Ea(j),Ca("onPinchClose",j),ha=!0}else d=(e-c)/e,d>1&&(d=1),c=e-d*(e/3);else c>g&&(d=(c-g)/(6*e),d>1&&(d=1),c=g+d*e);0>d&&(d=0),aa=b,Fb(gb,hb,qb),ma.x+=qb.x-ub.x,ma.y+=qb.y-ub.y,La(ub,qb),oa.x=Ka("x",c),oa.y=Ka("y",c),R=c>s,s=c,Ga()}else{if(!fa)return;if(ga&&(ga=!1,Math.abs(ib.x)>=fb&&(ib.x-=$[0].x-kb.x),Math.abs(ib.y)>=fb&&(ib.y-=$[0].y-kb.y)),jb.x=gb.x,jb.y=gb.y,0===ib.x&&0===ib.y)return;if("v"===fa&&i.closeOnVerticalDrag&&!Ab()){ma.y+=ib.y,oa.y+=ib.y;var k=Hb();return S=!0,Ca("onVerticalDrag",k),Ea(k),void Ga()}Gb(Da(),gb.x,gb.y),X=!0,ca=f.currItem.bounds;var l=Mb("x",ib);l||(Mb("y",ib),Ma(oa),Ga())}}},Qb=function(a){if(N.isOldAndroid){if(T&&"mouseup"===a.type)return;a.type.indexOf("touch")>-1&&(clearTimeout(T),T=setTimeout(function(){T=0},600))}Ca("pointerUp"),Db(a,!1)&&a.preventDefault();var b;if(F){var c=e.arraySearch(lb,a.pointerId,"id");if(c>-1)if(b=lb.splice(c,1)[0],navigator.pointerEnabled)b.type=a.pointerType||"mouse";else{var d={4:"mouse",2:"touch",3:"pen"};b.type=d[a.pointerType],b.type||(b.type=a.pointerType||"mouse")}}var g,h=Lb(a),j=h.length;if("mouseup"===a.type&&(j=0),2===j)return $=null,!0;1===j&&La(kb,h[0]),0!==j||fa||ea||(b||("mouseup"===a.type?b={x:a.pageX,y:a.pageY,type:"mouse"}:a.changedTouches&&a.changedTouches[0]&&(b={x:a.changedTouches[0].pageX,y:a.changedTouches[0].pageY,type:"touch"})),Ca("touchRelease",a,b));var k=-1;if(0===j&&(U=!1,e.unbind(window,p,f),yb(),_?k=0:-1!==rb&&(k=Da()-rb)),rb=1===j?Da():-1,g=-1!==k&&150>k?"zoom":"swipe",_&&2>j&&(_=!1,1===j&&(g="zoomPointerUp"),Ca("zoomGestureEnded")),$=null,X||W||ea||S)if(bb(),Q||(Q=Rb()),Q.calculateSwipeSpeed("x"),S){var l=Hb();if(lf.currItem.fitRatio&&Sb(Q))}},Rb=function(){var a,b,c={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(d){nb.length>1?(a=Da()-P+50,b=nb[nb.length-2][d]):(a=Da()-O,b=kb[d]),c.lastFlickOffset[d]=jb[d]-b,c.lastFlickDist[d]=Math.abs(c.lastFlickOffset[d]),c.lastFlickDist[d]>20?c.lastFlickSpeed[d]=c.lastFlickOffset[d]/a:c.lastFlickSpeed[d]=0,Math.abs(c.lastFlickSpeed[d])<.1&&(c.lastFlickSpeed[d]=0),c.slowDownRatio[d]=.95,c.slowDownRatioReverse[d]=1-c.slowDownRatio[d],c.speedDecelerationRatio[d]=1},calculateOverBoundsAnimOffset:function(a,b){c.backAnimStarted[a]||(oa[a]>ca.min[a]?c.backAnimDestination[a]=ca.min[a]:oa[a]eb&&(h||b.lastFlickOffset.x>20)?d=-1:-eb>g&&(h||b.lastFlickOffset.x<-20)&&(d=1)}var j;d&&(m+=d,0>m?(m=i.loop?_b()-1:0,j=!0):m>=_b()&&(m=i.loop?0:_b()-1,j=!0),(!j||i.loop)&&(ta+=d,qa-=d,c=!0));var k,l=sa.x*qa,n=Math.abs(l-sb.x);return c||l>sb.x==b.lastFlickSpeed.x>0?(k=Math.abs(b.lastFlickSpeed.x)>0?n/Math.abs(b.lastFlickSpeed.x):333,k=Math.min(k,400),k=Math.max(k,250)):k=333,pb===m&&(c=!1),ea=!0,Ca("mainScrollAnimStart"),cb("mainScroll",sb.x,l,k,e.easing.cubic.out,Ja,function(){bb(),ea=!1,pb=-1,(c||pb!==m)&&f.updateCurrItem(),Ca("mainScrollAnimComplete")}),c&&f.updateCurrItem(!0),c},Ub=function(a){return 1/ba*a*t},Vb=function(){var a=s,b=Sa(),c=Ta();b>s?a=b:s>c&&(a=c);var d,g=1,h=ia;return ha&&!R&&!ja&&b>s?(f.close(),!0):(ha&&(d=function(a){Ea((g-h)*a+h)}),f.zoomTo(a,0,200,e.easing.cubic.out,d),!0)};ya("Gestures",{publicMethods:{initGestures:function(){var a=function(a,b,c,d,e){A=a+b,B=a+c,C=a+d,D=e?a+e:""};F=N.pointerEvent,F&&N.touch&&(N.touch=!1),F?navigator.pointerEnabled?a("pointer","down","move","up","cancel"):a("MSPointer","Down","Move","Up","Cancel"):N.touch?(a("touch","start","move","end","cancel"),G=!0):a("mouse","down","move","up"),p=B+" "+C+" "+D,q=A,F&&!G&&(G=navigator.maxTouchPoints>1||navigator.msMaxTouchPoints>1),f.likelyTouchDevice=G,r[A]=Nb,r[B]=Ob,r[C]=Qb,D&&(r[D]=r[C]),N.touch&&(q+=" mousedown",p+=" mousemove mouseup",r.mousedown=r[A],r.mousemove=r[B],r.mouseup=r[C]),G||(i.allowPanToNext=!1)}}});var Wb,Xb,Yb,Zb,$b,_b,ac,bc=function(b,c,d,g){Wb&&clearTimeout(Wb),Zb=!0,Yb=!0;var h;b.initialLayout?(h=b.initialLayout,b.initialLayout=null):h=i.getThumbBoundsFn&&i.getThumbBoundsFn(m);var j=d?i.hideAnimationDuration:i.showAnimationDuration,k=function(){_a("initialZoom"),d?(f.template.removeAttribute("style"),f.bg.removeAttribute("style")):(Ea(1),c&&(c.style.display="block"),e.addClass(a,"pswp--animated-in"),Ca("initialZoom"+(d?"OutEnd":"InEnd"))),g&&g(),Zb=!1};if(!j||!h||void 0===h.x)return Ca("initialZoom"+(d?"Out":"In")),s=b.initialZoomLevel,La(oa,b.initialPosition),Ga(),a.style.opacity=d?0:1,Ea(1),void(j?setTimeout(function(){k()},j):k());var n=function(){var c=l,g=!f.currItem.src||f.currItem.loadError||i.showHideOpacity;b.miniImg&&(b.miniImg.style.webkitBackfaceVisibility="hidden"),d||(s=h.w/b.w,oa.x=h.x,oa.y=h.y-K,f[g?"template":"bg"].style.opacity=.001,Ga()),ab("initialZoom"),d&&!c&&e.removeClass(a,"pswp--animated-in"),g&&(d?e[(c?"remove":"add")+"Class"](a,"pswp--animate_opacity"):setTimeout(function(){e.addClass(a,"pswp--animate_opacity")},30)),Wb=setTimeout(function(){if(Ca("initialZoom"+(d?"Out":"In")),d){var f=h.w/b.w,i={x:oa.x,y:oa.y},l=s,m=ia,n=function(b){1===b?(s=f,oa.x=h.x,oa.y=h.y-M):(s=(f-l)*b+l,oa.x=(h.x-i.x)*b+i.x,oa.y=(h.y-M-i.y)*b+i.y),Ga(),g?a.style.opacity=1-b:Ea(m-b*m)};c?cb("initialZoom",0,1,j,e.easing.cubic.out,n,k):(n(1),Wb=setTimeout(k,j+20))}else s=b.initialZoomLevel,La(oa,b.initialPosition),Ga(),Ea(1),g?a.style.opacity=1:Ea(1),Wb=setTimeout(k,j+20)},d?25:90)};n()},cc={},dc=[],ec={index:0,errorMsg:'
The image could not be loaded.
',forceProgressiveLoading:!1,preload:[1,1],getNumItemsFn:function(){return Xb.length}},fc=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}}},gc=function(a,b,c){var d=a.bounds;d.center.x=Math.round((cc.x-b)/2),d.center.y=Math.round((cc.y-c)/2)+a.vGap.top,d.max.x=b>cc.x?Math.round(cc.x-b):d.center.x,d.max.y=c>cc.y?Math.round(cc.y-c)+a.vGap.top:d.center.y,d.min.x=b>cc.x?0:d.center.x,d.min.y=c>cc.y?a.vGap.top:d.center.y},hc=function(a,b,c){if(a.src&&!a.loadError){var d=!c;if(d&&(a.vGap||(a.vGap={top:0,bottom:0}),Ca("parseVerticalMargin",a)),cc.x=b.x,cc.y=b.y-a.vGap.top-a.vGap.bottom,d){var e=cc.x/a.w,f=cc.y/a.h;a.fitRatio=f>e?e:f;var g=i.scaleMode;"orig"===g?c=1:"fit"===g&&(c=a.fitRatio),c>1&&(c=1),a.initialZoomLevel=c,a.bounds||(a.bounds=fc())}if(!c)return;return gc(a,a.w*c,a.h*c),d&&c===a.initialZoomLevel&&(a.initialPosition=a.bounds.center),a.bounds}return a.w=a.h=0,a.initialZoomLevel=a.fitRatio=1,a.bounds=fc(),a.initialPosition=a.bounds.center,a.bounds},ic=function(a,b,c,d,e,g){b.loadError||d&&(b.imageAppended=!0,lc(b,d,b===f.currItem&&xa),c.appendChild(d),g&&setTimeout(function(){b&&b.loaded&&b.placeholder&&(b.placeholder.style.display="none",b.placeholder=null)},500))},jc=function(a){a.loading=!0,a.loaded=!1;var b=a.img=e.createEl("pswp__img","img"),c=function(){a.loading=!1,a.loaded=!0,a.loadComplete?a.loadComplete(a):a.img=null,b.onload=b.onerror=null,b=null};return b.onload=c,b.onerror=function(){a.loadError=!0,c()},b.src=a.src,b},kc=function(a,b){return a.src&&a.loadError&&a.container?(b&&(a.container.innerHTML=""),a.container.innerHTML=i.errorMsg.replace("%url%",a.src),!0):void 0},lc=function(a,b,c){if(a.src){b||(b=a.container.lastChild);var d=c?a.w:Math.round(a.w*a.fitRatio),e=c?a.h:Math.round(a.h*a.fitRatio);a.placeholder&&!a.loaded&&(a.placeholder.style.width=d+"px",a.placeholder.style.height=e+"px"),b.style.width=d+"px",b.style.height=e+"px"}},mc=function(){if(dc.length){for(var a,b=0;b=0,e=Math.min(c[0],_b()),g=Math.min(c[1],_b());for(b=1;(d?g:e)>=b;b++)f.lazyLoadItem(m+b);for(b=1;(d?e:g)>=b;b++)f.lazyLoadItem(m-b)}),Ba("initialLayout",function(){f.currItem.initialLayout=i.getThumbBoundsFn&&i.getThumbBoundsFn(m)}),Ba("mainScrollAnimComplete",mc),Ba("initialZoomInEnd",mc),Ba("destroy",function(){for(var a,b=0;b=0&&void 0!==Xb[a]?Xb[a]:!1},allowProgressiveImg:function(){return i.forceProgressiveLoading||!G||i.mouseUsed||screen.width>1200},setContent:function(a,b){i.loop&&(b=za(b));var c=f.getItemAt(a.index);c&&(c.container=null);var d,g=f.getItemAt(b);if(!g)return void(a.el.innerHTML="");Ca("gettingData",b,g),a.index=b,a.item=g;var h=g.container=e.createEl("pswp__zoom-wrap");if(!g.src&&g.html&&(g.html.tagName?h.appendChild(g.html):h.innerHTML=g.html),kc(g),hc(g,pa),!g.src||g.loadError||g.loaded)g.src&&!g.loadError&&(d=e.createEl("pswp__img","img"),d.style.opacity=1,d.src=g.src,lc(g,d),ic(b,g,h,d,!0));else{if(g.loadComplete=function(c){if(j){if(a&&a.index===b){if(kc(c,!0))return c.loadComplete=c.img=null,hc(c,pa),Ha(c),void(a.index===m&&f.updateCurrZoomItem());c.imageAppended?!Zb&&c.placeholder&&(c.placeholder.style.display="none",c.placeholder=null):N.transform&&(ea||Zb)?dc.push({item:c,baseDiv:h,img:c.img,index:b,holder:a,clearPlaceholder:!0}):ic(b,c,h,c.img,ea||Zb,!0)}c.loadComplete=null,c.img=null,Ca("imageLoadComplete",b,c)}},e.features.transform){var k="pswp__img pswp__img--placeholder";k+=g.msrc?"":" pswp__img--placeholder--blank";var l=e.createEl(k,g.msrc?"img":"");g.msrc&&(l.src=g.msrc),lc(g,l),h.appendChild(l),g.placeholder=l}g.loading||jc(g),f.allowProgressiveImg()&&(!Yb&&N.transform?dc.push({item:g,baseDiv:h,img:g.img,index:b,holder:a}):ic(b,g,h,g.img,!0,!0))}Yb||b!==m?Ha(g):(da=h.style,bc(g,d||g.img)),a.el.innerHTML="",a.el.appendChild(h)},cleanSlide:function(a){a.img&&(a.img.onload=a.img.onerror=null),a.loaded=a.loading=a.img=a.imageAppended=!1}}});var nc,oc={},pc=function(a,b,c){var d=document.createEvent("CustomEvent"),e={origEvent:a,target:a.target,releasePoint:b,pointerType:c||"touch"};d.initCustomEvent("pswpTap",!0,!0,e),a.target.dispatchEvent(d)};ya("Tap",{publicMethods:{initTap:function(){Ba("firstTouchStart",f.onTapStart),Ba("touchRelease",f.onTapRelease),Ba("destroy",function(){oc={},nc=null})},onTapStart:function(a){a.length>1&&(clearTimeout(nc),nc=null)},onTapRelease:function(a,b){if(b&&!X&&!V&&!$a){var c=b;if(nc&&(clearTimeout(nc),nc=null,wb(c,oc)))return void Ca("doubleTap",c);if("mouse"===b.type)return void pc(a,b,"mouse");var d=a.target.tagName.toUpperCase();if("BUTTON"===d||e.hasClass(a.target,"pswp__single-tap"))return void pc(a,b);La(oc,c),nc=setTimeout(function(){pc(a,b),nc=null},300)}}}});var qc;ya("DesktopZoom",{publicMethods:{initDesktopZoom:function(){L||(G?Ba("mouseUsed",function(){f.setupDesktopZoom()}):f.setupDesktopZoom(!0))},setupDesktopZoom:function(b){qc={};var c="wheel mousewheel DOMMouseScroll";Ba("bindEvents",function(){e.bind(a,c,f.handleMouseWheel)}),Ba("unbindEvents",function(){qc&&e.unbind(a,c,f.handleMouseWheel)}),f.mouseZoomedIn=!1;var d,g=function(){f.mouseZoomedIn&&(e.removeClass(a,"pswp--zoomed-in"),f.mouseZoomedIn=!1),1>s?e.addClass(a,"pswp--zoom-allowed"):e.removeClass(a,"pswp--zoom-allowed"),h()},h=function(){d&&(e.removeClass(a,"pswp--dragging"),d=!1)};Ba("resize",g),Ba("afterChange",g),Ba("pointerDown",function(){f.mouseZoomedIn&&(d=!0,e.addClass(a,"pswp--dragging"))}),Ba("pointerUp",h),b||g()},handleMouseWheel:function(a){if(s<=f.currItem.fitRatio)return i.modal&&(!i.closeOnScroll||$a||U?a.preventDefault():E&&Math.abs(a.deltaY)>2&&(l=!0,f.close())),!0;if(a.stopPropagation(),qc.x=0,"deltaX"in a)1===a.deltaMode?(qc.x=18*a.deltaX,qc.y=18*a.deltaY):(qc.x=a.deltaX,qc.y=a.deltaY);else if("wheelDelta"in a)a.wheelDeltaX&&(qc.x=-.16*a.wheelDeltaX),a.wheelDeltaY?qc.y=-.16*a.wheelDeltaY:qc.y=-.16*a.wheelDelta;else{if(!("detail"in a))return;qc.y=a.detail}Ra(s,!0);var b=oa.x-qc.x,c=oa.y-qc.y;(i.modal||b<=ca.min.x&&b>=ca.max.x&&c<=ca.min.y&&c>=ca.max.y)&&a.preventDefault(),f.panTo(b,c)},toggleDesktopZoom:function(b){b=b||{x:pa.x/2+ra.x,y:pa.y/2+ra.y};var c=i.getDoubleTapZoom(!0,f.currItem),d=s===c;f.mouseZoomedIn=!d,f.zoomTo(d?f.currItem.initialZoomLevel:c,b,333),e[(d?"remove":"add")+"Class"](a,"pswp--zoomed-in")}}});var rc,sc,tc,uc,vc,wc,xc,yc,zc,Ac,Bc,Cc,Dc={history:!0,galleryUID:1},Ec=function(){return Bc.hash.substring(1)},Fc=function(){rc&&clearTimeout(rc),tc&&clearTimeout(tc)},Gc=function(){var a=Ec(),b={};if(a.length<5)return b;var c,d=a.split("&");for(c=0;c-1&&(xc=xc.substring(0,b),"&"===xc.slice(-1)&&(xc=xc.slice(0,-1))),setTimeout(function(){j&&e.bind(window,"hashchange",f.onHashChange)},40)}},onHashChange:function(){return Ec()===xc?(zc=!0,void f.close()):void(uc||(vc=!0,f.goTo(Gc().pid),vc=!1))},updateURL:function(){Fc(),vc||(yc?rc=setTimeout(Hc,800):Hc())}}}),e.extend(f,db)};return a}); + +/** + * @module RD Navbar + * @author Evgeniy Gusarov + * @see https://ua.linkedin.com/pub/evgeniy-gusarov/8a/a40/54a + * @version 2.2.1 + * + **/ +(function(){var k="ontouchstart"in window;(function(c,n,h){var m=function(){function b(a,e){this.options=c.extend(!1,{},this.Defaults,e);this.$element=c(a);this.$clone=null;this.$win=c(h);this.$doc=c(n);this.currentLayout=this.options.layout;this.loaded=!1;this.focusOnHover=this.options.focusOnHover;this.isStuck=this.cloneTimer=this.focusTimer=!1;this.initialize()}b.prototype.Defaults={layout:"rd-navbar-static",deviceLayout:"rd-navbar-fixed",focusOnHover:!0,focusOnHoverTimeout:800,linkedElements:["html"], + domAppend:!0,stickUp:!0,stickUpClone:!0,stickUpOffset:"100%",anchorNavSpeed:400,anchorNavOffset:0,anchorNavEasing:"swing",autoHeight:!0,responsive:{0:{layout:"rd-navbar-fixed",deviceLayout:"rd-navbar-fixed",focusOnHover:!1,stickUp:!1},992:{layout:"rd-navbar-static",deviceLayout:"rd-navbar-static",focusOnHover:!0,stickUp:!0}},callbacks:{onToggleSwitch:!1,onToggleClose:!1,onDomAppend:!1,onDropdownOver:!1,onDropdownOut:!1,onDropdownToggle:!1,onDropdownClose:!1,onStuck:!1,onUnstuck:!1,onAnchorChange:!1}}; + b.prototype.initialize=function(){this.$element.addClass("rd-navbar").addClass(this.options.layout);k&&this.$element.addClass("rd-navbar--is-touch");this.setDataAPI(this);this.options.domAppend&&this.createNav(this);this.options.stickUpClone&&this.createClone(this);this.$element.addClass("rd-navbar-original");this.addAdditionalClassToToggles(".rd-navbar-original","toggle-original","toggle-original-elements");this.applyHandlers(this);this.offset=this.$element.offset().top;this.height=this.$element.outerHeight(); + this.loaded=!0;return this};b.prototype.resize=function(a,e){var f=k?a.getOption("deviceLayout"):a.getOption("layout");var d=a.$element.add(a.$clone);f===a.currentLayout&&a.loaded||(a.switchClass(d,a.currentLayout,f),null!=a.options.linkedElements&&c.grep(a.options.linkedElements,function(e,c){return a.switchClass(e,a.currentLayout+"-linked",f+"-linked")}),a.currentLayout=f);a.focusOnHover=a.getOption("focusOnHover");return a};b.prototype.stickUp=function(a,e){var f=a.getOption("stickUp");if(c("html").hasClass("ios")|| + a.$element.hasClass("rd-navbar-fixed"))f=!1;var d=a.$doc.scrollTop();var g=null!=a.$clone?a.$clone:a.$element;var b=a.getOption("stickUpOffset");b="string"===typeof b?0=b&&!a.isStuck||d=b&&!a.isStuck&&!a.$element.hasClass("rd-navbar-fixed"))"resize"=== + e.type?a.switchClass(g,"","rd-navbar--is-stuck"):g.addClass("rd-navbar--is-stuck"),a.isStuck=!0,a.options.callbacks.onStuck&&a.options.callbacks.onStuck.call(a);else{if("resize"===e.type)a.switchClass(g,"rd-navbar--is-stuck","");else g.removeClass("rd-navbar--is-stuck").one("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",c.proxy(a.resizeWrap,a,e));a.isStuck=!1;a.options.callbacks.onUnstuck&&a.options.callbacks.onUnstuck.call(a)}}else a.$element.find(".rd-navbar-submenu").removeClass("opened").removeClass("focus"), + a.isStuck&&(a.switchClass(g,"rd-navbar--is-stuck",""),a.isStuck=!1,a.resizeWrap(e));return a};b.prototype.resizeWrap=function(a){if(null==this.$clone&&!this.isStuck){var e=this.$element.parent();if(this.getOption("autoHeight"))return this.height=this.$element.outerHeight(),"resize"===a.type?(e.addClass("rd-navbar--no-transition").css("height",this.height),e[0].offsetHeight,e.removeClass("rd-navbar--no-transition")):e.css("height",this.height);e.css("height","auto")}};b.prototype.createNav=function(a){a.$element.find(".rd-navbar-dropdown, .rd-navbar-megamenu").each(function(){var a= + c(this);this.getBoundingClientRect();return a.hasClass("rd-navbar-megamenu")?a.parent().addClass("rd-navbar--has-megamenu"):a.parent().addClass("rd-navbar--has-dropdown")}).parents("li").addClass("rd-navbar-submenu");c('').insertAfter(".rd-navbar-nav li.rd-navbar-submenu > a");a.options.callbacks.onDomAppend&&a.options.callbacks.onDomAppend.call(this);return a};b.prototype.createClone=function(a){a.$clone=a.$element.clone().insertAfter(a.$element).addClass("rd-navbar--is-clone"); + a.addAdditionalClassToToggles(".rd-navbar--is-clone","toggle-cloned","toggle-cloned-elements");return a};b.prototype.closeToggle=function(a,e){var f=c(e.target);var d=!1;var g=this.getAttribute("data-rd-navbar-toggle");if(a.options.stickUpClone&&a.isStuck){var b=".toggle-cloned";var l=".toggle-cloned-elements";var h=!f.hasClass("toggle-cloned")}else b=".toggle-original",l=".toggle-original-elements",h=!f.hasClass("toggle-original");e.target!==this&&!f.parents(b+"[data-rd-navbar-toggle]").length&& + !f.parents(l).length&&g&&h&&(f=c(this).parents("body").find(g).add(c(this).parents(".rd-navbar")[0]),f.each(function(){if(!d)return d=!0===(e.target===this||c.contains(this,e.target))}),d||(f.add(this).removeClass("active"),a.options.callbacks.onToggleClose&&a.options.callbacks.onToggleClose.call(this,a)));return this};b.prototype.switchToggle=function(a,e){var f;e.preventDefault();if(c(this).hasClass("toggle-cloned")){var d=".rd-navbar--is-clone";var g=".toggle-cloned-elements"}else d=".rd-navbar-original", + g=".toggle-original-elements";if(f=this.getAttribute("data-rd-navbar-toggle"))c(d+" [data-rd-navbar-toggle]").not(this).each(function(){var a;if(a=this.getAttribute("data-rd-navbar-toggle"))return c(this).parents("body").find(d+" "+a+g).add(this).add(-1d-50){d=c('[data-type="anchor"]').last();if(d.length&&d.offset().top>=e){var g="#"+d.attr("id");var b=c('.rd-navbar-nav a[href^="'+g+'"]').parent();b.hasClass("active")||(b.addClass("active").siblings().removeClass("active"),this.options.callbacks.onAnchorChange&&this.options.callbacks.onAnchorChange.call(d[0],this))}return d}f=c('.rd-navbar-nav a[href^="#"]').get();for(b in f){d=f[b];var h=c(d);g=h.attr("href");d=c(g);d.length&&d.offset().top+a<=e&&d.offset().top+ + d.outerHeight()>e&&(h.parent().addClass("active").siblings().removeClass("active"),this.options.callbacks.onAnchorChange&&this.options.callbacks.onAnchorChange.call(d[0],this))}return null};b.prototype.getAnchor=function(){return history&&history.state?history.state.id:null};b.prototype.changeAnchor=function(a){history&&(history.state?history.state.id!==a?history.replaceState({anchorId:a},null,a):history.pushState({anchorId:a},null,a):history.pushState({anchorId:a},null,a));return this};b.prototype.applyHandlers= + function(a){null!=a.options.responsive&&a.$win.on("resize.navbar",c.proxy(a.resize,a.$win[0],a)).on("resize.navbar",c.proxy(a.resizeWrap,a)).on("resize.navbar",c.proxy(a.stickUp,null!=a.$clone?a.$clone:a.$element,a)).on("orientationchange.navbar",c.proxy(a.resize,a.$win[0],a)).trigger("resize.navbar");a.$doc.on("scroll.navbar",c.proxy(a.stickUp,null!=a.$clone?a.$clone:a.$element,a)).on("scroll.navbar",c.proxy(a.activateAnchor,a));a.$element.add(a.$clone).find("[data-rd-navbar-toggle]").each(function(){var e= + c(this);e.on("click",c.proxy(a.switchToggle,this,a));return e.parents("body").on("click",c.proxy(a.closeToggle,this,a))});a.$element.add(a.$clone).find(".rd-navbar-submenu").each(function(){var e=c(this);var f=e.parents(".rd-navbar--is-clone").length?a.cloneTimer:a.focusTimer;e.on("mouseleave.navbar",c.proxy(a.dropdownOut,this,a,f));e.find("> a").on("mouseenter.navbar",c.proxy(a.dropdownOver,this,a,f));e.find("> a").on("touchstart.navbar",c.proxy(a.dropdownTouch,this,a,f));e.find("> .rd-navbar-submenu-toggle").on("click", + c.proxy(a.dropdownToggle,this,a));return e.parents("body").on("click",c.proxy(a.dropdownClose,this,a))});a.$element.add(a.$clone).find('.rd-navbar-nav a[href^="#"]').each(function(){return c(this).on("click",c.proxy(a.goToAnchor,this,a))});a.$element.find(".rd-navbar-dropdown, .rd-navbar-megamenu").each(function(){var a=c(this);var f=this.getBoundingClientRect();f.left+a.outerWidth()>=h.innerWidth-10?this.className+=" rd-navbar-open-left":10>=f.left-a.outerWidth()&&(this.className+=" rd-navbar-open-right")}); + return a};b.prototype.switchClass=function(a,e,f){a=a instanceof jQuery?a:c(a);a.addClass("rd-navbar--no-transition").removeClass(e).addClass(f);a[0].offsetHeight;return a.removeClass("rd-navbar--no-transition")};b.prototype.setDataAPI=function(a){var c,f;a="- -xs- -sm- -md- -lg- -xl-".split(" ");var d=[0,480,768,992,1200,1800];var b=c=0;for(f=d.length;c'+t.text+""),o(i).click(function(){return o("html, body").stop().animate({scrollTop:0},t.scrollSpeed,t.easingType),!1}),o(window).scroll(function(){var n=o(window).scrollTop();"undefined"==typeof document.body.style.maxHeight&&o(i).css({position:"absolute",top:o(window).scrollTop()+o(window).height()-50}),n>t.min?o(i).stop(!0,!0).addClass("active"):o(i).removeClass("active")})}}(jQuery); +/** + * @module Bootstrap + * @author Twitter, Inc. + * @see http://getbootstrap.com + * @license MIT License + * @version v3.3.6 + */ +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); +/** + * @module RDInputLabel + * @author Evgeniy Gusarov + * @license MIT License + */ +(function(){!function(t,e,i){var s,n;return n=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isWebkit=/safari|chrome/i.test(navigator.userAgent),s=function(){function s(s,n){this.options=t.extend(!0,{},this.Defaults,n),this.$element=t(s).addClass("rd-input-label"),this.$target=t("#"+this.$element.attr("for")),this.$win=t(i),this.$doc=t(e),this.initialize()}return s.prototype.Defaults={callbacks:null},s.prototype.initialize=function(){return this.$target.on("input",t.proxy(this.change,this)).on("focus",t.proxy(this.focus,this)).on("blur",t.proxy(this.blur,this)).on("hover",t.proxy(this.hover,this)).parents("form").on("reset",t.proxy(this.reset,this)),this.change(),this.hover(),this},s.prototype.hover=function(){return isWebkit&&(this.$target.is(":-webkit-autofill")?this.$element.addClass("auto-fill"):this.$element.removeClass("auto-fill")),this},s.prototype.change=function(){return isWebkit&&(this.$target.is(":-webkit-autofill")?this.$element.addClass("auto-fill"):this.$element.removeClass("auto-fill")),""!==this.$target.val()?(this.$element.hasClass("focus")||this.focus(),this.$element.addClass("not-empty")):this.$element.removeClass("not-empty"),this},s.prototype.focus=function(){return this.$element.addClass("focus"),this},s.prototype.reset=function(){return setTimeout(t.proxy(this.blur,this)),this},s.prototype.blur=function(t){return""===this.$target.val()&&this.$element.removeClass("focus").removeClass("not-empty"),this},s}(),t.fn.extend({RDInputLabel:function(e){return this.each(function(){var i;return i=t(this),i.data("RDInputLabel")?void 0:i.data("RDInputLabel",new s(this,e))})}}),i.RDInputLabel=s}(window.jQuery,document,window),"undefined"!=typeof module&&null!==module?module.exports=window.RDInputLabel:"function"==typeof define&&define.amd&&define(["jquery"],function(){"use strict";return window.RDInputLabel})}).call(this); +/** + * @module RD-Google Map + * @author Evgeniy Gusarov + * @see https://ua.linkedin.com/pub/evgeniy-gusarov/8a/a40/54a + * @version 0.1.6 + */ +!function(e){var k={cntClass:"map",mapClass:"map_model",locationsClass:"map_locations",marker:{basic:"images/gmap_marker.png",active:"images/gmap_marker_active.png"},styles:[],onInit:!1},l={map:{x:-73.9924068,y:40.646197,zoom:14},locations:[]},m=function(f,b){var a=f.parent().find("."+b.locationsClass).find("li"),d=[];return 0":d[a].content=!1)}),d};e.fn.googleMap=function(f){f=e.extend(!0,{},k,f);e(this).each(function(){var b=e(this),a=e.extend(!0,{},l,{map:{x:b.data("x"),y:b.data("y"),zoom:b.data("zoom")},marker:{basic:b.data("marker"),active:b.data("marker-active")},locations:m(b,f)}),d=new google.maps.Map(this,{center:new google.maps.LatLng(parseFloat(a.map.y),parseFloat(a.map.x)),styles:f.styles,zoom:a.map.zoom, + scrollwheel:!1});f.onInit&&f.onInit.call(this,d);var h=new google.maps.InfoWindow,c=[],g;for(g in a.locations)c[g]=new google.maps.Marker({position:new google.maps.LatLng(parseFloat(a.locations[g].y),parseFloat(a.locations[g].x)),map:d,icon:a.locations[g].basic,index:g}),a.locations[g].content&&(google.maps.event.addListener(c[g],"click",function(){for(var b in c)c[b].setIcon(a.locations[b].basic);h.setContent(a.locations[this.index].content);h.open(d,this);e(".gm-style-iw").parent().parent().addClass("gm-wrapper"); + this.setIcon(a.locations[this.index].active)}),google.maps.event.addListener(h,"closeclick",function(){for(var b in c)c[b].setIcon(a.locations[b].basic)}));google.maps.event.addDomListener(window,"resize",function(){d.setCenter(new google.maps.LatLng(parseFloat(a.map.y),parseFloat(a.map.x)))})})}}(jQuery); +/** + * @module Materianize Parallax + * @see http://materializecss.com/parallax-demo.html + * @licesne MIT + */ +!function(i){i.fn.parallax=function(){var a=i(window).width();return this.each(function(t){function n(t){var n;n=a<601?r.height()>0?r.height():r.children("img").height():r.height()>0?r.height():500;var e=r.children("img").first(),l=e.height()-n,o=r.offset().top+n,h=r.offset().top,d=i(window).scrollTop(),s=window.innerHeight,c=(d+s-h)/(n+s),g=Math.round(l*c);t&&e.css("display","block"),o>d&&h
').find(".material-parallax");r.children("img").first().attr("src",r.parents("[data-parallax-img]").data("parallax-img")),r.children("img").one("load",function(){n(!0)}).each(function(){this.complete&&i(this).trigger("load")}),i(window).scroll(function(){a=i(window).width(),n(!1)}),i(window).resize(function(){a=i(window).width(),n(!1)})})}}(jQuery); + +/** + * @module Swiper 3.1.7 + * @description Most modern mobile touch slider and framework with hardware accelerated transitions + * @author Vladimir Kharlampidi + * @see http://www.idangero.us/swiper/ + * @licesne MIT License + */ +!function(){"use strict";function e(e){e.fn.swiper=function(a){var s;return e(this).each(function(){var e=new t(this,a);s||(s=e)}),s}}var a,t=function(e,s){function r(){return"horizontal"===v.params.direction}function i(e){return Math.floor(e)}function n(){v.autoplayTimeoutId=setTimeout(function(){v.params.loop?(v.fixLoop(),v._slideNext()):v.isEnd?s.autoplayStopOnLast?v.stopAutoplay():v._slideTo(0):v._slideNext()},v.params.autoplay)}function o(e,t){var s=a(e.target);if(!s.is(t))if("string"==typeof t)s=s.parents(t);else if(t.nodeType){var r;return s.parents().each(function(e,a){a===t&&(r=t)}),r?t:void 0}return 0===s.length?void 0:s[0]}function l(e,a){a=a||{};var t=window.MutationObserver||window.WebkitMutationObserver,s=new t(function(e){e.forEach(function(e){v.onResize(!0),v.emit("onObserverUpdate",v,e)})});s.observe(e,{attributes:"undefined"==typeof a.attributes?!0:a.attributes,childList:"undefined"==typeof a.childList?!0:a.childList,characterData:"undefined"==typeof a.characterData?!0:a.characterData}),v.observers.push(s)}function p(e){e.originalEvent&&(e=e.originalEvent);var a=e.keyCode||e.charCode;if(!v.params.allowSwipeToNext&&(r()&&39===a||!r()&&40===a))return!1;if(!v.params.allowSwipeToPrev&&(r()&&37===a||!r()&&38===a))return!1;if(!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||document.activeElement&&document.activeElement.nodeName&&("input"===document.activeElement.nodeName.toLowerCase()||"textarea"===document.activeElement.nodeName.toLowerCase()))){if(37===a||39===a||38===a||40===a){var t=!1;if(v.container.parents(".swiper-slide").length>0&&0===v.container.parents(".swiper-slide-active").length)return;var s={left:window.pageXOffset,top:window.pageYOffset},i=window.innerWidth,n=window.innerHeight,o=v.container.offset();v.rtl&&(o.left=o.left-v.container[0].scrollLeft);for(var l=[[o.left,o.top],[o.left+v.width,o.top],[o.left,o.top+v.height],[o.left+v.width,o.top+v.height]],p=0;p=s.left&&d[0]<=s.left+i&&d[1]>=s.top&&d[1]<=s.top+n&&(t=!0)}if(!t)return}r()?((37===a||39===a)&&(e.preventDefault?e.preventDefault():e.returnValue=!1),(39===a&&!v.rtl||37===a&&v.rtl)&&v.slideNext(),(37===a&&!v.rtl||39===a&&v.rtl)&&v.slidePrev()):((38===a||40===a)&&(e.preventDefault?e.preventDefault():e.returnValue=!1),40===a&&v.slideNext(),38===a&&v.slidePrev())}}function d(e){e.originalEvent&&(e=e.originalEvent);var a=v.mousewheel.event,t=0;if(e.detail)t=-e.detail;else if("mousewheel"===a)if(v.params.mousewheelForceToAxis)if(r()){if(!(Math.abs(e.wheelDeltaX)>Math.abs(e.wheelDeltaY)))return;t=e.wheelDeltaX}else{if(!(Math.abs(e.wheelDeltaY)>Math.abs(e.wheelDeltaX)))return;t=e.wheelDeltaY}else t=e.wheelDelta;else if("DOMMouseScroll"===a)t=-e.detail;else if("wheel"===a)if(v.params.mousewheelForceToAxis)if(r()){if(!(Math.abs(e.deltaX)>Math.abs(e.deltaY)))return;t=-e.deltaX}else{if(!(Math.abs(e.deltaY)>Math.abs(e.deltaX)))return;t=-e.deltaY}else t=Math.abs(e.deltaX)>Math.abs(e.deltaY)?-e.deltaX:-e.deltaY;if(v.params.mousewheelInvert&&(t=-t),v.params.freeMode){var s=v.getWrapperTranslate()+t*v.params.mousewheelSensitivity;if(s>v.minTranslate()&&(s=v.minTranslate()),s60)if(0>t)if(v.isEnd&&!v.params.loop||v.animating){if(v.params.mousewheelReleaseOnEdges)return!0}else v.slideNext();else if(v.isBeginning&&!v.params.loop||v.animating){if(v.params.mousewheelReleaseOnEdges)return!0}else v.slidePrev();v.mousewheel.lastScrollTime=(new window.Date).getTime()}return v.params.autoplay&&v.stopAutoplay(),e.preventDefault?e.preventDefault():e.returnValue=!1,!1}function c(e,t){e=a(e);var s,i,n;s=e.attr("data-swiper-parallax")||"0",i=e.attr("data-swiper-parallax-x"),n=e.attr("data-swiper-parallax-y"),i||n?(i=i||"0",n=n||"0"):r()?(i=s,n="0"):(n=s,i="0"),i=i.indexOf("%")>=0?parseInt(i,10)*t+"%":i*t+"px",n=n.indexOf("%")>=0?parseInt(n,10)*t+"%":n*t+"px",e.transform("translate3d("+i+", "+n+",0px)")}function u(e){return 0!==e.indexOf("on")&&(e=e[0]!==e[0].toUpperCase()?"on"+e[0].toUpperCase()+e.substring(1):"on"+e),e}if(!(this instanceof t))return new t(e,s);var m={direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,autoplay:!1,autoplayDisableOnInteraction:!0,iOSEdgeSwipeDetection:!1,iOSEdgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",coverflow:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0},cube:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94},fade:{crossFade:!1},parallax:!1,scrollbar:null,scrollbarHide:!0,scrollbarDraggable:!1,scrollbarSnapOnRelease:!1,keyboardControl:!1,mousewheelControl:!1,mousewheelReleaseOnEdges:!1,mousewheelInvert:!1,mousewheelForceToAxis:!1,mousewheelSensitivity:1,hashnav:!1,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,onlyExternal:!1,threshold:0,touchMoveStopPropagation:!0,pagination:null,paginationElement:"span",paginationClickable:!1,paginationHide:!1,paginationBulletRender:null,resistance:!0,resistanceRatio:.85,nextButton:null,prevButton:null,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,lazyLoading:!1,lazyLoadingInPrevNext:!1,lazyLoadingOnTransitionStart:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,control:void 0,controlInverse:!1,controlBy:"slide",allowSwipeToPrev:!0,allowSwipeToNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",buttonDisabledClass:"swiper-button-disabled",paginationHiddenClass:"swiper-pagination-hidden",observer:!1,observeParents:!1,a11y:!1,prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",runCallbacksOnInit:!0},f=s&&s.virtualTranslate;s=s||{};for(var h in m)if("undefined"==typeof s[h])s[h]=m[h];else if("object"==typeof s[h])for(var g in m[h])"undefined"==typeof s[h][g]&&(s[h][g]=m[h][g]);var v=this;if(v.params=s,v.classNames=[],"undefined"!=typeof a&&"undefined"!=typeof Dom7&&(a=Dom7),("undefined"!=typeof a||(a="undefined"==typeof Dom7?window.Dom7||window.Zepto||window.jQuery:Dom7))&&(v.$=a,v.container=a(e),0!==v.container.length)){if(v.container.length>1)return void v.container.each(function(){new t(this,s)});v.container[0].swiper=v,v.container.data("swiper",v),v.classNames.push("swiper-container-"+v.params.direction),v.params.freeMode&&v.classNames.push("swiper-container-free-mode"),v.support.flexbox||(v.classNames.push("swiper-container-no-flexbox"),v.params.slidesPerColumn=1),(v.params.parallax||v.params.watchSlidesVisibility)&&(v.params.watchSlidesProgress=!0),["cube","coverflow"].indexOf(v.params.effect)>=0&&(v.support.transforms3d?(v.params.watchSlidesProgress=!0,v.classNames.push("swiper-container-3d")):v.params.effect="slide"),"slide"!==v.params.effect&&v.classNames.push("swiper-container-"+v.params.effect),"cube"===v.params.effect&&(v.params.resistanceRatio=0,v.params.slidesPerView=1,v.params.slidesPerColumn=1,v.params.slidesPerGroup=1,v.params.centeredSlides=!1,v.params.spaceBetween=0,v.params.virtualTranslate=!0,v.params.setWrapperSize=!1),"fade"===v.params.effect&&(v.params.slidesPerView=1,v.params.slidesPerColumn=1,v.params.slidesPerGroup=1,v.params.watchSlidesProgress=!0,v.params.spaceBetween=0,"undefined"==typeof f&&(v.params.virtualTranslate=!0)),v.params.grabCursor&&v.support.touch&&(v.params.grabCursor=!1),v.wrapper=v.container.children("."+v.params.wrapperClass),v.params.pagination&&(v.paginationContainer=a(v.params.pagination),v.params.paginationClickable&&v.paginationContainer.addClass("swiper-pagination-clickable")),v.rtl=r()&&("rtl"===v.container[0].dir.toLowerCase()||"rtl"===v.container.css("direction")),v.rtl&&v.classNames.push("swiper-container-rtl"),v.rtl&&(v.wrongRTL="-webkit-box"===v.wrapper.css("display")),v.params.slidesPerColumn>1&&v.classNames.push("swiper-container-multirow"),v.device.android&&v.classNames.push("swiper-container-android"),v.container.addClass(v.classNames.join(" ")),v.translate=0,v.progress=0,v.velocity=0,v.lockSwipeToNext=function(){v.params.allowSwipeToNext=!1},v.lockSwipeToPrev=function(){v.params.allowSwipeToPrev=!1},v.lockSwipes=function(){v.params.allowSwipeToNext=v.params.allowSwipeToPrev=!1},v.unlockSwipeToNext=function(){v.params.allowSwipeToNext=!0},v.unlockSwipeToPrev=function(){v.params.allowSwipeToPrev=!0},v.unlockSwipes=function(){v.params.allowSwipeToNext=v.params.allowSwipeToPrev=!0},v.params.grabCursor&&(v.container[0].style.cursor="move",v.container[0].style.cursor="-webkit-grab",v.container[0].style.cursor="-moz-grab",v.container[0].style.cursor="grab"),v.imagesToLoad=[],v.imagesLoaded=0,v.loadImage=function(e,a,t,s,r){function i(){r&&r()}var n;e.complete&&s?i():a?(n=new window.Image,n.onload=i,n.onerror=i,t&&(n.srcset=t),a&&(n.src=a)):i()},v.preloadImages=function(){function e(){"undefined"!=typeof v&&null!==v&&(void 0!==v.imagesLoaded&&v.imagesLoaded++,v.imagesLoaded===v.imagesToLoad.length&&(v.params.updateOnImagesReady&&v.update(),v.emit("onImagesReady",v)))}v.imagesToLoad=v.container.find("img");for(var a=0;a=0&&(a=parseFloat(a.replace("%",""))/100*v.size),v.virtualSize=-a,v.slides.css(v.rtl?{marginLeft:"",marginTop:""}:{marginRight:"",marginBottom:""});var o;v.params.slidesPerColumn>1&&(o=Math.floor(v.slides.length/v.params.slidesPerColumn)===v.slides.length/v.params.slidesPerColumn?v.slides.length:Math.ceil(v.slides.length/v.params.slidesPerColumn)*v.params.slidesPerColumn,"auto"!==v.params.slidesPerView&&"row"===v.params.slidesPerColumnFill&&(o=Math.max(o,v.params.slidesPerView*v.params.slidesPerColumn)));var l,p=v.params.slidesPerColumn,d=o/p,c=d-(v.params.slidesPerColumn*d-v.slides.length);for(e=0;e1){var m,f,h;"column"===v.params.slidesPerColumnFill?(f=Math.floor(e/p),h=e-f*p,(f>c||f===c&&h===p-1)&&++h>=p&&(h=0,f++),m=f+h*o/p,u.css({"-webkit-box-ordinal-group":m,"-moz-box-ordinal-group":m,"-ms-flex-order":m,"-webkit-order":m,order:m})):(h=Math.floor(e/d),f=e-h*d),u.css({"margin-top":0!==h&&v.params.spaceBetween&&v.params.spaceBetween+"px"}).attr("data-swiper-column",f).attr("data-swiper-row",h)}"none"!==u.css("display")&&("auto"===v.params.slidesPerView?(l=r()?u.outerWidth(!0):u.outerHeight(!0),v.params.roundLengths&&(l=i(l))):(l=(v.size-(v.params.slidesPerView-1)*a)/v.params.slidesPerView,v.params.roundLengths&&(l=i(l)),r()?v.slides[e].style.width=l+"px":v.slides[e].style.height=l+"px"),v.slides[e].swiperSlideSize=l,v.slidesSizesGrid.push(l),v.params.centeredSlides?(t=t+l/2+s/2+a,0===e&&(t=t-v.size/2-a),Math.abs(t)<.001&&(t=0),n%v.params.slidesPerGroup===0&&v.snapGrid.push(t),v.slidesGrid.push(t)):(n%v.params.slidesPerGroup===0&&v.snapGrid.push(t),v.slidesGrid.push(t),t=t+l+a),v.virtualSize+=l+a,s=l,n++)}v.virtualSize=Math.max(v.virtualSize,v.size)+v.params.slidesOffsetAfter;var g;if(v.rtl&&v.wrongRTL&&("slide"===v.params.effect||"coverflow"===v.params.effect)&&v.wrapper.css({width:v.virtualSize+v.params.spaceBetween+"px"}),(!v.support.flexbox||v.params.setWrapperSize)&&v.wrapper.css(r()?{width:v.virtualSize+v.params.spaceBetween+"px"}:{height:v.virtualSize+v.params.spaceBetween+"px"}),v.params.slidesPerColumn>1&&(v.virtualSize=(l+v.params.spaceBetween)*o,v.virtualSize=Math.ceil(v.virtualSize/v.params.slidesPerColumn)-v.params.spaceBetween,v.wrapper.css({width:v.virtualSize+v.params.spaceBetween+"px"}),v.params.centeredSlides)){for(g=[],e=0;eMath.floor(v.snapGrid[v.snapGrid.length-1])&&v.snapGrid.push(v.virtualSize-v.size)}0===v.snapGrid.length&&(v.snapGrid=[0]),0!==v.params.spaceBetween&&v.slides.css(r()?v.rtl?{marginLeft:a+"px"}:{marginRight:a+"px"}:{marginBottom:a+"px"}),v.params.watchSlidesProgress&&v.updateSlidesOffset()},v.updateSlidesOffset=function(){for(var e=0;e=0&&n0&&o<=v.size||0>=n&&o>=v.size;l&&v.slides.eq(t).addClass(v.params.slideVisibleClass)}s.progress=v.rtl?-i:i}}},v.updateProgress=function(e){"undefined"==typeof e&&(e=v.translate||0);var a=v.maxTranslate()-v.minTranslate();0===a?(v.progress=0,v.isBeginning=v.isEnd=!0):(v.progress=(e-v.minTranslate())/a,v.isBeginning=v.progress<=0,v.isEnd=v.progress>=1),v.isBeginning&&v.emit("onReachBeginning",v),v.isEnd&&v.emit("onReachEnd",v),v.params.watchSlidesProgress&&v.updateSlidesProgress(e),v.emit("onProgress",v,v.progress)},v.updateActiveIndex=function(){var e,a,t,s=v.rtl?v.translate:-v.translate;for(a=0;a=v.slidesGrid[a]&&s=v.slidesGrid[a]&&s=v.slidesGrid[a]&&(e=a);(0>e||"undefined"==typeof e)&&(e=0),t=Math.floor(e/v.params.slidesPerGroup),t>=v.snapGrid.length&&(t=v.snapGrid.length-1),e!==v.activeIndex&&(v.snapIndex=t,v.previousIndex=v.activeIndex,v.activeIndex=e,v.updateClasses())},v.updateClasses=function(){v.slides.removeClass(v.params.slideActiveClass+" "+v.params.slideNextClass+" "+v.params.slidePrevClass);var e=v.slides.eq(v.activeIndex);if(e.addClass(v.params.slideActiveClass),e.next("."+v.params.slideClass).addClass(v.params.slideNextClass),e.prev("."+v.params.slideClass).addClass(v.params.slidePrevClass),v.bullets&&v.bullets.length>0){v.bullets.removeClass(v.params.bulletActiveClass);var t;v.params.loop?(t=Math.ceil(v.activeIndex-v.loopedSlides)/v.params.slidesPerGroup,t>v.slides.length-1-2*v.loopedSlides&&(t-=v.slides.length-2*v.loopedSlides),t>v.bullets.length-1&&(t-=v.bullets.length)):t="undefined"!=typeof v.snapIndex?v.snapIndex:v.activeIndex||0,v.paginationContainer.length>1?v.bullets.each(function(){a(this).index()===t&&a(this).addClass(v.params.bulletActiveClass)}):v.bullets.eq(t).addClass(v.params.bulletActiveClass)}v.params.loop||(v.params.prevButton&&(v.isBeginning?(a(v.params.prevButton).addClass(v.params.buttonDisabledClass),v.params.a11y&&v.a11y&&v.a11y.disable(a(v.params.prevButton))):(a(v.params.prevButton).removeClass(v.params.buttonDisabledClass),v.params.a11y&&v.a11y&&v.a11y.enable(a(v.params.prevButton)))),v.params.nextButton&&(v.isEnd?(a(v.params.nextButton).addClass(v.params.buttonDisabledClass),v.params.a11y&&v.a11y&&v.a11y.disable(a(v.params.nextButton))):(a(v.params.nextButton).removeClass(v.params.buttonDisabledClass),v.params.a11y&&v.a11y&&v.a11y.enable(a(v.params.nextButton)))))},v.updatePagination=function(){if(v.params.pagination&&v.paginationContainer&&v.paginationContainer.length>0){for(var e="",a=v.params.loop?Math.ceil((v.slides.length-2*v.loopedSlides)/v.params.slidesPerGroup):v.snapGrid.length,t=0;a>t;t++)e+=v.params.paginationBulletRender?v.params.paginationBulletRender(t,v.params.bulletClass):"<"+v.params.paginationElement+' class="'+v.params.bulletClass+'">";v.paginationContainer.html(e),v.bullets=v.paginationContainer.find("."+v.params.bulletClass),v.params.paginationClickable&&v.params.a11y&&v.a11y&&v.a11y.initPagination()}},v.update=function(e){function a(){s=Math.min(Math.max(v.translate,v.maxTranslate()),v.minTranslate()),v.setWrapperTranslate(s),v.updateActiveIndex(),v.updateClasses()}if(v.updateContainerSize(),v.updateSlidesSize(),v.updateProgress(),v.updatePagination(),v.updateClasses(),v.params.scrollbar&&v.scrollbar&&v.scrollbar.set(),e){var t,s;v.controller&&v.controller.spline&&(v.controller.spline=void 0),v.params.freeMode?a():(t=("auto"===v.params.slidesPerView||v.params.slidesPerView>1)&&v.isEnd&&!v.params.centeredSlides?v.slideTo(v.slides.length-1,0,!1,!0):v.slideTo(v.activeIndex,0,!1,!0),t||a())}},v.onResize=function(e){var a=v.params.allowSwipeToPrev,t=v.params.allowSwipeToNext;if(v.params.allowSwipeToPrev=v.params.allowSwipeToNext=!0,v.updateContainerSize(),v.updateSlidesSize(),("auto"===v.params.slidesPerView||v.params.freeMode||e)&&v.updatePagination(),v.params.scrollbar&&v.scrollbar&&v.scrollbar.set(),v.controller&&v.controller.spline&&(v.controller.spline=void 0),v.params.freeMode){var s=Math.min(Math.max(v.translate,v.maxTranslate()),v.minTranslate());v.setWrapperTranslate(s),v.updateActiveIndex(),v.updateClasses()}else v.updateClasses(),("auto"===v.params.slidesPerView||v.params.slidesPerView>1)&&v.isEnd&&!v.params.centeredSlides?v.slideTo(v.slides.length-1,0,!1,!0):v.slideTo(v.activeIndex,0,!1,!0);v.params.allowSwipeToPrev=a,v.params.allowSwipeToNext=t};var w=["mousedown","mousemove","mouseup"];window.navigator.pointerEnabled?w=["pointerdown","pointermove","pointerup"]:window.navigator.msPointerEnabled&&(w=["MSPointerDown","MSPointerMove","MSPointerUp"]),v.touchEvents={start:v.support.touch||!v.params.simulateTouch?"touchstart":w[0],move:v.support.touch||!v.params.simulateTouch?"touchmove":w[1],end:v.support.touch||!v.params.simulateTouch?"touchend":w[2]},(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&("container"===v.params.touchEventsTarget?v.container:v.wrapper).addClass("swiper-wp8-"+v.params.direction),v.initEvents=function(e){var t=e?"off":"on",r=e?"removeEventListener":"addEventListener",i="container"===v.params.touchEventsTarget?v.container[0]:v.wrapper[0],n=v.support.touch?i:document,o=v.params.nested?!0:!1;v.browser.ie?(i[r](v.touchEvents.start,v.onTouchStart,!1),n[r](v.touchEvents.move,v.onTouchMove,o),n[r](v.touchEvents.end,v.onTouchEnd,!1)):(v.support.touch&&(i[r](v.touchEvents.start,v.onTouchStart,!1),i[r](v.touchEvents.move,v.onTouchMove,o),i[r](v.touchEvents.end,v.onTouchEnd,!1)),!s.simulateTouch||v.device.ios||v.device.android||(i[r]("mousedown",v.onTouchStart,!1),document[r]("mousemove",v.onTouchMove,o),document[r]("mouseup",v.onTouchEnd,!1))),window[r]("resize",v.onResize),v.params.nextButton&&(a(v.params.nextButton)[t]("click",v.onClickNext),v.params.a11y&&v.a11y&&a(v.params.nextButton)[t]("keydown",v.a11y.onEnterKey)),v.params.prevButton&&(a(v.params.prevButton)[t]("click",v.onClickPrev),v.params.a11y&&v.a11y&&a(v.params.prevButton)[t]("keydown",v.a11y.onEnterKey)),v.params.pagination&&v.params.paginationClickable&&(a(v.paginationContainer)[t]("click","."+v.params.bulletClass,v.onClickIndex),v.params.a11y&&v.a11y&&a(v.paginationContainer)[t]("keydown","."+v.params.bulletClass,v.a11y.onEnterKey)),(v.params.preventClicks||v.params.preventClicksPropagation)&&i[r]("click",v.preventClicks,!0)},v.attachEvents=function(){v.initEvents()},v.detachEvents=function(){v.initEvents(!0)},v.allowClick=!0,v.preventClicks=function(e){v.allowClick||(v.params.preventClicks&&e.preventDefault(),v.params.preventClicksPropagation&&v.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))},v.onClickNext=function(e){e.preventDefault(),(!v.isEnd||v.params.loop)&&v.slideNext()},v.onClickPrev=function(e){e.preventDefault(),(!v.isBeginning||v.params.loop)&&v.slidePrev()},v.onClickIndex=function(e){e.preventDefault();var t=a(this).index()*v.params.slidesPerGroup;v.params.loop&&(t+=v.loopedSlides),v.slideTo(t)},v.updateClickedSlide=function(e){var t=o(e,"."+v.params.slideClass),s=!1;if(t)for(var r=0;rv.slides.length-v.loopedSlides+v.params.slidesPerView/2?(v.fixLoop(),n=v.wrapper.children("."+v.params.slideClass+'[data-swiper-slide-index="'+i+'"]:not(.swiper-slide-duplicate)').eq(0).index(),setTimeout(function(){v.slideTo(n)},0)):v.slideTo(n):n>v.slides.length-v.params.slidesPerView?(v.fixLoop(),n=v.wrapper.children("."+v.params.slideClass+'[data-swiper-slide-index="'+i+'"]:not(.swiper-slide-duplicate)').eq(0).index(),setTimeout(function(){v.slideTo(n)},0)):v.slideTo(n)}else v.slideTo(n)}};var b,y,x,T,S,C,M,P,z,I="input, select, textarea, button",E=Date.now(),k=[];v.animating=!1,v.touches={startX:0,startY:0,currentX:0,currentY:0,diff:0};var D,L;if(v.onTouchStart=function(e){if(e.originalEvent&&(e=e.originalEvent),D="touchstart"===e.type,D||!("which"in e)||3!==e.which){if(v.params.noSwiping&&o(e,"."+v.params.noSwipingClass))return void(v.allowClick=!0);if(!v.params.swipeHandler||o(e,v.params.swipeHandler)){var t=v.touches.currentX="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,s=v.touches.currentY="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY;if(!(v.device.ios&&v.params.iOSEdgeSwipeDetection&&t<=v.params.iOSEdgeSwipeThreshold)){if(b=!0,y=!1,T=void 0,L=void 0,v.touches.startX=t,v.touches.startY=s,x=Date.now(),v.allowClick=!0,v.updateContainerSize(),v.swipeDirection=void 0,v.params.threshold>0&&(M=!1),"touchstart"!==e.type){var r=!0;a(e.target).is(I)&&(r=!1),document.activeElement&&a(document.activeElement).is(I)&&document.activeElement.blur(),r&&e.preventDefault()}v.emit("onTouchStart",v,e)}}}},v.onTouchMove=function(e){if(e.originalEvent&&(e=e.originalEvent),!(D&&"mousemove"===e.type||e.preventedByNestedSwiper)){if(v.params.onlyExternal)return v.allowClick=!1,void(b&&(v.touches.startX=v.touches.currentX="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,v.touches.startY=v.touches.currentY="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,x=Date.now()));if(D&&document.activeElement&&e.target===document.activeElement&&a(e.target).is(I))return y=!0,void(v.allowClick=!1);if(v.emit("onTouchMove",v,e),!(e.targetTouches&&e.targetTouches.length>1)){if(v.touches.currentX="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,v.touches.currentY="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,"undefined"==typeof T){var t=180*Math.atan2(Math.abs(v.touches.currentY-v.touches.startY),Math.abs(v.touches.currentX-v.touches.startX))/Math.PI;T=r()?t>v.params.touchAngle:90-t>v.params.touchAngle}if(T&&v.emit("onTouchMoveOpposite",v,e),"undefined"==typeof L&&v.browser.ieTouch&&(v.touches.currentX!==v.touches.startX||v.touches.currentY!==v.touches.startY)&&(L=!0),b){if(T)return void(b=!1);if(L||!v.browser.ieTouch){v.allowClick=!1,v.emit("onSliderMove",v,e),e.preventDefault(),v.params.touchMoveStopPropagation&&!v.params.nested&&e.stopPropagation(),y||(s.loop&&v.fixLoop(),C=v.getWrapperTranslate(),v.setWrapperTransition(0),v.animating&&v.wrapper.trigger("webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd"),v.params.autoplay&&v.autoplaying&&(v.params.autoplayDisableOnInteraction?v.stopAutoplay():v.pauseAutoplay()),z=!1,v.params.grabCursor&&(v.container[0].style.cursor="move",v.container[0].style.cursor="-webkit-grabbing",v.container[0].style.cursor="-moz-grabbin",v.container[0].style.cursor="grabbing")),y=!0;var i=v.touches.diff=r()?v.touches.currentX-v.touches.startX:v.touches.currentY-v.touches.startY;i*=v.params.touchRatio,v.rtl&&(i=-i),v.swipeDirection=i>0?"prev":"next",S=i+C;var n=!0;if(i>0&&S>v.minTranslate()?(n=!1,v.params.resistance&&(S=v.minTranslate()-1+Math.pow(-v.minTranslate()+C+i,v.params.resistanceRatio))):0>i&&SS&&(S=C),!v.params.allowSwipeToPrev&&"prev"===v.swipeDirection&&S>C&&(S=C),v.params.followFinger){if(v.params.threshold>0){if(!(Math.abs(i)>v.params.threshold||M))return void(S=C);if(!M)return M=!0,v.touches.startX=v.touches.currentX,v.touches.startY=v.touches.currentY,S=C,void(v.touches.diff=r()?v.touches.currentX-v.touches.startX:v.touches.currentY-v.touches.startY)}(v.params.freeMode||v.params.watchSlidesProgress)&&v.updateActiveIndex(),v.params.freeMode&&(0===k.length&&k.push({position:v.touches[r()?"startX":"startY"],time:x}),k.push({position:v.touches[r()?"currentX":"currentY"],time:(new window.Date).getTime()})),v.updateProgress(S),v.setWrapperTranslate(S)}}}}}},v.onTouchEnd=function(e){if(e.originalEvent&&(e=e.originalEvent),v.emit("onTouchEnd",v,e),b){v.params.grabCursor&&y&&b&&(v.container[0].style.cursor="move",v.container[0].style.cursor="-webkit-grab",v.container[0].style.cursor="-moz-grab",v.container[0].style.cursor="grab");var t=Date.now(),s=t-x;if(v.allowClick&&(v.updateClickedSlide(e),v.emit("onTap",v,e),300>s&&t-E>300&&(P&&clearTimeout(P),P=setTimeout(function(){v&&(v.params.paginationHide&&v.paginationContainer.length>0&&!a(e.target).hasClass(v.params.bulletClass)&&v.paginationContainer.toggleClass(v.params.paginationHiddenClass),v.emit("onClick",v,e))},300)),300>s&&300>t-E&&(P&&clearTimeout(P),v.emit("onDoubleTap",v,e))),E=Date.now(),setTimeout(function(){v&&(v.allowClick=!0)},0),!b||!y||!v.swipeDirection||0===v.touches.diff||S===C)return void(b=y=!1);b=y=!1;var r;if(r=v.params.followFinger?v.rtl?v.translate:-v.translate:-S,v.params.freeMode){if(r<-v.minTranslate())return void v.slideTo(v.activeIndex);if(r>-v.maxTranslate())return void v.slideTo(v.slides.length1){var i=k.pop(),n=k.pop(),o=i.position-n.position,l=i.time-n.time;v.velocity=o/l,v.velocity=v.velocity/2,Math.abs(v.velocity)150||(new window.Date).getTime()-i.time>300)&&(v.velocity=0)}else v.velocity=0;k.length=0;var p=1e3*v.params.freeModeMomentumRatio,d=v.velocity*p,c=v.translate+d;v.rtl&&(c=-c);var u,m=!1,f=20*Math.abs(v.velocity)*v.params.freeModeMomentumBounceRatio;if(cv.minTranslate())v.params.freeModeMomentumBounce?(c-v.minTranslate()>f&&(c=v.minTranslate()+f),u=v.minTranslate(),m=!0,z=!0):c=v.minTranslate();else if(v.params.freeModeSticky){var h,g=0;for(g=0;g-c){h=g;break}c=Math.abs(v.snapGrid[h]-c)=v.params.longSwipesMs)&&(v.updateProgress(),v.updateActiveIndex()))}var w,T=0,M=v.slidesSizesGrid[0];for(w=0;w=v.slidesGrid[w]&&r=v.slidesGrid[w]&&(T=w,M=v.slidesGrid[v.slidesGrid.length-1]-v.slidesGrid[v.slidesGrid.length-2]);var I=(r-v.slidesGrid[T])/M;if(s>v.params.longSwipesMs){if(!v.params.longSwipes)return void v.slideTo(v.activeIndex);"next"===v.swipeDirection&&v.slideTo(I>=v.params.longSwipesRatio?T+v.params.slidesPerGroup:T),"prev"===v.swipeDirection&&v.slideTo(I>1-v.params.longSwipesRatio?T+v.params.slidesPerGroup:T)}else{if(!v.params.shortSwipes)return void v.slideTo(v.activeIndex);"next"===v.swipeDirection&&v.slideTo(T+v.params.slidesPerGroup),"prev"===v.swipeDirection&&v.slideTo(T)}}},v._slideTo=function(e,a){return v.slideTo(e,a,!0,!0)},v.slideTo=function(e,a,t,s){"undefined"==typeof t&&(t=!0),"undefined"==typeof e&&(e=0),0>e&&(e=0),v.snapIndex=Math.floor(e/v.params.slidesPerGroup),v.snapIndex>=v.snapGrid.length&&(v.snapIndex=v.snapGrid.length-1);var i=-v.snapGrid[v.snapIndex];v.params.autoplay&&v.autoplaying&&(s||!v.params.autoplayDisableOnInteraction?v.pauseAutoplay(a):v.stopAutoplay()),v.updateProgress(i);for(var n=0;n=Math.floor(100*v.slidesGrid[n])&&(e=n);if(!v.params.allowSwipeToNext&&iv.translate&&i>v.maxTranslate()&&(v.activeIndex||0)!==e)return!1; + if("undefined"==typeof a&&(a=v.params.speed),v.previousIndex=v.activeIndex||0,v.activeIndex=e,i===v.translate)return v.updateClasses(),!1;v.updateClasses(),v.onTransitionStart(t);r()?i:0,r()?0:i;return 0===a?(v.setWrapperTransition(0),v.setWrapperTranslate(i),v.onTransitionEnd(t)):(v.setWrapperTransition(a),v.setWrapperTranslate(i),v.animating||(v.animating=!0,v.wrapper.transitionEnd(function(){v&&v.onTransitionEnd(t)}))),!0},v.onTransitionStart=function(e){"undefined"==typeof e&&(e=!0),v.lazy&&v.lazy.onTransitionStart(),e&&(v.emit("onTransitionStart",v),v.activeIndex!==v.previousIndex&&v.emit("onSlideChangeStart",v))},v.onTransitionEnd=function(e){v.animating=!1,v.setWrapperTransition(0),"undefined"==typeof e&&(e=!0),v.lazy&&v.lazy.onTransitionEnd(),e&&(v.emit("onTransitionEnd",v),v.activeIndex!==v.previousIndex&&v.emit("onSlideChangeEnd",v)),v.params.hashnav&&v.hashnav&&v.hashnav.setHash()},v.slideNext=function(e,a,t){if(v.params.loop){if(v.animating)return!1;v.fixLoop();{v.container[0].clientLeft}return v.slideTo(v.activeIndex+v.params.slidesPerGroup,a,e,t)}return v.slideTo(v.activeIndex+v.params.slidesPerGroup,a,e,t)},v._slideNext=function(e){return v.slideNext(!0,e,!0)},v.slidePrev=function(e,a,t){if(v.params.loop){if(v.animating)return!1;v.fixLoop();{v.container[0].clientLeft}return v.slideTo(v.activeIndex-1,a,e,t)}return v.slideTo(v.activeIndex-1,a,e,t)},v._slidePrev=function(e){return v.slidePrev(!0,e,!0)},v.slideReset=function(e,a){return v.slideTo(v.activeIndex,a,e)},v.setWrapperTransition=function(e,a){v.wrapper.transition(e),"slide"!==v.params.effect&&v.effects[v.params.effect]&&v.effects[v.params.effect].setTransition(e),v.params.parallax&&v.parallax&&v.parallax.setTransition(e),v.params.scrollbar&&v.scrollbar&&v.scrollbar.setTransition(e),v.params.control&&v.controller&&v.controller.setTransition(e,a),v.emit("onSetTransition",v,e)},v.setWrapperTranslate=function(e,a,t){var s=0,n=0,o=0;r()?s=v.rtl?-e:e:n=e,v.params.roundLengths&&(s=i(s),n=i(n)),v.params.virtualTranslate||v.wrapper.transform(v.support.transforms3d?"translate3d("+s+"px, "+n+"px, "+o+"px)":"translate("+s+"px, "+n+"px)"),v.translate=r()?s:n,a&&v.updateActiveIndex(),"slide"!==v.params.effect&&v.effects[v.params.effect]&&v.effects[v.params.effect].setTranslate(v.translate),v.params.parallax&&v.parallax&&v.parallax.setTranslate(v.translate),v.params.scrollbar&&v.scrollbar&&v.scrollbar.setTranslate(v.translate),v.params.control&&v.controller&&v.controller.setTranslate(v.translate,t),v.emit("onSetTranslate",v,v.translate)},v.getTranslate=function(e,a){var t,s,r,i;return"undefined"==typeof a&&(a="x"),v.params.virtualTranslate?v.rtl?-v.translate:v.translate:(r=window.getComputedStyle(e,null),window.WebKitCSSMatrix?(s=r.transform||r.webkitTransform,s.split(",").length>6&&(s=s.split(", ").map(function(e){return e.replace(",",".")}).join(", ")),i=new window.WebKitCSSMatrix("none"===s?"":s)):(i=r.MozTransform||r.OTransform||r.MsTransform||r.msTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),t=i.toString().split(",")),"x"===a&&(s=window.WebKitCSSMatrix?i.m41:parseFloat(16===t.length?t[12]:t[4])),"y"===a&&(s=window.WebKitCSSMatrix?i.m42:parseFloat(16===t.length?t[13]:t[5])),v.rtl&&s&&(s=-s),s||0)},v.getWrapperTranslate=function(e){return"undefined"==typeof e&&(e=r()?"x":"y"),v.getTranslate(v.wrapper[0],e)},v.observers=[],v.initObservers=function(){if(v.params.observeParents)for(var e=v.container.parents(),a=0;ae.length&&(v.loopedSlides=e.length);var t,s=[],r=[];for(e.each(function(t,i){var n=a(this);t=e.length-v.loopedSlides&&s.push(i),n.attr("data-swiper-slide-index",t)}),t=0;t=0;t--)v.wrapper.prepend(a(s[t].cloneNode(!0)).addClass(v.params.slideDuplicateClass))},v.destroyLoop=function(){v.wrapper.children("."+v.params.slideClass+"."+v.params.slideDuplicateClass).remove(),v.slides.removeAttr("data-swiper-slide-index")},v.fixLoop=function(){var e;v.activeIndex=2*v.loopedSlides||v.activeIndex>v.slides.length-2*v.params.slidesPerView)&&(e=-v.slides.length+v.activeIndex+v.loopedSlides,e+=v.loopedSlides,v.slideTo(e,0,!1,!0))},v.appendSlide=function(e){if(v.params.loop&&v.destroyLoop(),"object"==typeof e&&e.length)for(var a=0;aa&&t--;t=Math.max(t,0)}else a=e,v.slides[a]&&v.slides.eq(a).remove(),t>a&&t--,t=Math.max(t,0);v.params.loop&&v.createLoop(),v.params.observer&&v.support.observer||v.update(!0),v.params.loop?v.slideTo(t+v.loopedSlides,0,!1):v.slideTo(t,0,!1)},v.removeAllSlides=function(){for(var e=[],a=0;a
'),v.wrapper.append(e)),e.css({height:v.width+"px"})):(e=v.container.find(".swiper-cube-shadow"),0===e.length&&(e=a('
'),v.container.append(e))));for(var s=0;s=l&&l>-1&&(t=90*s+90*l,v.rtl&&(t=90*-s-90*l)),i.transform(u),v.params.cube.slideShadows){var m=i.find(r()?".swiper-slide-shadow-left":".swiper-slide-shadow-top"),f=i.find(r()?".swiper-slide-shadow-right":".swiper-slide-shadow-bottom");0===m.length&&(m=a('
'),i.append(m)),0===f.length&&(f=a('
'),i.append(f));{i[0].progress}m.length&&(m[0].style.opacity=-i[0].progress),f.length&&(f[0].style.opacity=i[0].progress)}}if(v.wrapper.css({"-webkit-transform-origin":"50% 50% -"+v.size/2+"px","-moz-transform-origin":"50% 50% -"+v.size/2+"px","-ms-transform-origin":"50% 50% -"+v.size/2+"px","transform-origin":"50% 50% -"+v.size/2+"px"}),v.params.cube.shadow)if(r())e.transform("translate3d(0px, "+(v.width/2+v.params.cube.shadowOffset)+"px, "+-v.width/2+"px) rotateX(90deg) rotateZ(0deg) scale("+v.params.cube.shadowScale+")");else{var h=Math.abs(t)-90*Math.floor(Math.abs(t)/90),g=1.5-(Math.sin(2*h*Math.PI/360)/2+Math.cos(2*h*Math.PI/360)/2),w=v.params.cube.shadowScale,b=v.params.cube.shadowScale/g,y=v.params.cube.shadowOffset;e.transform("scale3d("+w+", 1, "+b+") translate3d(0px, "+(v.height/2+y)+"px, "+-v.height/2/b+"px) rotateX(-90deg)")}var x=v.isSafari||v.isUiWebView?-v.size/2:0;v.wrapper.transform("translate3d(0px,0,"+x+"px) rotateX("+(r()?0:t)+"deg) rotateY("+(r()?-t:0)+"deg)")},setTransition:function(e){v.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),v.params.cube.shadow&&!r()&&v.container.find(".swiper-cube-shadow").transition(e)}},coverflow:{setTranslate:function(){for(var e=v.translate,t=r()?-e+v.width/2:-e+v.height/2,s=r()?v.params.coverflow.rotate:-v.params.coverflow.rotate,i=v.params.coverflow.depth,n=0,o=v.slides.length;o>n;n++){var l=v.slides.eq(n),p=v.slidesSizesGrid[n],d=l[0].swiperSlideOffset,c=(t-d-p/2)/p*v.params.coverflow.modifier,u=r()?s*c:0,m=r()?0:s*c,f=-i*Math.abs(c),h=r()?0:v.params.coverflow.stretch*c,g=r()?v.params.coverflow.stretch*c:0;Math.abs(g)<.001&&(g=0),Math.abs(h)<.001&&(h=0),Math.abs(f)<.001&&(f=0),Math.abs(u)<.001&&(u=0),Math.abs(m)<.001&&(m=0);var w="translate3d("+g+"px,"+h+"px,"+f+"px) rotateX("+m+"deg) rotateY("+u+"deg)";if(l.transform(w),l[0].style.zIndex=-Math.abs(Math.round(c))+1,v.params.coverflow.slideShadows){var b=l.find(r()?".swiper-slide-shadow-left":".swiper-slide-shadow-top"),y=l.find(r()?".swiper-slide-shadow-right":".swiper-slide-shadow-bottom");0===b.length&&(b=a('
'),l.append(b)),0===y.length&&(y=a('
'),l.append(y)),b.length&&(b[0].style.opacity=c>0?c:0),y.length&&(y[0].style.opacity=-c>0?-c:0)}}if(v.browser.ie){var x=v.wrapper[0].style;x.perspectiveOrigin=t+"px 50%"}},setTransition:function(e){v.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e)}}},v.lazy={initialImageLoaded:!1,loadImageInSlide:function(e,t){if("undefined"!=typeof e&&("undefined"==typeof t&&(t=!0),0!==v.slides.length)){var s=v.slides.eq(e),r=s.find(".swiper-lazy:not(.swiper-lazy-loaded):not(.swiper-lazy-loading)");!s.hasClass("swiper-lazy")||s.hasClass("swiper-lazy-loaded")||s.hasClass("swiper-lazy-loading")||(r=r.add(s[0])),0!==r.length&&r.each(function(){var e=a(this);e.addClass("swiper-lazy-loading");var r=e.attr("data-background"),i=e.attr("data-src"),n=e.attr("data-srcset");v.loadImage(e[0],i||r,n,!1,function(){if(r?(e.css("background-image","url("+r+")"),e.removeAttr("data-background")):(n&&(e.attr("srcset",n),e.removeAttr("data-srcset")),i&&(e.attr("src",i),e.removeAttr("data-src"))),e.addClass("swiper-lazy-loaded").removeClass("swiper-lazy-loading"),s.find(".swiper-lazy-preloader, .preloader").remove(),v.params.loop&&t){var a=s.attr("data-swiper-slide-index");if(s.hasClass(v.params.slideDuplicateClass)){var o=v.wrapper.children('[data-swiper-slide-index="'+a+'"]:not(.'+v.params.slideDuplicateClass+")");v.lazy.loadImageInSlide(o.index(),!1)}else{var l=v.wrapper.children("."+v.params.slideDuplicateClass+'[data-swiper-slide-index="'+a+'"]');v.lazy.loadImageInSlide(l.index(),!1)}}v.emit("onLazyImageReady",v,s[0],e[0])}),v.emit("onLazyImageLoad",v,s[0],e[0])})}},load:function(){var e;if(v.params.watchSlidesVisibility)v.wrapper.children("."+v.params.slideVisibleClass).each(function(){v.lazy.loadImageInSlide(a(this).index())});else if(v.params.slidesPerView>1)for(e=v.activeIndex;e1){for(e=v.activeIndex+v.params.slidesPerView;e0&&v.lazy.loadImageInSlide(t.index());var s=v.wrapper.children("."+v.params.slidePrevClass);s.length>0&&v.lazy.loadImageInSlide(s.index())}},onTransitionStart:function(){v.params.lazyLoading&&(v.params.lazyLoadingOnTransitionStart||!v.params.lazyLoadingOnTransitionStart&&!v.lazy.initialImageLoaded)&&v.lazy.load()},onTransitionEnd:function(){v.params.lazyLoading&&!v.params.lazyLoadingOnTransitionStart&&v.lazy.load()}},v.scrollbar={isTouched:!1,setDragPosition:function(e){var a=v.scrollbar,t=r()?"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageX:e.pageX||e.clientX:"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageY:e.pageY||e.clientY,s=t-a.track.offset()[r()?"left":"top"]-a.dragSize/2,i=-v.minTranslate()*a.moveDivider,n=-v.maxTranslate()*a.moveDivider;i>s?s=i:s>n&&(s=n),s=-s/a.moveDivider,v.updateProgress(s),v.setWrapperTranslate(s,!0)},dragStart:function(e){var a=v.scrollbar;a.isTouched=!0,e.preventDefault(),e.stopPropagation(),a.setDragPosition(e),clearTimeout(a.dragTimeout),a.track.transition(0),v.params.scrollbarHide&&a.track.css("opacity",1),v.wrapper.transition(100),a.drag.transition(100),v.emit("onScrollbarDragStart",v)},dragMove:function(e){var a=v.scrollbar;a.isTouched&&(e.preventDefault?e.preventDefault():e.returnValue=!1,a.setDragPosition(e),v.wrapper.transition(0),a.track.transition(0),a.drag.transition(0),v.emit("onScrollbarDragMove",v))},dragEnd:function(){var e=v.scrollbar;e.isTouched&&(e.isTouched=!1,v.params.scrollbarHide&&(clearTimeout(e.dragTimeout),e.dragTimeout=setTimeout(function(){e.track.css("opacity",0),e.track.transition(400)},1e3)),v.emit("onScrollbarDragEnd",v),v.params.scrollbarSnapOnRelease&&v.slideReset())},enableDraggable:function(){var e=v.scrollbar,t=v.support.touch?e.track:document;a(e.track).on(v.touchEvents.start,e.dragStart),a(t).on(v.touchEvents.move,e.dragMove),a(t).on(v.touchEvents.end,e.dragEnd)},disableDraggable:function(){var e=v.scrollbar,t=v.support.touch?e.track:document;a(e.track).off(v.touchEvents.start,e.dragStart),a(t).off(v.touchEvents.move,e.dragMove),a(t).off(v.touchEvents.end,e.dragEnd)},set:function(){if(v.params.scrollbar){var e=v.scrollbar;e.track=a(v.params.scrollbar),e.drag=e.track.find(".swiper-scrollbar-drag"),0===e.drag.length&&(e.drag=a('
'),e.track.append(e.drag)),e.drag[0].style.width="",e.drag[0].style.height="",e.trackSize=r()?e.track[0].offsetWidth:e.track[0].offsetHeight,e.divider=v.size/v.virtualSize,e.moveDivider=e.divider*(e.trackSize/v.size),e.dragSize=e.trackSize*e.divider,r()?e.drag[0].style.width=e.dragSize+"px":e.drag[0].style.height=e.dragSize+"px",e.track[0].style.display=e.divider>=1?"none":"",v.params.scrollbarHide&&(e.track[0].style.opacity=0)}},setTranslate:function(){if(v.params.scrollbar){var e,a=v.scrollbar,t=(v.translate||0,a.dragSize);e=(a.trackSize-a.dragSize)*v.progress,v.rtl&&r()?(e=-e,e>0?(t=a.dragSize-e,e=0):-e+a.dragSize>a.trackSize&&(t=a.trackSize+e)):0>e?(t=a.dragSize+e,e=0):e+a.dragSize>a.trackSize&&(t=a.trackSize-e),r()?(a.drag.transform(v.support.transforms3d?"translate3d("+e+"px, 0, 0)":"translateX("+e+"px)"),a.drag[0].style.width=t+"px"):(a.drag.transform(v.support.transforms3d?"translate3d(0px, "+e+"px, 0)":"translateY("+e+"px)"),a.drag[0].style.height=t+"px"),v.params.scrollbarHide&&(clearTimeout(a.timeout),a.track[0].style.opacity=1,a.timeout=setTimeout(function(){a.track[0].style.opacity=0,a.track.transition(400)},1e3))}},setTransition:function(e){v.params.scrollbar&&v.scrollbar.drag.transition(e)}},v.controller={LinearSpline:function(e,a){this.x=e,this.y=a,this.lastIndex=e.length-1;{var t,s;this.x.length}this.interpolate=function(e){return e?(s=r(this.x,e),t=s-1,(e-this.x[t])*(this.y[s]-this.y[t])/(this.x[s]-this.x[t])+this.y[t]):0};var r=function(){var e,a,t;return function(s,r){for(a=-1,e=s.length;e-a>1;)s[t=e+a>>1]<=r?a=t:e=t;return e}}()},getInterpolateFunction:function(e){v.controller.spline||(v.controller.spline=v.params.loop?new v.controller.LinearSpline(v.slidesGrid,e.slidesGrid):new v.controller.LinearSpline(v.snapGrid,e.snapGrid))},setTranslate:function(e,a){function s(a){e=a.rtl&&"horizontal"===a.params.direction?-v.translate:v.translate,"slide"===v.params.controlBy&&(v.controller.getInterpolateFunction(a),i=-v.controller.spline.interpolate(-e)),i&&"container"!==v.params.controlBy||(r=(a.maxTranslate()-a.minTranslate())/(v.maxTranslate()-v.minTranslate()),i=(e-v.minTranslate())*r+a.minTranslate()),v.params.controlInverse&&(i=a.maxTranslate()-i),a.updateProgress(i),a.setWrapperTranslate(i,!1,v),a.updateActiveIndex()}var r,i,n=v.params.control;if(v.isArray(n))for(var o=0;ot;t++){var r=v.slides.eq(t),i=r.attr("data-hash");if(i===e&&!r.hasClass(v.params.slideDuplicateClass)){var n=r.index();v.slideTo(n,a,v.params.runCallbacksOnInit,!0)}}}},setHash:function(){v.hashnav.initialized&&v.params.hashnav&&(document.location.hash=v.slides.eq(v.activeIndex).attr("data-hash")||"")}},v.disableKeyboardControl=function(){a(document).off("keydown",p)},v.enableKeyboardControl=function(){a(document).on("keydown",p)},v.mousewheel={event:!1,lastScrollTime:(new window.Date).getTime()},v.params.mousewheelControl){try{new window.WheelEvent("wheel"),v.mousewheel.event="wheel"}catch(G){}v.mousewheel.event||void 0===document.onmousewheel||(v.mousewheel.event="mousewheel"),v.mousewheel.event||(v.mousewheel.event="DOMMouseScroll")}v.disableMousewheelControl=function(){return v.mousewheel.event?(v.container.off(v.mousewheel.event,d),!0):!1},v.enableMousewheelControl=function(){return v.mousewheel.event?(v.container.on(v.mousewheel.event,d),!0):!1},v.parallax={setTranslate:function(){v.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){c(this,v.progress)}),v.slides.each(function(){var e=a(this);e.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var a=Math.min(Math.max(e[0].progress,-1),1);c(this,a)})})},setTransition:function(e){"undefined"==typeof e&&(e=v.params.speed),v.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var t=a(this),s=parseInt(t.attr("data-swiper-parallax-duration"),10)||e;0===e&&(s=0),t.transition(s)})}},v._plugins=[];for(var B in v.plugins){var O=v.plugins[B](v,v.params[B]);O&&v._plugins.push(O)}return v.callPlugins=function(e){for(var a=0;a
'),notify:function(e){var a=v.a11y.liveRegion;0!==a.length&&(a.html(""),a.html(e))},init:function(){if(v.params.nextButton){var e=a(v.params.nextButton);v.a11y.makeFocusable(e),v.a11y.addRole(e,"button"),v.a11y.addLabel(e,v.params.nextSlideMessage)}if(v.params.prevButton){var t=a(v.params.prevButton);v.a11y.makeFocusable(t),v.a11y.addRole(t,"button"),v.a11y.addLabel(t,v.params.prevSlideMessage)}a(v.container).append(v.a11y.liveRegion)},initPagination:function(){v.params.pagination&&v.params.paginationClickable&&v.bullets&&v.bullets.length&&v.bullets.each(function(){var e=a(this);v.a11y.makeFocusable(e),v.a11y.addRole(e,"button"),v.a11y.addLabel(e,v.params.paginationBulletMessage.replace(/{{index}}/,e.index()+1))})},destroy:function(){v.a11y.liveRegion&&v.a11y.liveRegion.length>0&&v.a11y.liveRegion.remove()}},v.init=function(){v.params.loop&&v.createLoop(),v.updateContainerSize(),v.updateSlidesSize(),v.updatePagination(),v.params.scrollbar&&v.scrollbar&&(v.scrollbar.set(),v.params.scrollbarDraggable&&v.scrollbar.enableDraggable()),"slide"!==v.params.effect&&v.effects[v.params.effect]&&(v.params.loop||v.updateProgress(),v.effects[v.params.effect].setTranslate()),v.params.loop?v.slideTo(v.params.initialSlide+v.loopedSlides,0,v.params.runCallbacksOnInit):(v.slideTo(v.params.initialSlide,0,v.params.runCallbacksOnInit),0===v.params.initialSlide&&(v.parallax&&v.params.parallax&&v.parallax.setTranslate(),v.lazy&&v.params.lazyLoading&&(v.lazy.load(),v.lazy.initialImageLoaded=!0))),v.attachEvents(),v.params.observer&&v.support.observer&&v.initObservers(),v.params.preloadImages&&!v.params.lazyLoading&&v.preloadImages(),v.params.autoplay&&v.startAutoplay(),v.params.keyboardControl&&v.enableKeyboardControl&&v.enableKeyboardControl(),v.params.mousewheelControl&&v.enableMousewheelControl&&v.enableMousewheelControl(),v.params.hashnav&&v.hashnav&&v.hashnav.init(),v.params.a11y&&v.a11y&&v.a11y.init(),v.emit("onInit",v)},v.cleanupStyles=function(){v.container.removeClass(v.classNames.join(" ")).removeAttr("style"),v.wrapper.removeAttr("style"),v.slides&&v.slides.length&&v.slides.removeClass([v.params.slideVisibleClass,v.params.slideActiveClass,v.params.slideNextClass,v.params.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-column").removeAttr("data-swiper-row"),v.paginationContainer&&v.paginationContainer.length&&v.paginationContainer.removeClass(v.params.paginationHiddenClass),v.bullets&&v.bullets.length&&v.bullets.removeClass(v.params.bulletActiveClass),v.params.prevButton&&a(v.params.prevButton).removeClass(v.params.buttonDisabledClass),v.params.nextButton&&a(v.params.nextButton).removeClass(v.params.buttonDisabledClass),v.params.scrollbar&&v.scrollbar&&(v.scrollbar.track&&v.scrollbar.track.length&&v.scrollbar.track.removeAttr("style"),v.scrollbar.drag&&v.scrollbar.drag.length&&v.scrollbar.drag.removeAttr("style"))},v.destroy=function(e,a){v.detachEvents(),v.stopAutoplay(),v.params.scrollbar&&v.scrollbar&&v.params.scrollbarDraggable&&v.scrollbar.disableDraggable(),v.params.loop&&v.destroyLoop(),a&&v.cleanupStyles(),v.disconnectObservers(),v.params.keyboardControl&&v.disableKeyboardControl&&v.disableKeyboardControl(),v.params.mousewheelControl&&v.disableMousewheelControl&&v.disableMousewheelControl(),v.params.a11y&&v.a11y&&v.a11y.destroy(),v.emit("onDestroy"),e!==!1&&(v=null)},v.init(),v}};t.prototype={isSafari:function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0}(),isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},browser:{ie:window.navigator.pointerEnabled||window.navigator.msPointerEnabled,ieTouch:window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>1||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>1},device:function(){var e=navigator.userAgent,a=e.match(/(Android);?[\s\/]+([\d.]+)?/),t=e.match(/(iPad).*OS\s([\d_]+)/),s=e.match(/(iPod)(.*OS\s([\d_]+))?/),r=!t&&e.match(/(iPhone\sOS)\s([\d_]+)/);return{ios:t||r||s,android:a}}(),support:{touch:window.Modernizr&&Modernizr.touch===!0||function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0||function(){var e=document.createElement("div").style;return"webkitPerspective"in e||"MozPerspective"in e||"OPerspective"in e||"MsPerspective"in e||"perspective"in e}(),flexbox:function(){for(var e=document.createElement("div").style,a="alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "),t=0;tn)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); +!function(e){"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var o="function"==typeof define&&define.amd,a="undefined"!=typeof module&&module.exports,n="https:"==document.location.protocol?"https:":"http:",i="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js";o||(a?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+n+"//"+i+"%3E%3C/script%3E"))),t()}(function(){var t,o="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",i={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||n,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":p(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),h(t),e(o).each(function(){var o=e(this);if(!o.data(a)){o.data(a,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var n=o.data(a),i=n.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),n&&i.callbacks.onCreate&&"function"==typeof i.callbacks.onCreate&&i.callbacks.onCreate.call(this),e("#mCSB_"+n.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var n=t||f.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=e("#mCSB_"+n.idx),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!r.length)return;n.tweenRunning&&N(t),o&&n&&i.callbacks.onBeforeUpdate&&"function"==typeof i.callbacks.onBeforeUpdate&&i.callbacks.onBeforeUpdate.call(this),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),l.css("max-height","none"),l.height()!==t.height()&&l.css("max-height",t.height()),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r)),n.overflowed=y.call(this),M.call(this),i.autoDraggerLength&&S.call(this),b.call(this),T.call(this);var c=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(n.overflowed[0]?s[0].height()>s[0].parent().height()?B.call(this):(V(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(B.call(this),"y"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[1]&&V(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(n.overflowed[1]?s[1].width()>s[1].parent().width()?B.call(this):(V(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(B.call(this),"x"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[0]&&V(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&n&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),X.call(this)}})},scrollTo:function(t,o){if("undefined"!=typeof t&&null!=t){var n=f.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=q.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=Y.call(this,c[0],"y"),c[1]=Y.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=oe()?0:d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",V(n,c[0].toString(),s)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",V(n,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&N(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);if(o.data(a)){{o.data(a)}X.call(this,"remove"),k.call(this),t&&B.call(this),M.call(this,!0),o.addClass(d[3])}})},destroy:function(){var t=f.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),X.call(this,"remove"),k.call(this),B.call(this),n.removeData(a),K(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),n.removeClass(o+" _"+a+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},h=function(t){var o=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],a=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],n=["minimal","minimal-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,o)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,a)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,n)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,i)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,r)>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),K(l,e))},p=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),n=t.data(a),i=n.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["
","
"],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"
":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===n.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===n.langDir?"989999px":i.setLeft,t.addClass(o+" _"+a+"_"+n.idx+f+h).wrapInner("
");var m=e("#mCSB_"+n.idx),p=e("#mCSB_"+n.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p)),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){var o=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return e(this).outerWidth(!0)}).get())],a=t.parent().width();return o[0]>a?o[0]:o[1]>a?o[1]:"100%"},_=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx+"_container");if(n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis){i.css({width:"auto","min-width":0,"overflow-x":"scroll"});var r=Math.ceil(i[0].scrollWidth);3===n.advanced.autoExpandHorizontalScroll||2!==n.advanced.autoExpandHorizontalScroll&&r>i.parent().width()?i.css({width:r,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("
").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},w=function(){var t=e(this),o=t.data(a),n=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=ee(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",l=["","","",""],s=["x"===n.axis?l[2]:l[0],"x"===n.axis?l[3]:l[1],l[2],l[3]];n.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[n.height()/i.outerHeight(!1),n.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]r&&(r=s),c>l&&(l=c),[r>n.height(),l>n.width()]},B=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(N(t),("x"!==n.axis&&!o.overflowed[0]||"y"===n.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),V(t,"_resetY")),"y"!==n.axis&&!o.overflowed[1]||"x"===n.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),V(t,"_resetX")}},T=function(){function t(){r=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(r),R.call(o[0])):t()},100)}var o=e(this),n=o.data(a),i=n.opt;if(!n.bindEvents){if(I.call(this),i.contentTouchScroll&&D.call(this),E.call(this),i.mouseWheel.enable){var r;t()}L.call(this),P.call(this),i.advanced.autoScrollOnFocus&&z.call(this),i.scrollButtons.enable&&H.call(this),i.keyboard.enable&&U.call(this),n.bindEvents=!0}},k=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(e(n.advanced.releaseDraggableSelectors)),n.advanced.extraDraggableSelectors&&l.add(e(n.advanced.extraDraggableSelectors)),o.bindEvents&&(e(document).add(e(!W()||top.document)).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),K(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),K(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),K(s[0],"onCompleteTimeout"),o.bindEvents=!1)},M=function(t){var o=e(this),n=o.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(n.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(n.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),n.overflowed[0]||n.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},O=function(t){var o=t.type,a=t.target.ownerDocument!==document?[e(frameElement).offset().top,e(frameElement).offset().left]:null,n=W()&&t.target.ownerDocument!==top.document?[e(t.view.frameElement).offset().top,e(t.view.frameElement).offset().left]:[0,0];switch(o){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return a?[t.originalEvent.pageY-a[0]+n[0],t.originalEvent.pageX-a[1]+n[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],r=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[i.screenY,i.screenX,r>1]:[i.pageY,i.pageX,r>1];default:return a?[t.pageY-a[0]+n[0],t.pageX-a[1]+n[1],!1]:[t.pageY,t.pageX,!1]}},I=function(){function t(e){var t=m.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}}function o(e,t,o,a){if(m[0].idleTimer=u.scrollInertia<233?250:0,n.attr("id")===h[1])var i="x",r=(n[0].offsetLeft-t+a)*d.scrollRatio.x;else var i="y",r=(n[0].offsetTop-e+o)*d.scrollRatio.y;V(l,r.toString(),{dir:i,drag:!0})}var n,i,r,l=e(this),d=l.data(a),u=d.opt,f=a+"_"+d.idx,h=["mCSB_"+d.idx+"_dragger_vertical","mCSB_"+d.idx+"_dragger_horizontal"],m=e("#mCSB_"+d.idx+"_container"),p=e("#"+h[0]+",#"+h[1]),g=u.advanced.releaseDraggableSelectors?p.add(e(u.advanced.releaseDraggableSelectors)):p,v=u.advanced.extraDraggableSelectors?e(!W()||top.document).add(e(u.advanced.extraDraggableSelectors)):e(!W()||top.document);p.bind("mousedown."+f+" touchstart."+f+" pointerdown."+f+" MSPointerDown."+f,function(o){if(o.stopImmediatePropagation(),o.preventDefault(),Z(o)){c=!0,s&&(document.onselectstart=function(){return!1}),t(!1),N(l),n=e(this);var a=n.offset(),d=O(o)[0]-a.top,f=O(o)[1]-a.left,h=n.height()+a.top,m=n.width()+a.left;h>d&&d>0&&m>f&&f>0&&(i=d,r=f),C(n,"active",u.autoExpandScrollbar)}}).bind("touchmove."+f,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=n.offset(),a=O(e)[0]-t.top,l=O(e)[1]-t.left;o(i,r,a,l)}),e(document).add(v).bind("mousemove."+f+" pointermove."+f+" MSPointerMove."+f,function(e){if(n){var t=n.offset(),a=O(e)[0]-t.top,l=O(e)[1]-t.left;if(i===a&&r===l)return;o(i,r,a,l)}}).add(g).bind("mouseup."+f+" touchend."+f+" pointerup."+f+" MSPointerUp."+f,function(e){n&&(C(n,"active",u.autoExpandScrollbar),n=null),c=!1,s&&(document.onselectstart=null),t(!0)})},D=function(){function o(e){if(!$(e)||c||O(e)[2])return void(t=0);t=1,b=0,C=0,d=1,y.removeClass("mCS_touch_action");var o=I.offset();u=O(e)[0]-o.top,f=O(e)[1]-o.left,z=[O(e)[0],O(e)[1]]}function n(e){if($(e)&&!c&&!O(e)[2]&&(T.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!C||b)&&d)){g=G();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left,n="mcsLinearOut";if(E.push(o),R.push(a),z[2]=Math.abs(O(e)[0]-z[0]),z[3]=Math.abs(O(e)[1]-z[1]),B.overflowed[0])var i=D[0].parent().height()-D[0].height(),r=u-o>0&&o-u>-(i*B.scrollRatio.y)&&(2*z[3]0&&a-f>-(l*B.scrollRatio.x)&&(2*z[2]30)){_=1e3/(v-p);var n="mcsEaseOut",i=2.5>_,r=i?[E[E.length-2],R[R.length-2]]:[0,0];x=i?[o-r[0],a-r[1]]:[o-h,a-m];var u=[Math.abs(x[0]),Math.abs(x[1])];_=i?[Math.abs(x[0]/4),Math.abs(x[1]/4)]:[_,_];var f=[Math.abs(I[0].offsetTop)-x[0]*l(u[0]/_[0],_[0]),Math.abs(I[0].offsetLeft)-x[1]*l(u[1]/_[1],_[1])];w="yx"===T.axis?[f[0],f[1]]:"x"===T.axis?[null,f[1]]:[f[0],null],S=[4*u[0]+T.scrollInertia,4*u[1]+T.scrollInertia];var y=parseInt(T.contentTouchScroll)||0;w[0]=u[0]>y?w[0]:0,w[1]=u[1]>y?w[1]:0,B.overflowed[0]&&s(w[0],S[0],n,"y",L,!1),B.overflowed[1]&&s(w[1],S[1],n,"x",L,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,a,n,i){e&&V(y,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C,y=e(this),B=y.data(a),T=B.opt,k=a+"_"+B.idx,M=e("#mCSB_"+B.idx),I=e("#mCSB_"+B.idx+"_container"),D=[e("#mCSB_"+B.idx+"_dragger_vertical"),e("#mCSB_"+B.idx+"_dragger_horizontal")],E=[],R=[],A=0,L="yx"===T.axis?"none":"all",z=[],P=I.find("iframe"),H=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k],U=void 0!==document.body.style.touchAction;I.bind(H[0],function(e){o(e)}).bind(H[1],function(e){n(e)}),M.bind(H[0],function(e){i(e)}).bind(H[2],function(e){r(e)}),P.length&&P.each(function(){e(this).load(function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind(H[0],function(e){o(e),i(e)}).bind(H[1],function(e){n(e)}).bind(H[2],function(e){r(e)})})})},E=function(){function o(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function n(e,t,o){d.type=o&&i?"stepped":"stepless",d.scrollAmount=10,F(r,e,t,"mcsLinearOut",o?60:null)}var i,r=e(this),l=r.data(a),s=l.opt,d=l.sequential,u=a+"_"+l.idx,f=e("#mCSB_"+l.idx+"_container"),h=f.parent();f.bind("mousedown."+u,function(e){t||i||(i=1,c=!0)}).add(document).bind("mousemove."+u,function(e){if(!t&&i&&o()){var a=f.offset(),r=O(e)[0]-a.top+f[0].offsetTop,c=O(e)[1]-a.left+f[0].offsetLeft;r>0&&r0&&cr?n("on",38):r>h.height()&&n("on",40)),"y"!==s.axis&&l.overflowed[1]&&(0>c?n("on",37):c>h.width()&&n("on",39)))}}).bind("mouseup."+u+" dragend."+u,function(e){t||(i&&(i=0,n("off",null)),c=!1)})},R=function(){function t(t,a){if(N(o),!A(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100,d=i.scrollInertia;if("x"===i.axis||"x"===i.mouseWheel.axis)var u="x",f=[Math.round(r*n.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.width()?.9*l.width():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),p=c[1][0].offsetLeft,g=c[1].parent().width()-c[1].width(),v=t.deltaX||t.deltaY||a;else var u="y",f=[Math.round(r*n.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.height()?.9*l.height():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),p=c[0][0].offsetTop,g=c[0].parent().height()-c[0].height(),v=t.deltaY||a;"y"===u&&!n.overflowed[0]||"x"===u&&!n.overflowed[1]||((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(v=-v),i.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==p||0>v&&p!==g||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<2&&!i.mouseWheel.normalizeDelta&&(h=t.deltaFactor,d=17),V(o,(m-v*h).toString(),{dir:u,dur:d}))}}if(e(this).data(a)){var o=e(this),n=o.data(a),i=n.opt,r=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],d=e("#mCSB_"+n.idx+"_container").find("iframe");d.length&&d.each(function(){e(this).load(function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)})}},W=function(e){var t=null;if(e){try{var o=e.contentDocument||e.contentWindow.document;t=o.body.innerHTML}catch(a){}return null!==t}try{var o=top.document;t=o.body.innerHTML}catch(a){}return null!==t},A=function(t,o){var n=o.nodeName.toLowerCase(),i=t.data(a).opt.mouseWheel.disableOver,r=["select","textarea"];return e.inArray(n,i)>-1&&!(e.inArray(n,r)>-1&&!e(o).is(":focus"))},L=function(){var t,o=e(this),n=o.data(a),i=a+"_"+n.idx,r=e("#mCSB_"+n.idx+"_container"),l=r.parent(),s=e(".mCSB_"+n.idx+"_scrollbar ."+d[12]);s.bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i,function(o){c=!0,e(o.target).hasClass("mCSB_dragger")||(t=1)}).bind("touchend."+i+" pointerup."+i+" MSPointerUp."+i,function(e){c=!1}).bind("click."+i,function(a){if(t&&(t=0,e(a.target).hasClass(d[12])||e(a.target).hasClass("mCSB_draggerRail"))){N(o);var i=e(this),s=i.find(".mCSB_dragger");if(i.parent(".mCSB_scrollTools_horizontal").length>0){if(!n.overflowed[1])return;var c="x",u=a.pageX>s.offset().left?-1:1,f=Math.abs(r[0].offsetLeft)-.9*u*l.width()}else{if(!n.overflowed[0])return;var c="y",u=a.pageY>s.offset().top?-1:1,f=Math.abs(r[0].offsetTop)-.9*u*l.height()}V(o,f.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},z=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(o){var a=e(document.activeElement),i=r.find(".mCustomScrollBox").length,s=0;a.is(n.advanced.autoScrollOnFocus)&&(N(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=i?(s+17)*i:0,t[0]._focusTimeout=setTimeout(function(){var e=[te(a)[0],te(a)[1]],o=[r[0].offsetTop,r[0].offsetLeft],i=[o[0]+e[0]>=0&&o[0]+e[0]=0&&o[0]+e[1]a");s.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(a){function r(e,o){i.scrollAmount=n.scrollButtons.scrollAmount,F(t,e,o)}if(a.preventDefault(),Z(a)){var l=e(this).attr("class");switch(i.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.type)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},U=function(){function t(t){function a(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.keyboard.scrollAmount,"stepped"===r.type&&n.tweenRunning||F(o,e,t)}switch(t.type){case"blur":n.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),a(s,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){N(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-.9*f*d.width();else var h="y",m=Math.abs(c[0].offsetTop)-.9*f*d.height();V(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;V(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),n=o.data(a),i=n.opt,r=n.sequential,l=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).load(function(){W(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},F=function(t,o,n,i,r){function l(e){u.snapAmount&&(f.scrollAmount=u.snapAmount instanceof Array?"x"===f.dir[0]?u.snapAmount[1]:u.snapAmount[0]:u.snapAmount);var o="stepped"!==f.type,a=r?r:e?o?p/1.5:g:1e3/60,n=e?o?7.5:40:2.5,s=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],d=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],m="x"===f.dir[0]?s[1]+f.dir[1]*d[1]*n:s[0]+f.dir[1]*d[0]*n,v="x"===f.dir[0]?s[1]+f.dir[1]*parseInt(f.scrollAmount):s[0]+f.dir[1]*parseInt(f.scrollAmount),x="auto"!==f.scrollAmount?v:m,_=i?i:e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",w=e?!0:!1;return e&&17>a&&(x="x"===f.dir[0]?s[1]:s[0]),V(t,x.toString(),{dir:f.dir[0],scrollEasing:_,dur:a,onComplete:w}),e?void(f.dir=!1):(clearTimeout(f.step),void(f.step=setTimeout(function(){l()},a)))}function s(){clearTimeout(f.step),K(f,"step"),N(t)}var c=t.data(a),u=c.opt,f=c.sequential,h=e("#mCSB_"+c.idx+"_container"),m="stepped"===f.type?!0:!1,p=u.scrollInertia<26?26:u.scrollInertia,g=u.scrollInertia<1?17:u.scrollInertia;switch(o){case"on":if(f.dir=[n===d[16]||n===d[15]||39===n||37===n?"x":"y",n===d[13]||n===d[15]||38===n||37===n?-1:1],N(t),ee(n)&&"stepped"===f.type)return;l(m);break;case"off":s(),(m||c.tweenRunning&&f.dir)&&l(!0)}},q=function(t){var o=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===o.axis?null:t,n[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},Y=function(t,o){if(null!=t&&"undefined"!=typeof t){var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1):l.outerHeight(!1),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?te(m)[1]:te(m)[0];case"string":case"number":if(ee(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&ee(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?te(m)[1]:te(m)[0]}return e(t).length?"x"===o?te(e(t))[1]:te(e(t))[0]:(l.css(h,t),void u.update.call(null,n[0]))}}},X=function(t){function o(){return clearTimeout(f[0].autoUpdate),0===l.parents("html").length?void(l=null):void(f[0].autoUpdate=setTimeout(function(){return c.advanced.updateOnSelectorChange&&(s.poll.change.n=i(),s.poll.change.n!==s.poll.change.o)?(s.poll.change.o=s.poll.change.n,void r(3)):c.advanced.updateOnContentResize&&(s.poll.size.n=l[0].scrollHeight+l[0].scrollWidth+f[0].offsetHeight+l[0].offsetHeight+l[0].offsetWidth,s.poll.size.n!==s.poll.size.o)?(s.poll.size.o=s.poll.size.n,void r(1)):!c.advanced.updateOnImageLoad||"auto"===c.advanced.updateOnImageLoad&&"y"===c.axis||(s.poll.img.n=f.find("img").length,s.poll.img.n===s.poll.img.o)?void((c.advanced.updateOnSelectorChange||c.advanced.updateOnContentResize||c.advanced.updateOnImageLoad)&&o()):(s.poll.img.o=s.poll.img.n,void f.find("img").each(function(){n(this)}))},c.advanced.autoUpdateTimeout))}function n(t){function o(e,t){return function(){return t.apply(e,arguments)}}function a(){this.onload=null,e(t).addClass(d[2]),r(2)}if(e(t).hasClass(d[2]))return void r();var n=new Image;n.onload=o(n,a),n.src=t.src}function i(){c.advanced.updateOnSelectorChange===!0&&(c.advanced.updateOnSelectorChange="*");var e=0,t=f.find(c.advanced.updateOnSelectorChange);return c.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}function r(e){clearTimeout(f[0].autoUpdate),u.update.call(null,l[0],e)}var l=e(this),s=l.data(a),c=s.opt,f=e("#mCSB_"+s.idx+"_container");return t?(clearTimeout(f[0].autoUpdate),void K(f[0],"autoUpdate")):void o()},j=function(e,t,o){return Math.round(e/t)*t-o},N=function(t){var o=t.data(a),n=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");n.each(function(){J.call(this)})},V=function(t,o,n){function i(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function r(){return[c.callbacks.alwaysTriggerOffsets||w>=S[0]+y,c.callbacks.alwaysTriggerOffsets||-B>=w]}function l(){var e=[h[0].offsetTop,h[0].offsetLeft],o=[x[0].offsetTop,x[0].offsetLeft],a=[h.outerHeight(!1),h.outerWidth(!1)],i=[f.height(),f.width()];t[0].mcs={content:h,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(a[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-i[1])),direction:n.dir}}var s=t.data(a),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(d,n),u=[n.dur,n.drag?0:n.dur],f=e("#mCSB_"+s.idx),h=e("#mCSB_"+s.idx+"_container"),m=h.parent(),p=c.callbacks.onTotalScrollOffset?q.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?q.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(s.trigger=n.trigger,(0!==m.scrollTop()||0!==m.scrollLeft())&&(e(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==o||s.contentReset.y||(i("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),s.contentReset.y=1),"_resetX"!==o||s.contentReset.x||(i("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),s.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){if(!s.contentReset.y&&t[0].mcs||!s.overflowed[0]||(i("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),s.contentReset.x=null),!s.contentReset.x&&t[0].mcs||!s.overflowed[1]||(i("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),s.contentReset.x=null),c.snapAmount){var v=c.snapAmount instanceof Array?"x"===n.dir?c.snapAmount[1]:c.snapAmount[0]:c.snapAmount;o=j(o,v,c.snapOffset)}switch(n.dir){case"x":var x=e("#mCSB_"+s.idx+"_dragger_horizontal"),_="left",w=h[0].offsetLeft,S=[f.width()-h.outerWidth(!1),x.parent().width()-x.width()],b=[o,0===o?0:o/s.scrollRatio.x],y=p[1],B=g[1],T=y>0?y/s.scrollRatio.x:0,k=B>0?B/s.scrollRatio.x:0;break;case"y":var x=e("#mCSB_"+s.idx+"_dragger_vertical"),_="top",w=h[0].offsetTop,S=[f.height()-h.outerHeight(!1),x.parent().height()-x.height()],b=[o,0===o?0:o/s.scrollRatio.y],y=p[0],B=g[0],T=y>0?y/s.scrollRatio.y:0,k=B>0?B/s.scrollRatio.y:0}b[1]<0||0===b[0]&&0===b[1]?b=[0,0]:b[1]>=S[1]?b=[S[0],S[1]]:b[0]=-b[0],t[0].mcs||(l(),i("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(h[0].onCompleteTimeout),Q(x[0],_,Math.round(b[1]),u[1],n.scrollEasing),(s.tweenRunning||!(0===w&&b[0]>=0||w===S[0]&&b[0]<=S[0]))&&Q(h[0],_,Math.round(b[0]),u[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!s.tweenRunning&&(i("onScrollStart")&&(l(),c.callbacks.onScrollStart.call(t[0])),s.tweenRunning=!0,C(x),s.cbOffsets=r())},onUpdate:function(){n.callbacks&&n.onUpdate&&i("whileScrolling")&&(l(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var e=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(l(),c.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&b[1]>=S[1]-T&&s.cbOffsets[0]&&(l(),c.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&b[1]<=k&&s.cbOffsets[1]&&(l(),c.callbacks.onTotalScrollBack.call(t[0])),s.tweenRunning=!1,h[0].idleTimer=0,C(x,"hide")},e)}}})}},Q=function(e,t,o,a,n,i,r){function l(){S.stop||(x||m.call(),x=G()-v,s(),x>=S.time&&(S.time=x>S.time?x+f-(x-S.time):x+f-1,S.time0?(S.currVal=u(S.time,_,b,a,n),w[t]=Math.round(S.currVal)+"px"):w[t]=o+"px",p.call()}function c(){f=1e3/60,S.time=x+f,h=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},S.id=h(l)}function d(){null!=S.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(S.id):clearTimeout(S.id),S.id=null)}function u(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=a/2,1>e?o/2*e*e+t:(e--,-o/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=a/2,1>e?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=a/2,1>e?o/2*e*e*e+t:(e-=2,o/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=a,e--,-o*(e*e*e*e-1)+t;case"easeOutStrong":return o*(-Math.pow(2,-10*e/a)+1)+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var f,h,r=r||{},m=r.onStart||function(){},p=r.onUpdate||function(){},g=r.onComplete||function(){},v=G(),x=0,_=e.offsetTop,w=e.style,S=e._mTween[t];"left"===t&&(_=e.offsetLeft);var b=o-_;S.stop=0,"none"!==i&&d(),c()},G=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},J=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o=0&&a[0]+te(n)[0]=0&&a[1]+te(n)[1]0)for(n in Kn)i=Kn[n],s=e[i],c(s)||(t[i]=s);return t}function m(e){f(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),ti===!1&&(ti=!0,t.updateOffset(this),ti=!1)}function _(t){return t instanceof m||null!=t&&null!=t._isAMomentObject}function y(t){return 0>t?Math.ceil(t):Math.floor(t)}function g(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=y(e)),n}function p(t,e,n){var i,s=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),a=0;for(i=0;s>i;i++)(n&&t[i]!==e[i]||!n&&g(t[i])!==g(e[i]))&&a++;return a+r}function v(e){t.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function D(t,e){var n=!0;return a(function(){return n&&(v(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function M(t,e){ei[t]||(v(e),ei[t]=!0)}function S(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function Y(t){return"[object Object]"===Object.prototype.toString.call(t)}function w(t){var e,n;for(n in t)e=t[n],S(e)?this[n]=e:this["_"+n]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function k(t,e){var n,i=a({},t);for(n in e)r(e,n)&&(Y(t[n])&&Y(e[n])?(i[n]={},a(i[n],t[n]),a(i[n],e[n])):null!=e[n]?i[n]=e[n]:delete i[n]);return i}function T(t){null!=t&&this.set(t)}function b(t){return t?t.toLowerCase().replace("_","-"):t}function O(t){for(var e,n,i,s,r=0;r0;){if(i=W(s.slice(0,e).join("-")))return i;if(n&&n.length>=e&&p(s,n,!0)>=e-1)break;e--}r++}return null}function W(t){var e=null;if(!ii[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=ni._abbr,require("./locale/"+t),x(e)}catch(n){}return ii[t]}function x(t,e){var n;return t&&(n=c(e)?P(t):U(t,e),n&&(ni=n)),ni._abbr}function U(t,e){return null!==e?(e.abbr=t,null!=ii[t]?(M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=k(ii[t]._config,e)):null!=e.parentLocale&&(null!=ii[e.parentLocale]?e=k(ii[e.parentLocale]._config,e):M("parentLocaleUndefined","specified parentLocale is not defined yet")),ii[t]=new T(e),x(t),ii[t]):(delete ii[t],null)}function G(t,e){if(null!=e){var n;null!=ii[t]&&(e=k(ii[t]._config,e)),n=new T(e),n.parentLocale=ii[t],ii[t]=n,x(t)}else null!=ii[t]&&(null!=ii[t].parentLocale?ii[t]=ii[t].parentLocale:null!=ii[t]&&delete ii[t]);return ii[t]}function P(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ni;if(!n(t)){if(e=W(t))return e;t=[t]}return O(t)}function C(){return Object.keys(ii)}function F(t,e){var n=t.toLowerCase();si[n]=si[n+"s"]=si[e]=t}function H(t){return"string"==typeof t?si[t]||si[t.toLowerCase()]:void 0}function L(t){var e,n,i={};for(n in t)r(t,n)&&(e=H(n),e&&(i[e]=t[n]));return i}function V(e,n){return function(i){return null!=i?(I(this,e,i),t.updateOffset(this,n),this):N(this,e)}}function N(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function I(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function A(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=H(t),S(this[t]))return this[t](e);return this}function R(t,e,n){var i=""+Math.abs(t),s=e-i.length,r=t>=0;return(r?n?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+i}function E(t,e,n,i){var s=i;"string"==typeof i&&(s=function(){return this[i]()}),t&&(ui[t]=s),e&&(ui[e[0]]=function(){return R(s.apply(this,arguments),e[1],e[2])}),n&&(ui[n]=function(){return this.localeData().ordinal(s.apply(this,arguments),t)})}function j(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function z(t){var e,n,i=t.match(ri);for(e=0,n=i.length;n>e;e++)ui[i[e]]?i[e]=ui[i[e]]:i[e]=j(i[e]);return function(s){var r="";for(e=0;n>e;e++)r+=i[e]instanceof Function?i[e].call(s,t):i[e];return r}}function Z(t,e){return t.isValid()?(e=$(e,t.localeData()),oi[e]=oi[e]||z(e),oi[e](t)):t.localeData().invalidDate()}function $(t,e){function n(t){return e.longDateFormat(t)||t}var i=5;for(ai.lastIndex=0;i>=0&&ai.test(t);)t=t.replace(ai,n),ai.lastIndex=0,i-=1;return t}function q(t,e,n){Ti[t]=S(e)?e:function(t,i){return t&&n?n:e}}function J(t,e){return r(Ti,t)?Ti[t](e._strict,e._locale):new RegExp(B(t))}function B(t){return Q(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,s){return e||n||i||s}))}function Q(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function X(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(i=function(t,n){n[e]=g(t)}),n=0;ni;i++){if(s=o([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}}function rt(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=g(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return n=Math.min(t.date(),et(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function at(e){return null!=e?(rt(this,e),t.updateOffset(this,!0),this):N(this,"Month")}function ot(){return et(this.year(),this.month())}function ut(t){return this._monthsParseExact?(r(this,"_monthsRegex")||lt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function dt(t){return this._monthsParseExact?(r(this,"_monthsRegex")||lt.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function lt(){function t(t,e){return e.length-t.length}var e,n,i=[],s=[],r=[];for(e=0;12>e;e++)n=o([2e3,e]),i.push(this.monthsShort(n,"")),s.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(i.sort(t),s.sort(t),r.sort(t),e=0;12>e;e++)i[e]=Q(i[e]),s[e]=Q(s[e]),r[e]=Q(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")$","i")}function ht(t){var e,n=t._a;return n&&-2===d(t).overflow&&(e=n[Wi]<0||n[Wi]>11?Wi:n[xi]<1||n[xi]>et(n[Oi],n[Wi])?xi:n[Ui]<0||n[Ui]>24||24===n[Ui]&&(0!==n[Gi]||0!==n[Pi]||0!==n[Ci])?Ui:n[Gi]<0||n[Gi]>59?Gi:n[Pi]<0||n[Pi]>59?Pi:n[Ci]<0||n[Ci]>999?Ci:-1,d(t)._overflowDayOfYear&&(Oi>e||e>xi)&&(e=xi),d(t)._overflowWeeks&&-1===e&&(e=Fi),d(t)._overflowWeekday&&-1===e&&(e=Hi),d(t).overflow=e),t}function ct(t){var e,n,i,s,r,a,o=t._i,u=Ri.exec(o)||Ei.exec(o);if(u){for(d(t).iso=!0,e=0,n=zi.length;n>e;e++)if(zi[e][1].exec(u[1])){s=zi[e][0],i=zi[e][2]!==!1;break}if(null==s)return void(t._isValid=!1);if(u[3]){for(e=0,n=Zi.length;n>e;e++)if(Zi[e][1].exec(u[3])){r=(u[2]||" ")+Zi[e][0];break}if(null==r)return void(t._isValid=!1)}if(!i&&null!=r)return void(t._isValid=!1);if(u[4]){if(!ji.exec(u[4]))return void(t._isValid=!1);a="Z"}t._f=s+(r||"")+(a||""),bt(t)}else t._isValid=!1}function ft(e){var n=$i.exec(e._i);return null!==n?void(e._d=new Date(+n[1])):(ct(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function mt(t,e,n,i,s,r,a){var o=new Date(t,e,n,i,s,r,a);return 100>t&&t>=0&&isFinite(o.getFullYear())&&o.setFullYear(t),o}function _t(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function yt(t){return gt(t)?366:365}function gt(t){return t%4===0&&t%100!==0||t%400===0}function pt(){return gt(this.year())}function vt(t,e,n){var i=7+e-n,s=(7+_t(t,0,i).getUTCDay()-e)%7;return-s+i-1}function Dt(t,e,n,i,s){var r,a,o=(7+n-i)%7,u=vt(t,i,s),d=1+7*(e-1)+o+u;return 0>=d?(r=t-1,a=yt(r)+d):d>yt(t)?(r=t+1,a=d-yt(t)):(r=t,a=d),{year:r,dayOfYear:a}}function Mt(t,e,n){var i,s,r=vt(t.year(),e,n),a=Math.floor((t.dayOfYear()-r-1)/7)+1;return 1>a?(s=t.year()-1,i=a+St(s,e,n)):a>St(t.year(),e,n)?(i=a-St(t.year(),e,n),s=t.year()+1):(s=t.year(),i=a),{week:i,year:s}}function St(t,e,n){var i=vt(t,e,n),s=vt(t+1,e,n);return(yt(t)-i+s)/7}function Yt(t,e,n){return null!=t?t:null!=e?e:n}function wt(e){var n=new Date(t.now());return e._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function kt(t){var e,n,i,s,r=[];if(!t._d){for(i=wt(t),t._w&&null==t._a[xi]&&null==t._a[Wi]&&Tt(t),t._dayOfYear&&(s=Yt(t._a[Oi],i[Oi]),t._dayOfYear>yt(s)&&(d(t)._overflowDayOfYear=!0),n=_t(s,0,t._dayOfYear),t._a[Wi]=n.getUTCMonth(),t._a[xi]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=r[e]=i[e];for(;7>e;e++)t._a[e]=r[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Ui]&&0===t._a[Gi]&&0===t._a[Pi]&&0===t._a[Ci]&&(t._nextDay=!0,t._a[Ui]=0),t._d=(t._useUTC?_t:mt).apply(null,r),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Ui]=24)}}function Tt(t){var e,n,i,s,r,a,o,u;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(r=1,a=4,n=Yt(e.GG,t._a[Oi],Mt(Ft(),1,4).year),i=Yt(e.W,1),s=Yt(e.E,1),(1>s||s>7)&&(u=!0)):(r=t._locale._week.dow,a=t._locale._week.doy,n=Yt(e.gg,t._a[Oi],Mt(Ft(),r,a).year),i=Yt(e.w,1),null!=e.d?(s=e.d,(0>s||s>6)&&(u=!0)):null!=e.e?(s=e.e+r,(e.e<0||e.e>6)&&(u=!0)):s=r),1>i||i>St(n,r,a)?d(t)._overflowWeeks=!0:null!=u?d(t)._overflowWeekday=!0:(o=Dt(n,i,s,r,a),t._a[Oi]=o.year,t._dayOfYear=o.dayOfYear)}function bt(e){if(e._f===t.ISO_8601)return void ct(e);e._a=[],d(e).empty=!0;var n,i,s,r,a,o=""+e._i,u=o.length,l=0;for(s=$(e._f,e._locale).match(ri)||[],n=0;n0&&d(e).unusedInput.push(a),o=o.slice(o.indexOf(i)+i.length),l+=i.length),ui[r]?(i?d(e).empty=!1:d(e).unusedTokens.push(r),tt(r,i,e)):e._strict&&!i&&d(e).unusedTokens.push(r);d(e).charsLeftOver=u-l,o.length>0&&d(e).unusedInput.push(o),d(e).bigHour===!0&&e._a[Ui]<=12&&e._a[Ui]>0&&(d(e).bigHour=void 0),e._a[Ui]=Ot(e._locale,e._a[Ui],e._meridiem),kt(e),ht(e)}function Ot(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(i=t.isPM(n),i&&12>e&&(e+=12),i||12!==e||(e=0),e):e}function Wt(t){var e,n,i,s,r;if(0===t._f.length)return d(t).invalidFormat=!0,void(t._d=new Date(NaN));for(s=0;sr)&&(i=r,n=e));a(t,n||e)}function xt(t){if(!t._d){var e=L(t._i);t._a=s([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),kt(t)}}function Ut(t){var e=new m(ht(Gt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Gt(t){var e=t._i,s=t._f;return t._locale=t._locale||P(t._l),null===e||void 0===s&&""===e?h({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),_(e)?new m(ht(e)):(n(s)?Wt(t):s?bt(t):i(e)?t._d=e:Pt(t),l(t)||(t._d=null),t))}function Pt(e){var r=e._i;void 0===r?e._d=new Date(t.now()):i(r)?e._d=new Date(+r):"string"==typeof r?ft(e):n(r)?(e._a=s(r.slice(0),function(t){return parseInt(t,10)}),kt(e)):"object"==typeof r?xt(e):"number"==typeof r?e._d=new Date(r):t.createFromInputFallback(e)}function Ct(t,e,n,i,s){var r={};return"boolean"==typeof n&&(i=n,n=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=s,r._l=n,r._i=t,r._f=e,r._strict=i,Ut(r)}function Ft(t,e,n,i){return Ct(t,e,n,i,!1)}function Ht(t,e){var i,s;if(1===e.length&&n(e[0])&&(e=e[0]),!e.length)return Ft();for(i=e[0],s=1;st&&(t=-t,n="-"),n+R(~~(t/60),2)+e+R(~~t%60,2)})}function Rt(t,e){var n=(e||"").match(t)||[],i=n[n.length-1]||[],s=(i+"").match(Xi)||["-",0,0],r=+(60*s[1])+g(s[2]);return"+"===s[0]?r:-r}function Et(e,n){var s,r;return n._isUTC?(s=n.clone(),r=(_(e)||i(e)?+e:+Ft(e))-+s,s._d.setTime(+s._d+r),t.updateOffset(s,!1),s):Ft(e).local()}function jt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function zt(e,n){var i,s=this._offset||0;return this.isValid()?null!=e?("string"==typeof e?e=Rt(Yi,e):Math.abs(e)<16&&(e=60*e),!this._isUTC&&n&&(i=jt(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),s!==e&&(!n||this._changeInProgress?ue(this,ne(e-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?s:jt(this):null!=e?this:NaN}function Zt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function $t(t){return this.utcOffset(0,t)}function qt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(jt(this),"m")),this}function Jt(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Rt(Si,this._i)),this}function Bt(t){return this.isValid()?(t=t?Ft(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Qt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Xt(){if(!c(this._isDSTShifted))return this._isDSTShifted;var t={};if(f(t,this),t=Gt(t),t._a){var e=t._isUTC?o(t._a):Ft(t._a);this._isDSTShifted=this.isValid()&&p(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Kt(){return this.isValid()?!this._isUTC:!1}function te(){return this.isValid()?this._isUTC:!1}function ee(){return this.isValid()?this._isUTC&&0===this._offset:!1}function ne(t,e){var n,i,s,a=t,o=null;return It(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(a={},e?a[e]=t:a.milliseconds=t):(o=Ki.exec(t))?(n="-"===o[1]?-1:1,a={y:0,d:g(o[xi])*n,h:g(o[Ui])*n,m:g(o[Gi])*n,s:g(o[Pi])*n,ms:g(o[Ci])*n}):(o=ts.exec(t))?(n="-"===o[1]?-1:1,a={y:ie(o[2],n),M:ie(o[3],n),w:ie(o[4],n),d:ie(o[5],n),h:ie(o[6],n),m:ie(o[7],n),s:ie(o[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(s=re(Ft(a.from),Ft(a.to)),a={},a.ms=s.milliseconds,a.M=s.months),i=new Nt(a),It(t)&&r(t,"_locale")&&(i._locale=t._locale),i}function ie(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function se(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function re(t,e){var n;return t.isValid()&&e.isValid()?(e=Et(e,t),t.isBefore(e)?n=se(t,e):(n=se(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ae(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function oe(t,e){return function(n,i){var s,r;return null===i||isNaN(+i)||(M(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),r=n,n=i,i=r),n="string"==typeof n?+n:n,s=ne(n,i),ue(this,s,t),this}}function ue(e,n,i,s){var r=n._milliseconds,a=ae(n._days),o=ae(n._months);e.isValid()&&(s=null==s?!0:s,r&&e._d.setTime(+e._d+r*i),a&&I(e,"Date",N(e,"Date")+a*i),o&&rt(e,N(e,"Month")+o*i),s&&t.updateOffset(e,a||o))}function de(t,e){var n=t||Ft(),i=Et(n,this).startOf("day"),s=this.diff(i,"days",!0),r=-6>s?"sameElse":-1>s?"lastWeek":0>s?"lastDay":1>s?"sameDay":2>s?"nextDay":7>s?"nextWeek":"sameElse",a=e&&(S(e[r])?e[r]():e[r]);return this.format(a||this.localeData().calendar(r,this,Ft(n)))}function le(){return new m(this)}function he(t,e){var n=_(t)?t:Ft(t);return this.isValid()&&n.isValid()?(e=H(c(e)?"millisecond":e),"millisecond"===e?+this>+n:+n<+this.clone().startOf(e)):!1}function ce(t,e){var n=_(t)?t:Ft(t);return this.isValid()&&n.isValid()?(e=H(c(e)?"millisecond":e),"millisecond"===e?+n>+this:+this.clone().endOf(e)<+n):!1}function fe(t,e,n){return this.isAfter(t,n)&&this.isBefore(e,n)}function me(t,e){var n,i=_(t)?t:Ft(t);return this.isValid()&&i.isValid()?(e=H(e||"millisecond"),"millisecond"===e?+this===+i:(n=+i,+this.clone().startOf(e)<=n&&n<=+this.clone().endOf(e))):!1}function _e(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ye(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function ge(t,e,n){var i,s,r,a;return this.isValid()?(i=Et(t,this),i.isValid()?(s=6e4*(i.utcOffset()-this.utcOffset()),e=H(e),"year"===e||"month"===e||"quarter"===e?(a=pe(this,i),"quarter"===e?a/=3:"year"===e&&(a/=12)):(r=this-i,a="second"===e?r/1e3:"minute"===e?r/6e4:"hour"===e?r/36e5:"day"===e?(r-s)/864e5:"week"===e?(r-s)/6048e5:r),n?a:y(a)):NaN):NaN}function pe(t,e){var n,i,s=12*(e.year()-t.year())+(e.month()-t.month()),r=t.clone().add(s,"months");return 0>e-r?(n=t.clone().add(s-1,"months"),i=(e-r)/(r-n)):(n=t.clone().add(s+1,"months"),i=(e-r)/(n-r)),-(s+i)}function ve(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function De(){var t=this.clone().utc();return 0r&&(e=r),Ze.call(this,t,e,n,i,s))}function Ze(t,e,n,i,s){var r=Dt(t,e,n,i,s),a=_t(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function $e(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function qe(t){return Mt(t,this._week.dow,this._week.doy).week}function Je(){return this._week.dow}function Be(){return this._week.doy}function Qe(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Xe(t){var e=Mt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Ke(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function tn(t,e){return n(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function en(t){return this._weekdaysShort[t.day()]}function nn(t){return this._weekdaysMin[t.day()]}function sn(t,e,n){var i,s,r;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;7>i;i++){if(s=Ft([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(s,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(s,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(s,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}}function rn(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ke(t,this.localeData()),this.add(t-e,"d")):e}function an(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function on(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function un(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function dn(){return this.hours()%12||12}function ln(t,e){E(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function hn(t,e){return e._meridiemParse}function cn(t){return"p"===(t+"").toLowerCase().charAt(0)}function fn(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function mn(t,e){e[Ci]=g(1e3*("0."+t))}function _n(){return this._isUTC?"UTC":""}function yn(){return this._isUTC?"Coordinated Universal Time":""}function gn(t){return Ft(1e3*t)}function pn(){return Ft.apply(null,arguments).parseZone()}function vn(t,e,n){var i=this._calendar[t];return S(i)?i.call(e,n):i}function Dn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function Mn(){return this._invalidDate}function Sn(t){return this._ordinal.replace("%d",t)}function Yn(t){return t}function wn(t,e,n,i){var s=this._relativeTime[n];return S(s)?s(t,e,n,i):s.replace(/%d/i,t)}function kn(t,e){var n=this._relativeTime[t>0?"future":"past"];return S(n)?n(e):n.replace(/%s/i,e)}function Tn(t,e,n,i){var s=P(),r=o().set(i,e);return s[n](r,t)}function bn(t,e,n,i,s){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return Tn(t,e,n,s);var r,a=[];for(r=0;i>r;r++)a[r]=Tn(t,r,n,s);return a}function On(t,e){return bn(t,e,"months",12,"month")}function Wn(t,e){return bn(t,e,"monthsShort",12,"month")}function xn(t,e){return bn(t,e,"weekdays",7,"day")}function Un(t,e){return bn(t,e,"weekdaysShort",7,"day")}function Gn(t,e){return bn(t,e,"weekdaysMin",7,"day")}function Pn(){var t=this._data;return this._milliseconds=ws(this._milliseconds),this._days=ws(this._days),this._months=ws(this._months),t.milliseconds=ws(t.milliseconds),t.seconds=ws(t.seconds),t.minutes=ws(t.minutes),t.hours=ws(t.hours),t.months=ws(t.months),t.years=ws(t.years),this}function Cn(t,e,n,i){var s=ne(e,n);return t._milliseconds+=i*s._milliseconds,t._days+=i*s._days,t._months+=i*s._months,t._bubble()}function Fn(t,e){return Cn(this,t,e,1)}function Hn(t,e){return Cn(this,t,e,-1)}function Ln(t){return 0>t?Math.floor(t):Math.ceil(t)}function Vn(){var t,e,n,i,s,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return r>=0&&a>=0&&o>=0||0>=r&&0>=a&&0>=o||(r+=864e5*Ln(In(o)+a),a=0,o=0),u.milliseconds=r%1e3,t=y(r/1e3),u.seconds=t%60,e=y(t/60),u.minutes=e%60,n=y(e/60),u.hours=n%24,a+=y(n/24),s=y(Nn(a)),o+=s,a-=Ln(In(s)),i=y(o/12),o%=12,u.days=a,u.months=o,u.years=i,this}function Nn(t){return 4800*t/146097}function In(t){return 146097*t/4800}function An(t){var e,n,i=this._milliseconds;if(t=H(t),"month"===t||"year"===t)return e=this._days+i/864e5,n=this._months+Nn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(In(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}}function Rn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*g(this._months/12)}function En(t){return function(){return this.as(t)}}function jn(t){return t=H(t),this[t+"s"]()}function zn(t){return function(){return this._data[t]}}function Zn(){return y(this.days()/7)}function $n(t,e,n,i,s){return s.relativeTime(e||1,!!n,t,i)}function qn(t,e,n){var i=ne(t).abs(),s=Is(i.as("s")),r=Is(i.as("m")),a=Is(i.as("h")),o=Is(i.as("d")),u=Is(i.as("M")),d=Is(i.as("y")),l=s=r&&["m"]||r=a&&["h"]||a=o&&["d"]||o=u&&["M"]||u=d&&["y"]||["yy",d];return l[2]=e,l[3]=+t>0,l[4]=n,$n.apply(null,l)}function Jn(t,e){return void 0===As[t]?!1:void 0===e?As[t]:(As[t]=e,!0)}function Bn(t){var e=this.localeData(),n=qn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Qn(){var t,e,n,i=Rs(this._milliseconds)/1e3,s=Rs(this._days),r=Rs(this._months);t=y(i/60),e=y(t/60),i%=60,t%=60,n=y(r/12),r%=12;var a=n,o=r,u=s,d=e,l=t,h=i,c=this.asSeconds();return c?(0>c?"-":"")+"P"+(a?a+"Y":"")+(o?o+"M":"")+(u?u+"D":"")+(d||l||h?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(h?h+"S":""):"P0D"}var Xn,Kn=t.momentProperties=[],ti=!1,ei={};t.suppressDeprecationWarnings=!1;var ni,ii={},si={},ri=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ai=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,oi={},ui={},di=/\d/,li=/\d\d/,hi=/\d{3}/,ci=/\d{4}/,fi=/[+-]?\d{6}/,mi=/\d\d?/,_i=/\d\d\d\d?/,yi=/\d\d\d\d\d\d?/,gi=/\d{1,3}/,pi=/\d{1,4}/,vi=/[+-]?\d{1,6}/,Di=/\d+/,Mi=/[+-]?\d+/,Si=/Z|[+-]\d\d:?\d\d/gi,Yi=/Z|[+-]\d\d(?::?\d\d)?/gi,wi=/[+-]?\d+(\.\d{1,3})?/,ki=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Ti={},bi={},Oi=0,Wi=1,xi=2,Ui=3,Gi=4,Pi=5,Ci=6,Fi=7,Hi=8;E("M",["MM",2],"Mo",function(){return this.month()+1}),E("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),E("MMMM",0,0,function(t){return this.localeData().months(this,t)}),F("month","M"),q("M",mi),q("MM",mi,li),q("MMM",function(t,e){return e.monthsShortRegex(t)}),q("MMMM",function(t,e){return e.monthsRegex(t)}),X(["M","MM"],function(t,e){e[Wi]=g(t)-1}),X(["MMM","MMMM"],function(t,e,n,i){var s=n._locale.monthsParse(t,i,n._strict);null!=s?e[Wi]=s:d(n).invalidMonth=t});var Li=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Vi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ni="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ii=ki,Ai=ki,Ri=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Ei=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,ji=/Z|[+-]\d\d(?::?\d\d)?/,zi=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Zi=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],$i=/^\/?Date\((\-?\d+)/i;t.createFromInputFallback=D("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),E("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),E(0,["YY",2],0,function(){return this.year()%100}),E(0,["YYYY",4],0,"year"),E(0,["YYYYY",5],0,"year"),E(0,["YYYYYY",6,!0],0,"year"),F("year","y"),q("Y",Mi),q("YY",mi,li),q("YYYY",pi,ci),q("YYYYY",vi,fi),q("YYYYYY",vi,fi),X(["YYYYY","YYYYYY"],Oi),X("YYYY",function(e,n){n[Oi]=2===e.length?t.parseTwoDigitYear(e):g(e);}),X("YY",function(e,n){n[Oi]=t.parseTwoDigitYear(e)}),X("Y",function(t,e){e[Oi]=parseInt(t,10)}),t.parseTwoDigitYear=function(t){return g(t)+(g(t)>68?1900:2e3)};var qi=V("FullYear",!1);t.ISO_8601=function(){};var Ji=D("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=Ft.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:h()}),Bi=D("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=Ft.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:h()}),Qi=function(){return Date.now?Date.now():+new Date};At("Z",":"),At("ZZ",""),q("Z",Yi),q("ZZ",Yi),X(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Rt(Yi,t)});var Xi=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var Ki=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ts=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;ne.fn=Nt.prototype;var es=oe(1,"add"),ns=oe(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var is=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});E(0,["gg",2],0,function(){return this.weekYear()%100}),E(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ie("gggg","weekYear"),Ie("ggggg","weekYear"),Ie("GGGG","isoWeekYear"),Ie("GGGGG","isoWeekYear"),F("weekYear","gg"),F("isoWeekYear","GG"),q("G",Mi),q("g",Mi),q("GG",mi,li),q("gg",mi,li),q("GGGG",pi,ci),q("gggg",pi,ci),q("GGGGG",vi,fi),q("ggggg",vi,fi),K(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=g(t)}),K(["gg","GG"],function(e,n,i,s){n[s]=t.parseTwoDigitYear(e)}),E("Q",0,"Qo","quarter"),F("quarter","Q"),q("Q",di),X("Q",function(t,e){e[Wi]=3*(g(t)-1)}),E("w",["ww",2],"wo","week"),E("W",["WW",2],"Wo","isoWeek"),F("week","w"),F("isoWeek","W"),q("w",mi),q("ww",mi,li),q("W",mi),q("WW",mi,li),K(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=g(t)});var ss={dow:0,doy:6};E("D",["DD",2],"Do","date"),F("date","D"),q("D",mi),q("DD",mi,li),q("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),X(["D","DD"],xi),X("Do",function(t,e){e[xi]=g(t.match(mi)[0],10)});var rs=V("Date",!0);E("d",0,"do","day"),E("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),E("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),E("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),E("e",0,0,"weekday"),E("E",0,0,"isoWeekday"),F("day","d"),F("weekday","e"),F("isoWeekday","E"),q("d",mi),q("e",mi),q("E",mi),q("dd",ki),q("ddd",ki),q("dddd",ki),K(["dd","ddd","dddd"],function(t,e,n,i){var s=n._locale.weekdaysParse(t,i,n._strict);null!=s?e.d=s:d(n).invalidWeekday=t}),K(["d","e","E"],function(t,e,n,i){e[i]=g(t)});var as="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),os="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),us="Su_Mo_Tu_We_Th_Fr_Sa".split("_");E("DDD",["DDDD",3],"DDDo","dayOfYear"),F("dayOfYear","DDD"),q("DDD",gi),q("DDDD",hi),X(["DDD","DDDD"],function(t,e,n){n._dayOfYear=g(t)}),E("H",["HH",2],0,"hour"),E("h",["hh",2],0,dn),E("hmm",0,0,function(){return""+dn.apply(this)+R(this.minutes(),2)}),E("hmmss",0,0,function(){return""+dn.apply(this)+R(this.minutes(),2)+R(this.seconds(),2)}),E("Hmm",0,0,function(){return""+this.hours()+R(this.minutes(),2)}),E("Hmmss",0,0,function(){return""+this.hours()+R(this.minutes(),2)+R(this.seconds(),2)}),ln("a",!0),ln("A",!1),F("hour","h"),q("a",hn),q("A",hn),q("H",mi),q("h",mi),q("HH",mi,li),q("hh",mi,li),q("hmm",_i),q("hmmss",yi),q("Hmm",_i),q("Hmmss",yi),X(["H","HH"],Ui),X(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),X(["h","hh"],function(t,e,n){e[Ui]=g(t),d(n).bigHour=!0}),X("hmm",function(t,e,n){var i=t.length-2;e[Ui]=g(t.substr(0,i)),e[Gi]=g(t.substr(i)),d(n).bigHour=!0}),X("hmmss",function(t,e,n){var i=t.length-4,s=t.length-2;e[Ui]=g(t.substr(0,i)),e[Gi]=g(t.substr(i,2)),e[Pi]=g(t.substr(s)),d(n).bigHour=!0}),X("Hmm",function(t,e,n){var i=t.length-2;e[Ui]=g(t.substr(0,i)),e[Gi]=g(t.substr(i))}),X("Hmmss",function(t,e,n){var i=t.length-4,s=t.length-2;e[Ui]=g(t.substr(0,i)),e[Gi]=g(t.substr(i,2)),e[Pi]=g(t.substr(s))});var ds=/[ap]\.?m?\.?/i,ls=V("Hours",!0);E("m",["mm",2],0,"minute"),F("minute","m"),q("m",mi),q("mm",mi,li),X(["m","mm"],Gi);var hs=V("Minutes",!1);E("s",["ss",2],0,"second"),F("second","s"),q("s",mi),q("ss",mi,li),X(["s","ss"],Pi);var cs=V("Seconds",!1);E("S",0,0,function(){return~~(this.millisecond()/100)}),E(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),E(0,["SSS",3],0,"millisecond"),E(0,["SSSS",4],0,function(){return 10*this.millisecond()}),E(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),E(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),E(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),E(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),E(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),F("millisecond","ms"),q("S",gi,di),q("SS",gi,li),q("SSS",gi,hi);var fs;for(fs="SSSS";fs.length<=9;fs+="S")q(fs,Di);for(fs="S";fs.length<=9;fs+="S")X(fs,mn);var ms=V("Milliseconds",!1);E("z",0,0,"zoneAbbr"),E("zz",0,0,"zoneName");var _s=m.prototype;_s.add=es,_s.calendar=de,_s.clone=le,_s.diff=ge,_s.endOf=We,_s.format=Me,_s.from=Se,_s.fromNow=Ye,_s.to=we,_s.toNow=ke,_s.get=A,_s.invalidAt=Ve,_s.isAfter=he,_s.isBefore=ce,_s.isBetween=fe,_s.isSame=me,_s.isSameOrAfter=_e,_s.isSameOrBefore=ye,_s.isValid=He,_s.lang=is,_s.locale=Te,_s.localeData=be,_s.max=Bi,_s.min=Ji,_s.parsingFlags=Le,_s.set=A,_s.startOf=Oe,_s.subtract=ns,_s.toArray=Pe,_s.toObject=Ce,_s.toDate=Ge,_s.toISOString=De,_s.toJSON=Fe,_s.toString=ve,_s.unix=Ue,_s.valueOf=xe,_s.creationData=Ne,_s.year=qi,_s.isLeapYear=pt,_s.weekYear=Ae,_s.isoWeekYear=Re,_s.quarter=_s.quarters=$e,_s.month=at,_s.daysInMonth=ot,_s.week=_s.weeks=Qe,_s.isoWeek=_s.isoWeeks=Xe,_s.weeksInYear=je,_s.isoWeeksInYear=Ee,_s.date=rs,_s.day=_s.days=rn,_s.weekday=an,_s.isoWeekday=on,_s.dayOfYear=un,_s.hour=_s.hours=ls,_s.minute=_s.minutes=hs,_s.second=_s.seconds=cs,_s.millisecond=_s.milliseconds=ms,_s.utcOffset=zt,_s.utc=$t,_s.local=qt,_s.parseZone=Jt,_s.hasAlignedHourOffset=Bt,_s.isDST=Qt,_s.isDSTShifted=Xt,_s.isLocal=Kt,_s.isUtcOffset=te,_s.isUtc=ee,_s.isUTC=ee,_s.zoneAbbr=_n,_s.zoneName=yn,_s.dates=D("dates accessor is deprecated. Use date instead.",rs),_s.months=D("months accessor is deprecated. Use month instead",at),_s.years=D("years accessor is deprecated. Use year instead",qi),_s.zone=D("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Zt);var ys=_s,gs={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},ps={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},vs="Invalid date",Ds="%d",Ms=/\d{1,2}/,Ss={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ys=T.prototype;Ys._calendar=gs,Ys.calendar=vn,Ys._longDateFormat=ps,Ys.longDateFormat=Dn,Ys._invalidDate=vs,Ys.invalidDate=Mn,Ys._ordinal=Ds,Ys.ordinal=Sn,Ys._ordinalParse=Ms,Ys.preparse=Yn,Ys.postformat=Yn,Ys._relativeTime=Ss,Ys.relativeTime=wn,Ys.pastFuture=kn,Ys.set=w,Ys.months=nt,Ys._months=Vi,Ys.monthsShort=it,Ys._monthsShort=Ni,Ys.monthsParse=st,Ys._monthsRegex=Ai,Ys.monthsRegex=dt,Ys._monthsShortRegex=Ii,Ys.monthsShortRegex=ut,Ys.week=qe,Ys._week=ss,Ys.firstDayOfYear=Be,Ys.firstDayOfWeek=Je,Ys.weekdays=tn,Ys._weekdays=as,Ys.weekdaysMin=nn,Ys._weekdaysMin=us,Ys.weekdaysShort=en,Ys._weekdaysShort=os,Ys.weekdaysParse=sn,Ys.isPM=cn,Ys._meridiemParse=ds,Ys.meridiem=fn,x("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===g(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),t.lang=D("moment.lang is deprecated. Use moment.locale instead.",x),t.langData=D("moment.langData is deprecated. Use moment.localeData instead.",P);var ws=Math.abs,ks=En("ms"),Ts=En("s"),bs=En("m"),Os=En("h"),Ws=En("d"),xs=En("w"),Us=En("M"),Gs=En("y"),Ps=zn("milliseconds"),Cs=zn("seconds"),Fs=zn("minutes"),Hs=zn("hours"),Ls=zn("days"),Vs=zn("months"),Ns=zn("years"),Is=Math.round,As={s:45,m:45,h:22,d:26,M:11},Rs=Math.abs,Es=Nt.prototype;Es.abs=Pn,Es.add=Fn,Es.subtract=Hn,Es.as=An,Es.asMilliseconds=ks,Es.asSeconds=Ts,Es.asMinutes=bs,Es.asHours=Os,Es.asDays=Ws,Es.asWeeks=xs,Es.asMonths=Us,Es.asYears=Gs,Es.valueOf=Rn,Es._bubble=Vn,Es.get=jn,Es.milliseconds=Ps,Es.seconds=Cs,Es.minutes=Fs,Es.hours=Hs,Es.days=Ls,Es.weeks=Zn,Es.months=Vs,Es.years=Ns,Es.humanize=Bn,Es.toISOString=Qn,Es.toString=Qn,Es.toJSON=Qn,Es.locale=Te,Es.localeData=be,Es.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Qn),Es.lang=is,E("X",0,0,"unix"),E("x",0,0,"valueOf"),q("x",Mi),q("X",wi),X("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),X("x",function(t,e,n){n._d=new Date(g(t))}),t.version="2.12.0",e(Ft),t.fn=ys,t.min=Lt,t.max=Vt,t.now=Qi,t.utc=o,t.unix=gn,t.months=On,t.isDate=i,t.locale=x,t.invalid=h,t.duration=ne,t.isMoment=_,t.weekdays=xn,t.parseZone=pn,t.localeData=P,t.isDuration=It,t.monthsShort=Wn,t.weekdaysMin=Gn,t.defineLocale=U,t.updateLocale=G,t.locales=C,t.weekdaysShort=Un,t.normalizeUnits=H,t.relativeTimeThreshold=Jn,t.prototype=ys;var js=t;return js}); +/** + * @module Bootstrap Material Datetimepicker + * @see https://github.com/T00rk/bootstrap-material-datetimepicker + * @version 2.0 + */ +!function(a,b){function c(b,c){this.currentView=0,this.minDate,this.maxDate,this._attachedEvents=[],this.element=b,this.$element=a(b),this.params={date:!0,time:!0,format:"YYYY-MM-DD",minDate:null,maxDate:null,currentDate:null,lang:"en",weekStart:0,shortTime:!1,cancelText:"Cancel",okText:"OK"},this.params=a.fn.extend(this.params,c),this.name="dtp_"+this.setName(),this.$element.attr("data-dtp",this.name),this.init()}var d="bootstrapMaterialDatePicker",e="plugin_"+d;b.locale("en"),a.fn[d]=function(b,d){return this.each(function(){a.data(this,e)?("function"==typeof a.data(this,e)[b]&&a.data(this,e)[b](d),"destroy"===b&&delete a.data(this,e)):a.data(this,e,new c(this,b))}),this},c.prototype={init:function(){this.initDays(),this.initDates(),this.initTemplate(),this.initButtons(),this._attachEvent(a(window),"resize",this._centerBox(this)),this._attachEvent(this.$dtpElement.find(".dtp-content"),"click",this._onElementClick.bind(this)),this._attachEvent(this.$dtpElement,"click",this._onBackgroundClick.bind(this)),this._attachEvent(this.$dtpElement.find(".dtp-close > a"),"click",this._onCloseClick.bind(this)),this._attachEvent(this.$element,"click",this._onClick.bind(this))},initDays:function(){this.days=[];for(var a=this.params.weekStart;this.days.length<7;a++)a>6&&(a=0),this.days.push(a.toString())},initDates:function(){if(this.$element.val().length>0)"undefined"!=typeof this.params.format&&null!==this.params.format?this.currentDate=b(this.$element.val(),this.params.format).locale(this.params.lang):this.currentDate=b(this.$element.val()).locale(this.params.lang);else if("undefined"!=typeof this.$element.attr("value")&&null!==this.$element.attr("value")&&""!==this.$element.attr("value"))"string"==typeof this.$element.attr("value")&&("undefined"!=typeof this.params.format&&null!==this.params.format?this.currentDate=b(this.$element.attr("value"),this.params.format).locale(this.params.lang):this.currentDate=b(this.$element.attr("value")).locale(this.params.lang));else if("undefined"!=typeof this.params.currentDate&&null!==this.params.currentDate){if("string"==typeof this.params.currentDate)"undefined"!=typeof this.params.format&&null!==this.params.format?this.currentDate=b(this.params.currentDate,this.params.format).locale(this.params.lang):this.currentDate=b(this.params.currentDate).locale(this.params.lang);else if("undefined"==typeof this.params.currentDate.isValid||"function"!=typeof this.params.currentDate.isValid){var a=this.params.currentDate.getTime();this.currentDate=b(a,"x").locale(this.params.lang)}else this.currentDate=this.params.currentDate;this.$element.val(this.currentDate.format(this.params.format))}else this.currentDate=b();if("undefined"!=typeof this.params.minDate&&null!==this.params.minDate)if("string"==typeof this.params.minDate)"undefined"!=typeof this.params.format&&null!==this.params.format?this.minDate=b(this.params.minDate,this.params.format).locale(this.params.lang):this.minDate=b(this.params.minDate).locale(this.params.lang);else if("undefined"==typeof this.params.minDate.isValid||"function"!=typeof this.params.minDate.isValid){var a=this.params.minDate.getTime();this.minDate=b(a,"x").locale(this.params.lang)}else this.minDate=this.params.minDate;if("undefined"!=typeof this.params.maxDate&&null!==this.params.maxDate)if("string"==typeof this.params.maxDate)"undefined"!=typeof this.params.format&&null!==this.params.format?this.maxDate=b(this.params.maxDate,this.params.format).locale(this.params.lang):this.maxDate=b(this.params.maxDate).locale(this.params.lang);else if("undefined"==typeof this.params.maxDate.isValid||"function"!=typeof this.params.maxDate.isValid){var a=this.params.maxDate.getTime();this.maxDate=b(a,"x").locale(this.params.lang)}else this.maxDate=this.params.maxDate;this.isAfterMinDate(this.currentDate)||(this.currentDate=b(this.minDate)),this.isBeforeMaxDate(this.currentDate)||(this.currentDate=b(this.maxDate))},initTemplate:function(){this.template='',a("body").find("#"+this.name).length<=0&&(a("body").append(this.template),this.dtpElement=a("body").find("#"+this.name),this.$dtpElement=a(this.dtpElement))},initButtons:function(){this._attachEvent(this.$dtpElement.find(".dtp-btn-cancel"),"click",this._onCancelClick.bind(this)),this._attachEvent(this.$dtpElement.find(".dtp-btn-ok"),"click",this._onOKClick.bind(this)),this._attachEvent(this.$dtpElement.find("a.dtp-select-month-before"),"click",this._onMonthBeforeClick.bind(this)),this._attachEvent(this.$dtpElement.find("a.dtp-select-month-after"),"click",this._onMonthAfterClick.bind(this)),this._attachEvent(this.$dtpElement.find("a.dtp-select-year-before"),"click",this._onYearBeforeClick.bind(this)),this._attachEvent(this.$dtpElement.find("a.dtp-select-year-after"),"click",this._onYearAfterClick.bind(this))},initMeridienButtons:function(){this.$dtpElement.find("a.dtp-meridien-am").off("click").on("click",this._onSelectAM.bind(this)),this.$dtpElement.find("a.dtp-meridien-pm").off("click").on("click",this._onSelectPM.bind(this))},initDate:function(a){this.currentView=0,this.$dtpElement.find(".dtp-picker-calendar").removeClass("hidden"),this.$dtpElement.find(".dtp-picker-datetime").addClass("hidden");var b="undefined"!=typeof this.currentDate&&null!==this.currentDate?this.currentDate:null,c=this.generateCalendar(this.currentDate);if("undefined"!=typeof c.week&&"undefined"!=typeof c.days){var d=this.constructHTMLCalendar(b,c);this.$dtpElement.find("a.dtp-select-day").off("click"),this.$dtpElement.find(".dtp-picker-calendar").html(d),this.$dtpElement.find("a.dtp-select-day").on("click",this._onSelectDate.bind(this)),this.toggleButtons(b)}this._centerBox(),this.showDate(b)},initHours:function(){var b=this;setTimeout(function(){if(b.currentView=1,!b.params.date){var c=b.$dtpElement.find(".dtp-content").width(),d=b.$dtpElement.find(".dtp-picker-clock").css("marginLeft").replace("px",""),e=b.$dtpElement.find(".dtp-picker-clock").css("marginRight").replace("px",""),f=b.$dtpElement.find(".dtp-picker").css("paddingLeft").replace("px",""),g=b.$dtpElement.find(".dtp-picker").css("paddingRight").replace("px","");b.$dtpElement.find(".dtp-picker-clock").innerWidth(c-(parseInt(d)+parseInt(e)+parseInt(f)+parseInt(g)))}b.showTime(b.currentDate),b.initMeridienButtons(),b.$dtpElement.find(".dtp-picker-datetime").removeClass("hidden"),b.$dtpElement.find(".dtp-picker-calendar").addClass("hidden"),b.currentDate.hour()<12?b.$dtpElement.find("a.dtp-meridien-am").click():b.$dtpElement.find("a.dtp-meridien-pm").click();for(var h=b.$dtpElement.find(".dtp-picker-clock").parent().parent().css("paddingLeft").replace("px",""),i=b.$dtpElement.find(".dtp-picker-clock").parent().parent().css("paddingTop").replace("px",""),j=b.$dtpElement.find(".dtp-picker-clock").css("marginLeft").replace("px",""),k=b.$dtpElement.find(".dtp-picker-clock").css("marginTop").replace("px",""),l=b.$dtpElement.find(".dtp-picker-clock").innerWidth()/2,m=l/1.2,n=[],o=0;12>o;++o){var p=m*Math.sin(2*Math.PI*(o/12)),q=m*Math.cos(2*Math.PI*(o/12)),r=a("
",{class:"dtp-picker-time"}).css({marginLeft:l+p+parseInt(h)/2-(parseInt(h)+parseInt(j))+"px",marginTop:l-q-parseInt(k)/2-(parseInt(i)+parseInt(k))+"px"}),s=12==b.currentDate.format("h")?0:b.currentDate.format("h"),t=a("",{href:"javascript:void(0);",class:"dtp-select-hour"}).data("hour",o).text(0==o?12:o);o==parseInt(s)&&t.addClass("selected"),r.append(t),n.push(r)}b.$dtpElement.find("a.dtp-select-hour").off("click"),b.$dtpElement.find(".dtp-picker-clock").html(n),b.toggleTime(!0),b.$dtpElement.find(".dtp-picker-clock").css("height",b.$dtpElement.find(".dtp-picker-clock").width()+(parseInt(i)+parseInt(k))+"px"),b.initHands(!0)},300)},initMinutes:function(){this.currentView=2,this.showTime(this.currentDate),this.initMeridienButtons(),this.currentDate.hour()<12?this.$dtpElement.find("a.dtp-meridien-am").click():this.$dtpElement.find("a.dtp-meridien-pm").click(),this.$dtpElement.find(".dtp-picker-calendar").addClass("hidden"),this.$dtpElement.find(".dtp-picker-datetime").removeClass("hidden");for(var b=this.$dtpElement.find(".dtp-picker-clock").parent().parent().css("paddingLeft").replace("px",""),c=this.$dtpElement.find(".dtp-picker-clock").parent().parent().css("paddingTop").replace("px",""),d=this.$dtpElement.find(".dtp-picker-clock").css("marginLeft").replace("px",""),e=this.$dtpElement.find(".dtp-picker-clock").css("marginTop").replace("px",""),f=this.$dtpElement.find(".dtp-picker-clock").innerWidth()/2,g=f/1.2,h=[],i=0;60>i;i+=5){var j=g*Math.sin(2*Math.PI*(i/60)),k=g*Math.cos(2*Math.PI*(i/60)),l=a("
",{class:"dtp-picker-time"}).css({marginLeft:f+j+parseInt(b)/2-(parseInt(b)+parseInt(d))+"px",marginTop:f-k-parseInt(e)/2-(parseInt(c)+parseInt(e))+"px"}),m=a("",{href:"javascript:void(0);",class:"dtp-select-minute"}).data("minute",i).text(2==i.toString().length?i:"0"+i);i==5*Math.round(this.currentDate.minute()/5)&&(m.addClass("selected"),this.currentDate.minute(i)),l.append(m),h.push(l)}this.$dtpElement.find("a.dtp-select-minute").off("click"),this.$dtpElement.find(".dtp-picker-clock").html(h),this.toggleTime(!1),this.$dtpElement.find(".dtp-picker-clock").css("height",this.$dtpElement.find(".dtp-picker-clock").width()+(parseInt(c)+parseInt(e))+"px"),this.initHands(!1),this._centerBox()},initHands:function(a){this.$dtpElement.find(".dtp-picker-clock").append('
');var b=this.$dtpElement.find(".dtp-picker-clock").parent().parent().css("paddingLeft").replace("px",""),c=(this.$dtpElement.find(".dtp-picker-clock").parent().parent().css("paddingTop").replace("px",""),this.$dtpElement.find(".dtp-picker-clock").css("marginLeft").replace("px","")),d=(this.$dtpElement.find(".dtp-picker-clock").css("marginTop").replace("px",""),this.$dtpElement.find(".dtp-clock-center").width()/2),e=this.$dtpElement.find(".dtp-clock-center").height()/2,f=this.$dtpElement.find(".dtp-picker-clock").innerWidth()/2,g=f/1.7,h=f/1.5;this.$dtpElement.find(".dtp-hour-hand").css({left:f+1.5*parseInt(c)+"px",height:g+"px",marginTop:f-g-parseInt(b)+"px"}).addClass(a===!0?"on":""),this.$dtpElement.find(".dtp-minute-hand").css({left:f+1.5*parseInt(c)+"px",height:h+"px",marginTop:f-h-parseInt(b)+"px"}).addClass(a===!1?"on":""),this.$dtpElement.find(".dtp-clock-center").css({left:f+parseInt(b)+parseInt(c)-d+"px",marginTop:f-parseInt(c)/2-e+"px"}),this.animateHands(),this._centerBox()},animateHands:function(){var a=this.currentDate.hour();this.currentDate.minute(),this.rotateElement(this.$dtpElement.find(".dtp-hour-hand"),30*a),this.rotateElement(this.$dtpElement.find(".dtp-minute-hand"),6*(5*Math.round(this.currentDate.minute()/5)))},isAfterMinDate:function(a,c,d){var e=!0;if("undefined"!=typeof this.minDate&&null!==this.minDate){var f=b(this.minDate),g=b(a);c||d||(f.hour(0),f.minute(0),g.hour(0),g.minute(0)),f.second(0),g.second(0),f.millisecond(0),g.millisecond(0),d?e=parseInt(g.format("X"))>=parseInt(f.format("X")):(g.minute(0),f.minute(0),e=parseInt(g.format("X"))>=parseInt(f.format("X")))}return e},isBeforeMaxDate:function(a,c,d){var e=!0;if("undefined"!=typeof this.maxDate&&null!==this.maxDate){var f=b(this.maxDate),g=b(a);c||d||(f.hour(0),f.minute(0),g.hour(0),g.minute(0)),f.second(0),g.second(0),f.millisecond(0),g.millisecond(0),d?e=parseInt(g.format("X"))<=parseInt(f.format("X")):(g.minute(0),f.minute(0),e=parseInt(g.format("X"))<=parseInt(f.format("X")))}return e},rotateElement:function(b,c){a(b).css({WebkitTransform:"rotate("+c+"deg)","-moz-transform":"rotate("+c+"deg)"})},showDate:function(a){a&&(this.$dtpElement.find(".dtp-actual-day").html(a.locale(this.params.lang).format("dddd")),this.$dtpElement.find(".dtp-actual-month").html(a.locale(this.params.lang).format("MMM").toUpperCase()),this.$dtpElement.find(".dtp-actual-num").html(a.locale(this.params.lang).format("DD")),this.$dtpElement.find(".dtp-actual-year").html(a.locale(this.params.lang).format("YYYY")))},showTime:function(a){if(a){var b=5*Math.round(a.minute()/5),c=(this.params.shortTime?a.format("hh"):a.format("HH"))+":"+(2==b.toString().length?b:"0"+b);this.params.date?this.$dtpElement.find(".dtp-actual-time").html(c):(this.params.shortTime?this.$dtpElement.find(".dtp-actual-day").html(a.format("A")):this.$dtpElement.find(".dtp-actual-day").html(" "),this.$dtpElement.find(".dtp-actual-maxtime").html(c))}},selectDate:function(a){a&&(this.currentDate.date(a),this.showDate(this.currentDate),this.$element.trigger("dateSelected",this.currentDate))},generateCalendar:function(a){var c={};if(null!==a){var d=b(a).locale(this.params.lang).startOf("month"),e=b(a).locale(this.params.lang).endOf("month"),f=d.format("d");c.week=this.days,c.days=[];for(var g=d.date();g<=e.date();g++){if(g===d.date()){var h=c.week.indexOf(f.toString());if(h>0)for(var i=0;h>i;i++)c.days.push(0)}c.days.push(b(d).locale(this.params.lang).date(g))}}return c},constructHTMLCalendar:function(a,c){var d="";d+='
'+a.locale(this.params.lang).format("MMMM YYYY")+"
",d+='';for(var e=0;e"+b(parseInt(c.week[e]),"d").locale(this.params.lang).format("dd").substring(0,1)+"";d+="",d+="";for(var e=0;e"),d+='");return d+="
',0!=c.days[e]&&(d+=this.isBeforeMaxDate(b(c.days[e]),!1,!1)===!1||this.isAfterMinDate(b(c.days[e]),!1,!1)===!1?''+b(c.days[e]).locale(this.params.lang).format("DD")+"":b(c.days[e]).locale(this.params.lang).format("DD")===b(this.currentDate).locale(this.params.lang).format("DD")?''+b(c.days[e]).locale(this.params.lang).format("DD")+"":''+b(c.days[e]).locale(this.params.lang).format("DD")+"",d+="
"},setName:function(){for(var a="",b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",c=0;5>c;c++)a+=b.charAt(Math.floor(Math.random()*b.length));return a},isPM:function(){return this.$dtpElement.find("a.dtp-meridien-pm").hasClass("selected")},setElementValue:function(){this.$element.trigger("beforeChange",this.currentDate),"undefined"!=typeof a.material&&this.$element.removeClass("empty"),this.$element.val(b(this.currentDate).locale(this.params.lang).format(this.params.format)),this.$element.parent().find(".rd-input-label").addClass("focus"),this.$element.trigger("change",this.currentDate)},toggleButtons:function(a){if(a&&a.isValid()){var c=b(a).locale(this.params.lang).startOf("month"),d=b(a).locale(this.params.lang).endOf("month");this.isAfterMinDate(c,!1,!1)?this.$dtpElement.find("a.dtp-select-month-before").removeClass("invisible"):this.$dtpElement.find("a.dtp-select-month-before").addClass("invisible"),this.isBeforeMaxDate(d,!1,!1)?this.$dtpElement.find("a.dtp-select-month-after").removeClass("invisible"):this.$dtpElement.find("a.dtp-select-month-after").addClass("invisible");var e=b(a).locale(this.params.lang).startOf("year"),f=b(a).locale(this.params.lang).endOf("year");this.isAfterMinDate(e,!1,!1)?this.$dtpElement.find("a.dtp-select-year-before").removeClass("invisible"):this.$dtpElement.find("a.dtp-select-year-before").addClass("invisible"),this.isBeforeMaxDate(f,!1,!1)?this.$dtpElement.find("a.dtp-select-year-after").removeClass("invisible"):this.$dtpElement.find("a.dtp-select-year-after").addClass("invisible")}},toggleTime:function(c){if(c){this.$dtpElement.find("a.dtp-select-hour").removeClass("disabled"),this.$dtpElement.find("a.dtp-select-hour").removeProp("disabled"),this.$dtpElement.find("a.dtp-select-hour").off("click");var d=this;this.$dtpElement.find("a.dtp-select-hour").each(function(){var c=a(this).data("hour"),e=b(d.currentDate);e.hour(d.convertHours(c)).minute(0).second(0),d.isAfterMinDate(e,!0,!1)===!1||d.isBeforeMaxDate(e,!0,!1)===!1?(a(this).prop("disabled"),a(this).addClass("disabled")):a(this).on("click",d._onSelectHour.bind(d))})}else{this.$dtpElement.find("a.dtp-select-minute").removeClass("disabled"),this.$dtpElement.find("a.dtp-select-minute").removeProp("disabled"),this.$dtpElement.find("a.dtp-select-minute").off("click");var d=this;this.$dtpElement.find("a.dtp-select-minute").each(function(){var c=a(this).data("minute"),e=b(d.currentDate);e.minute(c).second(0),d.isAfterMinDate(e,!0,!0)===!1||d.isBeforeMaxDate(e,!0,!0)===!1?(a(this).prop("disabled"),a(this).addClass("disabled")):a(this).on("click",d._onSelectMinute.bind(d))})}},_attachEvent:function(a,b,c){a.on(b,c),this._attachedEvents.push([a,b,c])},_detachEvents:function(){for(var a=this._attachedEvents.length-1;a>=0;a--)this._attachedEvents[a][0].off(this._attachedEvents[a][1],this._attachedEvents[a][2]),this._attachedEvents.splice(a,1)},_onClick:function(){this.currentView=0,this.$element.blur(),this.initDates(),this.show(),this.params.date?(this.$dtpElement.find(".dtp-date").removeClass("hidden"),this.initDate()):this.params.time&&(this.$dtpElement.find(".dtp-time").removeClass("hidden"),this.initHours())},_onBackgroundClick:function(a){a.stopPropagation(),this.hide()},_onElementClick:function(a){a.stopPropagation()},_onCloseClick:function(){this.hide()},_onOKClick:function(){switch(this.currentView){case 0:this.params.time===!0?this.initHours():(this.setElementValue(),this.hide());break;case 1:this.initMinutes();break;case 2:this.setElementValue(),this.hide()}},_onCancelClick:function(){if(this.params.time)switch(this.currentView){case 0:this.hide();break;case 1:this.params.date?this.initDate():this.hide();break;case 2:this.initHours()}else this.hide()},_onMonthBeforeClick:function(){this.currentDate.subtract(1,"months"),this.initDate(this.currentDate)},_onMonthAfterClick:function(){this.currentDate.add(1,"months"),this.initDate(this.currentDate)},_onYearBeforeClick:function(){this.currentDate.subtract(1,"years"),this.initDate(this.currentDate)},_onYearAfterClick:function(){this.currentDate.add(1,"years"),this.initDate(this.currentDate)},_onSelectDate:function(b){this.$dtpElement.find("a.dtp-select-day").removeClass("selected"),a(b.currentTarget).addClass("selected"),this.selectDate(a(b.currentTarget).parent().data("date"))},_onSelectHour:function(b){this.$dtpElement.find("a.dtp-select-hour").removeClass("selected"),a(b.currentTarget).addClass("selected");var c=parseInt(a(b.currentTarget).data("hour"));this.isPM()&&(c+=12),this.currentDate.hour(c),this.showTime(this.currentDate),this.animateHands()},_onSelectMinute:function(b){this.$dtpElement.find("a.dtp-select-minute").removeClass("selected"),a(b.currentTarget).addClass("selected"),this.currentDate.minute(parseInt(a(b.currentTarget).data("minute"))),this.showTime(this.currentDate),this.animateHands()},_onSelectAM:function(b){a(".dtp-actual-meridien").find("a").removeClass("selected"),a(b.currentTarget).addClass("selected"),this.currentDate.hour()>=12&&this.currentDate.subtract(12,"hours")&&this.showTime(this.currentDate),this.toggleTime(1===this.currentView)},_onSelectPM:function(b){a(".dtp-actual-meridien").find("a").removeClass("selected"),a(b.currentTarget).addClass("selected"),this.currentDate.hour()<12&&this.currentDate.add(12,"hours")&&this.showTime(this.currentDate),this.toggleTime(1===this.currentView)},convertHours:function(a){var b=a;return 12>a&&this.isPM()&&(b+=12),b},setDate:function(a){this.params.currentDate=a,this.initDates()},setMinDate:function(a){this.params.minDate=a,this.initDates()},setMaxDate:function(a){this.params.maxDate=a,this.initDates()},destroy:function(){this._detachEvents(),this.$dtpElement.remove()},show:function(){var a=this;setTimeout(function(){a.$dtpElement.removeClass("hidden"),a._centerBox()},300)},hide:function(){this.$dtpElement.addClass("hidden")},resetDate:function(){},_centerBox:function(){var a=(this.$dtpElement.height()-this.$dtpElement.find(".dtp-content").height())/2;this.$dtpElement.find(".dtp-content").css("marginLeft",-(this.$dtpElement.find(".dtp-content").width()/2)+"px"),this.$dtpElement.find(".dtp-content").css("top",a+"px")}}}(jQuery,moment); + +/** + * @module Select2 + * @version 3.5.4 + * @license MIT License + * @link https://github.com/select2/select2/blob/master/ + */ +!function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(b){for(var c=a([0]),d=-1,e=this.length;++dc;c+=1)if(r(a,b[c]))return c;return-1}function q(){var b=a(l);b.appendTo(document.body);var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function r(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function s(a,b,c){var d,e,f;if(null===a||a.length<1)return[];for(d=a.split(b),e=0,f=d.length;f>e;e+=1)d[e]=c(d[e]);return d}function t(a){return a.outerWidth(!1)-a.width()}function u(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function v(c){c.on("mousemove",function(c){var d=h;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function w(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function x(a,b){var c=w(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){p(a.target,b.get())>=0&&c(a)})}function y(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus();var e=b.offsetWidth>0||b.offsetHeight>0;e&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function z(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function A(a){a.preventDefault(),a.stopPropagation()}function B(a){a.preventDefault(),a.stopImmediatePropagation()}function C(b){if(!g){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);g=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),g.attr("class","select2-sizer"),a(document.body).append(g)}return g.text(b.val()),g.width()}function D(b,c,d){var e,g,f=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(g))})),b.attr("class",f.join(" "))}function E(a,b,c,d){var e=o(a.toUpperCase()).indexOf(o(b.toUpperCase())),f=b.length;return 0>e?void c.push(d(a)):(c.push(d(a.substring(0,e))),c.push(""),c.push(d(a.substring(e,e+f))),c.push(""),void c.push(d(a.substring(e+f,a.length))))}function F(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function G(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&"function"==typeof e.abort&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{url:f,dataType:c.dataType,data:d,success:function(a){var b=c.results(a,i.page,i);i.callback(b)},error:function(a,b,c){var d={hasError:!0,jqXHR:a,textStatus:b,errorThrown:c};i.callback(d)}}),e=j.call(h,l)},f)}}function H(b){var d,e,c=b,f=function(a){return""+a.text};a.isArray(c)&&(e=c,c={results:e}),a.isFunction(c)===!1&&(e=c,c=function(){return e});var g=c();return g.text&&(f=g.text,a.isFunction(f)||(d=g.text,f=function(a){return a[d]})),function(b){var g,d=b.term,e={results:[]};return""===d?void b.callback(c()):(g=function(c,e){var h,i;if(c=c[0],c.children){h={};for(i in c)c.hasOwnProperty(i)&&(h[i]=c[i]);h.children=[],a(c.children).each2(function(a,b){g(b,h.children)}),(h.children.length||b.matcher(d,f(h),c))&&e.push(h)}else b.matcher(d,f(c),c)&&e.push(c)},a(c().results).each2(function(a,b){g(b,e.results)}),void b.callback(e))}}function I(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]},h=d?c(e):c;a.isArray(h)&&(a(h).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g))}}function J(b,c){if(a.isFunction(b))return!0;if(!b)return!1;if("string"==typeof b)return!0;throw new Error(c+" must be a string, function, or falsy value")}function K(b,c){if(a.isFunction(b)){var d=Array.prototype.slice.call(arguments,2);return b.apply(c,d)}return b}function L(b){var c=0;return a.each(b,function(a,b){b.children?c+=L(b.children):c++}),c}function M(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(r(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:void 0}function N(){var b=this;a.each(arguments,function(a,c){b[c].remove(),b[c]=null})}function O(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,i,j,h={x:0,y:0},k={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case k.LEFT:case k.RIGHT:case k.UP:case k.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case k.SHIFT:case k.CTRL:case k.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="
",m={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};i=a(document),f=function(){var a=1;return function(){return a++}}(),c=O(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,g=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=a(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=a("",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+f()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",c.element.attr("title")),this.body=a(document.body),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(K(c.containerCss,this.opts.element)),this.container.addClass(K(c.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",A),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(c.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",A),this.results=d=this.container.find(g),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",A),v(this.results),this.dropdown.on("mousemove-filtered",g,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",g,this.bind(function(a){this._touchEvent=!0,this.highlightUnderEvent(a)})),this.dropdown.on("touchmove",g,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",g,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(a){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),x(80,this.results),this.dropdown.on("scroll-debounced",g,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),A(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),A(a))}),u(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",g,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(a){a.stopPropagation()}),this.lastSearchTerm=b,a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),j=j||q(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",c.searchInputPlaceholder)},destroy:function(){var a=this.opts.element,c=a.data("select2"),d=this;this.close(),a.length&&a[0].detachEvent&&d._sync&&a.each(function(){d._sync&&this.detachEvent("onpropertychange",d._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,c!==b&&(c.container.remove(),c.liveRegion.remove(),c.dropdown.remove(),a.removeData("select2").off(".select2"),a.is("input[type='hidden']")?a.css("display",""):(a.show().prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show())),N.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:r(a.attr("locked"),"locked")||r(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:void 0},prepareOpts:function(c){var d,e,g,h,i=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a ","
"," ","
    ","
","
"].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var b,c,d;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),b=this.search.get(0),b.createTextRange?(c=b.createTextRange(),c.collapse(!1),c.select()):b.setSelectionRange&&(d=this.search.val().length,b.setSelectionRange(d,d))),this.prefillNextSearchTerm(),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"selection","focusser")},initContainer:function(){var b,g,c=this.container,d=this.dropdown,e=f();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=b=c.find(".select2-choice"),this.focusser=c.find(".select2-focusser"),b.find(".select2-chosen").attr("id","select2-chosen-"+e),this.focusser.attr("aria-labelledby","select2-chosen-"+e),this.results.attr("id","select2-results-"+e),this.search.attr("aria-owns","select2-results-"+e),this.focusser.attr("id","s2id_autogen"+e),g=a("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.on("focus.select2",this.bind(function(){this.focus()})),this.focusser.prev().text(g.text()).attr("for",this.focusser.attr("id"));var h=this.opts.element.attr("title");this.opts.element.attr("title",h||g.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(a("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&229!=a.keyCode){if(a.which===k.PAGE_UP||a.which===k.PAGE_DOWN)return void A(a);switch(a.which){case k.UP:case k.DOWN:return this.moveHighlight(a.which===k.UP?-1:1),void A(a);case k.ENTER:return this.selectHighlighted(),void A(a);case k.TAB:return void this.selectHighlighted({noFocus:!0});case k.ESC:return this.cancel(a),void A(a)}}})),this.search.on("blur",this.bind(function(a){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.results&&this.results.length>1&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==k.TAB&&!k.isControl(a)&&!k.isFunctionKey(a)&&a.which!==k.ESC){if(this.opts.openOnEnter===!1&&a.which===k.ENTER)return void A(a);if(a.which==k.DOWN||a.which==k.UP||a.which==k.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),void A(a)}return a.which==k.DELETE||a.which==k.BACKSPACE?(this.opts.allowClear&&this.clear(),void A(a)):void 0}})),u(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown touchstart","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),B(a),this.close(),this.selection&&this.selection.focus())})),b.on("mousedown touchstart",this.bind(function(c){n(b),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),A(c)})),d.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),b.on("focus",this.bind(function(a){A(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.setPlaceholder(),c.lastSearchTerm=c.search.val())})}},isPlaceholderOptionSelected:function(){var a;return this.getPlaceholder()===b?!1:(a=this.getPlaceholderOption())!==b&&a.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val()},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find("option").filter(function(){return this.selected&&!this.disabled});b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var g=r(e,b.id(d));return g&&(f=d),g},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return r(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&(b===!0&&d>=0?this.highlight(d):this.highlight(0)),b===!0){var g=this.opts.minimumResultsForSearch;g>=0&&this.showSearch(L(a.results)>=g)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.lastSearchTerm=this.search.val(),this.close(),b&&b.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),r(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var d,e,c=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),c.empty(),null!==a&&(d=this.opts.formatSelection(a,c,this.opts.escapeMarkup)),d!==b&&c.append(d),e=this.opts.formatSelectionCssClass(a,c),e!==b&&c.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1],this.opts.debug&&console&&console.warn&&console.warn('Select2: The second option to `select2("val")` is not supported in Select2 4.0.0. The `change` event will always be triggered in 4.0.0.')),this.select)this.opts.debug&&console&&console.warn&&console.warn('Select2: Setting the value on a "," ","","
","
    ","
","
"].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=s(c.val(),b.separator,b.transformVal),f=[];b.query({matcher:function(c,d,g){var h=a.grep(e,function(a){return r(a,b.id(g))}).length;return h&&f.push(g),h},callback:a.isFunction(d)?function(){for(var a=[],c=0;c0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",b,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.prefillNextSearchTerm(),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c={},d=[],e=this;a(b).each(function(){e.id(this)in c||(c[e.id(this)]=0,d.push(this))}),this.selection.find(".select2-search-choice").remove(),this.addSelectedChoice(d),e.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,b){this.triggerSelect(a)&&""!==a.text&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),this.lastSearchTerm=this.search.val(),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.prefillNextSearchTerm()&&this.updateResults(),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),b&&b.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(b){var c=this.getVal(),d=this;a(b).each(function(){c.push(d.createChoice(this))}),this.setVal(c)},createChoice:function(c){var i,j,d=!c.locked,e=a("
  • "),f=a("
  • "),g=d?e:f,h=this.id(c);return i=this.opts.formatSelection(c,g.find("div"),this.opts.escapeMarkup),i!=b&&g.find("div").replaceWith(a("
    ").html(i)),j=this.opts.formatSelectionCssClass(c,g.find("div")),j!=b&&g.addClass(j),d&&g.find(".select2-search-choice-close").on("mousedown",A).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),A(b),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),g.data("select2-data",c),g.insertBefore(this.searchContainer),h},unselect:function(b){var d,e,c=this.getVal();if(b=b.closest(".select2-search-choice"),0===b.length)throw"Invalid argument: "+b+". Must be .select2-search-choice";if(d=b.data("select2-data")){var f=a.Event("select2-removing");if(f.val=this.id(d),f.choice=d,this.opts.element.trigger(f),f.isDefaultPrevented())return!1;for(;(e=p(this.id(d),c))>=0;)c.splice(e,1),this.setVal(c),this.select&&this.postprocessResults();return b.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(d),choice:d}),this.triggerChange({removed:d}),!0}},postprocessResults:function(a,b,c){var d=this.getVal(),e=this.results.find(".select2-result"),f=this.results.find(".select2-result-with-children"),g=this;e.each2(function(a,b){var c=g.id(b.data("select2-data"));p(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),f.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&this.opts.closeOnSelect===!0&&g.highlight(0),!this.opts.createSearchChoice&&!e.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&J(g.opts.formatNoMatches,"formatNoMatches")&&this.results.append("
  • "+K(g.opts.formatNoMatches,g.opts.element,g.search.val())+"
  • ")},getMaxSearchWidth:function(){return this.selection.width()-t(this.search)},resizeSearch:function(){var a,b,c,d,e,f=t(this.search);a=C(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),s(a,this.opts.separator,this.opts.transformVal))},setVal:function(b){if(this.select)this.select.val(b);else{var c=[],d={};a(b).each(function(){this in d||(c.push(this),d[this]=0)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator))}},buildChangeDetails:function(a,b){ + for(var b=b.slice(0),a=a.slice(0),c=0;c. Attach to instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(b,c){var e,f,d=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(f=this.data(),b||(b=[]),e=a.map(b,function(a){return d.opts.id(a)}),this.setVal(e),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(f,this.data())),void 0)}}),a.fn.select2=function(){var d,e,f,g,h,c=Array.prototype.slice.call(arguments,0),i=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],j=["opened","isFocused","container","dropdown"],k=["val","data"],l={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])d=0===c.length?{}:a.extend({},c[0]),d.element=a(this),"select"===d.element.get(0).tagName.toLowerCase()?h=d.element.prop("multiple"):(h=d.multiple||!1,"tags"in d&&(d.multiple=h=!0)),e=h?new window.Select2["class"].multi:new window.Select2["class"].single,e.init(d);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(p(c[0],i)<0)throw"Unknown method: "+c[0];if(g=b,e=a(this).data("select2"),e===b)return;if(f=c[0],"container"===f?g=e.container:"dropdown"===f?g=e.dropdown:(l[f]&&(f=l[f]),g=e[f].apply(e,c.slice(1))),p(c[0],j)>=0||p(c[0],k)>=0&&1==c.length)return!1}}),g===b?this:g},a.fn.select2.defaults={debug:!1,width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return E(this.text(a),c.term,e,d),e.join("")},transformVal:function(b){return a.trim(b)},formatSelection:function(a,c,d){return a?d(this.text(a)):b},sortResults:function(a,b,c){return a},formatResultCssClass:function(a){return a.css},formatSelectionCssClass:function(a,c){return b},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a==b?null:a.id},text:function(b){return b&&this.data&&this.data.text?a.isFunction(this.data.text)?this.data.text(b):b[this.data.text]:b.text},matcher:function(a,b){return o(""+b).toUpperCase().indexOf(o(""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:F,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(a){return null},nextSearchTerm:function(a,c){return b},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(a){var b="ontouchstart"in window||navigator.msMaxTouchPoints>0;return b&&a.opts.minimumResultsForSearch<0?!1:!0}},a.fn.select2.locales=[],a.fn.select2.locales.en={formatMatches:function(a){return 1===a?"One result is available, press enter to select it.":a+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(a,b,c){return"Loading failed"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" or more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(a){return"Loading more results\u2026"},formatSearching:function(){return"Searching\u2026"}},a.extend(a.fn.select2.defaults,a.fn.select2.locales.en),a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:G,local:H,tags:I},util:{debounce:w,markMatch:E,escapeMarkup:F,stripDiacritics:o},"class":{"abstract":c,single:d,multi:e}}}}(jQuery); + +/** @module Slick + * @author Ken Wheeler + * @see http://kenwheeler.github.io/slick + * @version 1.6.0 + */ +!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";var b=window.Slick||{};b=function(){function c(c,d){var f,e=this;e.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:a(c),appendDots:a(c),arrows:!0,asNavFor:null,prevArrow:'',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(b,c){return a('
    "),".lg-sub-html"===this.s.appendSubHtmlTo&&(f='
    '),b='
    '+c+'
    '+d+f+"
    ",a("body").append(b),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?(this.$outer.addClass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addClass("lg-use-css3"),g.setTop(),a(window).on("resize.lg orientationchange.lg",function(){setTimeout(function(){g.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):(this.$outer.addClass("lg-css"),this.s.speed=0),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var h=this.$outer.find(".lg-inner");h.css("transition-timing-function",this.s.cssEasing),h.css("transition-duration",this.s.speed+"ms")}setTimeout(function(){a(".lg-backdrop").addClass("in")}),setTimeout(function(){g.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append(''),this.prevScrollTop=a(window).scrollTop()},b.prototype.setTop=function(){if("100%"!==this.s.height){var b=a(window).height(),c=(b-parseInt(this.s.height,10))/2,d=this.$outer.find(".lg");b>=parseInt(this.s.height,10)?d.css("top",c+"px"):d.css("top","0px")}},b.prototype.doCss=function(){var a=function(){var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=document.documentElement,c=0;for(c=0;c'+(parseInt(this.index,10)+1)+' / '+this.$items.length+"
    ")},b.prototype.addHtml=function(b){var c,d,e=null;if(this.s.dynamic?this.s.dynamicEl[b].subHtmlUrl?c=this.s.dynamicEl[b].subHtmlUrl:e=this.s.dynamicEl[b].subHtml:(d=this.$items.eq(b),d.attr("data-sub-html-url")?c=d.attr("data-sub-html-url"):(e=d.attr("data-sub-html"),this.s.getCaptionFromTitleOrAlt&&!e&&(e=d.attr("title")||d.find("img").first().attr("alt")))),!c)if("undefined"!=typeof e&&null!==e){var f=e.substring(0,1);"."!==f&&"#"!==f||(e=this.s.subHtmlSelectorRelative&&!this.s.dynamic?d.find(e).html():a(e).html())}else e="";".lg-sub-html"===this.s.appendSubHtmlTo?c?this.$outer.find(this.s.appendSubHtmlTo).load(c):this.$outer.find(this.s.appendSubHtmlTo).html(e):c?this.$slide.eq(b).load(c):this.$slide.eq(b).append(e),"undefined"!=typeof e&&null!==e&&(""===e?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")),this.$el.trigger("onAfterAppendSubHtml.lg",[b])},b.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadContent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(a-c<0);c++)this.loadContent(a-c,!1,0)},b.prototype.loadContent=function(b,c,d){var e,f,g,h,i,j,k=this,l=!1,m=function(b){for(var c=[],d=[],e=0;eh){f=d[i];break}};if(k.s.dynamic){if(k.s.dynamicEl[b].poster&&(l=!0,g=k.s.dynamicEl[b].poster),j=k.s.dynamicEl[b].html,f=k.s.dynamicEl[b].src,k.s.dynamicEl[b].responsive){var n=k.s.dynamicEl[b].responsive.split(",");m(n)}h=k.s.dynamicEl[b].srcset,i=k.s.dynamicEl[b].sizes}else{if(k.$items.eq(b).attr("data-poster")&&(l=!0,g=k.$items.eq(b).attr("data-poster")),j=k.$items.eq(b).attr("data-html"),f=k.$items.eq(b).attr("href")||k.$items.eq(b).attr("data-src"),k.$items.eq(b).attr("data-responsive")){var o=k.$items.eq(b).attr("data-responsive").split(",");m(o)}h=k.$items.eq(b).attr("data-srcset"),i=k.$items.eq(b).attr("data-sizes")}var p=!1;k.s.dynamic?k.s.dynamicEl[b].iframe&&(p=!0):"true"===k.$items.eq(b).attr("data-iframe")&&(p=!0);var q=k.isVideo(f,b);if(!k.$slide.eq(b).hasClass("lg-loaded")){if(p)k.$slide.eq(b).prepend('
    ');else if(l){var r="";r=q&&q.youtube?"lg-has-youtube":q&&q.vimeo?"lg-has-vimeo":"lg-has-html5",k.$slide.eq(b).prepend('
    ')}else q?(k.$slide.eq(b).prepend('
    '),k.$el.trigger("hasVideo.lg",[b,f,j])):k.$slide.eq(b).prepend('
    ');if(k.$el.trigger("onAferAppendSlide.lg",[b]),e=k.$slide.eq(b).find(".lg-object"),i&&e.attr("sizes",i),h){e.attr("srcset",h);try{picturefill({elements:[e[0]]})}catch(a){console.warn("lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.")}}".lg-sub-html"!==this.s.appendSubHtmlTo&&k.addHtml(b),k.$slide.eq(b).addClass("lg-loaded")}k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){var c=0;d&&!a("body").hasClass("lg-from-hash")&&(c=d),setTimeout(function(){k.$slide.eq(b).addClass("lg-complete"),k.$el.trigger("onSlideItemLoad.lg",[b,d||0])},c)}),q&&q.html5&&!l&&k.$slide.eq(b).addClass("lg-complete"),c===!0&&(k.$slide.eq(b).hasClass("lg-complete")?k.preload(b):k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){k.preload(b)}))},b.prototype.slide=function(b,c,d,e){var f=this.$outer.find(".lg-current").index(),g=this;if(!g.lGalleryOn||f!==b){var h=this.$slide.length,i=g.lGalleryOn?this.s.speed:0;if(!g.lgBusy){if(this.s.download){var j;j=g.s.dynamic?g.s.dynamicEl[b].downloadUrl!==!1&&(g.s.dynamicEl[b].downloadUrl||g.s.dynamicEl[b].src):"false"!==g.$items.eq(b).attr("data-download-url")&&(g.$items.eq(b).attr("data-download-url")||g.$items.eq(b).attr("href")||g.$items.eq(b).attr("data-src")),j?(a("#lg-download").attr("href",j),g.$outer.removeClass("lg-hide-download")):g.$outer.addClass("lg-hide-download")}if(this.$el.trigger("onBeforeSlide.lg",[f,b,c,d]),g.lgBusy=!0,clearTimeout(g.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){g.addHtml(b)},i),this.arrowDisable(b),e||(bf&&(e="next")),c){this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide");var k,l;h>2?(k=b-1,l=b+1,0===b&&f===h-1?(l=0,k=h-1):b===h-1&&0===f&&(l=0,k=h-1)):(k=0,l=1),"prev"===e?g.$slide.eq(l).addClass("lg-next-slide"):g.$slide.eq(k).addClass("lg-prev-slide"),g.$slide.eq(b).addClass("lg-current")}else g.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),"prev"===e?(this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(f).addClass("lg-next-slide")):(this.$slide.eq(b).addClass("lg-next-slide"),this.$slide.eq(f).addClass("lg-prev-slide")),setTimeout(function(){g.$slide.removeClass("lg-current"),g.$slide.eq(b).addClass("lg-current"),g.$outer.removeClass("lg-no-trans")},50);g.lGalleryOn?(setTimeout(function(){g.loadContent(b,!0,0)},this.s.speed+50),setTimeout(function(){g.lgBusy=!1,g.$el.trigger("onAfterSlide.lg",[f,b,c,d])},this.s.speed)):(g.loadContent(b,!0,g.s.backdropDuration),g.lgBusy=!1,g.$el.trigger("onAfterSlide.lg",[f,b,c,d])),g.lGalleryOn=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}g.index=b}},b.prototype.goToNextSlide=function(a){var b=this,c=b.s.loop;a&&b.$slide.length<3&&(c=!1),b.lgBusy||(b.index+10?(b.index--,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):c?(b.index=b.$items.length-1,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):b.s.slideEndAnimatoin&&!a&&(b.$outer.addClass("lg-left-end"),setTimeout(function(){b.$outer.removeClass("lg-left-end")},400)))},b.prototype.keyPress=function(){var b=this;this.$items.length>1&&a(window).on("keyup.lg",function(a){b.$items.length>1&&(37===a.keyCode&&(a.preventDefault(),b.goToPrevSlide()),39===a.keyCode&&(a.preventDefault(),b.goToNextSlide()))}),a(window).on("keydown.lg",function(a){b.s.escKey===!0&&27===a.keyCode&&(a.preventDefault(),b.$outer.hasClass("lg-thumb-open")?b.$outer.removeClass("lg-thumb-open"):b.destroy())})},b.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.goToNextSlide()})},b.prototype.arrowDisable=function(a){!this.s.loop&&this.s.hideControlOnEnd&&(a+10?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},b.prototype.setTranslate=function(a,b,c){this.s.useLeft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},b.prototype.touchMove=function(b,c){var d=c-b;Math.abs(d)>15&&(this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),d,0),this.setTranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.setTranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0))},b.prototype.touchEnd=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){b.$outer.removeClass("lg-dragging"),a<0&&Math.abs(a)>b.s.swipeThreshold?b.goToNextSlide(!0):a>0&&Math.abs(a)>b.s.swipeThreshold?b.goToPrevSlide(!0):Math.abs(a)<5&&b.$el.trigger("onSlideClick.lg"),b.$slide.removeAttr("style")}),setTimeout(function(){b.$outer.hasClass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeClass("lg-slide")},b.s.speed+100)},b.prototype.enableSwipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableSwipe&&a.doCss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasClass("lg-zoomed")||a.lgBusy||(c.preventDefault(),a.manageSwipeClass(),b=c.originalEvent.targetTouches[0].pageX)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasClass("lg-zoomed")||(e.preventDefault(),c=e.originalEvent.targetTouches[0].pageX,a.touchMove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasClass("lg-zoomed")||(d?(d=!1,a.touchEnd(c-b)):a.$el.trigger("onSlideClick.lg"))}))},b.prototype.enableDrag=function(){var b=this,c=0,d=0,e=!1,f=!1;b.s.enableDrag&&b.doCss()&&(b.$slide.on("mousedown.lg",function(d){b.$outer.hasClass("lg-zoomed")||(a(d.target).hasClass("lg-object")||a(d.target).hasClass("lg-video-play"))&&(d.preventDefault(),b.lgBusy||(b.manageSwipeClass(),c=d.pageX,e=!0,b.$outer.scrollLeft+=1,b.$outer.scrollLeft-=1,b.$outer.removeClass("lg-grab").addClass("lg-grabbing"),b.$el.trigger("onDragstart.lg")))}),a(window).on("mousemove.lg",function(a){e&&(f=!0,d=a.pageX,b.touchMove(c,d),b.$el.trigger("onDragmove.lg"))}),a(window).on("mouseup.lg",function(g){f?(f=!1,b.touchEnd(d-c),b.$el.trigger("onDragend.lg")):(a(g.target).hasClass("lg-object")||a(g.target).hasClass("lg-video-play"))&&b.$el.trigger("onSlideClick.lg"),e&&(e=!1,b.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},b.prototype.manageSwipeClass=function(){var a=this.index+1,b=this.index-1;this.s.loop&&this.$slide.length>2&&(0===this.index?b=this.$slide.length-1:this.index===this.$slide.length-1&&(a=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(a).addClass("lg-next-slide")},b.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltaY&&(b.deltaY>0?a.goToPrevSlide():a.goToNextSlide(),b.preventDefault())})},b.prototype.closeGallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=!!(a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap"))}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasClass("lg-dragging")||b.destroy())}))},b.prototype.destroy=function(b){var c=this;b||(c.$el.trigger("onBeforeClose.lg"),a(window).scrollTop(c.prevScrollTop)),b&&(c.s.dynamic||this.$items.off("click.lg click.lgcustom"),a.removeData(c.el,"lightGallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightGallery.modules,function(a){c.modules[a]&&c.modules[a].destroy()}),this.lGalleryOn=!1,clearTimeout(c.hideBartimeout),this.hideBartimeout=!1,a(window).off(".lg"),a("body").removeClass("lg-on lg-from-hash"),c.$outer&&c.$outer.removeClass("lg-visible"),a(".lg-backdrop").removeClass("in"),setTimeout(function(){c.$outer&&c.$outer.remove(),a(".lg-backdrop").remove(),b||c.$el.trigger("onCloseAfter.lg")},c.s.backdropDuration+50)},a.fn.lightGallery=function(c){return this.each(function(){if(a.data(this,"lightGallery"))try{a(this).data("lightGallery").init()}catch(a){console.error("lightGallery has not initiated properly")}else a.data(this,"lightGallery",new b(this,c))})},a.fn.lightGallery.modules={}}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={autoplay:!1,pause:5e3,progressBar:!0,fourceAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"},c=function(c){return this.core=a(c).data("lightGallery"),this.$el=a(c),!(this.core.$items.length<2)&&(this.core.s=a.extend({},b,this.core.s),this.interval=!1,this.fromAuto=!0,this.canceledOnTouch=!1,this.fourceAutoplayTemp=this.core.s.fourceAutoplay,this.core.doCss()||(this.core.s.progressBar=!1),this.init(),this)};c.prototype.init=function(){var a=this;a.core.s.autoplayControls&&a.controls(),a.core.s.progressBar&&a.core.$outer.find(".lg").append('
    '),a.progress(),a.core.s.autoplay&&a.$el.one("onSlideItemLoad.lg.tm",function(){a.startlAuto()}),a.$el.on("onDragstart.lg.tm touchstart.lg.tm",function(){a.interval&&(a.cancelAuto(),a.canceledOnTouch=!0)}),a.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm",function(){!a.interval&&a.canceledOnTouch&&(a.startlAuto(),a.canceledOnTouch=!1)})},c.prototype.progress=function(){var a,b,c=this;c.$el.on("onBeforeSlide.lg.tm",function(){c.core.s.progressBar&&c.fromAuto&&(a=c.core.$outer.find(".lg-progress-bar"),b=c.core.$outer.find(".lg-progress"),c.interval&&(b.removeAttr("style"),a.removeClass("lg-start"),setTimeout(function(){b.css("transition","width "+(c.core.s.speed+c.core.s.pause)+"ms ease 0s"),a.addClass("lg-start")},20))),c.fromAuto||c.core.s.fourceAutoplay||c.cancelAuto(),c.fromAuto=!1})},c.prototype.controls=function(){var b=this,c='';a(this.core.s.appendAutoplayControlsTo).append(c),b.core.$outer.find(".lg-autoplay-button").on("click.lg",function(){a(b.core.$outer).hasClass("lg-show-autoplay")?(b.cancelAuto(),b.core.s.fourceAutoplay=!1):b.interval||(b.startlAuto(),b.core.s.fourceAutoplay=b.fourceAutoplayTemp)})},c.prototype.startlAuto=function(){var a=this;a.core.$outer.find(".lg-progress").css("transition","width "+(a.core.s.speed+a.core.s.pause)+"ms ease 0s"),a.core.$outer.addClass("lg-show-autoplay"),a.core.$outer.find(".lg-progress-bar").addClass("lg-start"),a.interval=setInterval(function(){a.core.index+11&&this.init(),this};c.prototype.init=function(){var b,c,d,e=this,f="";if(e.core.$outer.find(".lg").append('
    '),e.core.s.dynamic)for(var g=0;g
    ';else e.core.$items.each(function(){f+=e.core.s.exThumbImage?'
    ':'
    '});c=e.core.$outer.find(".lg-pager-outer"),c.html(f),b=e.core.$outer.find(".lg-pager-cont"),b.on("click.lg touchend.lg",function(){var b=a(this);e.core.index=b.index(),e.core.slide(e.core.index,!1,!0,!1)}),c.on("mouseover.lg",function(){clearTimeout(d),c.addClass("lg-pager-hover")}),c.on("mouseout.lg",function(){d=setTimeout(function(){c.removeClass("lg-pager-hover")})}),e.core.$el.on("onBeforeSlide.lg.tm",function(a,c,d){b.removeClass("lg-pager-active"),b.eq(d).addClass("lg-pager-active")})},c.prototype.destroy=function(){},a.fn.lightGallery.modules.pager=c}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",thumbWidth:100,thumbHeight:"80px",thumbContHeight:100,thumbMargin:5,exThumbImage:!1,showThumbByDefault:!0,toogleThumb:!0,pullCaptionUp:!0,enableThumbDrag:!0,enableThumbSwipe:!0,swipeThreshold:50,loadYoutubeThumbnail:!0,youtubeThumbSize:1,loadVimeoThumbnail:!0,vimeoThumbSize:"thumbnail_small",loadDailymotionThumbnail:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.$el=a(c),this.$thumbOuter=null,this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.$items.length*(this.core.s.thumbWidth+this.core.s.thumbMargin),this.thumbIndex=this.core.index,this.core.s.animateThumb&&(this.core.s.thumbHeight="100%"),this.left=0,this.init(),this};c.prototype.init=function(){var a=this;this.core.s.thumbnail&&this.core.$items.length>1&&(this.core.s.showThumbByDefault&&setTimeout(function(){a.core.$outer.addClass("lg-thumb-open")},700),this.core.s.pullCaptionUp&&this.core.$outer.addClass("lg-pull-caption-up"),this.build(),this.core.s.animateThumb&&this.core.doCss()?(this.core.s.enableThumbDrag&&this.enableThumbDrag(),this.core.s.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toogle(),this.thumbkeyPress())},c.prototype.build=function(){function b(a,b,c){var g,h=d.core.isVideo(a,c)||{},i="";h.youtube||h.vimeo||h.dailymotion?h.youtube?g=d.core.s.loadYoutubeThumbnail?"//img.youtube.com/vi/"+h.youtube[1]+"/"+d.core.s.youtubeThumbSize+".jpg":b:h.vimeo?d.core.s.loadVimeoThumbnail?(g="//i.vimeocdn.com/video/error_"+f+".jpg",i=h.vimeo[1]):g=b:h.dailymotion&&(g=d.core.s.loadDailymotionThumbnail?"//www.dailymotion.com/thumbnail/video/"+h.dailymotion[1]:b):g=b,e+='
    ',i=""}var c,d=this,e="",f="",g='
    ';switch(this.core.s.vimeoThumbSize){case"thumbnail_large":f="640";break;case"thumbnail_medium":f="200x150";break;case"thumbnail_small":f="100x75"}if(d.core.$outer.addClass("lg-has-thumb"),d.core.$outer.find(".lg").append(g),d.$thumbOuter=d.core.$outer.find(".lg-thumb-outer"),d.thumbOuterWidth=d.$thumbOuter.width(),d.core.s.animateThumb&&d.core.$outer.find(".lg-thumb").css({width:d.thumbTotalWidth+"px",position:"relative"}),this.core.s.animateThumb&&d.$thumbOuter.css("height",d.core.s.thumbContHeight+"px"),d.core.s.dynamic)for(var h=0;hthis.thumbTotalWidth-this.thumbOuterWidth&&(this.left=this.thumbTotalWidth-this.thumbOuterWidth),this.left<0&&(this.left=0),this.core.lGalleryOn?(b.hasClass("on")||this.core.$outer.find(".lg-thumb").css("transition-duration",this.core.s.speed+"ms"),this.core.doCss()||b.animate({left:-this.left+"px"},this.core.s.speed)):this.core.doCss()||b.css("left",-this.left+"px"),this.setTranslate(this.left)}},c.prototype.enableThumbDrag=function(){var b=this,c=0,d=0,e=!1,f=!1,g=0;b.$thumbOuter.addClass("lg-grab"),b.core.$outer.find(".lg-thumb").on("mousedown.lg.thumb",function(a){b.thumbTotalWidth>b.thumbOuterWidth&&(a.preventDefault(),c=a.pageX,e=!0,b.core.$outer.scrollLeft+=1,b.core.$outer.scrollLeft-=1,b.thumbClickable=!1,b.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),a(window).on("mousemove.lg.thumb",function(a){e&&(g=b.left,f=!0,d=a.pageX,b.$thumbOuter.addClass("lg-dragging"),g-=d-c,g>b.thumbTotalWidth-b.thumbOuterWidth&&(g=b.thumbTotalWidth-b.thumbOuterWidth),g<0&&(g=0),b.setTranslate(g))}),a(window).on("mouseup.lg.thumb",function(){f?(f=!1,b.$thumbOuter.removeClass("lg-dragging"),b.left=g,Math.abs(d-c)a.thumbOuterWidth&&(c.preventDefault(),b=c.originalEvent.targetTouches[0].pageX,a.thumbClickable=!1)}),a.core.$outer.find(".lg-thumb").on("touchmove.lg",function(f){a.thumbTotalWidth>a.thumbOuterWidth&&(f.preventDefault(),c=f.originalEvent.targetTouches[0].pageX,d=!0,a.$thumbOuter.addClass("lg-dragging"),e=a.left,e-=c-b,e>a.thumbTotalWidth-a.thumbOuterWidth&&(e=a.thumbTotalWidth-a.thumbOuterWidth),e<0&&(e=0),a.setTranslate(e))}),a.core.$outer.find(".lg-thumb").on("touchend.lg",function(){a.thumbTotalWidth>a.thumbOuterWidth&&d?(d=!1,a.$thumbOuter.removeClass("lg-dragging"),Math.abs(c-b)'),a.core.$outer.find(".lg-toogle-thumb").on("click.lg",function(){a.core.$outer.toggleClass("lg-thumb-open")}))},c.prototype.thumbkeyPress=function(){var b=this;a(window).on("keydown.lg.thumb",function(a){38===a.keyCode?(a.preventDefault(),b.core.$outer.addClass("lg-thumb-open")):40===a.keyCode&&(a.preventDefault(),b.core.$outer.removeClass("lg-thumb-open"))})},c.prototype.destroy=function(){this.core.s.thumbnail&&this.core.$items.length>1&&(a(window).off("resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb"), + this.$thumbOuter.remove(),this.core.$outer.removeClass("lg-has-thumb"))},a.fn.lightGallery.modules.Thumbnail=c}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={videoMaxWidth:"855px",youtubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,vkPlayerParams:!1,videojs:!1,videojsOptions:{}},c=function(c){return this.core=a(c).data("lightGallery"),this.$el=a(c),this.core.s=a.extend({},b,this.core.s),this.videoLoaded=!1,this.init(),this};c.prototype.init=function(){var b=this;b.core.$el.on("hasVideo.lg.tm",function(a,c,d,e){if(b.core.$slide.eq(c).find(".lg-video").append(b.loadVideo(d,"lg-object",!0,c,e)),e)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(c).find(".lg-html5").get(0),b.core.s.videojsOptions,function(){b.videoLoaded||this.play()})}catch(a){console.error("Make sure you have included videojs")}else b.videoLoaded||b.core.$slide.eq(c).find(".lg-html5").get(0).play()}),b.core.$el.on("onAferAppendSlide.lg.tm",function(a,c){var d=b.core.$slide.eq(c).find(".lg-video-cont");d.hasClass("lg-has-iframe")||(d.css("max-width",b.core.s.videoMaxWidth),b.videoLoaded=!0)});var c=function(a){if(a.find(".lg-object").hasClass("lg-has-poster")&&a.find(".lg-object").is(":visible"))if(a.hasClass("lg-has-video")){var c=a.find(".lg-youtube").get(0),d=a.find(".lg-vimeo").get(0),e=a.find(".lg-dailymotion").get(0),f=a.find(".lg-html5").get(0);if(c)c.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*");else if(d)try{$f(d).api("play")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(e)e.contentWindow.postMessage("play","*");else if(f)if(b.core.s.videojs)try{videojs(f).play()}catch(a){console.error("Make sure you have included videojs")}else f.play();a.addClass("lg-video-playing")}else{a.addClass("lg-video-playing lg-has-video");var g,h,i=function(c,d){if(a.find(".lg-video").append(b.loadVideo(c,"",!1,b.core.index,d)),d)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(b.core.index).find(".lg-html5").get(0),b.core.s.videojsOptions,function(){this.play()})}catch(a){console.error("Make sure you have included videojs")}else b.core.$slide.eq(b.core.index).find(".lg-html5").get(0).play()};b.core.s.dynamic?(g=b.core.s.dynamicEl[b.core.index].src,h=b.core.s.dynamicEl[b.core.index].html,i(g,h)):(g=b.core.$items.eq(b.core.index).attr("href")||b.core.$items.eq(b.core.index).attr("data-src"),h=b.core.$items.eq(b.core.index).attr("data-html"),i(g,h));var j=a.find(".lg-object");a.find(".lg-video").append(j),a.find(".lg-video-object").hasClass("lg-html5")||(a.removeClass("lg-complete"),a.find(".lg-video-object").on("load.lg error.lg",function(){a.addClass("lg-complete")}))}};b.core.doCss()&&b.core.$items.length>1&&(b.core.s.enableSwipe||b.core.s.enableDrag)?b.core.$el.on("onSlideClick.lg.tm",function(){var a=b.core.$slide.eq(b.core.index);c(a)}):b.core.$slide.on("click.lg",function(){c(a(this))}),b.core.$el.on("onBeforeSlide.lg.tm",function(c,d,e){var f=b.core.$slide.eq(d),g=f.find(".lg-youtube").get(0),h=f.find(".lg-vimeo").get(0),i=f.find(".lg-dailymotion").get(0),j=f.find(".lg-vk").get(0),k=f.find(".lg-html5").get(0);if(g)g.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*");else if(h)try{$f(h).api("pause")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(i)i.contentWindow.postMessage("pause","*");else if(k)if(b.core.s.videojs)try{videojs(k).pause()}catch(a){console.error("Make sure you have included videojs")}else k.pause();j&&a(j).attr("src",a(j).attr("src").replace("&autoplay","&noplay"));var l;l=b.core.s.dynamic?b.core.s.dynamicEl[e].src:b.core.$items.eq(e).attr("href")||b.core.$items.eq(e).attr("data-src");var m=b.core.isVideo(l,e)||{};(m.youtube||m.vimeo||m.dailymotion||m.vk)&&b.core.$outer.addClass("lg-hide-download")}),b.core.$el.on("onAfterSlide.lg.tm",function(a,c){b.core.$slide.eq(c).removeClass("lg-video-playing")})},c.prototype.loadVideo=function(b,c,d,e,f){var g="",h=1,i="",j=this.core.isVideo(b,e)||{};if(d&&(h=this.videoLoaded?0:1),j.youtube)i="?wmode=opaque&autoplay="+h+"&enablejsapi=1",this.core.s.youtubePlayerParams&&(i=i+"&"+a.param(this.core.s.youtubePlayerParams)),g='';else if(j.vimeo)i="?autoplay="+h+"&api=1",this.core.s.vimeoPlayerParams&&(i=i+"&"+a.param(this.core.s.vimeoPlayerParams)),g='';else if(j.dailymotion)i="?wmode=opaque&autoplay="+h+"&api=postMessage",this.core.s.dailymotionPlayerParams&&(i=i+"&"+a.param(this.core.s.dailymotionPlayerParams)),g='';else if(j.html5){var k=f.substring(0,1);"."!==k&&"#"!==k||(f=a(f).html()),g=f}else j.vk&&(i="&autoplay="+h,this.core.s.vkPlayerParams&&(i=i+"&"+a.param(this.core.s.vkPlayerParams)),g='');return g},c.prototype.destroy=function(){this.videoLoaded=!1},a.fn.lightGallery.modules.video=c}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b=function(){var a=!1,b=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);return b&&parseInt(b[2],10)<54&&(a=!0),a},c={scale:1,zoom:!0,actualSize:!0,enableZoomAfter:300,useLeftForZoom:b()},d=function(b){return this.core=a(b).data("lightGallery"),this.core.s=a.extend({},c,this.core.s),this.core.s.zoom&&this.core.doCss()&&(this.init(),this.zoomabletimeout=!1,this.pageX=a(window).width()/2,this.pageY=a(window).height()/2+a(window).scrollTop()),this};d.prototype.init=function(){var b=this,c='';b.core.s.actualSize&&(c+=''),b.core.s.useLeftForZoom?b.core.$outer.addClass("lg-use-left-for-zoom"):b.core.$outer.addClass("lg-use-transition-for-zoom"),this.core.$outer.find(".lg-toolbar").append(c),b.core.$el.on("onSlideItemLoad.lg.tm.zoom",function(c,d,e){var f=b.core.s.enableZoomAfter+e;a("body").hasClass("lg-from-hash")&&e?f=0:a("body").removeClass("lg-from-hash"),b.zoomabletimeout=setTimeout(function(){b.core.$slide.eq(d).addClass("lg-zoomable")},f+30)});var d=1,e=function(c){var d,e,f=b.core.$outer.find(".lg-current .lg-image"),g=(a(window).width()-f.prop("offsetWidth"))/2,h=(a(window).height()-f.prop("offsetHeight"))/2+a(window).scrollTop();d=b.pageX-g,e=b.pageY-h;var i=(c-1)*d,j=(c-1)*e;f.css("transform","scale3d("+c+", "+c+", 1)").attr("data-scale",c),b.core.s.useLeftForZoom?f.parent().css({left:-i+"px",top:-j+"px"}).attr("data-x",i).attr("data-y",j):f.parent().css("transform","translate3d(-"+i+"px, -"+j+"px, 0)").attr("data-x",i).attr("data-y",j)},f=function(){d>1?b.core.$outer.addClass("lg-zoomed"):b.resetZoom(),d<1&&(d=1),e(d)},g=function(c,e,g,h){var i,j=e.prop("offsetWidth");i=b.core.s.dynamic?b.core.s.dynamicEl[g].width||e[0].naturalWidth||j:b.core.$items.eq(g).attr("data-width")||e[0].naturalWidth||j;var k;b.core.$outer.hasClass("lg-zoomed")?d=1:i>j&&(k=i/j,d=k||2),h?(b.pageX=a(window).width()/2,b.pageY=a(window).height()/2+a(window).scrollTop()):(b.pageX=c.pageX||c.originalEvent.targetTouches[0].pageX,b.pageY=c.pageY||c.originalEvent.targetTouches[0].pageY),f(),setTimeout(function(){b.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")},10)},h=!1;b.core.$el.on("onAferAppendSlide.lg.tm.zoom",function(a,c){var d=b.core.$slide.eq(c).find(".lg-image");d.on("dblclick",function(a){g(a,d,c)}),d.on("touchstart",function(a){h?(clearTimeout(h),h=null,g(a,d,c)):h=setTimeout(function(){h=null},300),a.preventDefault()})}),a(window).on("resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom",function(){b.pageX=a(window).width()/2,b.pageY=a(window).height()/2+a(window).scrollTop(),e(d)}),a("#lg-zoom-out").on("click.lg",function(){b.core.$outer.find(".lg-current .lg-image").length&&(d-=b.core.s.scale,f())}),a("#lg-zoom-in").on("click.lg",function(){b.core.$outer.find(".lg-current .lg-image").length&&(d+=b.core.s.scale,f())}),a("#lg-actual-size").on("click.lg",function(a){g(a,b.core.$slide.eq(b.core.index).find(".lg-image"),b.core.index,!0)}),b.core.$el.on("onBeforeSlide.lg.tm",function(){d=1,b.resetZoom()}),b.zoomDrag(),b.zoomSwipe()},d.prototype.resetZoom=function(){this.core.$outer.removeClass("lg-zoomed"),this.core.$slide.find(".lg-img-wrap").removeAttr("style data-x data-y"),this.core.$slide.find(".lg-image").removeAttr("style data-scale"),this.pageX=a(window).width()/2,this.pageY=a(window).height()/2+a(window).scrollTop()},d.prototype.zoomSwipe=function(){var a=this,b={},c={},d=!1,e=!1,f=!1;a.core.$slide.on("touchstart.lg",function(c){if(a.core.$outer.hasClass("lg-zoomed")){var d=a.core.$slide.eq(a.core.index).find(".lg-object");f=d.prop("offsetHeight")*d.attr("data-scale")>a.core.$outer.find(".lg").height(),e=d.prop("offsetWidth")*d.attr("data-scale")>a.core.$outer.find(".lg").width(),(e||f)&&(c.preventDefault(),b={x:c.originalEvent.targetTouches[0].pageX,y:c.originalEvent.targetTouches[0].pageY})}}),a.core.$slide.on("touchmove.lg",function(g){if(a.core.$outer.hasClass("lg-zoomed")){var h,i,j=a.core.$slide.eq(a.core.index).find(".lg-img-wrap");g.preventDefault(),d=!0,c={x:g.originalEvent.targetTouches[0].pageX,y:g.originalEvent.targetTouches[0].pageY},a.core.$outer.addClass("lg-zoom-dragging"),i=f?-Math.abs(j.attr("data-y"))+(c.y-b.y):-Math.abs(j.attr("data-y")),h=e?-Math.abs(j.attr("data-x"))+(c.x-b.x):-Math.abs(j.attr("data-x")),(Math.abs(c.x-b.x)>15||Math.abs(c.y-b.y)>15)&&(a.core.s.useLeftForZoom?j.css({left:h+"px",top:i+"px"}):j.css("transform","translate3d("+h+"px, "+i+"px, 0)"))}}),a.core.$slide.on("touchend.lg",function(){a.core.$outer.hasClass("lg-zoomed")&&d&&(d=!1,a.core.$outer.removeClass("lg-zoom-dragging"),a.touchendZoom(b,c,e,f))})},d.prototype.zoomDrag=function(){var b=this,c={},d={},e=!1,f=!1,g=!1,h=!1;b.core.$slide.on("mousedown.lg.zoom",function(d){var f=b.core.$slide.eq(b.core.index).find(".lg-object");h=f.prop("offsetHeight")*f.attr("data-scale")>b.core.$outer.find(".lg").height(),g=f.prop("offsetWidth")*f.attr("data-scale")>b.core.$outer.find(".lg").width(),b.core.$outer.hasClass("lg-zoomed")&&a(d.target).hasClass("lg-object")&&(g||h)&&(d.preventDefault(),c={x:d.pageX,y:d.pageY},e=!0,b.core.$outer.scrollLeft+=1,b.core.$outer.scrollLeft-=1,b.core.$outer.removeClass("lg-grab").addClass("lg-grabbing"))}),a(window).on("mousemove.lg.zoom",function(a){if(e){var i,j,k=b.core.$slide.eq(b.core.index).find(".lg-img-wrap");f=!0,d={x:a.pageX,y:a.pageY},b.core.$outer.addClass("lg-zoom-dragging"),j=h?-Math.abs(k.attr("data-y"))+(d.y-c.y):-Math.abs(k.attr("data-y")),i=g?-Math.abs(k.attr("data-x"))+(d.x-c.x):-Math.abs(k.attr("data-x")),b.core.s.useLeftForZoom?k.css({left:i+"px",top:j+"px"}):k.css("transform","translate3d("+i+"px, "+j+"px, 0)")}}),a(window).on("mouseup.lg.zoom",function(a){e&&(e=!1,b.core.$outer.removeClass("lg-zoom-dragging"),!f||c.x===d.x&&c.y===d.y||(d={x:a.pageX,y:a.pageY},b.touchendZoom(c,d,g,h)),f=!1),b.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")})},d.prototype.touchendZoom=function(a,b,c,d){var e=this,f=e.core.$slide.eq(e.core.index).find(".lg-img-wrap"),g=e.core.$slide.eq(e.core.index).find(".lg-object"),h=-Math.abs(f.attr("data-x"))+(b.x-a.x),i=-Math.abs(f.attr("data-y"))+(b.y-a.y),j=(e.core.$outer.find(".lg").height()-g.prop("offsetHeight"))/2,k=Math.abs(g.prop("offsetHeight")*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").height()+j),l=(e.core.$outer.find(".lg").width()-g.prop("offsetWidth"))/2,m=Math.abs(g.prop("offsetWidth")*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").width()+l);(Math.abs(b.x-a.x)>15||Math.abs(b.y-a.y)>15)&&(d&&(i<=-k?i=-k:i>=-j&&(i=-j)),c&&(h<=-m?h=-m:h>=-l&&(h=-l)),d?f.attr("data-y",Math.abs(i)):i=-Math.abs(f.attr("data-y")),c?f.attr("data-x",Math.abs(h)):h=-Math.abs(f.attr("data-x")),e.core.s.useLeftForZoom?f.css({left:h+"px",top:i+"px"}):f.css("transform","translate3d("+h+"px, "+i+"px, 0)"))},d.prototype.destroy=function(){var b=this;b.core.$el.off(".lg.zoom"),a(window).off(".lg.zoom"),b.core.$slide.off(".lg.zoom"),b.core.$el.off(".lg.tm.zoom"),b.resetZoom(),clearTimeout(b.zoomabletimeout),b.zoomabletimeout=!1},a.fn.lightGallery.modules.zoom=d}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={hash:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.core.s.hash&&(this.oldHash=window.location.hash,this.init()),this};c.prototype.init=function(){var b,c=this;c.core.$el.on("onAfterSlide.lg.tm",function(a,b,d){history.replaceState?history.replaceState(null,null,"#lg="+c.core.s.galleryId+"&slide="+d):window.location.hash="lg="+c.core.s.galleryId+"&slide="+d}),a(window).on("hashchange.lg.hash",function(){b=window.location.hash;var a=parseInt(b.split("&slide=")[1],10);b.indexOf("lg="+c.core.s.galleryId)>-1?c.core.slide(a,!1,!1):c.core.lGalleryOn&&c.core.destroy()})},c.prototype.destroy=function(){this.core.s.hash&&(this.oldHash&&this.oldHash.indexOf("lg="+this.core.s.galleryId)<0?history.replaceState?history.replaceState(null,null,this.oldHash):window.location.hash=this.oldHash:history.replaceState?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash="",this.core.$el.off(".lg.hash"))},a.fn.lightGallery.modules.hash=c}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){!function(){"use strict";var b={share:!0,facebook:!0,facebookDropdownText:"Facebook",twitter:!0,twitterDropdownText:"Twitter",googlePlus:!0,googlePlusDropdownText:"GooglePlus",pinterest:!0,pinterestDropdownText:"Pinterest"},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.core.s.share&&this.init(),this};c.prototype.init=function(){var b=this,c='",this.core.$outer.find(".lg-toolbar").append(c),this.core.$outer.find(".lg").append('
    '),a("#lg-share").on("click.lg",function(){b.core.$outer.toggleClass("lg-dropdown-active")}),a("#lg-dropdown-overlay").on("click.lg",function(){b.core.$outer.removeClass("lg-dropdown-active")}),b.core.$el.on("onAfterSlide.lg.tm",function(c,d,e){setTimeout(function(){a("#lg-share-facebook").attr("href","https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(b.getSahreProps(e,"facebookShareUrl")||window.location.href)),a("#lg-share-twitter").attr("href","https://twitter.com/intent/tweet?text="+b.getSahreProps(e,"tweetText")+"&url="+encodeURIComponent(b.getSahreProps(e,"twitterShareUrl")||window.location.href)),a("#lg-share-googleplus").attr("href","https://plus.google.com/share?url="+encodeURIComponent(b.getSahreProps(e,"googleplusShareUrl")||window.location.href)),a("#lg-share-pinterest").attr("href","http://www.pinterest.com/pin/create/button/?url="+encodeURIComponent(b.getSahreProps(e,"pinterestShareUrl")||window.location.href)+"&media="+encodeURIComponent(b.getSahreProps(e,"src"))+"&description="+b.getSahreProps(e,"pinterestText"))},100)})},c.prototype.getSahreProps=function(a,b){var c="";if(this.core.s.dynamic)c=this.core.s.dynamicEl[a][b];else{var d=this.core.$items.eq(a).attr("href"),e=this.core.$items.eq(a).data(b);c="src"===b?d||e:e}return c},c.prototype.destroy=function(){},a.fn.lightGallery.modules.share=c}()}); diff --git a/code/views/js/html5shiv.min.js b/code/views/js/html5shiv.min.js new file mode 100644 index 0000000..c4aa008 --- /dev/null +++ b/code/views/js/html5shiv.min.js @@ -0,0 +1,4 @@ +/** + * @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed + */ +!function(e,t){function n(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=y.elements;return"string"==typeof e?e.split(" "):e}function a(e,t){var n=y.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),y.elements=n+" "+e,m(t)}function c(e){var t=E[e[p]];return t||(t={},v++,e[p]=v,E[v]=t),t}function o(e,n,r){if(n||(n=t),u)return n.createElement(e);r||(r=c(n));var a;return a=r.cache[e]?r.cache[e].cloneNode():g.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!a.canHaveChildren||f.test(e)||a.tagUrn?a:r.frag.appendChild(a)}function i(e,n){if(e||(e=t),u)return e.createDocumentFragment();n=n||c(e);for(var a=n.frag.cloneNode(),o=0,i=r(),l=i.length;l>o;o++)a.createElement(i[o]);return a}function l(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return y.shivMethods?o(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(y,t.frag)}function m(e){e||(e=t);var r=c(e);return!y.shivCSS||s||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),u||l(e,r),e}var s,u,d="3.7.2",h=e.html5||{},f=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,g=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,p="_html5shiv",v=0,E={};!function(){try{var e=t.createElement("a");e.innerHTML="",s="hidden"in e,u=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){s=!0,u=!0}}();var y={elements:h.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:d,shivCSS:h.shivCSS!==!1,supportsUnknownElements:u,shivMethods:h.shivMethods!==!1,type:"default",shivDocument:m,createElement:o,createDocumentFragment:i,addElements:a};e.html5=y,m(t)}(this,document); \ No newline at end of file diff --git a/code/views/js/pointer-events.min.js b/code/views/js/pointer-events.min.js new file mode 100644 index 0000000..6c70907 --- /dev/null +++ b/code/views/js/pointer-events.min.js @@ -0,0 +1,5 @@ +/** + * Pointer Events + * @license BSD Lisence + */ +function PointerEventsPolyfill(t){if(this.options={selector:"*",mouseEvents:["click","dblclick","mousedown","mouseup"],usePolyfillIf:function(){if("Microsoft Internet Explorer"==navigator.appName){var t=navigator.userAgent;if(null!=t.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/)){var e=parseFloat(RegExp.$1);if(11>e)return!0}}return!1}},t){var e=this;$.each(t,function(t,n){e.options[t]=n})}this.options.usePolyfillIf()&&this.register_mouse_events()}PointerEventsPolyfill.initialize=function(t){return null==PointerEventsPolyfill.singleton&&(PointerEventsPolyfill.singleton=new PointerEventsPolyfill(t)),PointerEventsPolyfill.singleton},PointerEventsPolyfill.prototype.register_mouse_events=function(){$(document).on(this.options.mouseEvents.join(" "),this.options.selector,function(t){if("none"==$(this).css("pointer-events")){var e=$(this).css("display");$(this).css("display","none");var n=document.elementFromPoint(t.clientX,t.clientY);return e?$(this).css("display",e):$(this).css("display",""),t.target=n,$(n).trigger(t),!1}return!0})},jQuery(document).ready(function(){PointerEventsPolyfill.initialize({})}); \ No newline at end of file diff --git a/code/views/js/script.js b/code/views/js/script.js new file mode 100644 index 0000000..e911a36 --- /dev/null +++ b/code/views/js/script.js @@ -0,0 +1,1679 @@ +/** + * Global variables + */ +"use strict"; + +var userAgent = navigator.userAgent.toLowerCase(), + initialDate = new Date(), + + $document = $(document), + $window = $(window), + $html = $("html"), + + isDesktop = $html.hasClass("desktop"), + isIE = userAgent.indexOf("msie") != -1 ? parseInt(userAgent.split("msie")[1]) : userAgent.indexOf("trident") != -1 ? 11 : userAgent.indexOf("edge") != -1 ? 12 : false, + isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), + isTouch = "ontouchstart" in window, + onloadCaptchaCallback, + plugins = { + pointerEvents: isIE < 11 ? "js/pointer-events.min.js" : false, + bootstrapTooltip: $("[data-toggle='tooltip']"), + bootstrapModalDialog: $('.modal'), + bootstrapTabs: $(".tabs-custom-init"), + rdNavbar: $(".rd-navbar"), + materialParallax: $('.parallax-container'), + rdMailForm: $(".rd-mailform"), + rdInputLabel: $(".form-label"), + regula: $("[data-constraints]"), + owl: $(".owl-carousel"), + swiper: $(".swiper-slider"), + search: $(".rd-search"), + searchResults: $('.rd-search-results'), + statefulButton: $('.btn-stateful'), + isotope: $(".isotope"), + popover: $('[data-toggle="popover"]'), + viewAnimate: $('.view-animate'), + radio: $("input[type='radio']"), + checkbox: $("input[type='checkbox']"), + customToggle: $("[data-custom-toggle]"), + facebookWidget: $('#fb-root'), + pageLoader: $(".page-loader"), + captcha: $('.recaptcha'), + scroller: $(".scroll-wrap"), + bootstrapDateTimePicker: $("[data-time-picker]"), + selectFilter: $("select"), + slick: $('.slick-slider'), + lightGallery: $('[data-lightgallery="group"]'), + lightGalleryItem: $('[data-lightgallery="item"]'), + lightDynamicGalleryItem: $('[data-lightgallery="dynamic"]'), + maps: $('.google-map-container') + }; + +/** + * @desc Check the element was been scrolled into the view + * @param {object} elem - jQuery object + * @return {boolean} + */ +function isScrolledIntoView(elem) { + if (isNoviBuilder) return true; + return elem.offset().top + elem.outerHeight() >= $window.scrollTop() && elem.offset().top <= $window.scrollTop() + $window.height(); +} + +/** + * @desc Calls a function when element has been scrolled into the view + * @param {object} element - jQuery object + * @param {function} func - init function + */ +function lazyInit(element, func) { + var scrollHandler = function () { + if ((!element.hasClass('lazy-loaded') && (isScrolledIntoView(element)))) { + func.call(); + element.addClass('lazy-loaded'); + } + }; + + scrollHandler(); + $window.on('scroll', scrollHandler); +} + +// Initialize scripts that require a loaded window +$window.on('load', function () { + // Material Parallax + if (plugins.materialParallax.length) { + if (!isNoviBuilder && !isIE && !isMobile) { + plugins.materialParallax.parallax(); + } else { + for (var i = 0; i < plugins.materialParallax.length; i++) { + var $parallax = $(plugins.materialParallax[i]); + + $parallax.addClass('parallax-disabled'); + $parallax.css({"background-image": 'url(' + $parallax.data("parallax-img") + ')'}); + } + } + } +}); + +/** + * Initialize All Scripts + */ +$(function () { + var isNoviBuilder = window.xMode; + + /** + * @desc Google map function for getting latitude and longitude + */ + function getLatLngObject(str, marker, map, callback) { + var coordinates = {}; + try { + coordinates = JSON.parse(str); + callback(new google.maps.LatLng( + coordinates.lat, + coordinates.lng + ), marker, map) + } catch (e) { + map.geocoder.geocode({'address': str}, function (results, status) { + if (status === google.maps.GeocoderStatus.OK) { + var latitude = results[0].geometry.location.lat(); + var longitude = results[0].geometry.location.lng(); + + callback(new google.maps.LatLng( + parseFloat(latitude), + parseFloat(longitude) + ), marker, map) + } + }) + } + } + + /** + * @desc Initialize Google maps + */ + function initMaps() { + var key; + + for (var i = 0; i < plugins.maps.length; i++) { + if (plugins.maps[i].hasAttribute("data-key")) { + key = plugins.maps[i].getAttribute("data-key"); + break; + } + } + + $.getScript('//maps.google.com/maps/api/js?' + (key ? 'key=' + key + '&' : '') + 'sensor=false&libraries=geometry,places&v=quarterly', function () { + var head = document.getElementsByTagName('head')[0], + insertBefore = head.insertBefore; + + head.insertBefore = function (newElement, referenceElement) { + if (newElement.href && newElement.href.indexOf('//fonts.googleapis.com/css?family=Roboto') !== -1 || newElement.innerHTML.indexOf('gm-style') !== -1) { + return; + } + insertBefore.call(head, newElement, referenceElement); + }; + var geocoder = new google.maps.Geocoder; + for (var i = 0; i < plugins.maps.length; i++) { + var zoom = parseInt(plugins.maps[i].getAttribute("data-zoom"), 10) || 11; + var styles = plugins.maps[i].hasAttribute('data-styles') ? JSON.parse(plugins.maps[i].getAttribute("data-styles")) : []; + var center = plugins.maps[i].getAttribute("data-center") || "New York"; + + // Initialize map + var map = new google.maps.Map(plugins.maps[i].querySelectorAll(".google-map")[0], { + zoom: zoom, + styles: styles, + scrollwheel: false, + center: {lat: 0, lng: 0} + }); + + // Add map object to map node + plugins.maps[i].map = map; + plugins.maps[i].geocoder = geocoder; + plugins.maps[i].keySupported = true; + plugins.maps[i].google = google; + + // Get Center coordinates from attribute + getLatLngObject(center, null, plugins.maps[i], function (location, markerElement, mapElement) { + mapElement.map.setCenter(location); + }); + + // Add markers from google-map-markers array + var markerItems = plugins.maps[i].querySelectorAll(".google-map-markers li"); + + if (markerItems.length) { + var markers = []; + for (var j = 0; j < markerItems.length; j++) { + var markerElement = markerItems[j]; + getLatLngObject(markerElement.getAttribute("data-location"), markerElement, plugins.maps[i], function (location, markerElement, mapElement) { + var icon = markerElement.getAttribute("data-icon") || mapElement.getAttribute("data-icon"); + var activeIcon = markerElement.getAttribute("data-icon-active") || mapElement.getAttribute("data-icon-active"); + var info = markerElement.getAttribute("data-description") || ""; + var infoWindow = new google.maps.InfoWindow({ + content: info + }); + markerElement.infoWindow = infoWindow; + var markerData = { + position: location, + map: mapElement.map + } + if (icon) { + markerData.icon = icon; + } + var marker = new google.maps.Marker(markerData); + markerElement.gmarker = marker; + markers.push({markerElement: markerElement, infoWindow: infoWindow}); + marker.isActive = false; + // Handle infoWindow close click + google.maps.event.addListener(infoWindow, 'closeclick', (function (markerElement, mapElement) { + var markerIcon = null; + markerElement.gmarker.isActive = false; + markerIcon = markerElement.getAttribute("data-icon") || mapElement.getAttribute("data-icon"); + markerElement.gmarker.setIcon(markerIcon); + }).bind(this, markerElement, mapElement)); + + + // Set marker active on Click and open infoWindow + google.maps.event.addListener(marker, 'click', (function (markerElement, mapElement) { + if (markerElement.infoWindow.getContent().length === 0) return; + var gMarker, currentMarker = markerElement.gmarker, currentInfoWindow; + for (var k = 0; k < markers.length; k++) { + var markerIcon; + if (markers[k].markerElement === markerElement) { + currentInfoWindow = markers[k].infoWindow; + } + gMarker = markers[k].markerElement.gmarker; + if (gMarker.isActive && markers[k].markerElement !== markerElement) { + gMarker.isActive = false; + markerIcon = markers[k].markerElement.getAttribute("data-icon") || mapElement.getAttribute("data-icon") + gMarker.setIcon(markerIcon); + markers[k].infoWindow.close(); + } + } + + currentMarker.isActive = !currentMarker.isActive; + if (currentMarker.isActive) { + if (markerIcon = markerElement.getAttribute("data-icon-active") || mapElement.getAttribute("data-icon-active")) { + currentMarker.setIcon(markerIcon); + } + + currentInfoWindow.open(map, marker); + } else { + if (markerIcon = markerElement.getAttribute("data-icon") || mapElement.getAttribute("data-icon")) { + currentMarker.setIcon(markerIcon); + } + currentInfoWindow.close(); + } + }).bind(this, markerElement, mapElement)) + }) + } + } + } + }); + } + + /** + * @desc Initialize the gallery with set of images + * @param {object} itemsToInit - jQuery object + * @param {string} [addClass] - additional gallery class + */ + function initLightGallery(itemsToInit, addClass) { + if (!isNoviBuilder) { + $(itemsToInit).lightGallery({ + thumbnail: $(itemsToInit).attr("data-lg-thumbnail") !== "false", + selector: "[data-lightgallery='item']", + autoplay: $(itemsToInit).attr("data-lg-autoplay") === "true", + pause: parseInt($(itemsToInit).attr("data-lg-autoplay-delay")) || 5000, + addClass: addClass, + mode: $(itemsToInit).attr("data-lg-animation") || "lg-slide", + loop: $(itemsToInit).attr("data-lg-loop") !== "false" + }); + } + } + + /** + * @desc Initialize the gallery with dynamic addition of images + * @param {object} itemsToInit - jQuery object + * @param {string} [addClass] - additional gallery class + */ + function initDynamicLightGallery(itemsToInit, addClass) { + if (!isNoviBuilder) { + $(itemsToInit).on("click", function () { + $(itemsToInit).lightGallery({ + thumbnail: $(itemsToInit).attr("data-lg-thumbnail") !== "false", + selector: "[data-lightgallery='item']", + autoplay: $(itemsToInit).attr("data-lg-autoplay") === "true", + pause: parseInt($(itemsToInit).attr("data-lg-autoplay-delay")) || 5000, + addClass: addClass, + mode: $(itemsToInit).attr("data-lg-animation") || "lg-slide", + loop: $(itemsToInit).attr("data-lg-loop") !== "false", + dynamic: true, + dynamicEl: JSON.parse($(itemsToInit).attr("data-lg-dynamic-elements")) || [] + }); + }); + } + } + + /** + * @desc Initialize the gallery with one image + * @param {object} itemToInit - jQuery object + * @param {string} [addClass] - additional gallery class + */ + function initLightGalleryItem(itemToInit, addClass) { + if (!isNoviBuilder) { + $(itemToInit).lightGallery({ + selector: "this", + addClass: addClass, + counter: false, + youtubePlayerParams: { + modestbranding: 1, + showinfo: 0, + rel: 0, + controls: 0 + }, + vimeoPlayerParams: { + byline: 0, + portrait: 0 + } + }); + } + } + + /** + * @desc Google map function for getting latitude and longitude + */ + + /** + * @desc Toggle swiper videos on active slides + * @param {object} swiper - swiper slider + */ + function toggleSwiperInnerVideos(swiper) { + var prevSlide = $(swiper.slides[swiper.previousIndex]), + nextSlide = $(swiper.slides[swiper.activeIndex]), + videos, + videoItems = prevSlide.find("video"); + + for (var i = 0; i < videoItems.length; i++) { + videoItems[i].pause(); + } + + videos = nextSlide.find("video"); + if (videos.length) { + videos.get(0).play(); + } + } + + /** + * @desc Toggle swiper animations on active slides + * @param {object} swiper - swiper slider + */ + function toggleSwiperCaptionAnimation(swiper) { + var prevSlide = $(swiper.container).find("[data-caption-animate]"), + nextSlide = $(swiper.slides[swiper.activeIndex]).find("[data-caption-animate]"), + delay, + duration, + nextSlideItem, + prevSlideItem; + + for (var i = 0; i < prevSlide.length; i++) { + prevSlideItem = $(prevSlide[i]); + + prevSlideItem.removeClass("animated") + .removeClass(prevSlideItem.attr("data-caption-animate")) + .addClass("not-animated"); + } + + + var tempFunction = function (nextSlideItem, duration) { + return function () { + nextSlideItem + .removeClass("not-animated") + .addClass(nextSlideItem.attr("data-caption-animate")) + .addClass("animated"); + if (duration) { + nextSlideItem.css('animation-duration', duration + 'ms'); + } + }; + }; + + for (var i = 0; i < nextSlide.length; i++) { + nextSlideItem = $(nextSlide[i]); + delay = nextSlideItem.attr("data-caption-delay"); + duration = nextSlideItem.attr('data-caption-duration'); + if (!isNoviBuilder) { + if (delay) { + setTimeout(tempFunction(nextSlideItem, duration), parseInt(delay, 10)); + } else { + tempFunction(nextSlideItem, duration); + } + + } else { + nextSlideItem.removeClass("not-animated") + } + } + } + + /** + * makeParallax + * @description create swiper parallax scrolling effect + */ + function makeParallax(el, speed, wrapper, prevScroll) { + var scrollY = window.scrollY || window.pageYOffset; + + if (prevScroll != scrollY) { + prevScroll = scrollY; + el.addClass('no-transition'); + el[0].style['transform'] = 'translate3d(0,' + -scrollY * (1 - speed) + 'px,0)'; + el.height(); + el.removeClass('no-transition'); + + if (el.attr('data-fade') === 'true') { + var bound = el[0].getBoundingClientRect(), + offsetTop = bound.top * 2 + scrollY, + sceneHeight = wrapper.outerHeight(), + sceneDevider = wrapper.offset().top + sceneHeight / 2.0, + layerDevider = offsetTop + el.outerHeight() / 2.0, + pos = sceneHeight / 6.0, + opacity; + if (sceneDevider + pos > layerDevider && sceneDevider - pos < layerDevider) { + el[0].style["opacity"] = 1; + } else { + if (sceneDevider - pos < layerDevider) { + opacity = 1 + ((sceneDevider + pos - layerDevider) / sceneHeight / 3.0 * 5); + } else { + opacity = 1 - ((sceneDevider - pos - layerDevider) / sceneHeight / 3.0 * 5); + } + el[0].style["opacity"] = opacity < 0 ? 0 : opacity > 1 ? 1 : opacity.toFixed(2); + } + } + } + + requestAnimationFrame(function () { + makeParallax(el, speed, wrapper, prevScroll); + }); + } + + /** + * @desc Initialize owl carousel plugin + * @param {object} carousel - carousel jQuery object + */ + function initOwlCarousel(c) { + var aliaces = ["-", "-xs-", "-sm-", "-md-", "-lg-", "-xl-"], + values = [0, 480, 768, 992, 1200, 1800], + responsive = {}, + j, k; + + for (j = 0; j < values.length; j++) { + responsive[values[j]] = {}; + for (k = j; k >= -1; k--) { + if (!responsive[values[j]]["items"] && c.attr("data" + aliaces[k] + "items")) { + responsive[values[j]]["items"] = k < 0 ? 1 : parseInt(c.attr("data" + aliaces[k] + "items")); + } + if (!responsive[values[j]]["stagePadding"] && responsive[values[j]]["stagePadding"] !== 0 && c.attr("data" + aliaces[k] + "stage-padding")) { + responsive[values[j]]["stagePadding"] = k < 0 ? 0 : parseInt(c.attr("data" + aliaces[k] + "stage-padding")); + } + if (!responsive[values[j]]["margin"] && responsive[values[j]]["margin"] !== 0 && c.attr("data" + aliaces[k] + "margin")) { + responsive[values[j]]["margin"] = k < 0 ? 30 : parseInt(c.attr("data" + aliaces[k] + "margin")); + } + } + } + + // Enable custom pagination + if (c.attr('data-dots-custom')) { + c.on("initialized.owl.carousel", function (event) { + var carousel = $(event.currentTarget), + customPag = $(carousel.attr("data-dots-custom")), + active = 0; + + if (carousel.attr('data-active')) { + active = parseInt(carousel.attr('data-active')); + } + + carousel.trigger('to.owl.carousel', [active, 300, true]); + customPag.find("[data-owl-item='" + active + "']").addClass("active"); + + customPag.find("[data-owl-item]").on('click', function (e) { + e.preventDefault(); + carousel.trigger('to.owl.carousel', [parseInt(this.getAttribute("data-owl-item")), 300, true]); + }); + + carousel.on("translate.owl.carousel", function (event) { + customPag.find(".active").removeClass("active"); + customPag.find("[data-owl-item='" + event.item.index + "']").addClass("active") + }); + }); + } + + c.owlCarousel({ + autoplay: c.attr("data-autoplay") === "true", + loop: c.attr("data-loop") === "true", + startPosition: c.attr("data-start-position") ? parseInt(c.attr("data-start-position")) : 0, + smartSpeed: c.attr("data-smart-speed") ? parseInt(c.attr("data-smart-speed")) : 600, + items: 1, + dotsContainer: c.attr("data-pagination-class") || false, + navContainer: c.attr("data-navigation-class") || false, + mouseDrag: isNoviBuilder ? false : c.attr("data-mouse-drag") !== "false", + nav: c.attr("data-nav") === "true", + dots: c.attr("data-dots") === "true", + dotsEach: c.attr("data-dots-each") ? parseInt(c.attr("data-dots-each")) : false, + animateIn: c.attr('data-animation-in') ? c.attr('data-animation-in') : false, + animateOut: c.attr('data-animation-out') ? c.attr('data-animation-out') : false, + responsive: responsive, + center: c.attr("data-center") === "true", + navText: $.parseJSON(c.attr("data-nav-text")) || [], + navClass: $.parseJSON(c.attr("data-nav-class")) || ['owl-prev', 'owl-next'], + }); + } + + /** + * isScrolledIntoView + * @description check the element whas been scrolled into the view + */ + function isScrolledIntoView(elem) { + if (!isNoviBuilder) { + return elem.offset().top + elem.outerHeight() >= $window.scrollTop() && elem.offset().top <= $window.scrollTop() + $window.height(); + } + else { + return true; + } + } + + /** + * initOnView + * @description calls a function when element has been scrolled into the view + */ + function lazyInit(element, func) { + var $win = jQuery(window); + $win.on('load scroll', function () { + if ((!element.hasClass('lazy-loaded') && (isScrolledIntoView(element)))) { + func.call(); + element.addClass('lazy-loaded'); + } + }); + } + + /** + * Live Search + * @description create live search results + */ + function liveSearch(options) { + options.live.removeClass('cleared').html(); + options.current++; + options.spin.addClass('loading'); + + $.get(handler, { + s: decodeURI(options.term), + liveSearch: options.element.attr('data-search-live'), + dataType: "html", + liveCount: options.liveCount, + filter: options.filter, + template: options.template + }, function (data) { + options.processed++; + var live = options.live; + if (options.processed == options.current && !live.hasClass('cleared')) { + live.find('> #search-results').removeClass('active'); + live.html(data); + setTimeout(function () { + live.find('> #search-results').addClass('active'); + }, 50); + } + options.spin.parents('.rd-search').find('.input-group-addon').removeClass('loading'); + }) + } + + /** + * attachFormValidator + * @description attach form validation to elements + */ + function attachFormValidator(elements) { + for (var i = 0; i < elements.length; i++) { + var o = $(elements[i]), v; + o.addClass("form-control-has-validation").after(""); + v = o.parent().find(".form-validation"); + if (v.is(":last-child")) { + o.addClass("form-control-last-child"); + } + } + + elements + .on('input change propertychange blur', function (e) { + var $this = $(this), results; + + if (e.type != "blur") { + if (!$this.parent().hasClass("has-error")) { + return; + } + } + + if ($this.parents('.rd-mailform').hasClass('success')) { + return; + } + + if ((results = $this.regula('validate')).length) { + for (i = 0; i < results.length; i++) { + $this.siblings(".form-validation").text(results[i].message).parent().addClass("has-error") + } + } else { + $this.siblings(".form-validation").text("").parent().removeClass("has-error") + } + }) + .regula('bind'); + + var regularConstraintsMessages = [ + { + type: regula.Constraint.Required, + newMessage: "The text field is required." + }, + { + type: regula.Constraint.Email, + newMessage: "The email is not a valid email." + }, + { + type: regula.Constraint.Numeric, + newMessage: "Only numbers are required" + }, + { + type: regula.Constraint.Selected, + newMessage: "Please choose an option." + } + ]; + + + for (var i = 0; i < regularConstraintsMessages.length; i++) { + var regularConstraint = regularConstraintsMessages[i]; + + regula.override({ + constraintType: regularConstraint.type, + defaultMessage: regularConstraint.newMessage + }); + } + } + + /** + * isValidated + * @description check if all elemnts pass validation + */ + function isValidated(elements, captcha) { + var results, errors = 0; + + if (elements.length) { + for (j = 0; j < elements.length; j++) { + + var $input = $(elements[j]); + if ((results = $input.regula('validate')).length) { + for (k = 0; k < results.length; k++) { + errors++; + $input.siblings(".form-validation").text(results[k].message).parent().addClass("has-error"); + } + } else { + $input.siblings(".form-validation").text("").parent().removeClass("has-error") + } + } + + if (captcha) { + if (captcha.length) { + return validateReCaptcha(captcha) && errors == 0 + } + } + + return errors == 0; + } + return true; + } + + /** + * Init Bootstrap tooltip + * @description calls a function when need to init bootstrap tooltips + */ + function initBootstrapTooltip(tooltipPlacement) { + if (window.innerWidth < 599) { + plugins.bootstrapTooltip.tooltip('destroy'); + plugins.bootstrapTooltip.tooltip({ + placement: 'bottom' + }); + } else { + plugins.bootstrapTooltip.tooltip('destroy'); + plugins.bootstrapTooltip.tooltipPlacement; + plugins.bootstrapTooltip.tooltip(); + } + } + + + /** + * Copyright Year + * @description Evaluates correct copyright year + */ + var o = $("#copyright-year"); + if (o.length) { + o.text(initialDate.getFullYear()); + } + + // Google maps + if (plugins.maps.length) { + lazyInit(plugins.maps, initMaps); + } + + /** + * Page loader + * @description Enables Page loader + */ + if (plugins.pageLoader.length > 0) { + $window.on("load", function () { + var loader = setTimeout(function () { + plugins.pageLoader.addClass("loaded"); + $window.trigger("resize"); + }, 1000); + }); + } + + /** + * validateReCaptcha + * @description validate google reCaptcha + */ + function validateReCaptcha(captcha) { + var $captchaToken = captcha.find('.g-recaptcha-response').val(); + + if ($captchaToken == '') { + captcha + .siblings('.form-validation') + .html('Please, prove that you are not robot.') + .addClass('active'); + captcha + .closest('.form-group') + .addClass('has-error'); + + captcha.bind('propertychange', function () { + var $this = $(this), + $captchaToken = $this.find('.g-recaptcha-response').val(); + + if ($captchaToken != '') { + $this + .closest('.form-group') + .removeClass('has-error'); + $this + .siblings('.form-validation') + .removeClass('active') + .html(''); + $this.unbind('propertychange'); + } + }); + + return false; + } + + return true; + } + + /** + * onloadCaptchaCallback + * @description init google reCaptcha + */ + onloadCaptchaCallback = function () { + for (i = 0; i < plugins.captcha.length; i++) { + var $capthcaItem = $(plugins.captcha[i]); + + grecaptcha.render( + $capthcaItem.attr('id'), + { + sitekey: $capthcaItem.attr('data-sitekey'), + size: $capthcaItem.attr('data-size') ? $capthcaItem.attr('data-size') : 'normal', + theme: $capthcaItem.attr('data-theme') ? $capthcaItem.attr('data-theme') : 'light', + callback: function (e) { + $('.recaptcha').trigger('propertychange'); + } + } + ); + $capthcaItem.after(""); + } + }; + + /** + * Google ReCaptcha + * @description Enables Google ReCaptcha + */ + if (plugins.captcha.length) { + $.getScript("//www.google.com/recaptcha/api.js?onload=onloadCaptchaCallback&render=explicit&hl=en"); + } + + /** + * Is Mac os + * @description add additional class on html if mac os. + */ + if (navigator.platform.match(/(Mac)/i)) $html.addClass("mac-os"); + + /** + * IE Polyfills + * @description Adds some loosing functionality to IE browsers + */ + if (isIE) { + if (isIE < 10) { + $html.addClass("lt-ie-10"); + } + + if (isIE < 11) { + if (plugins.pointerEvents) { + $.getScript(plugins.pointerEvents) + .done(function () { + $html.addClass("ie-10"); + PointerEventsPolyfill.initialize({}); + }); + } + } + + if (isIE === 11) { + $("html").addClass("ie-11"); + } + + if (isIE === 12) { + $("html").addClass("ie-edge"); + } + } + + /** + * Bootstrap Tooltips + * @description Activate Bootstrap Tooltips + */ + if (plugins.bootstrapTooltip.length) { + var tooltipPlacement = plugins.bootstrapTooltip.attr('data-placement'); + initBootstrapTooltip(tooltipPlacement); + $(window).on('resize orientationchange', function () { + initBootstrapTooltip(tooltipPlacement); + }) + } + + /** + * bootstrapModalDialog + * @description Stap vioeo in bootstrapModalDialog + */ + if (plugins.bootstrapModalDialog.length > 0) { + var i = 0; + + for (i = 0; i < plugins.bootstrapModalDialog.length; i++) { + var modalItem = $(plugins.bootstrapModalDialog[i]); + + modalItem.on('hidden.bs.modal', $.proxy(function () { + var activeModal = $(this), + rdVideoInside = activeModal.find('video'), + youTubeVideoInside = activeModal.find('iframe'); + + if (rdVideoInside.length) { + rdVideoInside[0].pause(); + } + + if (youTubeVideoInside.length) { + var videoUrl = youTubeVideoInside.attr('src'); + + youTubeVideoInside + .attr('src', '') + .attr('src', videoUrl); + } + }, modalItem)) + } + } + + /** + * JQuery mousewheel plugin + * @description Enables jquery mousewheel plugin + */ + if (plugins.scroller.length) { + var i; + for (i = 0; i < plugins.scroller.length; i++) { + var scrollerItem = $(plugins.scroller[i]); + + scrollerItem.mCustomScrollbar({ + theme: scrollerItem.attr('data-theme') ? scrollerItem.attr('data-theme') : 'minimal', + scrollInertia: 100, + scrollButtons: {enable: false} + }); + } + } + + /** + * Radio + * @description Add custom styling options for input[type="radio"] + */ + if (plugins.radio.length) { + var i; + for (i = 0; i < plugins.radio.length; i++) { + var $this = $(plugins.radio[i]); + $this.addClass("radio-custom").after("") + } + } + + /** + * Checkbox + * @description Add custom styling options for input[type="checkbox"] + */ + if (plugins.checkbox.length) { + var i; + for (i = 0; i < plugins.checkbox.length; i++) { + var $this = $(plugins.checkbox[i]); + $this.addClass("checkbox-custom").after("") + } + } + + /** + * Popovers + * @description Enables Popovers plugin + */ + if (plugins.popover.length) { + if (window.innerWidth < 767) { + plugins.popover.attr('data-placement', 'bottom'); + plugins.popover.popover(); + } + else { + plugins.popover.popover(); + } + } + + /** + * Bootstrap Buttons + * @description Enable Bootstrap Buttons plugin + */ + if (plugins.statefulButton.length) { + $(plugins.statefulButton).on('click', function () { + var statefulButtonLoading = $(this).button('loading'); + + setTimeout(function () { + statefulButtonLoading.button('reset') + }, 2000); + }) + } + + /** + * UI To Top + * @description Enables ToTop Button + */ + if (isDesktop && !isNoviBuilder) { + $().UItoTop({ + easingType: 'easeOutQuart', + containerClass: 'ui-to-top fa fa-angle-up' + }); + } + + /** + * RD Navbar + * @description Enables RD Navbar plugin + */ + if (plugins.rdNavbar.length) { + plugins.rdNavbar.RDNavbar({ + stickUpClone: (plugins.rdNavbar.attr("data-stick-up-clone") && !isNoviBuilder) ? plugins.rdNavbar.attr("data-stick-up-clone") === 'true' : false, + responsive: { + 0: { + stickUp: (!isNoviBuilder) ? plugins.rdNavbar.attr("data-stick-up") === 'true' : false + }, + 768: { + stickUp: (!isNoviBuilder) ? plugins.rdNavbar.attr("data-sm-stick-up") === 'true' : false + }, + 992: { + stickUp: (!isNoviBuilder) ? plugins.rdNavbar.attr("data-md-stick-up") === 'true' : false + }, + 1200: { + stickUp: (!isNoviBuilder) ? plugins.rdNavbar.attr("data-lg-stick-up") === 'true' : false + } + }, + callbacks: { + onStuck: function () { + var navbarSearch = this.$element.find('.rd-search input'); + + if (navbarSearch) { + navbarSearch.val('').trigger('propertychange'); + } + }, + onUnstuck: function () { + if (this.$clone === null) + return; + + var navbarSearch = this.$clone.find('.rd-search input'); + + if (navbarSearch) { + navbarSearch.val('').trigger('propertychange'); + navbarSearch.blur(); + } + } + } + }); + if (plugins.rdNavbar.attr("data-body-class")) { + document.body.className += ' ' + plugins.rdNavbar.attr("data-body-class"); + } + + + } + + // Custom sidebar animation + + $window.on("load resize", function () { + var windowWidth = window.innerWidth, + sidebarWidth = $('.rd-navbar-nav-wrap').width(), + navbarInnerWidth = $('.rd-navbar-inner').width(), + transformWidth; + + if ($('.rd-navbar').hasClass('rd-navbar-sidebar')) { + transformWidth = -(sidebarWidth - 144 - (windowWidth - navbarInnerWidth) / 2);// 144 - width of toggle-sidebar + padding of navbar link + } + if ($('.rd-navbar').hasClass('rd-navbar-fixed')) { + transformWidth = (sidebarWidth - 144 - (windowWidth - navbarInnerWidth) / 2); + } + + if ($window.width() <= 1920) { + $('.rd-navbar-sidebar-toggle-custom').toggle(function () { + $('main').css('transform', 'translate3d(' + transformWidth + 'px, 0, 0)'); + $('.rd-navbar-sidebar').css('left', transformWidth + 'px'); + $('.rd-navbar-nav-wrap').addClass('active'); + $(this).addClass('active'); + }, function () { + $('main').css('transform', 'none'); + $('.rd-navbar-sidebar').css('left', '0'); + $('.rd-navbar-nav-wrap').removeClass('active'); + $(this).removeClass('active'); + }); + } else { + $('.rd-navbar-sidebar-toggle-custom').toggle(function () { + $('.rd-navbar-nav-wrap').addClass('active'); + $(this).addClass('active'); + }, function () { + $('.rd-navbar-nav-wrap').removeClass('active'); + $(this).removeClass('active'); + }); + } + }); + + + /** + * RD Search + * @description Enables search + */ + if (plugins.search.length || plugins.searchResults) { + var handler = "bat/rd-search.php"; + var defaultTemplate = '
    #{title}
    ' + + '

    ...#{token}...

    ' + + '

    Terms matched: #{count} - URL: #{href}

    '; + var defaultFilter = '*.html'; + + if (plugins.search.length) { + + plugins.search = $('.' + plugins.search[0].className); + + for (i = 0; i < plugins.search.length; i++) { + var searchItem = $(plugins.search[i]), + options = { + element: searchItem, + filter: (searchItem.attr('data-search-filter')) ? searchItem.attr('data-search-filter') : defaultFilter, + template: (searchItem.attr('data-search-template')) ? searchItem.attr('data-search-template') : defaultTemplate, + live: (searchItem.attr('data-search-live')) ? (searchItem.find('.' + searchItem.attr('data-search-live'))) : false, + liveCount: (searchItem.attr('data-search-live-count')) ? parseInt(searchItem.attr('data-search-live')) : 4, + current: 0, processed: 0, timer: {} + }; + + if ($('.rd-navbar-search-toggle').length) { + var toggle = $('.rd-navbar-search-toggle'); + toggle.on('click', function () { + if (!($(this).hasClass('active'))) { + searchItem.find('input').val('').trigger('propertychange'); + } + }); + } + + if (options.live) { + options.clearHandler = false; + + searchItem.find('input').on("keyup input propertychange", $.proxy(function () { + var ctx = this; + + this.term = this.element.find('input').val().trim(); + this.spin = this.element.find('.input-group-addon'); + + clearTimeout(ctx.timer); + + if (ctx.term.length > 2) { + ctx.timer = setTimeout(liveSearch(ctx), 200); + + if (ctx.clearHandler == false) { + ctx.clearHandler = true; + + $("body").on("click", function (e) { + if ($(e.toElement).parents('.rd-search').length == 0) { + ctx.live.addClass('cleared').html(''); + } + }) + } + + } else if (ctx.term.length == 0) { + ctx.live.addClass('cleared').html(''); + } + }, options, this)); + } + + searchItem.submit($.proxy(function () { + $('').attr('type', 'hidden') + .attr('name', "filter") + .attr('value', this.filter) + .appendTo(this.element); + return true; + }, options, this)) + } + } + + if (plugins.searchResults.length) { + var regExp = /\?.*s=([^&]+)\&filter=([^&]+)/g; + var match = regExp.exec(location.search); + + if (match != null) { + $.get(handler, { + s: decodeURI(match[1]), + dataType: "html", + filter: match[2], + template: defaultTemplate, + live: '' + }, function (data) { + plugins.searchResults.html(data); + }) + } + } + } + + + /** + * ViewPort Universal + * @description Add class in viewport + */ + if (plugins.viewAnimate.length) { + var i; + for (i = 0; i < plugins.viewAnimate.length; i++) { + var $view = $(plugins.viewAnimate[i]).not('.active'); + $document.on("scroll", $.proxy(function () { + if (isScrolledIntoView(this)) { + this.addClass("active"); + } + }, $view)) + .trigger("scroll"); + } + } + + + // Swiper + if (plugins.swiper.length) { + for (var i = 0; i < plugins.swiper.length; i++) { + var s = $(plugins.swiper[i]); + var pag = s.find(".swiper-pagination"), + next = s.find(".swiper-button-next"), + prev = s.find(".swiper-button-prev"), + bar = s.find(".swiper-scrollbar"), + swiperSlide = s.find(".swiper-slide"), + autoplay = false; + + for (var j = 0; j < swiperSlide.length; j++) { + var $this = $(swiperSlide[j]), + url; + + if (url = $this.attr("data-slide-bg")) { + $this.css({ + "background-image": "url(" + url + ")", + "background-size": "cover" + }) + } + } + + swiperSlide.end() + .find("[data-caption-animate]") + .addClass("not-animated") + .end(); + + s.swiper({ + autoplay: !isNoviBuilder && $.isNumeric( s.attr('data-autoplay') ) ? s.attr('data-autoplay') : false, + direction: s.attr('data-direction') ? s.attr('data-direction') : "horizontal", + effect: s.attr('data-slide-effect') ? s.attr('data-slide-effect') : "slide", + speed: s.attr('data-slide-speed') ? s.attr('data-slide-speed') : 600, + keyboardControl: s.attr('data-keyboard') === "true", + mousewheelControl: s.attr('data-mousewheel') === "true", + mousewheelReleaseOnEdges: s.attr('data-mousewheel-release') === "true", + nextButton: next.length ? next.get(0) : null, + prevButton: prev.length ? prev.get(0) : null, + pagination: pag.length ? pag.get(0) : null, + paginationClickable: pag.length ? pag.attr("data-clickable") !== "false" : false, + paginationBulletRender: pag.length ? pag.attr("data-index-bullet") === "true" ? function (swiper, index, className) { + return '' + (index + 1) + ''; + } : null : null, + scrollbar: bar.length ? bar.get(0) : null, + scrollbarDraggable: bar.length ? bar.attr("data-draggable") !== "false" : true, + scrollbarHide: bar.length ? bar.attr("data-draggable") === "false" : false, + loop: isNoviBuilder ? false : s.attr('data-loop') !== "false", + simulateTouch: s.attr('data-simulate-touch') && !isNoviBuilder ? s.attr('data-simulate-touch') === "true" : false, + onTransitionStart: function (swiper) { + toggleSwiperInnerVideos(swiper); + }, + onTransitionEnd: function (swiper) { + toggleSwiperCaptionAnimation(swiper); + }, + onInit: function (swiper) { + toggleSwiperInnerVideos(swiper); + toggleSwiperCaptionAnimation(swiper); + initLightGalleryItem(s.find('[data-lightgallery="item"]'), 'lightGallery-in-carousel'); + } + }); + } + } + + + // Owl carousel + if ( plugins.owl.length ) { + for ( var i = 0; i < plugins.owl.length; i++ ) { + var carousel = $( plugins.owl[ i ] ); + plugins.owl[ i ].owl = carousel; + initOwlCarousel( carousel ); + } + } + + /** + * Isotope + * @description Enables Isotope plugin + */ + if (plugins.isotope.length) { + var i, isogroup = []; + for (i = 0; i < plugins.isotope.length; i++) { + var isotopeItem = plugins.isotope[i], + iso = new Isotope(isotopeItem, { + itemSelector: '.isotope-item', + layoutMode: isotopeItem.getAttribute('data-isotope-layout') ? isotopeItem.getAttribute('data-isotope-layout') : 'masonry', + filter: '*', + masonry: { + columnWidth: '.grid-sizer' + } + }); + + isogroup.push(iso); + } + + $(window).on('load', function () { + setTimeout(function () { + var i; + for (i = 0; i < isogroup.length; i++) { + isogroup[i].element.className += " isotope--loaded"; + isogroup[i].layout(); + } + }, 600); + }); + + var resizeTimout; + + $("[data-isotope-filter]").on("click", function (e) { + e.preventDefault(); + var filter = $(this); + clearTimeout(resizeTimout); + filter.parents(".isotope-filters").find('.active').removeClass("active"); + filter.addClass("active"); + var iso = $('.isotope[data-isotope-group="' + this.getAttribute("data-isotope-group") + '"]'); + iso.isotope({ + itemSelector: '.isotope-item', + layoutMode: iso.attr('data-isotope-layout') ? iso.attr('data-isotope-layout') : 'masonry', + filter: this.getAttribute("data-isotope-filter") == '*' ? '*' : '[data-filter*="' + this.getAttribute("data-isotope-filter") + '"]' + }); + }).eq(0).trigger("click") + } + + /** + * WOW + * @description Enables Wow animation plugin + */ + if (isDesktop && $html.hasClass("wow-animation") && $(".wow").length) { + new WOW().init(); + } + + /** + * Bootstrap tabs + * @description Activate Bootstrap Tabs + */ + if (plugins.bootstrapTabs.length) { + var i; + for (i = 0; i < plugins.bootstrapTabs.length; i++) { + var bootstrapTabsItem = $(plugins.bootstrapTabs[i]); + + //If have owl carousel inside tab - resize owl carousel on click + if (bootstrapTabsItem.find('.owl-carousel').length) { + // init first open tab + + var carouselObj = bootstrapTabsItem.find('.tab-content .tab-pane.active .owl-carousel'); + + initOwlCarousel(carouselObj); + + //init owl carousel on tab change + bootstrapTabsItem.find('.nav-custom a').on('click', $.proxy(function () { + var $this = $(this); + + $this.find('.owl-carousel').trigger('destroy.owl.carousel').removeClass('owl-loaded'); + $this.find('.owl-carousel').find('.owl-stage-outer').children().unwrap(); + + setTimeout(function () { + var carouselObj = $this.find('.tab-content .tab-pane.active .owl-carousel'); + + if (carouselObj.length) { + for (var j = 0; j < carouselObj.length; j++) { + var carouselItem = $(carouselObj[j]); + initOwlCarousel(carouselItem); + } + } + + }, isNoviBuilder ? 1500 : 300); + + }, bootstrapTabsItem)); + } + + //If have slick carousel inside tab - resize slick carousel on click + if (bootstrapTabsItem.find('.slick-slider').length) { + bootstrapTabsItem.find('.tabs-custom-list > li > a').on('click', $.proxy(function () { + var $this = $(this); + var setTimeOutTime = isNoviBuilder ? 1500 : 300; + + setTimeout(function () { + $this.find('.tab-content .tab-pane.active .slick-slider').slick('setPosition'); + }, setTimeOutTime); + }, bootstrapTabsItem)); + } + } + } + + + /** + * RD Input Label + * @description Enables RD Input Label Plugin + */ + if (plugins.rdInputLabel.length) { + plugins.rdInputLabel.RDInputLabel(); + } + + /** + * Regula + * @description Enables Regula plugin + */ + if (plugins.regula.length) { + attachFormValidator(plugins.regula); + } + + + /** + * RD Mailform + * @version 3.2.0 + */ + + /* + if (plugins.rdMailForm.length) { + var i, j, k, + msg = { + 'MF000': 'Successfully sent!', + 'MF001': 'Recipients are not set!', + 'MF002': 'Form will not work locally!', + 'MF003': 'Please, define email field in your form!', + 'MF004': 'Please, define type of your form!', + 'MF254': 'Something went wrong with PHPMailer!', + 'MF255': 'Aw, snap! Something went wrong.' + }; + + for (i = 0; i < plugins.rdMailForm.length; i++) { + var $form = $(plugins.rdMailForm[i]), + formHasCaptcha = false; + + $form.attr('novalidate', 'novalidate').ajaxForm({ + data: { + "form-type": $form.attr("data-form-type") || "contact", + "counter": i + }, + beforeSubmit: function (arr, $form, options) { + if (isNoviBuilder) + return; + + var form = $(plugins.rdMailForm[this.extraData.counter]), + inputs = form.find("[data-constraints]"), + output = $("#" + form.attr("data-form-output")), + captcha = form.find('.recaptcha'), + captchaFlag = true; + + output.removeClass("active error success"); + + if (isValidated(inputs, captcha)) { + + // veify reCaptcha + if (captcha.length) { + var captchaToken = captcha.find('.g-recaptcha-response').val(), + captchaMsg = { + 'CPT001': 'Please, setup you "site key" and "secret key" of reCaptcha', + 'CPT002': 'Something wrong with google reCaptcha' + } + + formHasCaptcha = true; + + $.ajax({ + method: "POST", + url: "bat/reCaptcha.php", + data: {'g-recaptcha-response': captchaToken}, + async: false + }) + .done(function (responceCode) { + if (responceCode != 'CPT000') { + if (output.hasClass("snackbars")) { + output.html('

    ' + captchaMsg[responceCode] + '

    ') + + setTimeout(function () { + output.removeClass("active"); + }, 3500); + + captchaFlag = false; + } else { + output.html(captchaMsg[responceCode]); + } + + output.addClass("active"); + } + }); + } + + if (!captchaFlag) { + return false; + } + + form.addClass('form-in-process'); + + if (output.hasClass("snackbars")) { + output.html('

    Sending

    '); + output.addClass("active"); + } + } else { + return false; + } + }, + error: function (result) { + if (isNoviBuilder) + return; + + var output = $("#" + $(plugins.rdMailForm[this.extraData.counter]).attr("data-form-output")), + form = $(plugins.rdMailForm[this.extraData.counter]); + + output.text(msg[result]); + form.removeClass('form-in-process'); + + if (formHasCaptcha) { + grecaptcha.reset(); + } + }, + success: function (result) { + if (isNoviBuilder) + return; + + var form = $(plugins.rdMailForm[this.extraData.counter]), + output = $("#" + form.attr("data-form-output")), + select = form.find('select'); + + form + .addClass('success') + .removeClass('form-in-process'); + + if (formHasCaptcha) { + grecaptcha.reset(); + } + + result = result.length === 5 ? result : 'MF255'; + output.text(msg[result]); + + if (result === "MF000") { + if (output.hasClass("snackbars")) { + output.html('

    ' + msg[result] + '

    '); + } else { + output.addClass("active success"); + } + } else { + if (output.hasClass("snackbars")) { + output.html('

    ' + msg[result] + '

    '); + } else { + output.addClass("active error"); + } + } + + form.clearForm(); + + + if (select.length) { + select.select2("val", ""); + } + + form.find('input, textarea').trigger('blur'); + + setTimeout(function () { + output.removeClass("active error success"); + form.removeClass('success'); + }, 3500); + } + }); + } + } + */ + + + + /** + * Custom Toggles + */ + if (plugins.customToggle.length) { + var i; + + for (i = 0; i < plugins.customToggle.length; i++) { + var $this = $(plugins.customToggle[i]); + + $this.on('click', $.proxy(function (event) { + event.preventDefault(); + var $ctx = $(this); + $($ctx.attr('data-custom-toggle')).add(this).toggleClass('active'); + }, $this)); + + if ($this.attr("data-custom-toggle-hide-on-blur") === "true") { + $("body").on("click", $this, function (e) { + if (e.target !== e.data[0] + && $(e.data.attr('data-custom-toggle')).find($(e.target)).length + && e.data.find($(e.target)).length == 0) { + $(e.data.attr('data-custom-toggle')).add(e.data[0]).removeClass('active'); + } + }) + } + + if ($this.attr("data-custom-toggle-disable-on-blur") === "true") { + $("body").on("click", $this, function (e) { + if (e.target !== e.data[0] && $(e.data.attr('data-custom-toggle')).find($(e.target)).length == 0 && e.data.find($(e.target)).length == 0) { + $(e.data.attr('data-custom-toggle')).add(e.data[0]).removeClass('active'); + } + }) + } + } + } + + + /** + * Bootstrap Date time picker + */ + if (plugins.bootstrapDateTimePicker.length) { + var i; + for (i = 0; i < plugins.bootstrapDateTimePicker.length; i++) { + var $dateTimePicker = $(plugins.bootstrapDateTimePicker[i]); + var options = {}; + + options['format'] = 'dddd DD MMMM YYYY - HH:mm'; + if ($dateTimePicker.attr("data-time-picker") == "date") { + options['format'] = 'dddd DD MMMM YYYY'; + options['minDate'] = new Date(); + } else if ($dateTimePicker.attr("data-time-picker") == "time") { + options['format'] = 'HH:mm'; + } + + options["time"] = ($dateTimePicker.attr("data-time-picker") != "date"); + options["date"] = ($dateTimePicker.attr("data-time-picker") != "time"); + options["shortTime"] = true; + + $dateTimePicker.bootstrapMaterialDatePicker(options); + } + } + + + + /** + * Select2 + * @description Enables select2 plugin + */ + if (plugins.selectFilter.length) { + var i; + for (i = 0; i < plugins.selectFilter.length; i++) { + var select = $(plugins.selectFilter[i]); + + select.select2({ + placeholder: select.attr("data-placeholder") ? select.attr("data-placeholder") : false, + minimumResultsForSearch: select.attr("data-minimum-results-search") ? select.attr("data-minimum-results-search") : 10, + maximumSelectionSize: 3 + }); + } + } + + + + /** + * Slick carousel + * @description Enable Slick carousel plugin + */ + if (plugins.slick.length) { + var i; + for (i = 0; i < plugins.slick.length; i++) { + var $slickItem = $(plugins.slick[i]); + + $slickItem.slick({ + // adaptiveHeight: true, + slidesToScroll: parseInt($slickItem.attr('data-slide-to-scroll')) || 1, + asNavFor: $slickItem.attr('data-for') || false, + dots: $slickItem.attr("data-dots") == "true", + infinite: isNoviBuilder ? false : $slickItem.attr("data-loop") == "true", + focusOnSelect: true, + arrows: $slickItem.attr("data-arrows") == "true", + swipe: $slickItem.attr("data-swipe") == "true", + autoplay: $slickItem.attr("data-autoplay") == "true", + + centerMode: $slickItem.attr("data-center-mode") == "true", + centerPadding: $slickItem.attr("data-center-padding") ? $slickItem.attr("data-center-padding") : '0.50', + mobileFirst: true, + responsive: [ + { + breakpoint: 0, + settings: { + slidesToShow: parseInt($slickItem.attr('data-items')) || 1, + vertical: $slickItem.attr("data-vertical") == "true", + } + }, + { + breakpoint: 479, + settings: { + slidesToShow: parseInt($slickItem.attr('data-xs-items')) || 1, + vertical: $slickItem.attr("data-xs-vertical") == "true", + } + }, + { + breakpoint: 767, + settings: { + slidesToShow: parseInt($slickItem.attr('data-sm-items')) || 1, + centerMode: $slickItem.attr("data-sm-center-mode") == "true", + vertical: $slickItem.attr("data-sm-vertical") == "true", + } + }, + { + breakpoint: 991, + settings: { + slidesToShow: parseInt($slickItem.attr('data-md-items')) || 1, + centerMode: $slickItem.attr("data-md-center-mode") == "true", + vertical: $slickItem.attr("data-md-vertical") == "true", + } + }, + { + breakpoint: 1199, + settings: { + slidesToShow: parseInt($slickItem.attr('data-lg-items')) || 1, + centerMode: $slickItem.attr("data-lg-center-mode") == "true", + vertical: $slickItem.attr("data-lg-vertical") == "true", + } + } + ] + }) + .on('afterChange', function (event, slick, currentSlide, nextSlide) { + var $this = $(this), + childCarousel = $this.attr('data-child'); + + if (childCarousel) { + $(childCarousel + ' .slick-slide').removeClass('slick-current'); + $(childCarousel + ' .slick-slide').eq(currentSlide).addClass('slick-current'); + } + }); + } + } + + // lightGallery + if (plugins.lightGallery.length) { + for (var i = 0; i < plugins.lightGallery.length; i++) { + initLightGallery(plugins.lightGallery[i]); + } + } + + // lightGallery item + if (plugins.lightGalleryItem.length) { + // Filter carousel items + var notCarouselItems = []; + + for (var z = 0; z < plugins.lightGalleryItem.length; z++) { + if (!$(plugins.lightGalleryItem[z]).parents('.owl-carousel').length && + !$(plugins.lightGalleryItem[z]).parents('.swiper-slider').length && + !$(plugins.lightGalleryItem[z]).parents('.slick-slider').length) { + notCarouselItems.push(plugins.lightGalleryItem[z]); + } + } + + plugins.lightGalleryItem = notCarouselItems; + + for (var i = 0; i < plugins.lightGalleryItem.length; i++) { + initLightGalleryItem(plugins.lightGalleryItem[i]); + } + } + + // Dynamic lightGallery + if (plugins.lightDynamicGalleryItem.length) { + for (var i = 0; i < plugins.lightDynamicGalleryItem.length; i++) { + initDynamicLightGallery(plugins.lightDynamicGalleryItem[i]); + } + } +}()); + diff --git a/code/views/login.ejs b/code/views/login.ejs new file mode 100644 index 0000000..5c14b1d --- /dev/null +++ b/code/views/login.ejs @@ -0,0 +1,32 @@ +<%- include('head') %> +<%- include('head2') %> +
    +
    +
    +

    Login

    + +
    +
    +
    +

    ID

    +
    + + +
    +
    +
    +

    PASSWORD

    +
    + + +
    +
    +
    + +
    +
    +
    +
    +
    +

    +<%- include('foot') %> \ No newline at end of file diff --git a/code/views/mypage.ejs b/code/views/mypage.ejs new file mode 100644 index 0000000..019d5d5 --- /dev/null +++ b/code/views/mypage.ejs @@ -0,0 +1,65 @@ +<%- include('head') %> +<%- include('head2') %> +
    +
    +

    <%= id %> 님의 마이페이지

    +
    +
    +
    + + + +
    + <% if(role === 2) { %> +
    +
    +

    예약 정보

    +
    +
    +
    + <% if(data.length === 0) { %> +

    +

    예약 정보가 없습니다.

    + <% }else{ %> +

    + + + + + + + + + + <% data.forEach((row, index)=>{ %> + + + + + + + + <% }) %> + +
    Noroomcheck-incheck-out예약취소
    <%= index+1 %> <% x = row.roomid %> + <% if(x === 1) { %> Single + <% } if(x === 2) { %> Twin + <% } if(x === 3) { %> Double + <% } if(x === 4) { %> Family + <% } %> + <%= row.checkindate.toLocaleDateString() %> <%= row.checkoutdate.toLocaleDateString() %> + 취소 +
    + <% } %> +
    +
    +
    +<% } %> +<%- include('foot') %> diff --git a/code/views/notice.ejs b/code/views/notice.ejs new file mode 100644 index 0000000..30ea770 --- /dev/null +++ b/code/views/notice.ejs @@ -0,0 +1,17 @@ +<%- include('head') %> +<%- include('head2') %> +
    +
    +
    +
    +
      +
    • +

      <%= detail %>

      +
    • +
    +
    +
    +
    +
    +<%- include('foot') %> \ No newline at end of file diff --git a/code/views/reservation.ejs b/code/views/reservation.ejs new file mode 100644 index 0000000..d0d3050 --- /dev/null +++ b/code/views/reservation.ejs @@ -0,0 +1,78 @@ +<%- include('head') %> +<%- include('head2') %> + +
    +
    +
    +
    +

    Check Availability

    + +
    +
    + +
    +

    Arrival

    +
    + +
    +
    +
    +

    Departure

    +
    + +
    +
    + <% if(role === 2) { %> +
    +

    인원

    +
    + + +
    +
    + <% } %> + + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +

    +<%- include('foot') %> \ No newline at end of file diff --git a/code/views/room.ejs b/code/views/room.ejs new file mode 100644 index 0000000..2949d13 --- /dev/null +++ b/code/views/room.ejs @@ -0,0 +1,47 @@ +<%- include('head') %> +<%- include('head2') %> + +
    +
    +

    Rooms & Suites

    +

    Royal Villas offers the finest accommodations with unique designs that provide both a luxurious and relaxing environment. Specially
    selected fabrics and finishes vary from room to room, offering guests a variety of beautiful and unique atmospheres to select from.

    + + <% data.forEach((row, index)=>{ %> +
    +
    +

    <%= row.roomname %> Room

    +

    <%= row.roomdesc %>

    +
    + +
    + <% if(role === 1) { %> +
    + +
    +
    +

    현재 방 개수: <%= row.roomnum %>

    +
    +
    + + +
    + +
    + +
    +
    + +
    + <% } %> + <% }) %> +
    +
    + + <%- include('foot') %> \ No newline at end of file diff --git a/code/views/sign-up.ejs b/code/views/sign-up.ejs new file mode 100644 index 0000000..b8964da --- /dev/null +++ b/code/views/sign-up.ejs @@ -0,0 +1,96 @@ +<%- include('head') %> +<%- include('head2') %> +

    +
    +
    +

    <%= __('signup') %>

    + +
    +
    +
    +

    <%= __('id') %>

    +
    + + +
    +
    +
    +

    <%= __('password') %>

    +
    + + +
    +
    +
    +

    <%= __('password2') %>

    +
    + + +
    +
    +
    +

    <%= __('name') %>

    +
    + + +
    +
    +
    +

    E-MAIL

    +
    + + +
    +
    +
    +

    <%= __('phone') %>

    +
    + + + +
    +
    +
    + +
    +
    +
    +
    +
    +

    + +<%- include('foot') %> diff --git a/code/views/updatepw.ejs b/code/views/updatepw.ejs new file mode 100644 index 0000000..0512a4a --- /dev/null +++ b/code/views/updatepw.ejs @@ -0,0 +1,40 @@ +<%- include('head') %> +<%- include('head2') %> +

    +
    +
    +

    비밀번호 변경

    + +
    +
    +
    +

    현재 비밀번호

    +
    + + +
    +
    +
    +

    새로운 비밀번호

    +
    + + +
    +
    +
    +

    새로운 비밀번호 확인

    +
    + + +
    +
    +
    + +
    +
    +
    +
    +
    +

    + +<%- include('foot') %> \ No newline at end of file diff --git a/db/hoteldb.sql b/db/hoteldb.sql new file mode 100644 index 0000000..6617f83 --- /dev/null +++ b/db/hoteldb.sql @@ -0,0 +1,137 @@ +-- MySQL dump 10.13 Distrib 8.0.34, for Win64 (x86_64) +-- +-- Host: 127.0.0.1 Database: hoteldb +-- ------------------------------------------------------ +-- Server version 8.0.34 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!50503 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `reservation` +-- + +DROP TABLE IF EXISTS `reservation`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `reservation` ( + `reservationid` int NOT NULL AUTO_INCREMENT, + `userid` varchar(20) DEFAULT NULL, + `roomid` int DEFAULT NULL, + `checkindate` date DEFAULT NULL, + `checkoutdate` date DEFAULT NULL, + PRIMARY KEY (`reservationid`), + KEY `user_id_idx` (`userid`), + KEY `room_id_idx` (`roomid`), + CONSTRAINT `room_id` FOREIGN KEY (`roomid`) REFERENCES `rooms` (`roomid`) ON DELETE RESTRICT ON UPDATE CASCADE, + CONSTRAINT `user_id` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `reservation` +-- + +LOCK TABLES `reservation` WRITE; +/*!40000 ALTER TABLE `reservation` DISABLE KEYS */; +INSERT INTO `reservation` VALUES (32,'testuser01',1,'2023-11-29','2023-11-30'),(33,'testuser01',4,'2023-12-01','2023-12-04'),(34,'testuser01',2,'2023-12-07','2023-12-10'),(35,'testuser02',2,'2023-11-24','2023-11-28'),(36,'testuser02',3,'2023-12-01','2023-12-10'); +/*!40000 ALTER TABLE `reservation` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `roles` +-- + +DROP TABLE IF EXISTS `roles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `roles` ( + `roleid` int NOT NULL, + `rolename` varchar(45) DEFAULT NULL, + PRIMARY KEY (`roleid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `roles` +-- + +LOCK TABLES `roles` WRITE; +/*!40000 ALTER TABLE `roles` DISABLE KEYS */; +INSERT INTO `roles` VALUES (1,'admin'),(2,'user'),(3,'anonymous'); +/*!40000 ALTER TABLE `roles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `rooms` +-- + +DROP TABLE IF EXISTS `rooms`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `rooms` ( + `roomid` int NOT NULL AUTO_INCREMENT, + `roomname` varchar(20) DEFAULT NULL, + `roomdesc` longtext, + `numofperson` int DEFAULT NULL, + `roomnum` int DEFAULT '2', + PRIMARY KEY (`roomid`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rooms` +-- + +LOCK TABLES `rooms` WRITE; +/*!40000 ALTER TABLE `rooms` DISABLE KEYS */; +INSERT INTO `rooms` VALUES (1,'single','1인용 객실으로 single 침대 1개가 있습니다. 최대 2인 숙박 가능합니다.',2,2),(2,'twin','2인용 객실으로 single 침대 2개가 있습니다. 최대 3인 숙박 가능합니다.',3,4),(3,'double','2인용 객실으로 double 침대 1개가 있습니다. 최대 3인 숙박 가능합니다.',3,2),(4,'family','4인용 객실으로 double 침대 2개가 있습니다. 최대 5인 숙박 가능합니다.',5,2); +/*!40000 ALTER TABLE `rooms` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `users` ( + `userid` varchar(20) NOT NULL, + `userpw` varchar(25) NOT NULL, + `username` varchar(15) NOT NULL, + `useremail` varchar(30) DEFAULT NULL, + `userphone` varchar(15) DEFAULT NULL, + `roleid` int DEFAULT '2', + PRIMARY KEY (`userid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `users` +-- + +LOCK TABLES `users` WRITE; +/*!40000 ALTER TABLE `users` DISABLE KEYS */; +INSERT INTO `users` VALUES ('adminuser01','12345678','admin','admin@aaa.com','01012345678',1),('testuser01','12345678','테스트','aaa@aaa.com','01011111111',2),('testuser02','12345678','테스트2','test@test.com','01022222222',2); +/*!40000 ALTER TABLE `users` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2023-11-29 3:36:53 diff --git a/db/ums.sql b/db/ums.sql deleted file mode 100644 index b62f1e3..0000000 --- a/db/ums.sql +++ /dev/null @@ -1,96 +0,0 @@ --- phpMyAdmin SQL Dump --- version 5.2.0 --- https://www.phpmyadmin.net/ --- --- Host: 127.0.0.1 --- Generation Time: Oct 25, 2023 at 08:52 AM --- Server version: 10.4.27-MariaDB --- PHP Version: 7.4.33 - -SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; -START TRANSACTION; -SET time_zone = "+00:00"; - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8mb4 */; - --- --- Database: `ums` --- - --- -------------------------------------------------------- - --- --- Table structure for table `projects` --- - -CREATE TABLE `projects` ( - `id` int(11) NOT NULL, - `title` varchar(255) NOT NULL, - `description` text NOT NULL, - `type` varchar(255) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- --- Dumping data for table `projects` --- - -INSERT INTO `projects` (`id`, `title`, `description`, `type`) VALUES -(3, 'AI recommendation', 'Movie recommendation', 'ai'), -(4, 'Random', 'sadasd', 'other'); - --- -------------------------------------------------------- - --- --- Table structure for table `users` --- - -CREATE TABLE `users` ( - `id` int(11) NOT NULL, - `username` varchar(255) NOT NULL, - `pwd` varchar(255) NOT NULL, - `email` varchar(255) NOT NULL, - `gender` int(11) NOT NULL, - `skills` varchar(255) NOT NULL, - `nationality` varchar(255) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - --- --- Indexes for dumped tables --- - --- --- Indexes for table `projects` --- -ALTER TABLE `projects` - ADD PRIMARY KEY (`id`); - --- --- Indexes for table `users` --- -ALTER TABLE `users` - ADD PRIMARY KEY (`id`); - --- --- AUTO_INCREMENT for dumped tables --- - --- --- AUTO_INCREMENT for table `projects` --- -ALTER TABLE `projects` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; - --- --- AUTO_INCREMENT for table `users` --- -ALTER TABLE `users` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -COMMIT; - -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/locales/en.json b/locales/en.json deleted file mode 100644 index ed6f117..0000000 --- a/locales/en.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "welcome": "Welcome to my Portfolio", - "intro": "Hey, I'm Shabir", - "job": "Freelance Creative & Professional Graphic Designer", - "Home": "ㅎ" -} \ No newline at end of file diff --git a/locales/ko.json b/locales/ko.json deleted file mode 100644 index 8d5a898..0000000 --- a/locales/ko.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "welcome": "내 웹사이트 환영합니다!", - "intro": "안녕하세요? 샤비르입니다", - "job": "프로그래머, 웹 개발자, 인공지능 연구자", - "Home": "홈" -} \ No newline at end of file diff --git a/locales/kr.json b/locales/kr.json deleted file mode 100644 index 1d70163..0000000 --- a/locales/kr.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "welcome": "내 웹사이트 환영합니다!", - "intro": "안녕하세요? 샤비르입니다", - "job": "프로그래머, 웹 개발자, 인공지능 연구자", - "Home": "", -} \ No newline at end of file diff --git a/main.js b/main.js deleted file mode 100644 index af381fe..0000000 --- a/main.js +++ /dev/null @@ -1,402 +0,0 @@ -const express = require('express') -const cookieParser = require('cookie-parser') -const app = express() -const mysql = require('mysql') -const i18n = require('i18n') - -const flash = require('connect-flash') - -app.use(cookieParser()) -app.use(flash()) -var session = require('express-session') -/** - * Session configuration - */ - -/** - * Configure i18n module - */ - -i18n.configure({ - locales:['en','ko'], - directory: __dirname+'/locales', - defaultLocale:'en', - cookie:'lang', - objectNotation:true, -}) - -app.use(i18n.init) - -// Populates req.session -app.use(session({ - resave: false, // don't save session if unmodified - saveUninitialized: false, // don't create session until something stored - secret: 'keyboard cat' - })); - -/** - * Install EJS and then include the following in your code - */ -const ejs = require('ejs') - -/** - * Login Check - */ -function requireLogin(req, res, next){ - if(req.session.username) { - next() - } - else { - req.flash('error', 'You have to login first!'); - res.redirect("/login") - } -} - - - -/** - * Store data in res local - */ - -app.use((req, res, next) => { - res.locals.username = req.session.username || null; - if(req.session.username) { - res.locals.role = req.session.role - console.log("role") - console.log(res.locals.role) - } - next() -}) - - -app.use("/scripts", express.static(__dirname+"/scripts")) -app.use("/assets", express.static(__dirname+"/pages/assets/")) -app.use(express.urlencoded({extended: true})) - - -app.set("view engine", "ejs") -app.set("views", "./views") - - - -const pool = mysql.createPool({ - host: "localhost", - user: "root", - password: "", - database: "ums", - connectionLimit: 10, -}) - -app.listen(8080, ()=> { - console.log("connection established") -}) - - -/** - * Language Routes - */ -app.get('/lang/:locale', (req, res) => { - const locale = req.params.locale; - console.log('local ='+locale) - res.cookie('lang', locale); - res.redirect('back'); // Redirect back to the previous page or use a specific URL - }); - -app.get("/", (req, res)=>{ - console.log(__dirname) - res.render('index', { - welcome: res.__('welcome'), - intro: res.__('intro'), - job: res.__('job') - }) -}) - -app.get("/about", (req, res)=>{ - res.render('about') -}) - -app.get("/contact", (req, res)=>{ - res.render('contact') -}) - -app.get("/signup", (req, res)=>{ - res.render('signup') -}) - -/** - * Login Route - */ -app.get("/login", (req, res)=>{ - - res.render('signin') -}) - - - -app.get("/users", requireLogin, (req, res)=>{ - pool.getConnection((err, conn) =>{ - if(err) throw err - - const exec = conn.query('Select * from users', (err, rows) => { - conn.release() - console.log('SQL', exec.sql) - if(err) { - res.status(500).send('Error retreiving the data') - } - else { - res.render('users', {data: rows}) - } - }) - }) - - -}) - - -app.get("/showusers", (req, res) => { - /** - * - */ - - pool.getConnection((err, conn) => { - const exec = conn.query('SELECT * FROM users', (err, rows) => { - conn.release() - console.log('SQL', exec.sql) - if(!err) { - res.json({rows}) - } - else { - console.log(`The data from the user table are:11 \n`, rows) - } - }) - }) -}) - - -app.get("/users/:id/delete", (req, res) => { - /** - * - */ - - const id = req.params.id - - pool.getConnection((err, conn) => { - const exec = conn.query('DELETE from users WHERE id = ?', [id], (err, rows) => { - - console.log('SQL', exec.sql) - if(err) { - res.json({"status":"Error"}) - } - else { - conn.release() - res.json({"status":"Success", "message":"User deleted"}) - - - - } - }) - }) - - - -}) - -app.get("/logout",(req, res) => { - req.session.destroy() - res.redirect("/") -}) - - -app.post("/process/signin", (req, res) => { - - pool.getConnection((err, conn) => { - if(err) throw err - const username = req.body.username - const pwd = req.body.pwd - - console.log("before SELECT query!!", username,pwd) - - - const exec = conn.query('SELECT * FROM users where username = ? AND pwd = password(?)', [username, pwd], (err, rows) => { - conn.release() - console.log('SQL', exec.sql) - if(!err) { - if(rows.length > 0) { - req.session.username = rows[0].username - req.session.role = rows[0].role - console.log("session info") - console.log(req.session.username) - } - res.redirect("/") - } - else { - console.log(`The data from the user table are:11 \n`, rows) - } - }) - - - }) -}) - - - -app.post("/process/signup", (req, res) => { - - pool.getConnection((err, conn) => { - if(err) throw err - const params = req.body - const username = params.username - const pwd = params.pwd - const email = params.email - const gender = params.gender - - console.log("before query!!", username,pwd,email,gender) - - - const exec = conn.query('INSERT INTO users (username, pwd, email, gender) VALUES (?, password(?), ?, ?)', [username, pwd, email, gender,'',''], (err, rows) => { - conn.release() - console.log('SQL', exec.sql) - if(!err) { - res.send(`User with record ID has been added`) - } - else { - console.log(`The data from the user table are:11 \n`, rows) - } - }) - - - }) -}) - -app.get("/delete/:id", (req, res)=>{ - const id = req.params.id - console.log(id) - pool.getConnection((err, conn) =>{ - if(err) throw err - - const exec = conn.query('DELETE from users WHERE id = ?', [id], (err, rows) => { - - console.log('SQL', exec.sql) - if(err) { - res.status(500).send('Error Deleting the data') - } - else { - conn.release() - res.redirect('/users') - - - - - } - }) - }) - - -}) - - - - -/** - * Creating Backend API - */ - -app.get("/api/users", (req, res)=>{ - pool.getConnection((err, conn) =>{ - if(err) throw err - - const exec = conn.query('Select * from users', (err, rows) => { - conn.release() - console.log('SQL', exec.sql) - if(err) { - res.status(500).send('Error retreiving the data') - } - else { - res.json({rows}) - } - }) - }) - - -}) - - -/** Project Management */ - -/** Insert Project */ - -app.get("/addproject", (req, res)=>{ - res.render('project') -}) - -app.post("/process/project", (req, res) => { - - pool.getConnection((err, conn) => { - if(err) throw err - const params = req.body - const title = params.title - const desc = params.desc - const type = params.type - - - - - const exec = conn.query('INSERT INTO projects (title, description, type) VALUES (?, ?, ?)', [title, desc, type], (err, rows) => { - conn.release() - console.log('SQL', exec.sql) - if(!err) { - res.redirect('/projects') - } - else { - console.log(`The data from the user table are:11 \n`, rows) - } - }) - - - }) -}) - -app.get("/projects", (req, res)=>{ - pool.getConnection((err, conn) =>{ - if(err) throw err - - const exec = conn.query('Select * from projects', (err, rows) => { - conn.release() - console.log('SQL', exec.sql) - if(err) { - res.status(500).send('Error retreiving the data') - } - else { - res.render('projects', {data: rows}) - } - }) - }) - - -}) - -app.get("/project/:id/delete", (req, res)=>{ - const id = req.params.id - console.log(id) - pool.getConnection((err, conn) =>{ - if(err) throw err - - const exec = conn.query('DELETE from projects WHERE id = ?', [id], (err, rows) => { - - console.log('SQL', exec.sql) - if(err) { - res.status(500).send('Error Deleting the data') - } - else { - conn.release() - res.redirect('/projects') - - - - - } - }) - }) - - -}) \ No newline at end of file diff --git a/node_modules/.bin/ejs b/node_modules/.bin/ejs deleted file mode 100644 index 002d2ac..0000000 --- a/node_modules/.bin/ejs +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../ejs/bin/cli.js" "$@" -else - exec node "$basedir/../ejs/bin/cli.js" "$@" -fi diff --git a/node_modules/.bin/ejs.cmd b/node_modules/.bin/ejs.cmd deleted file mode 100644 index 7cc2b56..0000000 --- a/node_modules/.bin/ejs.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ejs\bin\cli.js" %* diff --git a/node_modules/.bin/ejs.ps1 b/node_modules/.bin/ejs.ps1 deleted file mode 100644 index f31305e..0000000 --- a/node_modules/.bin/ejs.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../ejs/bin/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../ejs/bin/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../ejs/bin/cli.js" $args - } else { - & "node$exe" "$basedir/../ejs/bin/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/jake b/node_modules/.bin/jake deleted file mode 100644 index 8580efe..0000000 --- a/node_modules/.bin/jake +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../jake/bin/cli.js" "$@" -else - exec node "$basedir/../jake/bin/cli.js" "$@" -fi diff --git a/node_modules/.bin/jake.cmd b/node_modules/.bin/jake.cmd deleted file mode 100644 index 1ccccef..0000000 --- a/node_modules/.bin/jake.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jake\bin\cli.js" %* diff --git a/node_modules/.bin/jake.ps1 b/node_modules/.bin/jake.ps1 deleted file mode 100644 index d86e1bd..0000000 --- a/node_modules/.bin/jake.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../jake/bin/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../jake/bin/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../jake/bin/cli.js" $args - } else { - & "node$exe" "$basedir/../jake/bin/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/mime b/node_modules/.bin/mime deleted file mode 100644 index 0a62a1b..0000000 --- a/node_modules/.bin/mime +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../mime/cli.js" "$@" -else - exec node "$basedir/../mime/cli.js" "$@" -fi diff --git a/node_modules/.bin/mime.cmd b/node_modules/.bin/mime.cmd deleted file mode 100644 index 54491f1..0000000 --- a/node_modules/.bin/mime.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mime\cli.js" %* diff --git a/node_modules/.bin/mime.ps1 b/node_modules/.bin/mime.ps1 deleted file mode 100644 index 2222f40..0000000 --- a/node_modules/.bin/mime.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../mime/cli.js" $args - } else { - & "$basedir/node$exe" "$basedir/../mime/cli.js" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../mime/cli.js" $args - } else { - & "node$exe" "$basedir/../mime/cli.js" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.bin/mustache b/node_modules/.bin/mustache deleted file mode 100644 index 7bc1d34..0000000 --- a/node_modules/.bin/mustache +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - exec "$basedir/node" "$basedir/../mustache/bin/mustache" "$@" -else - exec node "$basedir/../mustache/bin/mustache" "$@" -fi diff --git a/node_modules/.bin/mustache.cmd b/node_modules/.bin/mustache.cmd deleted file mode 100644 index 92cf68d..0000000 --- a/node_modules/.bin/mustache.cmd +++ /dev/null @@ -1,17 +0,0 @@ -@ECHO off -GOTO start -:find_dp0 -SET dp0=%~dp0 -EXIT /b -:start -SETLOCAL -CALL :find_dp0 - -IF EXIST "%dp0%\node.exe" ( - SET "_prog=%dp0%\node.exe" -) ELSE ( - SET "_prog=node" - SET PATHEXT=%PATHEXT:;.JS;=;% -) - -endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\mustache\bin\mustache" %* diff --git a/node_modules/.bin/mustache.ps1 b/node_modules/.bin/mustache.ps1 deleted file mode 100644 index ec52dfe..0000000 --- a/node_modules/.bin/mustache.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env pwsh -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent - -$exe="" -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { - # Fix case when both the Windows and Linux builds of Node - # are installed in the same directory - $exe=".exe" -} -$ret=0 -if (Test-Path "$basedir/node$exe") { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "$basedir/node$exe" "$basedir/../mustache/bin/mustache" $args - } else { - & "$basedir/node$exe" "$basedir/../mustache/bin/mustache" $args - } - $ret=$LASTEXITCODE -} else { - # Support pipeline input - if ($MyInvocation.ExpectingInput) { - $input | & "node$exe" "$basedir/../mustache/bin/mustache" $args - } else { - & "node$exe" "$basedir/../mustache/bin/mustache" $args - } - $ret=$LASTEXITCODE -} -exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index 02b733e..0000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,1047 +0,0 @@ -{ - "name": "portfolio_express", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "node_modules/@messageformat/core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@messageformat/core/-/core-3.2.0.tgz", - "integrity": "sha512-ppbb/7OYqg/t4WdFk8VAfZEV2sNUq3+7VeBAo5sKFhmF786sh6gB7fUeXa2qLTDIcTHS49HivTBN7QNOU5OFTg==", - "dependencies": { - "@messageformat/date-skeleton": "^1.0.0", - "@messageformat/number-skeleton": "^1.0.0", - "@messageformat/parser": "^5.1.0", - "@messageformat/runtime": "^3.0.1", - "make-plural": "^7.0.0", - "safe-identifier": "^0.4.1" - } - }, - "node_modules/@messageformat/date-skeleton": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@messageformat/date-skeleton/-/date-skeleton-1.0.1.tgz", - "integrity": "sha512-jPXy8fg+WMPIgmGjxSlnGJn68h/2InfT0TNSkVx0IGXgp4ynnvYkbZ51dGWmGySEK+pBiYUttbQdu5XEqX5CRg==" - }, - "node_modules/@messageformat/number-skeleton": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@messageformat/number-skeleton/-/number-skeleton-1.2.0.tgz", - "integrity": "sha512-xsgwcL7J7WhlHJ3RNbaVgssaIwcEyFkBqxHdcdaiJzwTZAWEOD8BuUFxnxV9k5S0qHN3v/KzUpq0IUpjH1seRg==" - }, - "node_modules/@messageformat/parser": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@messageformat/parser/-/parser-5.1.0.tgz", - "integrity": "sha512-jKlkls3Gewgw6qMjKZ9SFfHUpdzEVdovKFtW1qRhJ3WI4FW5R/NnGDqr8SDGz+krWDO3ki94boMmQvGke1HwUQ==", - "dependencies": { - "moo": "^0.5.1" - } - }, - "node_modules/@messageformat/runtime": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@messageformat/runtime/-/runtime-3.0.1.tgz", - "integrity": "sha512-6RU5ol2lDtO8bD9Yxe6CZkl0DArdv0qkuoZC+ZwowU+cdRlVE1157wjCmlA5Rsf1Xc/brACnsZa5PZpEDfTFFg==", - "dependencies": { - "make-plural": "^7.0.0" - } - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "node_modules/async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/bignumber.js": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", - "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==", - "engines": { - "node": "*" - } - }, - "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/boolean": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", - "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==" - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/connect-flash": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/connect-flash/-/connect-flash-0.1.1.tgz", - "integrity": "sha512-2rcfELQt/ZMP+SM/pG8PyhJRaLKp+6Hk2IUBNkEit09X+vwn3QsAL3ZbYtxUn7NVPzbMTSLRDhqe0B/eh30RYA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-parser": { - "version": "1.4.6", - "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.6.tgz", - "integrity": "sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==", - "dependencies": { - "cookie": "0.4.1", - "cookie-signature": "1.0.6" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/cookie-parser/node_modules/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/ejs": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz", - "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", - "dependencies": { - "jake": "^10.8.5" - }, - "bin": { - "ejs": "bin/cli.js" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express-session": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.17.3.tgz", - "integrity": "sha512-4+otWXlShYlG1Ma+2Jnn+xgKUZTMJ5QD3YvfilX3AcocOAbIkVylSWEklzALe/+Pu4qV6TYBj5GwOBFfdKqLBw==", - "dependencies": { - "cookie": "0.4.2", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~2.0.0", - "on-headers": "~1.0.2", - "parseurl": "~1.3.3", - "safe-buffer": "5.2.1", - "uid-safe": "~2.1.5" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/express-session/node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fast-printf": { - "version": "1.6.9", - "resolved": "https://registry.npmjs.org/fast-printf/-/fast-printf-1.6.9.tgz", - "integrity": "sha512-FChq8hbz65WMj4rstcQsFB0O7Cy++nmbNfLYnD9cYv2cRn8EG6k/MGn9kO/tjO66t09DLDugj3yL+V2o6Qftrg==", - "dependencies": { - "boolean": "^3.1.4" - }, - "engines": { - "node": ">=10.0" - } - }, - "node_modules/filelist": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", - "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", - "dependencies": { - "minimatch": "^5.0.1" - } - }, - "node_modules/filelist/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/filelist/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/i18n": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/i18n/-/i18n-0.15.1.tgz", - "integrity": "sha512-yue187t8MqUPMHdKjiZGrX+L+xcUsDClGO0Cz4loaKUOK9WrGw5pgan4bv130utOwX7fHE9w2iUeHFalVQWkXA==", - "dependencies": { - "@messageformat/core": "^3.0.0", - "debug": "^4.3.3", - "fast-printf": "^1.6.9", - "make-plural": "^7.0.0", - "math-interval-parser": "^2.0.1", - "mustache": "^4.2.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/mashpie" - } - }, - "node_modules/i18n/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/i18n/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" - }, - "node_modules/jake": { - "version": "10.8.7", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", - "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", - "dependencies": { - "async": "^3.2.3", - "chalk": "^4.0.2", - "filelist": "^1.0.4", - "minimatch": "^3.1.2" - }, - "bin": { - "jake": "bin/cli.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-plural": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/make-plural/-/make-plural-7.3.0.tgz", - "integrity": "sha512-/K3BC0KIsO+WK2i94LkMPv3wslMrazrQhfi5We9fMbLlLjzoOSJWr7TAdupLlDWaJcWxwoNosBkhFDejiu5VDw==" - }, - "node_modules/math-interval-parser": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/math-interval-parser/-/math-interval-parser-2.0.1.tgz", - "integrity": "sha512-VmlAmb0UJwlvMyx8iPhXUDnVW1F9IrGEd9CIOmv+XL8AErCUUuozoDMrgImvnYt2A+53qVX/tPW6YJurMKYsvA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/moo": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.2.tgz", - "integrity": "sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==" - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", - "bin": { - "mustache": "bin/mustache" - } - }, - "node_modules/mysql": { - "version": "2.18.1", - "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz", - "integrity": "sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig==", - "dependencies": { - "bignumber.js": "9.0.0", - "readable-stream": "2.3.7", - "safe-buffer": "5.1.2", - "sqlstring": "2.3.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mysql/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/random-bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", - "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/safe-identifier": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/safe-identifier/-/safe-identifier-0.4.2.tgz", - "integrity": "sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w==" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/sqlstring": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", - "integrity": "sha512-ooAzh/7dxIG5+uDik1z/Rd1vli0+38izZhGzSa34FwR7IbelPWCCKSNIl8jlL/F7ERvy8CB2jNeM1E9i9mXMAQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/uid-safe": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", - "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", - "dependencies": { - "random-bytes": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - } - } -} diff --git a/node_modules/@messageformat/core/LICENSE b/node_modules/@messageformat/core/LICENSE deleted file mode 100644 index 78918d5..0000000 --- a/node_modules/@messageformat/core/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright OpenJS Foundation and contributors, https://openjsf.org/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@messageformat/core/README.md b/node_modules/@messageformat/core/README.md deleted file mode 100644 index 91704ff..0000000 --- a/node_modules/@messageformat/core/README.md +++ /dev/null @@ -1,31 +0,0 @@ -
    - -

    messageformat

    -
    - -The experience and subtlety of your program's text is important. -The messageformat project provides a complete set of tools for handling all the messages of your application, for both front-end and back-end environments; for both runtime and build-time use. -It's built around the ICU MessageFormat standard and supports [all the languages](http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html) included in the [Unicode CLDR](http://cldr.unicode.org/), but it can be just as useful if you're dealing with only one of them. - -[ICU MessageFormat](https://unicode-org.github.io/icu/userguide/format_parse/messages/) is a mechanism for handling both **pluralization** and **gender** in your applications. -This is the core compiler of a [JavaScript project](http://messageformat.github.io/) supports and extends all parts of the official Java/C++ implementation, with the exception of the deprecated ChoiceFormat. -In addition to compiling messages into JavaScript functions, it also provides tooling for making their use easy during both the build and runtime of your site or application. - -For more details, please see the project's documentation site: http://messageformat.github.io/ - -This package was previously named [messageformat](https://www.npmjs.com/package/messageformat). - ---- - -Messageformat is an OpenJS Foundation project, and we follow its [Code of Conduct](https://code-of-conduct.openjsf.org/). - -Copyright [OpenJS Foundation](https://openjsf.org) and messageformat contributors. All rights reserved. -The [OpenJS Foundation](https://openjsf.org) has registered trademarks and uses trademarks. -For a list of trademarks of the [OpenJS Foundation](https://openjsf.org), please see our [Trademark Policy](https://trademark-policy.openjsf.org/) and [Trademark List](https://trademark-list.openjsf.org/). -Trademarks and logos not indicated on the [list of OpenJS Foundation trademarks](https://trademark-list.openjsf.org) are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them. - -Browser testing provided by: - - -BrowserStack - diff --git a/node_modules/@messageformat/core/compile-module.js b/node_modules/@messageformat/core/compile-module.js deleted file mode 100644 index 0ef6c04..0000000 --- a/node_modules/@messageformat/core/compile-module.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/compile-module'); diff --git a/node_modules/@messageformat/core/lib/bidi-mark-text.d.ts b/node_modules/@messageformat/core/lib/bidi-mark-text.d.ts deleted file mode 100644 index 0d435a3..0000000 --- a/node_modules/@messageformat/core/lib/bidi-mark-text.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Utility formatter function for enforcing Bidi Structured Text by using UCC - * - * List inlined from data extracted from CLDR v27 & v28 - * To verify/recreate, use the following: - * - * git clone https://github.com/unicode-cldr/cldr-misc-full.git - * cd cldr-misc-full/main/ - * grep characterOrder -r . | tr '"/' '\t' | cut -f2,6 | grep -C4 right-to-left - * - * @private - */ -export declare function biDiMarkText(text: string, locale: string): string; diff --git a/node_modules/@messageformat/core/lib/compile-module.d.ts b/node_modules/@messageformat/core/lib/compile-module.d.ts deleted file mode 100644 index 6052941..0000000 --- a/node_modules/@messageformat/core/lib/compile-module.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { StringStructure } from './compiler'; -import MessageFormat, { MessageFunction } from './messageformat'; -export { MessageFunction, StringStructure }; -/** - * The type of the generated ES module, once executed - * - * @public - * @remarks - * Use with `Shape` extending the {@link StringStructure} that was used as - * the module source. - */ -export type MessageModule = Shape extends string ? MessageFunction : { - [P in keyof Shape]: MessageModule; -}; -/** - * Compile a collection of messages into an ES module - * - * @public - * @remarks - * Available as the default export of `'@messageformat/core/compile-module'`, to - * allow for its exclusion from browser builds. - * - * With `messages` as a hierarchical structure of ICU MessageFormat strings, - * the output of `compileModule()` will be the source code of an ES module with - * a default export matching the input structure, with each string replaced by - * its corresponding JS function. If the input includes anything other than - * simple variable replacements, the output ES module will have a dependency on - * `'@messageformat/runtime'`. - * - * If the `messageformat` instance has been initialized with support for more - * than one locale, using a key that matches the locale's identifier at any - * depth of a `messages` object will set its child elements to use that locale. - * To customize this behaviour, see {@link MessageFormatOptions.localeCodeFromKey}. - * - * @example - * ``` - * import { writeFileSync } from 'fs' - * import MessageFormat from '@messageformat/core' - * import compileModule from '@messageformat/core/compile-module' - * - * const mf = new MessageFormat('en') - * const msgSet = { - * a: 'A {TYPE} example.', - * b: 'This has {COUNT, plural, one{one member} other{# members}}.', - * c: 'We have {P, number, percent} code coverage.' - * } - * const msgModule = compileModule(mf, msgSet) - * writeFileSync('messages.js', msgModule) - * - * ... - * - * import messages from './messages' - * - * messages.a({ TYPE: 'more complex' }) // 'A more complex example.' - * messages.b({ COUNT: 3 }) // 'This has 3 members.' - * ``` - * - * @param messageformat - A {@link MessageFormat} instance - * @param messages - A hierarchical structure of ICU MessageFormat strings - */ -export default function compileModule(messageformat: MessageFormat<'string' | 'values'>, messages: StringStructure): string; diff --git a/node_modules/@messageformat/core/lib/compile-module.js b/node_modules/@messageformat/core/lib/compile-module.js deleted file mode 100644 index 5fab317..0000000 --- a/node_modules/@messageformat/core/lib/compile-module.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -var safeIdentifier = require('safe-identifier'); -var Compiler = require('./compiler'); - -function stringifyRuntime(runtime) { - const imports = {}; - const vars = {}; - for (const [name, fn] of Object.entries(runtime)) { - if (fn.module) { - const alias = fn.id && fn.id !== name ? `${fn.id} as ${name}` : name; - const prev = imports[fn.module]; - imports[fn.module] = prev ? [...prev, alias] : [alias]; - } - else { - vars[name] = String(fn); - } - } - const is = Object.entries(imports).map(([module, names]) => `import { ${names.sort().join(', ')} } from ${JSON.stringify(module)};`); - const vs = Object.entries(vars).map(([id, value]) => new RegExp(`^function ${id}\\b`).test(value) - ? value - : `const ${id} = ${value};`); - if (is.length > 0 && vs.length > 0) - is.push(''); - return is.concat(vs).join('\n'); -} -function stringifyObject(obj, level = 0) { - if (typeof obj !== 'object') - return obj; - const indent = ' '.repeat(level); - const o = Object.keys(obj).map(key => { - const v = stringifyObject(obj[key], level + 1); - return `\n${indent} ${safeIdentifier.property(null, key)}: ${v}`; - }); - return `{${o.join(',')}\n${indent}}`; -} -function compileModule(messageformat, messages) { - const { plurals } = messageformat; - const cp = {}; - if (plurals.length > 1) - for (const pl of plurals) - cp[pl.lc] = cp[pl.locale] = pl; - const compiler = new Compiler(messageformat.options); - const msgObj = compiler.compile(messages, plurals[0], cp); - const msgStr = stringifyObject(msgObj); - const rtStr = stringifyRuntime(compiler.runtime); - return `${rtStr}\nexport default ${msgStr}`; -} - -module.exports = compileModule; diff --git a/node_modules/@messageformat/core/lib/compiler.d.ts b/node_modules/@messageformat/core/lib/compiler.d.ts deleted file mode 100644 index 1dfed7c..0000000 --- a/node_modules/@messageformat/core/lib/compiler.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { FunctionArg, Select, Token } from '@messageformat/parser'; -import { MessageFormatOptions } from './messageformat'; -import { PluralObject } from './plurals'; -type RuntimeType = 'formatter' | 'locale' | 'runtime'; -interface RuntimeEntry { - (...args: any[]): unknown; - id?: string | null; - module?: string | null; - toString?: () => string; - type?: RuntimeType; -} -export interface RuntimeMap { - [key: string]: Required; -} -/** - * A hierarchical structure of ICU MessageFormat strings - * - * @public - * @remarks - * Used in {@link compileModule} arguments - */ -export interface StringStructure { - [key: string]: StringStructure | string; -} -export default class Compiler { - arguments: string[]; - options: Required; - plural: PluralObject; - runtime: RuntimeMap; - constructor(options: Required); - /** - * Recursively compile a string or a tree of strings to JavaScript function - * sources - * - * If `src` is an object with a key that is also present in `plurals`, the key - * in question will be used as the locale identifier for its value. To disable - * the compile-time checks for plural & selectordinal keys while maintaining - * multi-locale support, use falsy values in `plurals`. - * - * @param src - The source for which the JS code should be generated - * @param plural - The default locale - * @param plurals - A map of pluralization keys for all available locales - */ - compile(src: string | StringStructure, plural: PluralObject, plurals?: { - [key: string]: PluralObject; - }): string | StringStructure; - cases(token: Select, pluralToken: Select | null): string; - concatenate(tokens: string[], root: boolean): string; - token(token: Token, pluralToken: Select | null): string; - runtimeIncludes(key: string, type: RuntimeType): Required; - setLocale(key: string, ord: boolean): void; - setRuntimeFn(key: 'number' | 'plural' | 'select' | 'strictNumber' | 'reqArgs'): void; - getFormatterArg({ key, param }: FunctionArg, pluralToken: Select | null): string | null; - setFormatter(key: string): void; - setDateFormatter({ param }: FunctionArg, args: (number | string)[], plural: Select | null): string; - setNumberFormatter({ param }: FunctionArg, args: (number | string)[], plural: Select | null): string; -} -export {}; diff --git a/node_modules/@messageformat/core/lib/compiler.js b/node_modules/@messageformat/core/lib/compiler.js deleted file mode 100644 index 222d812..0000000 --- a/node_modules/@messageformat/core/lib/compiler.js +++ /dev/null @@ -1,2167 +0,0 @@ -'use strict'; - -var parser = require('@messageformat/parser'); -var Runtime = require('@messageformat/runtime'); -var Formatters = require('@messageformat/runtime/lib/formatters'); -var safeIdentifier = require('safe-identifier'); - -function _interopNamespaceDefault(e) { - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); -} - -var Runtime__namespace = /*#__PURE__*/_interopNamespaceDefault(Runtime); -var Formatters__namespace = /*#__PURE__*/_interopNamespaceDefault(Formatters); - -/** - * Parent class for errors. - * - * @remarks - * Errors with `type: "warning"` do not necessarily indicate that the parser - * encountered an error. In addition to a human-friendly `message`, may also - * includes the `token` at which the error was encountered. - * - * @public - */ -class DateFormatError extends Error { - /** @internal */ - constructor(msg, token, type) { - super(msg); - this.token = token; - this.type = type || 'error'; - } -} -const alpha = (width) => width < 4 ? 'short' : width === 4 ? 'long' : 'narrow'; -const numeric = (width) => (width % 2 === 0 ? '2-digit' : 'numeric'); -function yearOptions(token, onError) { - switch (token.char) { - case 'y': - return { year: numeric(token.width) }; - case 'r': - return { calendar: 'gregory', year: 'numeric' }; - case 'u': - case 'U': - case 'Y': - default: - onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING); - return { year: 'numeric' }; - } -} -function monthStyle(token, onError) { - switch (token.width) { - case 1: - return 'numeric'; - case 2: - return '2-digit'; - case 3: - return 'short'; - case 4: - return 'long'; - case 5: - return 'narrow'; - default: - onError(`${token.desc} is not supported with width ${token.width}`); - return undefined; - } -} -function dayStyle(token, onError) { - const { char, desc, width } = token; - if (char === 'd') - return numeric(width); - else { - onError(`${desc} is not supported`); - return undefined; - } -} -function weekdayStyle(token, onError) { - const { char, desc, width } = token; - if ((char === 'c' || char === 'e') && width < 3) { - // ignoring stand-alone-ness - const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`; - onError(msg, DateFormatError.WARNING); - } - // merging narrow styles - return alpha(width); -} -function hourOptions(token) { - const hour = numeric(token.width); - let hourCycle; - switch (token.char) { - case 'h': - hourCycle = 'h12'; - break; - case 'H': - hourCycle = 'h23'; - break; - case 'k': - hourCycle = 'h24'; - break; - case 'K': - hourCycle = 'h11'; - break; - } - return hourCycle ? { hour, hourCycle } : { hour }; -} -function timeZoneNameStyle(token, onError) { - // so much fallback behaviour here - const { char, desc, width } = token; - switch (char) { - case 'v': - case 'z': - return width === 4 ? 'long' : 'short'; - case 'V': - if (width === 4) - return 'long'; - onError(`${desc} is not supported with width ${width}`); - return undefined; - case 'X': - onError(`${desc} is not supported`); - return undefined; - } - return 'short'; -} -function compileOptions(token, onError) { - switch (token.field) { - case 'era': - return { era: alpha(token.width) }; - case 'year': - return yearOptions(token, onError); - case 'month': - return { month: monthStyle(token, onError) }; - case 'day': - return { day: dayStyle(token, onError) }; - case 'weekday': - return { weekday: weekdayStyle(token, onError) }; - case 'period': - return undefined; - case 'hour': - return hourOptions(token); - case 'min': - return { minute: numeric(token.width) }; - case 'sec': - return { second: numeric(token.width) }; - case 'tz': - return { timeZoneName: timeZoneNameStyle(token, onError) }; - case 'quarter': - case 'week': - case 'sec-frac': - case 'ms': - onError(`${token.desc} is not supported`); - } - return undefined; -} -function getDateFormatOptions(tokens, onError = error => { - throw error; -}) { - const options = {}; - const fields = []; - for (const token of tokens) { - const { error, field, str } = token; - if (error) { - const dte = new DateFormatError(error.message, token); - dte.stack = error.stack; - onError(dte); - } - if (str) { - const msg = `Ignoring string part: ${str}`; - onError(new DateFormatError(msg, token, DateFormatError.WARNING)); - } - if (field) { - if (fields.indexOf(field) === -1) - fields.push(field); - else - onError(new DateFormatError(`Duplicate ${field} token`, token)); - } - const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning))); - if (opt) - Object.assign(options, opt); - } - return options; -} - -const fields = { - G: { field: 'era', desc: 'Era' }, - y: { field: 'year', desc: 'Year' }, - Y: { field: 'year', desc: 'Year of "Week of Year"' }, - u: { field: 'year', desc: 'Extended year' }, - U: { field: 'year', desc: 'Cyclic year name' }, - r: { field: 'year', desc: 'Related Gregorian year' }, - Q: { field: 'quarter', desc: 'Quarter' }, - q: { field: 'quarter', desc: 'Stand-alone quarter' }, - M: { field: 'month', desc: 'Month in year' }, - L: { field: 'month', desc: 'Stand-alone month in year' }, - w: { field: 'week', desc: 'Week of year' }, - W: { field: 'week', desc: 'Week of month' }, - d: { field: 'day', desc: 'Day in month' }, - D: { field: 'day', desc: 'Day of year' }, - F: { field: 'day', desc: 'Day of week in month' }, - g: { field: 'day', desc: 'Modified julian day' }, - E: { field: 'weekday', desc: 'Day of week' }, - e: { field: 'weekday', desc: 'Local day of week' }, - c: { field: 'weekday', desc: 'Stand-alone local day of week' }, - a: { field: 'period', desc: 'AM/PM marker' }, - b: { field: 'period', desc: 'AM/PM/noon/midnight marker' }, - B: { field: 'period', desc: 'Flexible day period' }, - h: { field: 'hour', desc: 'Hour in AM/PM (1~12)' }, - H: { field: 'hour', desc: 'Hour in day (0~23)' }, - k: { field: 'hour', desc: 'Hour in day (1~24)' }, - K: { field: 'hour', desc: 'Hour in AM/PM (0~11)' }, - j: { field: 'hour', desc: 'Hour in preferred cycle' }, - J: { field: 'hour', desc: 'Hour in preferred cycle without marker' }, - C: { field: 'hour', desc: 'Hour in preferred cycle with flexible marker' }, - m: { field: 'min', desc: 'Minute in hour' }, - s: { field: 'sec', desc: 'Second in minute' }, - S: { field: 'sec-frac', desc: 'Fractional second' }, - A: { field: 'ms', desc: 'Milliseconds in day' }, - z: { field: 'tz', desc: 'Time Zone: specific non-location' }, - Z: { field: 'tz', desc: 'Time Zone' }, - O: { field: 'tz', desc: 'Time Zone: localized' }, - v: { field: 'tz', desc: 'Time Zone: generic non-location' }, - V: { field: 'tz', desc: 'Time Zone: ID' }, - X: { field: 'tz', desc: 'Time Zone: ISO8601 with Z' }, - x: { field: 'tz', desc: 'Time Zone: ISO8601' } -}; -const isLetter = (char) => (char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z'); -function readFieldToken(src, pos) { - const char = src[pos]; - let width = 1; - while (src[++pos] === char) - ++width; - const field = fields[char]; - if (!field) { - const msg = `The letter ${char} is not a valid field identifier`; - return { char, error: new Error(msg), width }; - } - return { char, field: field.field, desc: field.desc, width }; -} -function readQuotedToken(src, pos) { - let str = src[++pos]; - let width = 2; - if (str === "'") - return { char: "'", str, width }; - while (true) { - const next = src[++pos]; - ++width; - if (next === undefined) { - const msg = `Unterminated quoted literal in pattern: ${str || src}`; - return { char: "'", error: new Error(msg), str, width }; - } - else if (next === "'") { - if (src[++pos] !== "'") - return { char: "'", str, width }; - else - ++width; - } - str += next; - } -} -function readToken(src, pos) { - const char = src[pos]; - if (!char) - return null; - if (isLetter(char)) - return readFieldToken(src, pos); - if (char === "'") - return readQuotedToken(src, pos); - let str = char; - let width = 1; - while (true) { - const next = src[++pos]; - if (!next || isLetter(next) || next === "'") - return { char, str, width }; - str += next; - width += 1; - } -} -/** - * Parse an {@link http://userguide.icu-project.org/formatparse/datetime | ICU - * DateFormat skeleton} string into a {@link DateToken} array. - * - * @remarks - * Errors will not be thrown, but if encountered are included as the relevant - * token's `error` value. - * - * @public - * @param src - The skeleton string - * - * @example - * ```js - * import { parseDateTokens } from '@messageformat/date-skeleton' - * - * parseDateTokens('GrMMMdd', console.error) - * // [ - * // { char: 'G', field: 'era', desc: 'Era', width: 1 }, - * // { char: 'r', field: 'year', desc: 'Related Gregorian year', width: 1 }, - * // { char: 'M', field: 'month', desc: 'Month in year', width: 3 }, - * // { char: 'd', field: 'day', desc: 'Day in month', width: 2 } - * // ] - * ``` - */ -function parseDateTokens(src) { - const tokens = []; - let pos = 0; - while (true) { - const token = readToken(src, pos); - if (!token) - return tokens; - tokens.push(token); - pos += token.width; - } -} - -/** - * Returns a date formatter function for the given locales and date skeleton - * - * @remarks - * Uses `Intl.DateTimeFormat` internally. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param tokens - An ICU DateFormat skeleton string, or an array or parsed - * `DateToken` tokens - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getDateFormatter } from '@messageformat/date-skeleton' - * - * // 2006 Jan 2, 15:04:05.789 in local time - * const date = new Date(2006, 0, 2, 15, 4, 5, 789) - * - * let fmt = getDateFormatter('en-CA', 'GrMMMdd', console.error) - * fmt(date) // 'Jan. 02, 2006 AD' - * - * fmt = getDateFormatter('en-CA', 'hamszzzz', console.error) - * fmt(date) // '3:04:05 p.m. Newfoundland Daylight Time' - * ``` - */ -function getDateFormatter(locales, tokens, onError) { - if (typeof tokens === 'string') - tokens = parseDateTokens(tokens); - const opt = getDateFormatOptions(tokens, onError); - const dtf = new Intl.DateTimeFormat(locales, opt); - return (date) => dtf.format(date); -} -/** - * Returns a string of JavaScript source that evaluates to a date formatter - * function with the same `(date: Date | number) => string` signature as the - * function returned by {@link getDateFormatter}. - * - * @remarks - * The returned function will memoize an `Intl.DateTimeFormat` instance. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param tokens - An ICU DateFormat skeleton string, or an array or parsed - * `DateToken` tokens - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getDateFormatterSource } from '@messageformat/date-skeleton' - * - * getDateFormatterSource('en-CA', 'GrMMMdd', console.error) - * // '(function() {\n' + - * // ' var opt = {"era":"short","calendar":"gregory","year":"numeric",' + - * // '"month":"short","day":"2-digit"};\n' + - * // ' var dtf = new Intl.DateTimeFormat("en-CA", opt);\n' + - * // ' return function(value) { return dtf.format(value); }\n' + - * // '})()' - * - * const src = getDateFormatterSource('en-CA', 'hamszzzz', console.error) - * // '(function() {\n' + - * // ' var opt = {"hour":"numeric","hourCycle":"h12","minute":"numeric",' + - * // '"second":"numeric","timeZoneName":"long"};\n' + - * // ' var dtf = new Intl.DateTimeFormat("en-CA", opt);\n' + - * // ' return function(value) { return dtf.format(value); }\n' + - * // '})()' - * - * const fmt = new Function(`return ${src}`)() - * const date = new Date(2006, 0, 2, 15, 4, 5, 789) - * fmt(date) // '3:04:05 p.m. Newfoundland Daylight Time' - * ``` - */ -function getDateFormatterSource(locales, tokens, onError) { - if (typeof tokens === 'string') - tokens = parseDateTokens(tokens); - const opt = getDateFormatOptions(tokens, onError); - const lines = [ - `(function() {`, - `var opt = ${JSON.stringify(opt)};`, - `var dtf = new Intl.DateTimeFormat(${JSON.stringify(locales)}, opt);`, - `return function(value) { return dtf.format(value); }` - ]; - return lines.join('\n ') + '\n})()'; -} - -/** - * Base class for errors. In addition to a `code` and a human-friendly - * `message`, may also includes the token `stem` as well as other fields. - * - * @public - */ -class NumberFormatError extends Error { - /** @internal */ - constructor(code, msg) { - super(msg); - this.code = code; - } -} -/** @internal */ -class BadOptionError extends NumberFormatError { - constructor(stem, opt) { - super('BAD_OPTION', `Unknown ${stem} option: ${opt}`); - this.stem = stem; - this.option = opt; - } -} -/** @internal */ -class BadStemError extends NumberFormatError { - constructor(stem) { - super('BAD_STEM', `Unknown stem: ${stem}`); - this.stem = stem; - } -} -/** @internal */ -class MaskedValueError extends NumberFormatError { - constructor(type, prev) { - super('MASKED_VALUE', `Value for ${type} is set multiple times`); - this.type = type; - this.prev = prev; - } -} -/** @internal */ -class MissingOptionError extends NumberFormatError { - constructor(stem) { - super('MISSING_OPTION', `Required option missing for ${stem}`); - this.stem = stem; - } -} -/** @internal */ -class PatternError extends NumberFormatError { - constructor(char, msg) { - super('BAD_PATTERN', msg); - this.char = char; - } -} -/** @internal */ -class TooManyOptionsError extends NumberFormatError { - constructor(stem, options, maxOpt) { - const maxOptStr = maxOpt > 1 ? `${maxOpt} options` : 'one option'; - super('TOO_MANY_OPTIONS', `Token ${stem} only supports ${maxOptStr} (got ${options.length})`); - this.stem = stem; - this.options = options; - } -} -/** @internal */ -class UnsupportedError extends NumberFormatError { - constructor(stem, source) { - super('UNSUPPORTED', `The stem ${stem} is not supported`); - this.stem = stem; - if (source) { - this.message += ` with value ${source}`; - this.source = source; - } - } -} - -/** - * Add - * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation | numbering-system tags} - * to locale identifiers - * - * @internal - */ -function getNumberFormatLocales(locales, { numberingSystem }) { - if (!Array.isArray(locales)) - locales = [locales]; - return numberingSystem - ? locales - .map(lc => { - const ext = lc.indexOf('-u-') === -1 ? 'u-nu' : 'nu'; - return `${lc}-${ext}-${numberingSystem}`; - }) - .concat(locales) - : locales; -} - -// from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round -function round(x, precision) { - const y = +x + precision / 2; - return y - (y % +precision); -} -function getNumberFormatMultiplier({ scale, unit }) { - let mult = typeof scale === 'number' && scale >= 0 ? scale : 1; - if (unit && unit.style === 'percent') - mult *= 0.01; - return mult; -} -/** - * Determine a modifier for the input value to account for any `scale`, - * `percent`, and `precision-increment` tokens in the skeleton. - * - * @internal - * @remarks - * With ICU NumberFormatter, the `percent` skeleton would style `25` as "25%". - * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`. - */ -function getNumberFormatModifier(skeleton) { - const mult = getNumberFormatMultiplier(skeleton); - const { precision } = skeleton; - if (precision && precision.style === 'precision-increment') { - return (n) => round(n, precision.increment) * mult; - } - else { - return (n) => n * mult; - } -} -/** - * Returns a string of JavaScript source that evaluates to a modifier for the - * input value to account for any `scale`, `percent`, and `precision-increment` - * tokens in the skeleton. - * - * @internal - * @remarks - * With ICU NumberFormatter, the `percent` skeleton would style `25` as "25%". - * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`. - */ -function getNumberFormatModifierSource(skeleton) { - const mult = getNumberFormatMultiplier(skeleton); - const { precision } = skeleton; - if (precision && precision.style === 'precision-increment') { - // see round() above for source - const setX = `+n + ${precision.increment / 2}`; - let res = `x - (x % +${precision.increment})`; - if (mult !== 1) - res = `(${res}) * ${mult}`; - return `function(n) { var x = ${setX}; return ${res}; }`; - } - return mult !== 1 ? `function(n) { return n * ${mult}; }` : null; -} - -/** - * Given an input ICU NumberFormatter skeleton, does its best to construct a - * corresponding `Intl.NumberFormat` options structure. - * - * @remarks - * Some features depend on `Intl.NumberFormat` features defined in ES2020. - * - * @internal - * @param onUnsupported - If defined, called when encountering unsupported (but - * valid) tokens, such as `decimal-always` or `permille`. The error `source` - * may specify the source of an unsupported option. - * - * @example - * ```js - * import { - * getNumberFormatOptions, - * parseNumberSkeleton - * } from '@messageformat/number-skeleton' - * - * const src = 'currency/CAD unit-width-narrow' - * const skeleton = parseNumberSkeleton(src, console.error) - * // { - * // unit: { style: 'currency', currency: 'CAD' }, - * // unitWidth: 'unit-width-narrow' - * // } - * - * getNumberFormatOptions(skeleton, console.error) - * // { - * // style: 'currency', - * // currency: 'CAD', - * // currencyDisplay: 'narrowSymbol', - * // unitDisplay: 'narrow' - * // } - * - * const sk2 = parseNumberSkeleton('group-min2') - * // { group: 'group-min2' } - * - * getNumberFormatOptions(sk2, console.error) - * // Error: The stem group-min2 is not supported - * // at UnsupportedError.NumberFormatError ... { - * // code: 'UNSUPPORTED', - * // stem: 'group-min2' - * // } - * // {} - * ``` - */ -function getNumberFormatOptions(skeleton, onUnsupported) { - const { decimal, group, integerWidth, notation, precision, roundingMode, sign, unit, unitPer, unitWidth } = skeleton; - const fail = (stem, source) => { - if (onUnsupported) - onUnsupported(new UnsupportedError(stem, source)); - }; - const opt = {}; - if (unit) { - switch (unit.style) { - case 'base-unit': - opt.style = 'decimal'; - break; - case 'currency': - opt.style = 'currency'; - opt.currency = unit.currency; - break; - case 'measure-unit': - opt.style = 'unit'; - opt.unit = unit.unit.replace(/.*-/, ''); - if (unitPer) - opt.unit += '-per-' + unitPer.replace(/.*-/, ''); - break; - case 'percent': - opt.style = 'percent'; - break; - case 'permille': - fail('permille'); - break; - } - } - switch (unitWidth) { - case 'unit-width-full-name': - opt.currencyDisplay = 'name'; - opt.unitDisplay = 'long'; - break; - case 'unit-width-hidden': - fail(unitWidth); - break; - case 'unit-width-iso-code': - opt.currencyDisplay = 'code'; - break; - case 'unit-width-narrow': - opt.currencyDisplay = 'narrowSymbol'; - opt.unitDisplay = 'narrow'; - break; - case 'unit-width-short': - opt.currencyDisplay = 'symbol'; - opt.unitDisplay = 'short'; - break; - } - switch (group) { - case 'group-off': - opt.useGrouping = false; - break; - case 'group-auto': - opt.useGrouping = true; - break; - case 'group-min2': - case 'group-on-aligned': - case 'group-thousands': - fail(group); - opt.useGrouping = true; - break; - } - if (precision) { - switch (precision.style) { - case 'precision-fraction': { - const { minFraction: minF, maxFraction: maxF, minSignificant: minS, maxSignificant: maxS, source } = precision; - if (typeof minF === 'number') { - opt.minimumFractionDigits = minF; - if (typeof minS === 'number') - fail('precision-fraction', source); - } - if (typeof maxF === 'number') - opt.maximumFractionDigits = maxF; - if (typeof minS === 'number') - opt.minimumSignificantDigits = minS; - if (typeof maxS === 'number') - opt.maximumSignificantDigits = maxS; - break; - } - case 'precision-integer': - opt.maximumFractionDigits = 0; - break; - case 'precision-unlimited': - opt.maximumFractionDigits = 20; - break; - case 'precision-increment': - break; - case 'precision-currency-standard': - opt.trailingZeroDisplay = precision.trailingZero; - break; - case 'precision-currency-cash': - fail(precision.style); - break; - } - } - if (notation) { - switch (notation.style) { - case 'compact-short': - opt.notation = 'compact'; - opt.compactDisplay = 'short'; - break; - case 'compact-long': - opt.notation = 'compact'; - opt.compactDisplay = 'long'; - break; - case 'notation-simple': - opt.notation = 'standard'; - break; - case 'scientific': - case 'engineering': { - const { expDigits, expSign, source, style } = notation; - opt.notation = style; - if ((expDigits && expDigits > 1) || - (expSign && expSign !== 'sign-auto')) - fail(style, source); - break; - } - } - } - if (integerWidth) { - const { min, max, source } = integerWidth; - if (min > 0) - opt.minimumIntegerDigits = min; - if (Number(max) > 0) { - const hasExp = opt.notation === 'engineering' || opt.notation === 'scientific'; - if (max === 3 && hasExp) - opt.notation = 'engineering'; - else - fail('integer-width', source); - } - } - switch (sign) { - case 'sign-auto': - opt.signDisplay = 'auto'; - break; - case 'sign-always': - opt.signDisplay = 'always'; - break; - case 'sign-except-zero': - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore https://github.com/microsoft/TypeScript/issues/46712 - opt.signDisplay = 'exceptZero'; - break; - case 'sign-never': - opt.signDisplay = 'never'; - break; - case 'sign-accounting': - opt.currencySign = 'accounting'; - break; - case 'sign-accounting-always': - opt.currencySign = 'accounting'; - opt.signDisplay = 'always'; - break; - case 'sign-accounting-except-zero': - opt.currencySign = 'accounting'; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore https://github.com/microsoft/TypeScript/issues/46712 - opt.signDisplay = 'exceptZero'; - break; - } - if (decimal === 'decimal-always') - fail(decimal); - if (roundingMode) - fail(roundingMode); - return opt; -} - -function parseAffixToken(src, pos, onError) { - const char = src[pos]; - switch (char) { - case '%': - return { char: '%', style: 'percent', width: 1 }; - case '‰': - return { char: '%', style: 'permille', width: 1 }; - case '¤': { - let width = 1; - while (src[++pos] === '¤') - ++width; - switch (width) { - case 1: - return { char, currency: 'default', width }; - case 2: - return { char, currency: 'iso-code', width }; - case 3: - return { char, currency: 'full-name', width }; - case 5: - return { char, currency: 'narrow', width }; - default: { - const msg = `Invalid number (${width}) of ¤ chars in pattern`; - onError(new PatternError('¤', msg)); - return null; - } - } - } - case '*': { - const pad = src[pos + 1]; - if (pad) - return { char, pad, width: 2 }; - break; - } - case '+': - case '-': - return { char, width: 1 }; - case "'": { - let str = src[++pos]; - let width = 2; - if (str === "'") - return { char, str, width }; - while (true) { - const next = src[++pos]; - ++width; - if (next === undefined) { - const msg = `Unterminated quoted literal in pattern: ${str}`; - onError(new PatternError("'", msg)); - return { char, str, width }; - } - else if (next === "'") { - if (src[++pos] !== "'") - return { char, str, width }; - else - ++width; - } - str += next; - } - } - } - return null; -} - -const isDigit = (char) => char >= '0' && char <= '9'; -function parseNumberToken(src, pos) { - const char = src[pos]; - if (isDigit(char)) { - let digits = char; - while (true) { - const next = src[++pos]; - if (isDigit(next)) - digits += next; - else - return { char: '0', digits, width: digits.length }; - } - } - switch (char) { - case '#': { - let width = 1; - while (src[++pos] === '#') - ++width; - return { char, width }; - } - case '@': { - let min = 1; - while (src[++pos] === '@') - ++min; - let width = min; - pos -= 1; - while (src[++pos] === '#') - ++width; - return { char, min, width }; - } - case 'E': { - const plus = src[pos + 1] === '+'; - if (plus) - ++pos; - let expDigits = 0; - while (src[++pos] === '0') - ++expDigits; - const width = (plus ? 2 : 1) + expDigits; - if (expDigits) - return { char, expDigits, plus, width }; - else - break; - } - case '.': - case ',': - return { char, width: 1 }; - } - return null; -} - -function parseSubpattern(src, pos, onError) { - let State; - (function (State) { - State[State["Prefix"] = 0] = "Prefix"; - State[State["Number"] = 1] = "Number"; - State[State["Suffix"] = 2] = "Suffix"; - })(State || (State = {})); - const prefix = []; - const number = []; - const suffix = []; - let state = State.Prefix; - let str = ''; - while (pos < src.length) { - const char = src[pos]; - if (char === ';') { - pos += 1; - break; - } - switch (state) { - case State.Prefix: { - const token = parseAffixToken(src, pos, onError); - if (token) { - if (str) { - prefix.push({ char: "'", str, width: str.length }); - str = ''; - } - prefix.push(token); - pos += token.width; - } - else { - const token = parseNumberToken(src, pos); - if (token) { - if (str) { - prefix.push({ char: "'", str, width: str.length }); - str = ''; - } - state = State.Number; - number.push(token); - pos += token.width; - } - else { - str += char; - pos += 1; - } - } - break; - } - case State.Number: { - const token = parseNumberToken(src, pos); - if (token) { - number.push(token); - pos += token.width; - } - else { - state = State.Suffix; - } - break; - } - case State.Suffix: { - const token = parseAffixToken(src, pos, onError); - if (token) { - if (str) { - suffix.push({ char: "'", str, width: str.length }); - str = ''; - } - suffix.push(token); - pos += token.width; - } - else { - str += char; - pos += 1; - } - break; - } - } - } - if (str) - suffix.push({ char: "'", str, width: str.length }); - return { pattern: { prefix, number, suffix }, pos }; -} -function parseTokens(src, onError) { - const { pattern, pos } = parseSubpattern(src, 0, onError); - if (pos < src.length) { - const { pattern: negative } = parseSubpattern(src, pos, onError); - return { tokens: pattern, negative }; - } - return { tokens: pattern }; -} - -function parseNumberAsSkeleton(tokens, onError) { - const res = {}; - let hasGroups = false; - let hasExponent = false; - let intOptional = 0; - let intDigits = ''; - let decimalPos = -1; - let fracDigits = ''; - let fracOptional = 0; - for (let pos = 0; pos < tokens.length; ++pos) { - const token = tokens[pos]; - switch (token.char) { - case '#': { - if (decimalPos === -1) { - if (intDigits) { - const msg = 'Pattern has # after integer digits'; - onError(new PatternError('#', msg)); - } - intOptional += token.width; - } - else { - fracOptional += token.width; - } - break; - } - case '0': { - if (decimalPos === -1) { - intDigits += token.digits; - } - else { - if (fracOptional) { - const msg = 'Pattern has digits after # in fraction'; - onError(new PatternError('0', msg)); - } - fracDigits += token.digits; - } - break; - } - case '@': { - if (res.precision) - onError(new MaskedValueError('precision', res.precision)); - res.precision = { - style: 'precision-fraction', - minSignificant: token.min, - maxSignificant: token.width - }; - break; - } - case ',': - hasGroups = true; - break; - case '.': - if (decimalPos === 1) { - const msg = 'Pattern has more than one decimal separator'; - onError(new PatternError('.', msg)); - } - decimalPos = pos; - break; - case 'E': { - if (hasExponent) - onError(new MaskedValueError('exponent', res.notation)); - if (hasGroups) { - const msg = 'Exponential patterns may not contain grouping separators'; - onError(new PatternError('E', msg)); - } - res.notation = { style: 'scientific' }; - if (token.expDigits > 1) - res.notation.expDigits = token.expDigits; - if (token.plus) - res.notation.expSign = 'sign-always'; - hasExponent = true; - } - } - } - // imprecise mapping due to paradigm differences - if (hasGroups) - res.group = 'group-auto'; - else if (intOptional + intDigits.length > 3) - res.group = 'group-off'; - const increment = Number(`${intDigits || '0'}.${fracDigits}`); - if (increment) - res.precision = { style: 'precision-increment', increment }; - if (!hasExponent) { - if (intDigits.length > 1) - res.integerWidth = { min: intDigits.length }; - if (!res.precision && (fracDigits.length || fracOptional)) { - res.precision = { - style: 'precision-fraction', - minFraction: fracDigits.length, - maxFraction: fracDigits.length + fracOptional - }; - } - } - else { - if (!res.precision || increment) { - res.integerWidth = intOptional - ? { min: 1, max: intOptional + intDigits.length } - : { min: Math.max(1, intDigits.length) }; - } - if (res.precision) { - if (!increment) - res.integerWidth = { min: 1, max: 1 }; - } - else { - const dc = intDigits.length + fracDigits.length; - if (decimalPos === -1) { - if (dc > 0) - res.precision = { style: 'precision-fraction', maxSignificant: dc }; - } - else { - res.precision = { - style: 'precision-fraction', - maxSignificant: Math.max(1, dc) + fracOptional - }; - if (dc > 1) - res.precision.minSignificant = dc; - } - } - } - return res; -} - -function handleAffix(affixTokens, res, currency, onError, isPrefix) { - let inFmt = false; - let str = ''; - for (const token of affixTokens) { - switch (token.char) { - case '%': - res.unit = { style: token.style }; - if (isPrefix) - inFmt = true; - else - str = ''; - break; - case '¤': - if (!currency) { - const msg = `The ¤ pattern requires a currency`; - onError(new PatternError('¤', msg)); - break; - } - res.unit = { style: 'currency', currency }; - switch (token.currency) { - case 'iso-code': - res.unitWidth = 'unit-width-iso-code'; - break; - case 'full-name': - res.unitWidth = 'unit-width-full-name'; - break; - case 'narrow': - res.unitWidth = 'unit-width-narrow'; - break; - } - if (isPrefix) - inFmt = true; - else - str = ''; - break; - case '*': - // TODO - break; - case '+': - if (!inFmt) - str += '+'; - break; - case "'": - if (!inFmt) - str += token.str; - break; - } - } - return str; -} -function getNegativeAffix(affixTokens, isPrefix) { - let inFmt = false; - let str = ''; - for (const token of affixTokens) { - switch (token.char) { - case '%': - case '¤': - if (isPrefix) - inFmt = true; - else - str = ''; - break; - case '-': - if (!inFmt) - str += '-'; - break; - case "'": - if (!inFmt) - str += token.str; - break; - } - } - return str; -} -/** - * Parse an {@link - * http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns | - * ICU NumberFormatter pattern} string into a {@link Skeleton} structure. - * - * @public - * @param src - The pattern string - * @param currency - If the pattern includes ¤ tokens, their skeleton - * representation requires a three-letter currency code. - * @param onError - Called when the parser encounters a syntax error. The - * function will still return a {@link Skeleton}, but it will be incomplete - * and/or inaccurate. If not defined, the error will be thrown instead. - * - * @remarks - * Unlike the skeleton parser, the pattern parser is not able to return partial - * results on error, and will instead throw. Output padding is not supported. - * - * @example - * ```js - * import { parseNumberPattern } from '@messageformat/number-skeleton' - * - * parseNumberPattern('#,##0.00 ¤', 'EUR', console.error) - * // { - * // group: 'group-auto', - * // precision: { - * // style: 'precision-fraction', - * // minFraction: 2, - * // maxFraction: 2 - * // }, - * // unit: { style: 'currency', currency: 'EUR' } - * // } - * ``` - */ -function parseNumberPattern(src, currency, onError = error => { - throw error; -}) { - const { tokens, negative } = parseTokens(src, onError); - const res = parseNumberAsSkeleton(tokens.number, onError); - const prefix = handleAffix(tokens.prefix, res, currency, onError, true); - const suffix = handleAffix(tokens.suffix, res, currency, onError, false); - if (negative) { - const negPrefix = getNegativeAffix(negative.prefix, true); - const negSuffix = getNegativeAffix(negative.suffix, false); - res.affix = { pos: [prefix, suffix], neg: [negPrefix, negSuffix] }; - res.sign = 'sign-never'; - } - else if (prefix || suffix) { - res.affix = { pos: [prefix, suffix] }; - } - return res; -} - -/** @internal */ -function isNumberingSystem(ns) { - const systems = [ - 'arab', - 'arabext', - 'bali', - 'beng', - 'deva', - 'fullwide', - 'gujr', - 'guru', - 'hanidec', - 'khmr', - 'knda', - 'laoo', - 'latn', - 'limb', - 'mlym', - 'mong', - 'mymr', - 'orya', - 'tamldec', - 'telu', - 'thai', - 'tibt' - ]; - return systems.indexOf(ns) !== -1; -} - -// FIXME: subtype is not checked -/** @internal */ -function isUnit(unit) { - const types = [ - 'acceleration', - 'angle', - 'area', - 'concentr', - 'consumption', - 'digital', - 'duration', - 'electric', - 'energy', - 'force', - 'frequency', - 'graphics', - 'length', - 'light', - 'mass', - 'power', - 'pressure', - 'speed', - 'temperature', - 'torque', - 'volume' - ]; - const [type] = unit.split('-', 1); - return types.indexOf(type) !== -1; -} - -const maxOptions = { - 'compact-short': 0, - 'compact-long': 0, - 'notation-simple': 0, - scientific: 2, - engineering: 2, - percent: 0, - permille: 0, - 'base-unit': 0, - currency: 1, - 'measure-unit': 1, - 'per-measure-unit': 1, - 'unit-width-narrow': 0, - 'unit-width-short': 0, - 'unit-width-full-name': 0, - 'unit-width-iso-code': 0, - 'unit-width-hidden': 0, - 'precision-integer': 0, - 'precision-unlimited': 0, - 'precision-currency-standard': 1, - 'precision-currency-cash': 0, - 'precision-increment': 1, - 'rounding-mode-ceiling': 0, - 'rounding-mode-floor': 0, - 'rounding-mode-down': 0, - 'rounding-mode-up': 0, - 'rounding-mode-half-even': 0, - 'rounding-mode-half-down': 0, - 'rounding-mode-half-up': 0, - 'rounding-mode-unnecessary': 0, - 'integer-width': 1, - scale: 1, - 'group-off': 0, - 'group-min2': 0, - 'group-auto': 0, - 'group-on-aligned': 0, - 'group-thousands': 0, - latin: 0, - 'numbering-system': 1, - 'sign-auto': 0, - 'sign-always': 0, - 'sign-never': 0, - 'sign-accounting': 0, - 'sign-accounting-always': 0, - 'sign-except-zero': 0, - 'sign-accounting-except-zero': 0, - 'decimal-auto': 0, - 'decimal-always': 0 -}; -const minOptions = { - currency: 1, - 'integer-width': 1, - 'measure-unit': 1, - 'numbering-system': 1, - 'per-measure-unit': 1, - 'precision-increment': 1, - scale: 1 -}; -function hasMaxOption(stem) { - return stem in maxOptions; -} -function hasMinOption(stem) { - return stem in minOptions; -} -/** @internal */ -function validOptions(stem, options, onError) { - if (hasMaxOption(stem)) { - const maxOpt = maxOptions[stem]; - if (options.length > maxOpt) { - if (maxOpt === 0) { - for (const opt of options) - onError(new BadOptionError(stem, opt)); - } - else { - onError(new TooManyOptionsError(stem, options, maxOpt)); - } - return false; - } - else if (hasMinOption(stem) && options.length < minOptions[stem]) { - onError(new MissingOptionError(stem)); - return false; - } - } - return true; -} - -function parseBlueprintDigits(src, style) { - const re = style === 'fraction' ? /^\.(0*)(\+|#*)$/ : /^(@+)(\+|#*)$/; - const match = src && src.match(re); - if (match) { - const min = match[1].length; - switch (match[2].charAt(0)) { - case '': - return { min, max: min }; - case '+': - return { min, max: null }; - case '#': { - return { min, max: min + match[2].length }; - } - } - } - return null; -} -function parsePrecisionBlueprint(stem, options, onError) { - const fd = parseBlueprintDigits(stem, 'fraction'); - if (fd) { - if (options.length > 1) - onError(new TooManyOptionsError(stem, options, 1)); - const res = { - style: 'precision-fraction', - source: stem, - minFraction: fd.min - }; - if (fd.max != null) - res.maxFraction = fd.max; - const option = options[0]; - const sd = parseBlueprintDigits(option, 'significant'); - if (sd) { - res.source = `${stem}/${option}`; - res.minSignificant = sd.min; - if (sd.max != null) - res.maxSignificant = sd.max; - } - else if (option) - onError(new BadOptionError(stem, option)); - return res; - } - const sd = parseBlueprintDigits(stem, 'significant'); - if (sd) { - for (const opt of options) - onError(new BadOptionError(stem, opt)); - const res = { - style: 'precision-fraction', - source: stem, - minSignificant: sd.min - }; - if (sd.max != null) - res.maxSignificant = sd.max; - return res; - } - return null; -} - -/** @internal */ -class TokenParser { - constructor(onError) { - this.skeleton = {}; - this.onError = onError; - } - badOption(stem, opt) { - this.onError(new BadOptionError(stem, opt)); - } - assertEmpty(key) { - const prev = this.skeleton[key]; - if (prev) - this.onError(new MaskedValueError(key, prev)); - } - parseToken(stem, options) { - if (!validOptions(stem, options, this.onError)) - return; - const option = options[0]; - const res = this.skeleton; - switch (stem) { - // notation - case 'compact-short': - case 'compact-long': - case 'notation-simple': - this.assertEmpty('notation'); - res.notation = { style: stem }; - break; - case 'scientific': - case 'engineering': { - let expDigits = null; - let expSign = undefined; - for (const opt of options) { - switch (opt) { - case 'sign-auto': - case 'sign-always': - case 'sign-never': - case 'sign-accounting': - case 'sign-accounting-always': - case 'sign-except-zero': - case 'sign-accounting-except-zero': - expSign = opt; - break; - default: - if (/^\+e+$/.test(opt)) - expDigits = opt.length - 1; - else { - this.badOption(stem, opt); - } - } - } - this.assertEmpty('notation'); - const source = options.join('/'); - res.notation = - expDigits && expSign - ? { style: stem, source, expDigits, expSign } - : expDigits - ? { style: stem, source, expDigits } - : expSign - ? { style: stem, source, expSign } - : { style: stem, source }; - break; - } - // unit - case 'percent': - case 'permille': - case 'base-unit': - this.assertEmpty('unit'); - res.unit = { style: stem }; - break; - case 'currency': - if (/^[A-Z]{3}$/.test(option)) { - this.assertEmpty('unit'); - res.unit = { style: stem, currency: option }; - } - else - this.badOption(stem, option); - break; - case 'measure-unit': { - if (isUnit(option)) { - this.assertEmpty('unit'); - res.unit = { style: stem, unit: option }; - } - else - this.badOption(stem, option); - break; - } - // unitPer - case 'per-measure-unit': { - if (isUnit(option)) { - this.assertEmpty('unitPer'); - res.unitPer = option; - } - else - this.badOption(stem, option); - break; - } - // unitWidth - case 'unit-width-narrow': - case 'unit-width-short': - case 'unit-width-full-name': - case 'unit-width-iso-code': - case 'unit-width-hidden': - this.assertEmpty('unitWidth'); - res.unitWidth = stem; - break; - // precision - case 'precision-integer': - case 'precision-unlimited': - case 'precision-currency-cash': - this.assertEmpty('precision'); - res.precision = { style: stem }; - break; - case 'precision-currency-standard': - this.assertEmpty('precision'); - if (option === 'w') { - res.precision = { style: stem, trailingZero: 'stripIfInteger' }; - } - else { - res.precision = { style: stem }; - } - break; - case 'precision-increment': { - const increment = Number(option); - if (increment > 0) { - this.assertEmpty('precision'); - res.precision = { style: stem, increment }; - } - else - this.badOption(stem, option); - break; - } - // roundingMode - case 'rounding-mode-ceiling': - case 'rounding-mode-floor': - case 'rounding-mode-down': - case 'rounding-mode-up': - case 'rounding-mode-half-even': - case 'rounding-mode-half-odd': - case 'rounding-mode-half-ceiling': - case 'rounding-mode-half-floor': - case 'rounding-mode-half-down': - case 'rounding-mode-half-up': - case 'rounding-mode-unnecessary': - this.assertEmpty('roundingMode'); - res.roundingMode = stem; - break; - // integerWidth - case 'integer-width': { - if (/^\+0*$/.test(option)) { - this.assertEmpty('integerWidth'); - res.integerWidth = { source: option, min: option.length - 1 }; - } - else { - const m = option.match(/^#*(0*)$/); - if (m) { - this.assertEmpty('integerWidth'); - res.integerWidth = { - source: option, - min: m[1].length, - max: m[0].length - }; - } - else - this.badOption(stem, option); - } - break; - } - // scale - case 'scale': { - const scale = Number(option); - if (scale > 0) { - this.assertEmpty('scale'); - res.scale = scale; - } - else - this.badOption(stem, option); - break; - } - // group - case 'group-off': - case 'group-min2': - case 'group-auto': - case 'group-on-aligned': - case 'group-thousands': - this.assertEmpty('group'); - res.group = stem; - break; - // numberingSystem - case 'latin': - this.assertEmpty('numberingSystem'); - res.numberingSystem = 'latn'; - break; - case 'numbering-system': { - if (isNumberingSystem(option)) { - this.assertEmpty('numberingSystem'); - res.numberingSystem = option; - } - else - this.badOption(stem, option); - break; - } - // sign - case 'sign-auto': - case 'sign-always': - case 'sign-never': - case 'sign-accounting': - case 'sign-accounting-always': - case 'sign-except-zero': - case 'sign-accounting-except-zero': - this.assertEmpty('sign'); - res.sign = stem; - break; - // decimal - case 'decimal-auto': - case 'decimal-always': - this.assertEmpty('decimal'); - res.decimal = stem; - break; - // precision blueprint - default: { - const precision = parsePrecisionBlueprint(stem, options, this.onError); - if (precision) { - this.assertEmpty('precision'); - res.precision = precision; - } - else { - this.onError(new BadStemError(stem)); - } - } - } - } -} - -/** - * Parse an {@link - * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md - * | ICU NumberFormatter skeleton} string into a {@link Skeleton} structure. - * - * @public - * @param src - The skeleton string - * @param onError - Called when the parser encounters a syntax error. The - * function will still return a {@link Skeleton}, but it may not contain - * information for all tokens. If not defined, the error will be thrown - * instead. - * - * @example - * ```js - * import { parseNumberSkeleton } from '@messageformat/number-skeleton' - * - * parseNumberSkeleton('compact-short currency/GBP', console.error) - * // { - * // notation: { style: 'compact-short' }, - * // unit: { style: 'currency', currency: 'GBP' } - * // } - * ``` - */ -function parseNumberSkeleton(src, onError = error => { - throw error; -}) { - const tokens = []; - for (const part of src.split(' ')) { - if (part) { - const options = part.split('/'); - const stem = options.shift() || ''; - tokens.push({ stem, options }); - } - } - const parser = new TokenParser(onError); - for (const { stem, options } of tokens) { - parser.parseToken(stem, options); - } - return parser.skeleton; -} - -/** - * Returns a number formatter function for the given locales and number skeleton - * - * @remarks - * Uses `Intl.NumberFormat` (ES2020) internally. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param skeleton - An ICU NumberFormatter pattern or `::`-prefixed skeleton - * string, or a parsed `Skeleton` structure - * @param currency - If `skeleton` is a pattern string that includes ¤ tokens, - * their skeleton representation requires a three-letter currency code. - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getNumberFormatter } from '@messageformat/number-skeleton' - * - * let src = ':: currency/CAD unit-width-narrow' - * let fmt = getNumberFormatter('en-CA', src, console.error) - * fmt(42) // '$42.00' - * - * src = '::percent scale/100' - * fmt = getNumberFormatter('en', src, console.error) - * fmt(0.3) // '30%' - * ``` - */ -function getNumberFormatter(locales, skeleton, currency, onError) { - if (typeof skeleton === 'string') { - skeleton = - skeleton.indexOf('::') === 0 - ? parseNumberSkeleton(skeleton.slice(2), onError) - : parseNumberPattern(skeleton, currency, onError); - } - const lc = getNumberFormatLocales(locales, skeleton); - const opt = getNumberFormatOptions(skeleton, onError); - const mod = getNumberFormatModifier(skeleton); - const nf = new Intl.NumberFormat(lc, opt); - if (skeleton.affix) { - const [p0, p1] = skeleton.affix.pos; - const [n0, n1] = skeleton.affix.neg || ['', '']; - return (value) => { - const n = nf.format(mod(value)); - return value < 0 ? `${n0}${n}${n1}` : `${p0}${n}${p1}`; - }; - } - return (value) => nf.format(mod(value)); -} -/** - * Returns a string of JavaScript source that evaluates to a number formatter - * function with the same `(value: number) => string` signature as the function - * returned by {@link getNumberFormatter}. - * - * @remarks - * The returned function will memoize an `Intl.NumberFormat` instance. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param skeleton - An ICU NumberFormatter pattern or `::`-prefixed skeleton - * string, or a parsed `Skeleton` structure - * @param currency - If `skeleton` is a pattern string that includes ¤ tokens, - * their skeleton representation requires a three-letter currency code. - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getNumberFormatterSource } from '@messageformat/number-skeleton' - * - * getNumberFormatterSource('en', '::percent', console.error) - * // '(function() {\n' + - * // ' var opt = {"style":"percent"};\n' + - * // ' var nf = new Intl.NumberFormat(["en"], opt);\n' + - * // ' var mod = function(n) { return n * 0.01; };\n' + - * // ' return function(value) { return nf.format(mod(value)); }\n' + - * // '})()' - * - * const src = getNumberFormatterSource('en-CA', ':: currency/CAD unit-width-narrow', console.error) - * // '(function() {\n' + - * // ' var opt = {"style":"currency","currency":"CAD","currencyDisplay":"narrowSymbol","unitDisplay":"narrow"};\n' + - * // ' var nf = new Intl.NumberFormat(["en-CA"], opt);\n' - * // ' return function(value) { return nf.format(value); }\n' + - * // '})()' - * const fmt = new Function(`return ${src}`)() - * fmt(42) // '$42.00' - * ``` - */ -function getNumberFormatterSource(locales, skeleton, currency, onError) { - if (typeof skeleton === 'string') { - skeleton = - skeleton.indexOf('::') === 0 - ? parseNumberSkeleton(skeleton.slice(2), onError) - : parseNumberPattern(skeleton, currency, onError); - } - const lc = getNumberFormatLocales(locales, skeleton); - const opt = getNumberFormatOptions(skeleton, onError); - const modSrc = getNumberFormatModifierSource(skeleton); - const lines = [ - `(function() {`, - `var opt = ${JSON.stringify(opt)};`, - `var nf = new Intl.NumberFormat(${JSON.stringify(lc)}, opt);` - ]; - let res = 'nf.format(value)'; - if (modSrc) { - lines.push(`var mod = ${modSrc};`); - res = 'nf.format(mod(value))'; - } - if (skeleton.affix) { - const [p0, p1] = skeleton.affix.pos.map(s => JSON.stringify(s)); - if (skeleton.affix.neg) { - const [n0, n1] = skeleton.affix.neg.map(s => JSON.stringify(s)); - res = `value < 0 ? ${n0} + ${res} + ${n1} : ${p0} + ${res} + ${p1}`; - } - else { - res = `${p0} + ${res} + ${p1}`; - } - } - lines.push(`return function(value) { return ${res}; }`); - return lines.join('\n ') + '\n})()'; -} - -const rtlLanguages = [ - 'ar', - 'ckb', - 'fa', - 'he', - 'ks($|[^bfh])', - 'lrc', - 'mzn', - 'pa-Arab', - 'ps', - 'ug', - 'ur', - 'uz-Arab', - 'yi' -]; -const rtlRegExp = new RegExp('^' + rtlLanguages.join('|^')); -function biDiMarkText(text, locale) { - const isLocaleRTL = rtlRegExp.test(locale); - const mark = JSON.stringify(isLocaleRTL ? '\u200F' : '\u200E'); - return `${mark} + ${text} + ${mark}`; -} - -const RUNTIME_MODULE = '@messageformat/runtime'; -const CARDINAL_MODULE = '@messageformat/runtime/lib/cardinals'; -const PLURAL_MODULE = '@messageformat/runtime/lib/plurals'; -const FORMATTER_MODULE = '@messageformat/runtime/lib/formatters'; -class Compiler { - constructor(options) { - this.arguments = []; - this.runtime = {}; - this.options = options; - } - compile(src, plural, plurals) { - const { localeCodeFromKey, requireAllArguments, strict, strictPluralKeys } = this.options; - if (typeof src === 'object') { - const result = {}; - for (const key of Object.keys(src)) { - const lc = localeCodeFromKey ? localeCodeFromKey(key) : key; - const pl = (plurals && lc && plurals[lc]) || plural; - result[key] = this.compile(src[key], pl, plurals); - } - return result; - } - this.plural = plural; - const parserOptions = { - cardinal: plural.cardinals, - ordinal: plural.ordinals, - strict, - strictPluralKeys - }; - this.arguments = []; - const r = parser.parse(src, parserOptions).map(token => this.token(token, null)); - const hasArgs = this.arguments.length > 0; - const res = this.concatenate(r, true); - if (requireAllArguments && hasArgs) { - this.setRuntimeFn('reqArgs'); - const reqArgs = JSON.stringify(this.arguments); - return `(d) => { reqArgs(${reqArgs}, d); return ${res}; }`; - } - return `(${hasArgs ? 'd' : ''}) => ${res}`; - } - cases(token, pluralToken) { - let needOther = true; - const r = token.cases.map(({ key, tokens }) => { - if (key === 'other') - needOther = false; - const s = tokens.map(tok => this.token(tok, pluralToken)); - return `${safeIdentifier.property(null, key.replace(/^=/, ''))}: ${this.concatenate(s, false)}`; - }); - if (needOther) { - const { type } = token; - const { cardinals, ordinals } = this.plural; - if (type === 'select' || - (type === 'plural' && cardinals.includes('other')) || - (type === 'selectordinal' && ordinals.includes('other'))) - throw new Error(`No 'other' form found in ${JSON.stringify(token)}`); - } - return `{ ${r.join(', ')} }`; - } - concatenate(tokens, root) { - const asValues = this.options.returnType === 'values'; - return asValues && (root || tokens.length > 1) - ? '[' + tokens.join(', ') + ']' - : tokens.join(' + ') || '""'; - } - token(token, pluralToken) { - if (token.type === 'content') - return JSON.stringify(token.value); - const { id, lc } = this.plural; - let args, fn; - if ('arg' in token) { - this.arguments.push(token.arg); - args = [safeIdentifier.property('d', token.arg)]; - } - else - args = []; - switch (token.type) { - case 'argument': - return this.options.biDiSupport - ? biDiMarkText(String(args[0]), lc) - : String(args[0]); - case 'select': - fn = 'select'; - if (pluralToken && this.options.strict) - pluralToken = null; - args.push(this.cases(token, pluralToken)); - this.setRuntimeFn('select'); - break; - case 'selectordinal': - fn = 'plural'; - args.push(token.pluralOffset || 0, id, this.cases(token, token), 1); - this.setLocale(id, true); - this.setRuntimeFn('plural'); - break; - case 'plural': - fn = 'plural'; - args.push(token.pluralOffset || 0, id, this.cases(token, token)); - this.setLocale(id, false); - this.setRuntimeFn('plural'); - break; - case 'function': - if (!this.options.customFormatters[token.key]) { - if (token.key === 'date') { - fn = this.setDateFormatter(token, args, pluralToken); - break; - } - else if (token.key === 'number') { - fn = this.setNumberFormatter(token, args, pluralToken); - break; - } - } - args.push(JSON.stringify(this.plural.locale)); - if (token.param) { - if (pluralToken && this.options.strict) - pluralToken = null; - const arg = this.getFormatterArg(token, pluralToken); - if (arg) - args.push(arg); - } - fn = token.key; - this.setFormatter(fn); - break; - case 'octothorpe': - if (!pluralToken) - return '"#"'; - args = [ - JSON.stringify(this.plural.locale), - safeIdentifier.property('d', pluralToken.arg), - pluralToken.pluralOffset || 0 - ]; - if (this.options.strict) { - fn = 'strictNumber'; - args.push(JSON.stringify(pluralToken.arg)); - this.setRuntimeFn('strictNumber'); - } - else { - fn = 'number'; - this.setRuntimeFn('number'); - } - break; - } - if (!fn) - throw new Error('Parser error for token ' + JSON.stringify(token)); - return `${fn}(${args.join(', ')})`; - } - runtimeIncludes(key, type) { - if (safeIdentifier.identifier(key) !== key) - throw new SyntaxError(`Reserved word used as ${type} identifier: ${key}`); - const prev = this.runtime[key]; - if (!prev || prev.type === type) - return prev; - throw new TypeError(`Cannot override ${prev.type} runtime function as ${type}: ${key}`); - } - setLocale(key, ord) { - const prev = this.runtimeIncludes(key, 'locale'); - const { getCardinal, getPlural, isDefault } = this.plural; - let pf, module, toString; - if (!ord && isDefault && getCardinal) { - if (prev) - return; - pf = (n) => getCardinal(n); - module = CARDINAL_MODULE; - toString = () => String(getCardinal); - } - else { - if (prev && (!isDefault || prev.module === PLURAL_MODULE)) - return; - pf = (n, ord) => getPlural(n, ord); - module = isDefault ? PLURAL_MODULE : getPlural.module || null; - toString = () => String(getPlural); - } - this.runtime[key] = Object.assign(pf, { - id: key, - module, - toString, - type: 'locale' - }); - } - setRuntimeFn(key) { - if (this.runtimeIncludes(key, 'runtime')) - return; - this.runtime[key] = Object.assign(Runtime__namespace[key], { - id: key, - module: RUNTIME_MODULE, - type: 'runtime' - }); - } - getFormatterArg({ key, param }, pluralToken) { - const fmt = this.options.customFormatters[key] || - (isFormatterKey(key) && Formatters__namespace[key]); - if (!fmt || !param) - return null; - const argShape = ('arg' in fmt && fmt.arg) || 'string'; - if (argShape === 'options') { - let value = ''; - for (const tok of param) { - if (tok.type === 'content') - value += tok.value; - else - throw new SyntaxError(`Expected literal options for ${key} formatter`); - } - const options = {}; - for (const pair of value.split(',')) { - const keyEnd = pair.indexOf(':'); - if (keyEnd === -1) - options[pair.trim()] = null; - else { - const k = pair.substring(0, keyEnd).trim(); - const v = pair.substring(keyEnd + 1).trim(); - if (v === 'true') - options[k] = true; - else if (v === 'false') - options[k] = false; - else if (v === 'null') - options[k] = null; - else { - const n = Number(v); - options[k] = Number.isFinite(n) ? n : v; - } - } - } - return JSON.stringify(options); - } - else { - const parts = param.map(tok => this.token(tok, pluralToken)); - if (argShape === 'raw') - return `[${parts.join(', ')}]`; - const s = parts.join(' + '); - return s ? `(${s}).trim()` : '""'; - } - } - setFormatter(key) { - if (this.runtimeIncludes(key, 'formatter')) - return; - let cf = this.options.customFormatters[key]; - if (cf) { - if (typeof cf === 'function') - cf = { formatter: cf }; - this.runtime[key] = Object.assign(cf.formatter, { type: 'formatter' }, 'module' in cf && cf.module && cf.id - ? { id: safeIdentifier.identifier(cf.id), module: cf.module } - : { id: null, module: null }); - } - else if (isFormatterKey(key)) { - this.runtime[key] = Object.assign(Formatters__namespace[key], { type: 'formatter' }, { id: key, module: FORMATTER_MODULE }); - } - else { - throw new Error(`Formatting function not found: ${key}`); - } - } - setDateFormatter({ param }, args, plural) { - const { locale } = this.plural; - const argStyle = param && param.length === 1 && param[0]; - if (argStyle && - argStyle.type === 'content' && - /^\s*::/.test(argStyle.value)) { - const argSkeletonText = argStyle.value.trim().substr(2); - const key = safeIdentifier.identifier(`date_${locale}_${argSkeletonText}`, true); - if (!this.runtimeIncludes(key, 'formatter')) { - const fmt = getDateFormatter(locale, argSkeletonText); - this.runtime[key] = Object.assign(fmt, { - id: key, - module: null, - toString: () => getDateFormatterSource(locale, argSkeletonText), - type: 'formatter' - }); - } - return key; - } - args.push(JSON.stringify(locale)); - if (param && param.length > 0) { - if (plural && this.options.strict) - plural = null; - const s = param.map(tok => this.token(tok, plural)); - args.push('(' + (s.join(' + ') || '""') + ').trim()'); - } - this.setFormatter('date'); - return 'date'; - } - setNumberFormatter({ param }, args, plural) { - const { locale } = this.plural; - if (!param || param.length === 0) { - args.unshift(JSON.stringify(locale)); - args.push('0'); - this.setRuntimeFn('number'); - return 'number'; - } - args.push(JSON.stringify(locale)); - if (param.length === 1 && param[0].type === 'content') { - const fmtArg = param[0].value.trim(); - switch (fmtArg) { - case 'currency': - args.push(JSON.stringify(this.options.currency)); - this.setFormatter('numberCurrency'); - return 'numberCurrency'; - case 'integer': - this.setFormatter('numberInteger'); - return 'numberInteger'; - case 'percent': - this.setFormatter('numberPercent'); - return 'numberPercent'; - } - const cm = fmtArg.match(/^currency:([A-Z]+)$/); - if (cm) { - args.push(JSON.stringify(cm[1])); - this.setFormatter('numberCurrency'); - return 'numberCurrency'; - } - const key = safeIdentifier.identifier(`number_${locale}_${fmtArg}`, true); - if (!this.runtimeIncludes(key, 'formatter')) { - const { currency } = this.options; - const fmt = getNumberFormatter(locale, fmtArg, currency); - this.runtime[key] = Object.assign(fmt, { - id: null, - module: null, - toString: () => getNumberFormatterSource(locale, fmtArg, currency), - type: 'formatter' - }); - } - return key; - } - if (plural && this.options.strict) - plural = null; - const s = param.map(tok => this.token(tok, plural)); - args.push('(' + (s.join(' + ') || '""') + ').trim()'); - args.push(JSON.stringify(this.options.currency)); - this.setFormatter('numberFmt'); - return 'numberFmt'; - } -} -function isFormatterKey(key) { - return key in Formatters__namespace; -} - -module.exports = Compiler; diff --git a/node_modules/@messageformat/core/lib/messageformat.d.ts b/node_modules/@messageformat/core/lib/messageformat.d.ts deleted file mode 100644 index 20bf4af..0000000 --- a/node_modules/@messageformat/core/lib/messageformat.d.ts +++ /dev/null @@ -1,207 +0,0 @@ -import { PluralFunction, PluralObject } from './plurals'; -export { PluralFunction }; -/** - * A compiled message function, which may accept an object parameter - * - * @public - */ -export type MessageFunction = (param?: Record | unknown[]) => ReturnType extends 'string' ? string : unknown[]; -/** - * A custom formatter function. See - * {@link https://messageformat.github.io/messageformat/custom-formatters/ | Custom Formatters} - * for more details. - * - * @public - */ -export type CustomFormatter = (value: unknown, locale: string, arg: string | null) => unknown; -/** - * Options for the MessageFormat constructor - * - * @public - */ -export interface MessageFormatOptions { - /** - * Add Unicode control characters to all input parts to preserve the - * integrity of the output when mixing LTR and RTL text - * - * Default: `false` - */ - biDiSupport?: boolean; - /** - * The currency to use when formatting `{V, number, currency}` - * - * Default: `USD` - */ - currency?: string; - /** - * Map of custom formatting functions to include. See - * {@link https://messageformat.github.io/messageformat/custom-formatters/ | Custom Formatters} - * for more details. - */ - customFormatters?: { - [key: string]: CustomFormatter | { - formatter: CustomFormatter; - arg?: 'string' | 'raw' | 'options'; - id?: string; - module?: string; - }; - }; - /** - * If defined, used by {@link compileModule} to identify and map keys to - * the locale identifiers used by formatters and plural rules. - * The values returned by the function should match the `locale` argument. - * - * Default: `undefined` - * - * @example - * ```js - * // Support all recognised Unicode locale identifiers - * function localeCodeFromKey(key) { - * try { - * // Ignore all language subtags - * return new Intl.Locale(key).language - * } catch { - * return null - * } - * } - * ``` - */ - localeCodeFromKey?: ((key: string) => string | null | undefined) | null; - /** - * Require all message arguments to be set with a defined value - * - * Default: `false` - */ - requireAllArguments?: boolean; - /** - * Return type of compiled functions; either a concatenated `'string'` or an - * array (possibly hierarchical) of `'values'`. - * - * Default: `'string'` - */ - returnType?: ReturnType; - /** - * Follow the ICU MessageFormat spec more closely, but not allowing custom - * formatters and by allowing`#` only directly within a plural or - * selectordinal case, rather than in any inner select case as well. See the - * {@link http://messageformat.github.io/messageformat/api/parser.parseoptions.strict/ | parser option} - * for more details. - * - * Default: `false` - */ - strict?: boolean; - /** - * Enable strict checks for plural keys according to - * {@link http://cldr.unicode.org/index/cldr-spec/plural-rules | Unicode CLDR}. - * When set to `false`, the compiler will also accept any invalid plural keys. - * Also see the corresponding {@link @messageformat/parser#ParseOptions | parser option}. - * - * Default: `true` - */ - strictPluralKeys?: boolean; -} -/** - * Returned by {@link MessageFormat.resolvedOptions} - * @public - */ -export interface ResolvedMessageFormatOptions extends Required> { - /** The default locale */ - locale: string; - /** All of the supported plurals */ - plurals: PluralObject[]; -} -/** - * The core MessageFormat-to-JavaScript compiler - * - * @public - * @example - * ```js - * import MessageFormat from '@messageformat/core' - * const mf = new MessageFormat('en') - * - * const msgSrc = `{GENDER, select, - * male {He} female {She} other {They} - * } found {RES, plural, - * =0 {no results} one {1 result} other {# results} - * }.`; - * const msg = mf.compile(msgSrc) - * - * msg({ GENDER: 'male', RES: 1 }) // 'He found 1 result.' - * msg({ GENDER: 'female', RES: 1 }) // 'She found 1 result.' - * msg({ GENDER: 'male', RES: 0 }) // 'He found no results.' - * msg({ RES: 2 }) // 'They found 2 results.' - * ``` - */ -export default class MessageFormat { - /** - * Used by the constructor when no `locale` argument is given. - * Default: `'en'` - */ - static defaultLocale: string; - /** - * Escape characaters that may be considered as MessageFormat markup - * - * @remarks - * This surrounds the characters `{`, `}` and optionally `#` with 'quotes'. - * This will allow those characters to not be considered as MessageFormat control characters. - * - * @param str - The input string - * @param octothorpe - Also escape `#` - * @returns The escaped string - */ - static escape(str: string, octothorpe?: boolean): string; - /** - * Returns a subset of `locales` consisting of those for which MessageFormat - * has built-in plural category support. - */ - static supportedLocalesOf(locales: string | string[]): string[]; - /** @internal */ - options: Required>; - /** @internal */ - plurals: PluralObject[]; - /** - * Create a new MessageFormat compiler - * - * @remarks - * If given multiple valid locales, the first will be the default. - * If `locale` is empty, it will fall back to `MessageFormat.defaultLocale`. - * - * String `locale` values will be matched to plural categorisation functions provided by the Unicode CLDR. - * If defining your own instead, use named functions, optionally providing them with the properties: - * `cardinals: string[]`, `ordinals: string[]`, and `module: string` - * (to import the formatter as a runtime dependency, rather than inlining its source). - * - * If `locale` has the special value `'*'`, it will match **all** available locales. - * This may be useful if you want your messages to be completely determined by your data, - * but may provide surprising results if your input message object includes any 2-3 character keys that are not locale identifiers. - * - * @param locale - The locale or locales supported by this MessageFormat instance. - * @param options - Options for this instance - */ - constructor(locale: string | PluralFunction | Array | null, options?: MessageFormatOptions); - /** - * Returns a new object with properties reflecting the default locale, - * plurals, and other options computed during initialization. - */ - resolvedOptions(): ResolvedMessageFormatOptions; - /** - * Compile a message into a function - * - * @remarks - * Given a string `message` with ICU MessageFormat declarations, the result is - * a function taking a single Object parameter representing each of the - * input's defined variables, using the first valid locale. - * - * @param message - The input message to be compiled, in ICU MessageFormat - * @returns The compiled function - * - * @example - * ```js - * const mf = new MessageFormat('en') - * const msg = mf.compile('A {TYPE} example.') - * - * msg({ TYPE: 'simple' }) // 'A simple example.' - * ``` - */ - compile(message: string): MessageFunction; -} diff --git a/node_modules/@messageformat/core/lib/messageformat.js b/node_modules/@messageformat/core/lib/messageformat.js deleted file mode 100644 index a83e667..0000000 --- a/node_modules/@messageformat/core/lib/messageformat.js +++ /dev/null @@ -1,135 +0,0 @@ -'use strict'; - -var Compiler = require('./compiler'); -var Cardinals = require('make-plural/cardinals'); -var PluralCategories = require('make-plural/pluralCategories'); -var Plurals = require('make-plural/plurals'); -var safeIdentifier = require('safe-identifier'); - -function _interopNamespaceDefault(e) { - var n = Object.create(null); - if (e) { - Object.keys(e).forEach(function (k) { - if (k !== 'default') { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function () { return e[k]; } - }); - } - }); - } - n.default = e; - return Object.freeze(n); -} - -var Cardinals__namespace = /*#__PURE__*/_interopNamespaceDefault(Cardinals); -var PluralCategories__namespace = /*#__PURE__*/_interopNamespaceDefault(PluralCategories); -var Plurals__namespace = /*#__PURE__*/_interopNamespaceDefault(Plurals); - -function normalize(locale) { - if (typeof locale !== 'string' || locale.length < 2) - throw new RangeError(`Invalid language tag: ${locale}`); - if (locale.startsWith('pt-PT')) - return 'pt-PT'; - const m = locale.match(/.+?(?=[-_])/); - return m ? m[0] : locale; -} -function getPlural(locale) { - if (typeof locale === 'function') { - const lc = normalize(locale.name); - return { - isDefault: false, - id: safeIdentifier.identifier(lc), - lc, - locale: locale.name, - getPlural: locale, - cardinals: locale.cardinals || [], - ordinals: locale.ordinals || [] - }; - } - const lc = normalize(locale); - const id = safeIdentifier.identifier(lc); - if (isPluralId(id)) { - return { - isDefault: true, - id, - lc, - locale, - getCardinal: Cardinals__namespace[id], - getPlural: Plurals__namespace[id], - cardinals: PluralCategories__namespace[id].cardinal, - ordinals: PluralCategories__namespace[id].ordinal - }; - } - return null; -} -function getAllPlurals(firstLocale) { - const keys = Object.keys(Plurals__namespace).filter(key => key !== firstLocale); - keys.unshift(firstLocale); - return keys.map(getPlural); -} -function hasPlural(locale) { - const lc = normalize(locale); - return safeIdentifier.identifier(lc) in Plurals__namespace; -} -function isPluralId(id) { - return id in Plurals__namespace; -} - -class MessageFormat { - static escape(str, octothorpe) { - const esc = octothorpe ? /[#{}]/g : /[{}]/g; - return String(str).replace(esc, "'$&'"); - } - static supportedLocalesOf(locales) { - const la = Array.isArray(locales) ? locales : [locales]; - return la.filter(hasPlural); - } - constructor(locale, options) { - this.plurals = []; - this.options = Object.assign({ - biDiSupport: false, - currency: 'USD', - customFormatters: {}, - localeCodeFromKey: null, - requireAllArguments: false, - returnType: 'string', - strict: (options && options.strictNumberSign) || false, - strictPluralKeys: true - }, options); - if (locale === '*') { - this.plurals = getAllPlurals(MessageFormat.defaultLocale); - } - else if (Array.isArray(locale)) { - this.plurals = locale.map(getPlural).filter(Boolean); - } - else if (locale) { - const pl = getPlural(locale); - if (pl) - this.plurals = [pl]; - } - if (this.plurals.length === 0) { - const pl = getPlural(MessageFormat.defaultLocale); - this.plurals = [pl]; - } - } - resolvedOptions() { - return Object.assign(Object.assign({}, this.options), { locale: this.plurals[0].locale, plurals: this.plurals }); - } - compile(message) { - const compiler = new Compiler(this.options); - const fnBody = 'return ' + compiler.compile(message, this.plurals[0]); - const nfArgs = []; - const fnArgs = []; - for (const [key, fmt] of Object.entries(compiler.runtime)) { - nfArgs.push(key); - fnArgs.push(fmt); - } - const fn = new Function(...nfArgs, fnBody); - return fn(...fnArgs); - } -} -MessageFormat.defaultLocale = 'en'; - -module.exports = MessageFormat; diff --git a/node_modules/@messageformat/core/lib/plurals.d.ts b/node_modules/@messageformat/core/lib/plurals.d.ts deleted file mode 100644 index 7739660..0000000 --- a/node_modules/@messageformat/core/lib/plurals.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as Plurals from 'make-plural/plurals'; -/** - * Function used to define the pluralisation for a locale - * - * @public - * @remarks - * `(value: number | string, ord?: boolean) => PluralCateogry` - * - * May be used as a {@link MessageFormat} constructor `locale` argument. - */ -export interface PluralFunction { - /** Foo bar */ - (value: number | string, ord?: boolean): Plurals.PluralCategory; - /** Which plurals may be returned if `ord` is falsy */ - cardinals?: Plurals.PluralCategory[]; - /** Which plurals may be returned if `ord` is true */ - ordinals?: Plurals.PluralCategory[]; - /** The name of the module from which this function may be imported */ - module?: string; -} -export interface PluralObject { - isDefault: boolean; - id: string; - lc: string; - locale: string; - getCardinal?: (value: string | number) => Plurals.PluralCategory; - getPlural: PluralFunction; - cardinals: Plurals.PluralCategory[]; - ordinals: Plurals.PluralCategory[]; -} -export declare function getPlural(locale: string | PluralFunction): PluralObject | null; -export declare function getAllPlurals(firstLocale: string): PluralObject[]; -export declare function hasPlural(locale: string): boolean; diff --git a/node_modules/@messageformat/core/lib/tsdoc-metadata.json b/node_modules/@messageformat/core/lib/tsdoc-metadata.json deleted file mode 100644 index ea81a7a..0000000 --- a/node_modules/@messageformat/core/lib/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "7.35.2" - } - ] -} diff --git a/node_modules/@messageformat/core/messageformat.js b/node_modules/@messageformat/core/messageformat.js deleted file mode 100644 index bc509ac..0000000 --- a/node_modules/@messageformat/core/messageformat.js +++ /dev/null @@ -1,6285 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.MessageFormat = factory()); -})(this, (function () { 'use strict'; - - /****************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - /* global Reflect, Promise */ - - var __assign = function () { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); - }; - function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, - m = s && o[s], - i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { - value: o && o[i++], - done: !o - }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - } - function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), - r, - ar = [], - e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } catch (error) { - e = { - error: error - }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; - } - function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - } - - /** - * Parent class for errors. - * - * @remarks - * Errors with `type: "warning"` do not necessarily indicate that the parser - * encountered an error. In addition to a human-friendly `message`, may also - * includes the `token` at which the error was encountered. - * - * @public - */ - class DateFormatError extends Error { - /** @internal */ - constructor(msg, token, type) { - super(msg); - this.token = token; - this.type = type || 'error'; - } - } - const alpha = width => width < 4 ? 'short' : width === 4 ? 'long' : 'narrow'; - const numeric = width => width % 2 === 0 ? '2-digit' : 'numeric'; - function yearOptions(token, onError) { - switch (token.char) { - case 'y': - return { - year: numeric(token.width) - }; - case 'r': - return { - calendar: 'gregory', - year: 'numeric' - }; - case 'u': - case 'U': - case 'Y': - default: - onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING); - return { - year: 'numeric' - }; - } - } - function monthStyle(token, onError) { - switch (token.width) { - case 1: - return 'numeric'; - case 2: - return '2-digit'; - case 3: - return 'short'; - case 4: - return 'long'; - case 5: - return 'narrow'; - default: - onError(`${token.desc} is not supported with width ${token.width}`); - return undefined; - } - } - function dayStyle(token, onError) { - const { - char, - desc, - width - } = token; - if (char === 'd') return numeric(width);else { - onError(`${desc} is not supported`); - return undefined; - } - } - function weekdayStyle(token, onError) { - const { - char, - desc, - width - } = token; - if ((char === 'c' || char === 'e') && width < 3) { - // ignoring stand-alone-ness - const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`; - onError(msg, DateFormatError.WARNING); - } - // merging narrow styles - return alpha(width); - } - function hourOptions(token) { - const hour = numeric(token.width); - let hourCycle; - switch (token.char) { - case 'h': - hourCycle = 'h12'; - break; - case 'H': - hourCycle = 'h23'; - break; - case 'k': - hourCycle = 'h24'; - break; - case 'K': - hourCycle = 'h11'; - break; - } - return hourCycle ? { - hour, - hourCycle - } : { - hour - }; - } - function timeZoneNameStyle(token, onError) { - // so much fallback behaviour here - const { - char, - desc, - width - } = token; - switch (char) { - case 'v': - case 'z': - return width === 4 ? 'long' : 'short'; - case 'V': - if (width === 4) return 'long'; - onError(`${desc} is not supported with width ${width}`); - return undefined; - case 'X': - onError(`${desc} is not supported`); - return undefined; - } - return 'short'; - } - function compileOptions(token, onError) { - switch (token.field) { - case 'era': - return { - era: alpha(token.width) - }; - case 'year': - return yearOptions(token, onError); - case 'month': - return { - month: monthStyle(token, onError) - }; - case 'day': - return { - day: dayStyle(token, onError) - }; - case 'weekday': - return { - weekday: weekdayStyle(token, onError) - }; - case 'period': - return undefined; - case 'hour': - return hourOptions(token); - case 'min': - return { - minute: numeric(token.width) - }; - case 'sec': - return { - second: numeric(token.width) - }; - case 'tz': - return { - timeZoneName: timeZoneNameStyle(token, onError) - }; - case 'quarter': - case 'week': - case 'sec-frac': - case 'ms': - onError(`${token.desc} is not supported`); - } - return undefined; - } - function getDateFormatOptions(tokens) { - let onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : error => { - throw error; - }; - const options = {}; - const fields = []; - for (const token of tokens) { - const { - error, - field, - str - } = token; - if (error) { - const dte = new DateFormatError(error.message, token); - dte.stack = error.stack; - onError(dte); - } - if (str) { - const msg = `Ignoring string part: ${str}`; - onError(new DateFormatError(msg, token, DateFormatError.WARNING)); - } - if (field) { - if (fields.indexOf(field) === -1) fields.push(field);else onError(new DateFormatError(`Duplicate ${field} token`, token)); - } - const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning))); - if (opt) Object.assign(options, opt); - } - return options; - } - - const fields = { - G: { - field: 'era', - desc: 'Era' - }, - y: { - field: 'year', - desc: 'Year' - }, - Y: { - field: 'year', - desc: 'Year of "Week of Year"' - }, - u: { - field: 'year', - desc: 'Extended year' - }, - U: { - field: 'year', - desc: 'Cyclic year name' - }, - r: { - field: 'year', - desc: 'Related Gregorian year' - }, - Q: { - field: 'quarter', - desc: 'Quarter' - }, - q: { - field: 'quarter', - desc: 'Stand-alone quarter' - }, - M: { - field: 'month', - desc: 'Month in year' - }, - L: { - field: 'month', - desc: 'Stand-alone month in year' - }, - w: { - field: 'week', - desc: 'Week of year' - }, - W: { - field: 'week', - desc: 'Week of month' - }, - d: { - field: 'day', - desc: 'Day in month' - }, - D: { - field: 'day', - desc: 'Day of year' - }, - F: { - field: 'day', - desc: 'Day of week in month' - }, - g: { - field: 'day', - desc: 'Modified julian day' - }, - E: { - field: 'weekday', - desc: 'Day of week' - }, - e: { - field: 'weekday', - desc: 'Local day of week' - }, - c: { - field: 'weekday', - desc: 'Stand-alone local day of week' - }, - a: { - field: 'period', - desc: 'AM/PM marker' - }, - b: { - field: 'period', - desc: 'AM/PM/noon/midnight marker' - }, - B: { - field: 'period', - desc: 'Flexible day period' - }, - h: { - field: 'hour', - desc: 'Hour in AM/PM (1~12)' - }, - H: { - field: 'hour', - desc: 'Hour in day (0~23)' - }, - k: { - field: 'hour', - desc: 'Hour in day (1~24)' - }, - K: { - field: 'hour', - desc: 'Hour in AM/PM (0~11)' - }, - j: { - field: 'hour', - desc: 'Hour in preferred cycle' - }, - J: { - field: 'hour', - desc: 'Hour in preferred cycle without marker' - }, - C: { - field: 'hour', - desc: 'Hour in preferred cycle with flexible marker' - }, - m: { - field: 'min', - desc: 'Minute in hour' - }, - s: { - field: 'sec', - desc: 'Second in minute' - }, - S: { - field: 'sec-frac', - desc: 'Fractional second' - }, - A: { - field: 'ms', - desc: 'Milliseconds in day' - }, - z: { - field: 'tz', - desc: 'Time Zone: specific non-location' - }, - Z: { - field: 'tz', - desc: 'Time Zone' - }, - O: { - field: 'tz', - desc: 'Time Zone: localized' - }, - v: { - field: 'tz', - desc: 'Time Zone: generic non-location' - }, - V: { - field: 'tz', - desc: 'Time Zone: ID' - }, - X: { - field: 'tz', - desc: 'Time Zone: ISO8601 with Z' - }, - x: { - field: 'tz', - desc: 'Time Zone: ISO8601' - } - }; - const isLetter = char => char >= 'A' && char <= 'Z' || char >= 'a' && char <= 'z'; - function readFieldToken(src, pos) { - const char = src[pos]; - let width = 1; - while (src[++pos] === char) ++width; - const field = fields[char]; - if (!field) { - const msg = `The letter ${char} is not a valid field identifier`; - return { - char, - error: new Error(msg), - width - }; - } - return { - char, - field: field.field, - desc: field.desc, - width - }; - } - function readQuotedToken(src, pos) { - let str = src[++pos]; - let width = 2; - if (str === "'") return { - char: "'", - str, - width - }; - while (true) { - const next = src[++pos]; - ++width; - if (next === undefined) { - const msg = `Unterminated quoted literal in pattern: ${str || src}`; - return { - char: "'", - error: new Error(msg), - str, - width - }; - } else if (next === "'") { - if (src[++pos] !== "'") return { - char: "'", - str, - width - };else ++width; - } - str += next; - } - } - function readToken(src, pos) { - const char = src[pos]; - if (!char) return null; - if (isLetter(char)) return readFieldToken(src, pos); - if (char === "'") return readQuotedToken(src, pos); - let str = char; - let width = 1; - while (true) { - const next = src[++pos]; - if (!next || isLetter(next) || next === "'") return { - char, - str, - width - }; - str += next; - width += 1; - } - } - /** - * Parse an {@link http://userguide.icu-project.org/formatparse/datetime | ICU - * DateFormat skeleton} string into a {@link DateToken} array. - * - * @remarks - * Errors will not be thrown, but if encountered are included as the relevant - * token's `error` value. - * - * @public - * @param src - The skeleton string - * - * @example - * ```js - * import { parseDateTokens } from '@messageformat/date-skeleton' - * - * parseDateTokens('GrMMMdd', console.error) - * // [ - * // { char: 'G', field: 'era', desc: 'Era', width: 1 }, - * // { char: 'r', field: 'year', desc: 'Related Gregorian year', width: 1 }, - * // { char: 'M', field: 'month', desc: 'Month in year', width: 3 }, - * // { char: 'd', field: 'day', desc: 'Day in month', width: 2 } - * // ] - * ``` - */ - function parseDateTokens(src) { - const tokens = []; - let pos = 0; - while (true) { - const token = readToken(src, pos); - if (!token) return tokens; - tokens.push(token); - pos += token.width; - } - } - - /** - * Returns a date formatter function for the given locales and date skeleton - * - * @remarks - * Uses `Intl.DateTimeFormat` internally. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param tokens - An ICU DateFormat skeleton string, or an array or parsed - * `DateToken` tokens - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getDateFormatter } from '@messageformat/date-skeleton' - * - * // 2006 Jan 2, 15:04:05.789 in local time - * const date = new Date(2006, 0, 2, 15, 4, 5, 789) - * - * let fmt = getDateFormatter('en-CA', 'GrMMMdd', console.error) - * fmt(date) // 'Jan. 02, 2006 AD' - * - * fmt = getDateFormatter('en-CA', 'hamszzzz', console.error) - * fmt(date) // '3:04:05 p.m. Newfoundland Daylight Time' - * ``` - */ - function getDateFormatter(locales, tokens, onError) { - if (typeof tokens === 'string') tokens = parseDateTokens(tokens); - const opt = getDateFormatOptions(tokens, onError); - const dtf = new Intl.DateTimeFormat(locales, opt); - return date => dtf.format(date); - } - /** - * Returns a string of JavaScript source that evaluates to a date formatter - * function with the same `(date: Date | number) => string` signature as the - * function returned by {@link getDateFormatter}. - * - * @remarks - * The returned function will memoize an `Intl.DateTimeFormat` instance. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param tokens - An ICU DateFormat skeleton string, or an array or parsed - * `DateToken` tokens - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getDateFormatterSource } from '@messageformat/date-skeleton' - * - * getDateFormatterSource('en-CA', 'GrMMMdd', console.error) - * // '(function() {\n' + - * // ' var opt = {"era":"short","calendar":"gregory","year":"numeric",' + - * // '"month":"short","day":"2-digit"};\n' + - * // ' var dtf = new Intl.DateTimeFormat("en-CA", opt);\n' + - * // ' return function(value) { return dtf.format(value); }\n' + - * // '})()' - * - * const src = getDateFormatterSource('en-CA', 'hamszzzz', console.error) - * // '(function() {\n' + - * // ' var opt = {"hour":"numeric","hourCycle":"h12","minute":"numeric",' + - * // '"second":"numeric","timeZoneName":"long"};\n' + - * // ' var dtf = new Intl.DateTimeFormat("en-CA", opt);\n' + - * // ' return function(value) { return dtf.format(value); }\n' + - * // '})()' - * - * const fmt = new Function(`return ${src}`)() - * const date = new Date(2006, 0, 2, 15, 4, 5, 789) - * fmt(date) // '3:04:05 p.m. Newfoundland Daylight Time' - * ``` - */ - function getDateFormatterSource(locales, tokens, onError) { - if (typeof tokens === 'string') tokens = parseDateTokens(tokens); - const opt = getDateFormatOptions(tokens, onError); - const lines = [`(function() {`, `var opt = ${JSON.stringify(opt)};`, `var dtf = new Intl.DateTimeFormat(${JSON.stringify(locales)}, opt);`, `return function(value) { return dtf.format(value); }`]; - return lines.join('\n ') + '\n})()'; - } - - /** - * Base class for errors. In addition to a `code` and a human-friendly - * `message`, may also includes the token `stem` as well as other fields. - * - * @public - */ - class NumberFormatError extends Error { - /** @internal */ - constructor(code, msg) { - super(msg); - this.code = code; - } - } - /** @internal */ - class BadOptionError extends NumberFormatError { - constructor(stem, opt) { - super('BAD_OPTION', `Unknown ${stem} option: ${opt}`); - this.stem = stem; - this.option = opt; - } - } - /** @internal */ - class BadStemError extends NumberFormatError { - constructor(stem) { - super('BAD_STEM', `Unknown stem: ${stem}`); - this.stem = stem; - } - } - /** @internal */ - class MaskedValueError extends NumberFormatError { - constructor(type, prev) { - super('MASKED_VALUE', `Value for ${type} is set multiple times`); - this.type = type; - this.prev = prev; - } - } - /** @internal */ - class MissingOptionError extends NumberFormatError { - constructor(stem) { - super('MISSING_OPTION', `Required option missing for ${stem}`); - this.stem = stem; - } - } - /** @internal */ - class PatternError extends NumberFormatError { - constructor(char, msg) { - super('BAD_PATTERN', msg); - this.char = char; - } - } - /** @internal */ - class TooManyOptionsError extends NumberFormatError { - constructor(stem, options, maxOpt) { - const maxOptStr = maxOpt > 1 ? `${maxOpt} options` : 'one option'; - super('TOO_MANY_OPTIONS', `Token ${stem} only supports ${maxOptStr} (got ${options.length})`); - this.stem = stem; - this.options = options; - } - } - /** @internal */ - class UnsupportedError extends NumberFormatError { - constructor(stem, source) { - super('UNSUPPORTED', `The stem ${stem} is not supported`); - this.stem = stem; - if (source) { - this.message += ` with value ${source}`; - this.source = source; - } - } - } - - /** - * Add - * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation | numbering-system tags} - * to locale identifiers - * - * @internal - */ - function getNumberFormatLocales(locales, _ref) { - let { - numberingSystem - } = _ref; - if (!Array.isArray(locales)) locales = [locales]; - return numberingSystem ? locales.map(lc => { - const ext = lc.indexOf('-u-') === -1 ? 'u-nu' : 'nu'; - return `${lc}-${ext}-${numberingSystem}`; - }).concat(locales) : locales; - } - - // from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round - function round(x, precision) { - const y = +x + precision / 2; - return y - y % +precision; - } - function getNumberFormatMultiplier(_ref) { - let { - scale, - unit - } = _ref; - let mult = typeof scale === 'number' && scale >= 0 ? scale : 1; - if (unit && unit.style === 'percent') mult *= 0.01; - return mult; - } - /** - * Determine a modifier for the input value to account for any `scale`, - * `percent`, and `precision-increment` tokens in the skeleton. - * - * @internal - * @remarks - * With ICU NumberFormatter, the `percent` skeleton would style `25` as "25%". - * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`. - */ - function getNumberFormatModifier(skeleton) { - const mult = getNumberFormatMultiplier(skeleton); - const { - precision - } = skeleton; - if (precision && precision.style === 'precision-increment') { - return n => round(n, precision.increment) * mult; - } else { - return n => n * mult; - } - } - /** - * Returns a string of JavaScript source that evaluates to a modifier for the - * input value to account for any `scale`, `percent`, and `precision-increment` - * tokens in the skeleton. - * - * @internal - * @remarks - * With ICU NumberFormatter, the `percent` skeleton would style `25` as "25%". - * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`. - */ - function getNumberFormatModifierSource(skeleton) { - const mult = getNumberFormatMultiplier(skeleton); - const { - precision - } = skeleton; - if (precision && precision.style === 'precision-increment') { - // see round() above for source - const setX = `+n + ${precision.increment / 2}`; - let res = `x - (x % +${precision.increment})`; - if (mult !== 1) res = `(${res}) * ${mult}`; - return `function(n) { var x = ${setX}; return ${res}; }`; - } - return mult !== 1 ? `function(n) { return n * ${mult}; }` : null; - } - - /** - * Given an input ICU NumberFormatter skeleton, does its best to construct a - * corresponding `Intl.NumberFormat` options structure. - * - * @remarks - * Some features depend on `Intl.NumberFormat` features defined in ES2020. - * - * @internal - * @param onUnsupported - If defined, called when encountering unsupported (but - * valid) tokens, such as `decimal-always` or `permille`. The error `source` - * may specify the source of an unsupported option. - * - * @example - * ```js - * import { - * getNumberFormatOptions, - * parseNumberSkeleton - * } from '@messageformat/number-skeleton' - * - * const src = 'currency/CAD unit-width-narrow' - * const skeleton = parseNumberSkeleton(src, console.error) - * // { - * // unit: { style: 'currency', currency: 'CAD' }, - * // unitWidth: 'unit-width-narrow' - * // } - * - * getNumberFormatOptions(skeleton, console.error) - * // { - * // style: 'currency', - * // currency: 'CAD', - * // currencyDisplay: 'narrowSymbol', - * // unitDisplay: 'narrow' - * // } - * - * const sk2 = parseNumberSkeleton('group-min2') - * // { group: 'group-min2' } - * - * getNumberFormatOptions(sk2, console.error) - * // Error: The stem group-min2 is not supported - * // at UnsupportedError.NumberFormatError ... { - * // code: 'UNSUPPORTED', - * // stem: 'group-min2' - * // } - * // {} - * ``` - */ - function getNumberFormatOptions(skeleton, onUnsupported) { - const { - decimal, - group, - integerWidth, - notation, - precision, - roundingMode, - sign, - unit, - unitPer, - unitWidth - } = skeleton; - const fail = (stem, source) => { - if (onUnsupported) onUnsupported(new UnsupportedError(stem, source)); - }; - const opt = {}; - if (unit) { - switch (unit.style) { - case 'base-unit': - opt.style = 'decimal'; - break; - case 'currency': - opt.style = 'currency'; - opt.currency = unit.currency; - break; - case 'measure-unit': - opt.style = 'unit'; - opt.unit = unit.unit.replace(/.*-/, ''); - if (unitPer) opt.unit += '-per-' + unitPer.replace(/.*-/, ''); - break; - case 'percent': - opt.style = 'percent'; - break; - case 'permille': - fail('permille'); - break; - } - } - switch (unitWidth) { - case 'unit-width-full-name': - opt.currencyDisplay = 'name'; - opt.unitDisplay = 'long'; - break; - case 'unit-width-hidden': - fail(unitWidth); - break; - case 'unit-width-iso-code': - opt.currencyDisplay = 'code'; - break; - case 'unit-width-narrow': - opt.currencyDisplay = 'narrowSymbol'; - opt.unitDisplay = 'narrow'; - break; - case 'unit-width-short': - opt.currencyDisplay = 'symbol'; - opt.unitDisplay = 'short'; - break; - } - switch (group) { - case 'group-off': - opt.useGrouping = false; - break; - case 'group-auto': - opt.useGrouping = true; - break; - case 'group-min2': - case 'group-on-aligned': - case 'group-thousands': - fail(group); - opt.useGrouping = true; - break; - } - if (precision) { - switch (precision.style) { - case 'precision-fraction': - { - const { - minFraction: minF, - maxFraction: maxF, - minSignificant: minS, - maxSignificant: maxS, - source - } = precision; - if (typeof minF === 'number') { - opt.minimumFractionDigits = minF; - if (typeof minS === 'number') fail('precision-fraction', source); - } - if (typeof maxF === 'number') opt.maximumFractionDigits = maxF; - if (typeof minS === 'number') opt.minimumSignificantDigits = minS; - if (typeof maxS === 'number') opt.maximumSignificantDigits = maxS; - break; - } - case 'precision-integer': - opt.maximumFractionDigits = 0; - break; - case 'precision-unlimited': - opt.maximumFractionDigits = 20; - break; - case 'precision-increment': - break; - case 'precision-currency-standard': - opt.trailingZeroDisplay = precision.trailingZero; - break; - case 'precision-currency-cash': - fail(precision.style); - break; - } - } - if (notation) { - switch (notation.style) { - case 'compact-short': - opt.notation = 'compact'; - opt.compactDisplay = 'short'; - break; - case 'compact-long': - opt.notation = 'compact'; - opt.compactDisplay = 'long'; - break; - case 'notation-simple': - opt.notation = 'standard'; - break; - case 'scientific': - case 'engineering': - { - const { - expDigits, - expSign, - source, - style - } = notation; - opt.notation = style; - if (expDigits && expDigits > 1 || expSign && expSign !== 'sign-auto') fail(style, source); - break; - } - } - } - if (integerWidth) { - const { - min, - max, - source - } = integerWidth; - if (min > 0) opt.minimumIntegerDigits = min; - if (Number(max) > 0) { - const hasExp = opt.notation === 'engineering' || opt.notation === 'scientific'; - if (max === 3 && hasExp) opt.notation = 'engineering';else fail('integer-width', source); - } - } - switch (sign) { - case 'sign-auto': - opt.signDisplay = 'auto'; - break; - case 'sign-always': - opt.signDisplay = 'always'; - break; - case 'sign-except-zero': - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore https://github.com/microsoft/TypeScript/issues/46712 - opt.signDisplay = 'exceptZero'; - break; - case 'sign-never': - opt.signDisplay = 'never'; - break; - case 'sign-accounting': - opt.currencySign = 'accounting'; - break; - case 'sign-accounting-always': - opt.currencySign = 'accounting'; - opt.signDisplay = 'always'; - break; - case 'sign-accounting-except-zero': - opt.currencySign = 'accounting'; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore https://github.com/microsoft/TypeScript/issues/46712 - opt.signDisplay = 'exceptZero'; - break; - } - if (decimal === 'decimal-always') fail(decimal); - if (roundingMode) fail(roundingMode); - return opt; - } - - function parseAffixToken(src, pos, onError) { - const char = src[pos]; - switch (char) { - case '%': - return { - char: '%', - style: 'percent', - width: 1 - }; - case '‰': - return { - char: '%', - style: 'permille', - width: 1 - }; - case '¤': - { - let width = 1; - while (src[++pos] === '¤') ++width; - switch (width) { - case 1: - return { - char, - currency: 'default', - width - }; - case 2: - return { - char, - currency: 'iso-code', - width - }; - case 3: - return { - char, - currency: 'full-name', - width - }; - case 5: - return { - char, - currency: 'narrow', - width - }; - default: - { - const msg = `Invalid number (${width}) of ¤ chars in pattern`; - onError(new PatternError('¤', msg)); - return null; - } - } - } - case '*': - { - const pad = src[pos + 1]; - if (pad) return { - char, - pad, - width: 2 - }; - break; - } - case '+': - case '-': - return { - char, - width: 1 - }; - case "'": - { - let str = src[++pos]; - let width = 2; - if (str === "'") return { - char, - str, - width - }; - while (true) { - const next = src[++pos]; - ++width; - if (next === undefined) { - const msg = `Unterminated quoted literal in pattern: ${str}`; - onError(new PatternError("'", msg)); - return { - char, - str, - width - }; - } else if (next === "'") { - if (src[++pos] !== "'") return { - char, - str, - width - };else ++width; - } - str += next; - } - } - } - return null; - } - - const isDigit = char => char >= '0' && char <= '9'; - function parseNumberToken(src, pos) { - const char = src[pos]; - if (isDigit(char)) { - let digits = char; - while (true) { - const next = src[++pos]; - if (isDigit(next)) digits += next;else return { - char: '0', - digits, - width: digits.length - }; - } - } - switch (char) { - case '#': - { - let width = 1; - while (src[++pos] === '#') ++width; - return { - char, - width - }; - } - case '@': - { - let min = 1; - while (src[++pos] === '@') ++min; - let width = min; - pos -= 1; - while (src[++pos] === '#') ++width; - return { - char, - min, - width - }; - } - case 'E': - { - const plus = src[pos + 1] === '+'; - if (plus) ++pos; - let expDigits = 0; - while (src[++pos] === '0') ++expDigits; - const width = (plus ? 2 : 1) + expDigits; - if (expDigits) return { - char, - expDigits, - plus, - width - };else break; - } - case '.': - case ',': - return { - char, - width: 1 - }; - } - return null; - } - - function parseSubpattern(src, pos, onError) { - let State; - (function (State) { - State[State["Prefix"] = 0] = "Prefix"; - State[State["Number"] = 1] = "Number"; - State[State["Suffix"] = 2] = "Suffix"; - })(State || (State = {})); - const prefix = []; - const number = []; - const suffix = []; - let state = State.Prefix; - let str = ''; - while (pos < src.length) { - const char = src[pos]; - if (char === ';') { - pos += 1; - break; - } - switch (state) { - case State.Prefix: - { - const token = parseAffixToken(src, pos, onError); - if (token) { - if (str) { - prefix.push({ - char: "'", - str, - width: str.length - }); - str = ''; - } - prefix.push(token); - pos += token.width; - } else { - const token = parseNumberToken(src, pos); - if (token) { - if (str) { - prefix.push({ - char: "'", - str, - width: str.length - }); - str = ''; - } - state = State.Number; - number.push(token); - pos += token.width; - } else { - str += char; - pos += 1; - } - } - break; - } - case State.Number: - { - const token = parseNumberToken(src, pos); - if (token) { - number.push(token); - pos += token.width; - } else { - state = State.Suffix; - } - break; - } - case State.Suffix: - { - const token = parseAffixToken(src, pos, onError); - if (token) { - if (str) { - suffix.push({ - char: "'", - str, - width: str.length - }); - str = ''; - } - suffix.push(token); - pos += token.width; - } else { - str += char; - pos += 1; - } - break; - } - } - } - if (str) suffix.push({ - char: "'", - str, - width: str.length - }); - return { - pattern: { - prefix, - number, - suffix - }, - pos - }; - } - function parseTokens(src, onError) { - const { - pattern, - pos - } = parseSubpattern(src, 0, onError); - if (pos < src.length) { - const { - pattern: negative - } = parseSubpattern(src, pos, onError); - return { - tokens: pattern, - negative - }; - } - return { - tokens: pattern - }; - } - - function parseNumberAsSkeleton(tokens, onError) { - const res = {}; - let hasGroups = false; - let hasExponent = false; - let intOptional = 0; - let intDigits = ''; - let decimalPos = -1; - let fracDigits = ''; - let fracOptional = 0; - for (let pos = 0; pos < tokens.length; ++pos) { - const token = tokens[pos]; - switch (token.char) { - case '#': - { - if (decimalPos === -1) { - if (intDigits) { - const msg = 'Pattern has # after integer digits'; - onError(new PatternError('#', msg)); - } - intOptional += token.width; - } else { - fracOptional += token.width; - } - break; - } - case '0': - { - if (decimalPos === -1) { - intDigits += token.digits; - } else { - if (fracOptional) { - const msg = 'Pattern has digits after # in fraction'; - onError(new PatternError('0', msg)); - } - fracDigits += token.digits; - } - break; - } - case '@': - { - if (res.precision) onError(new MaskedValueError('precision', res.precision)); - res.precision = { - style: 'precision-fraction', - minSignificant: token.min, - maxSignificant: token.width - }; - break; - } - case ',': - hasGroups = true; - break; - case '.': - if (decimalPos === 1) { - const msg = 'Pattern has more than one decimal separator'; - onError(new PatternError('.', msg)); - } - decimalPos = pos; - break; - case 'E': - { - if (hasExponent) onError(new MaskedValueError('exponent', res.notation)); - if (hasGroups) { - const msg = 'Exponential patterns may not contain grouping separators'; - onError(new PatternError('E', msg)); - } - res.notation = { - style: 'scientific' - }; - if (token.expDigits > 1) res.notation.expDigits = token.expDigits; - if (token.plus) res.notation.expSign = 'sign-always'; - hasExponent = true; - } - } - } - // imprecise mapping due to paradigm differences - if (hasGroups) res.group = 'group-auto';else if (intOptional + intDigits.length > 3) res.group = 'group-off'; - const increment = Number(`${intDigits || '0'}.${fracDigits}`); - if (increment) res.precision = { - style: 'precision-increment', - increment - }; - if (!hasExponent) { - if (intDigits.length > 1) res.integerWidth = { - min: intDigits.length - }; - if (!res.precision && (fracDigits.length || fracOptional)) { - res.precision = { - style: 'precision-fraction', - minFraction: fracDigits.length, - maxFraction: fracDigits.length + fracOptional - }; - } - } else { - if (!res.precision || increment) { - res.integerWidth = intOptional ? { - min: 1, - max: intOptional + intDigits.length - } : { - min: Math.max(1, intDigits.length) - }; - } - if (res.precision) { - if (!increment) res.integerWidth = { - min: 1, - max: 1 - }; - } else { - const dc = intDigits.length + fracDigits.length; - if (decimalPos === -1) { - if (dc > 0) res.precision = { - style: 'precision-fraction', - maxSignificant: dc - }; - } else { - res.precision = { - style: 'precision-fraction', - maxSignificant: Math.max(1, dc) + fracOptional - }; - if (dc > 1) res.precision.minSignificant = dc; - } - } - } - return res; - } - - function handleAffix(affixTokens, res, currency, onError, isPrefix) { - let inFmt = false; - let str = ''; - for (const token of affixTokens) { - switch (token.char) { - case '%': - res.unit = { - style: token.style - }; - if (isPrefix) inFmt = true;else str = ''; - break; - case '¤': - if (!currency) { - const msg = `The ¤ pattern requires a currency`; - onError(new PatternError('¤', msg)); - break; - } - res.unit = { - style: 'currency', - currency - }; - switch (token.currency) { - case 'iso-code': - res.unitWidth = 'unit-width-iso-code'; - break; - case 'full-name': - res.unitWidth = 'unit-width-full-name'; - break; - case 'narrow': - res.unitWidth = 'unit-width-narrow'; - break; - } - if (isPrefix) inFmt = true;else str = ''; - break; - case '*': - // TODO - break; - case '+': - if (!inFmt) str += '+'; - break; - case "'": - if (!inFmt) str += token.str; - break; - } - } - return str; - } - function getNegativeAffix(affixTokens, isPrefix) { - let inFmt = false; - let str = ''; - for (const token of affixTokens) { - switch (token.char) { - case '%': - case '¤': - if (isPrefix) inFmt = true;else str = ''; - break; - case '-': - if (!inFmt) str += '-'; - break; - case "'": - if (!inFmt) str += token.str; - break; - } - } - return str; - } - /** - * Parse an {@link - * http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns | - * ICU NumberFormatter pattern} string into a {@link Skeleton} structure. - * - * @public - * @param src - The pattern string - * @param currency - If the pattern includes ¤ tokens, their skeleton - * representation requires a three-letter currency code. - * @param onError - Called when the parser encounters a syntax error. The - * function will still return a {@link Skeleton}, but it will be incomplete - * and/or inaccurate. If not defined, the error will be thrown instead. - * - * @remarks - * Unlike the skeleton parser, the pattern parser is not able to return partial - * results on error, and will instead throw. Output padding is not supported. - * - * @example - * ```js - * import { parseNumberPattern } from '@messageformat/number-skeleton' - * - * parseNumberPattern('#,##0.00 ¤', 'EUR', console.error) - * // { - * // group: 'group-auto', - * // precision: { - * // style: 'precision-fraction', - * // minFraction: 2, - * // maxFraction: 2 - * // }, - * // unit: { style: 'currency', currency: 'EUR' } - * // } - * ``` - */ - function parseNumberPattern(src, currency) { - let onError = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : error => { - throw error; - }; - const { - tokens, - negative - } = parseTokens(src, onError); - const res = parseNumberAsSkeleton(tokens.number, onError); - const prefix = handleAffix(tokens.prefix, res, currency, onError, true); - const suffix = handleAffix(tokens.suffix, res, currency, onError, false); - if (negative) { - const negPrefix = getNegativeAffix(negative.prefix, true); - const negSuffix = getNegativeAffix(negative.suffix, false); - res.affix = { - pos: [prefix, suffix], - neg: [negPrefix, negSuffix] - }; - res.sign = 'sign-never'; - } else if (prefix || suffix) { - res.affix = { - pos: [prefix, suffix] - }; - } - return res; - } - - /** @internal */ - function isNumberingSystem(ns) { - const systems = ['arab', 'arabext', 'bali', 'beng', 'deva', 'fullwide', 'gujr', 'guru', 'hanidec', 'khmr', 'knda', 'laoo', 'latn', 'limb', 'mlym', 'mong', 'mymr', 'orya', 'tamldec', 'telu', 'thai', 'tibt']; - return systems.indexOf(ns) !== -1; - } - - // FIXME: subtype is not checked - /** @internal */ - function isUnit(unit) { - const types = ['acceleration', 'angle', 'area', 'concentr', 'consumption', 'digital', 'duration', 'electric', 'energy', 'force', 'frequency', 'graphics', 'length', 'light', 'mass', 'power', 'pressure', 'speed', 'temperature', 'torque', 'volume']; - const [type] = unit.split('-', 1); - return types.indexOf(type) !== -1; - } - - const maxOptions = { - 'compact-short': 0, - 'compact-long': 0, - 'notation-simple': 0, - scientific: 2, - engineering: 2, - percent: 0, - permille: 0, - 'base-unit': 0, - currency: 1, - 'measure-unit': 1, - 'per-measure-unit': 1, - 'unit-width-narrow': 0, - 'unit-width-short': 0, - 'unit-width-full-name': 0, - 'unit-width-iso-code': 0, - 'unit-width-hidden': 0, - 'precision-integer': 0, - 'precision-unlimited': 0, - 'precision-currency-standard': 1, - 'precision-currency-cash': 0, - 'precision-increment': 1, - 'rounding-mode-ceiling': 0, - 'rounding-mode-floor': 0, - 'rounding-mode-down': 0, - 'rounding-mode-up': 0, - 'rounding-mode-half-even': 0, - 'rounding-mode-half-down': 0, - 'rounding-mode-half-up': 0, - 'rounding-mode-unnecessary': 0, - 'integer-width': 1, - scale: 1, - 'group-off': 0, - 'group-min2': 0, - 'group-auto': 0, - 'group-on-aligned': 0, - 'group-thousands': 0, - latin: 0, - 'numbering-system': 1, - 'sign-auto': 0, - 'sign-always': 0, - 'sign-never': 0, - 'sign-accounting': 0, - 'sign-accounting-always': 0, - 'sign-except-zero': 0, - 'sign-accounting-except-zero': 0, - 'decimal-auto': 0, - 'decimal-always': 0 - }; - const minOptions = { - currency: 1, - 'integer-width': 1, - 'measure-unit': 1, - 'numbering-system': 1, - 'per-measure-unit': 1, - 'precision-increment': 1, - scale: 1 - }; - function hasMaxOption(stem) { - return stem in maxOptions; - } - function hasMinOption(stem) { - return stem in minOptions; - } - /** @internal */ - function validOptions(stem, options, onError) { - if (hasMaxOption(stem)) { - const maxOpt = maxOptions[stem]; - if (options.length > maxOpt) { - if (maxOpt === 0) { - for (const opt of options) onError(new BadOptionError(stem, opt)); - } else { - onError(new TooManyOptionsError(stem, options, maxOpt)); - } - return false; - } else if (hasMinOption(stem) && options.length < minOptions[stem]) { - onError(new MissingOptionError(stem)); - return false; - } - } - return true; - } - - function parseBlueprintDigits(src, style) { - const re = style === 'fraction' ? /^\.(0*)(\+|#*)$/ : /^(@+)(\+|#*)$/; - const match = src && src.match(re); - if (match) { - const min = match[1].length; - switch (match[2].charAt(0)) { - case '': - return { - min, - max: min - }; - case '+': - return { - min, - max: null - }; - case '#': - { - return { - min, - max: min + match[2].length - }; - } - } - } - return null; - } - function parsePrecisionBlueprint(stem, options, onError) { - const fd = parseBlueprintDigits(stem, 'fraction'); - if (fd) { - if (options.length > 1) onError(new TooManyOptionsError(stem, options, 1)); - const res = { - style: 'precision-fraction', - source: stem, - minFraction: fd.min - }; - if (fd.max != null) res.maxFraction = fd.max; - const option = options[0]; - const sd = parseBlueprintDigits(option, 'significant'); - if (sd) { - res.source = `${stem}/${option}`; - res.minSignificant = sd.min; - if (sd.max != null) res.maxSignificant = sd.max; - } else if (option) onError(new BadOptionError(stem, option)); - return res; - } - const sd = parseBlueprintDigits(stem, 'significant'); - if (sd) { - for (const opt of options) onError(new BadOptionError(stem, opt)); - const res = { - style: 'precision-fraction', - source: stem, - minSignificant: sd.min - }; - if (sd.max != null) res.maxSignificant = sd.max; - return res; - } - return null; - } - - /** @internal */ - class TokenParser { - constructor(onError) { - this.skeleton = {}; - this.onError = onError; - } - badOption(stem, opt) { - this.onError(new BadOptionError(stem, opt)); - } - assertEmpty(key) { - const prev = this.skeleton[key]; - if (prev) this.onError(new MaskedValueError(key, prev)); - } - parseToken(stem, options) { - if (!validOptions(stem, options, this.onError)) return; - const option = options[0]; - const res = this.skeleton; - switch (stem) { - // notation - case 'compact-short': - case 'compact-long': - case 'notation-simple': - this.assertEmpty('notation'); - res.notation = { - style: stem - }; - break; - case 'scientific': - case 'engineering': - { - let expDigits = null; - let expSign = undefined; - for (const opt of options) { - switch (opt) { - case 'sign-auto': - case 'sign-always': - case 'sign-never': - case 'sign-accounting': - case 'sign-accounting-always': - case 'sign-except-zero': - case 'sign-accounting-except-zero': - expSign = opt; - break; - default: - if (/^\+e+$/.test(opt)) expDigits = opt.length - 1;else { - this.badOption(stem, opt); - } - } - } - this.assertEmpty('notation'); - const source = options.join('/'); - res.notation = expDigits && expSign ? { - style: stem, - source, - expDigits, - expSign - } : expDigits ? { - style: stem, - source, - expDigits - } : expSign ? { - style: stem, - source, - expSign - } : { - style: stem, - source - }; - break; - } - // unit - case 'percent': - case 'permille': - case 'base-unit': - this.assertEmpty('unit'); - res.unit = { - style: stem - }; - break; - case 'currency': - if (/^[A-Z]{3}$/.test(option)) { - this.assertEmpty('unit'); - res.unit = { - style: stem, - currency: option - }; - } else this.badOption(stem, option); - break; - case 'measure-unit': - { - if (isUnit(option)) { - this.assertEmpty('unit'); - res.unit = { - style: stem, - unit: option - }; - } else this.badOption(stem, option); - break; - } - // unitPer - case 'per-measure-unit': - { - if (isUnit(option)) { - this.assertEmpty('unitPer'); - res.unitPer = option; - } else this.badOption(stem, option); - break; - } - // unitWidth - case 'unit-width-narrow': - case 'unit-width-short': - case 'unit-width-full-name': - case 'unit-width-iso-code': - case 'unit-width-hidden': - this.assertEmpty('unitWidth'); - res.unitWidth = stem; - break; - // precision - case 'precision-integer': - case 'precision-unlimited': - case 'precision-currency-cash': - this.assertEmpty('precision'); - res.precision = { - style: stem - }; - break; - case 'precision-currency-standard': - this.assertEmpty('precision'); - if (option === 'w') { - res.precision = { - style: stem, - trailingZero: 'stripIfInteger' - }; - } else { - res.precision = { - style: stem - }; - } - break; - case 'precision-increment': - { - const increment = Number(option); - if (increment > 0) { - this.assertEmpty('precision'); - res.precision = { - style: stem, - increment - }; - } else this.badOption(stem, option); - break; - } - // roundingMode - case 'rounding-mode-ceiling': - case 'rounding-mode-floor': - case 'rounding-mode-down': - case 'rounding-mode-up': - case 'rounding-mode-half-even': - case 'rounding-mode-half-odd': - case 'rounding-mode-half-ceiling': - case 'rounding-mode-half-floor': - case 'rounding-mode-half-down': - case 'rounding-mode-half-up': - case 'rounding-mode-unnecessary': - this.assertEmpty('roundingMode'); - res.roundingMode = stem; - break; - // integerWidth - case 'integer-width': - { - if (/^\+0*$/.test(option)) { - this.assertEmpty('integerWidth'); - res.integerWidth = { - source: option, - min: option.length - 1 - }; - } else { - const m = option.match(/^#*(0*)$/); - if (m) { - this.assertEmpty('integerWidth'); - res.integerWidth = { - source: option, - min: m[1].length, - max: m[0].length - }; - } else this.badOption(stem, option); - } - break; - } - // scale - case 'scale': - { - const scale = Number(option); - if (scale > 0) { - this.assertEmpty('scale'); - res.scale = scale; - } else this.badOption(stem, option); - break; - } - // group - case 'group-off': - case 'group-min2': - case 'group-auto': - case 'group-on-aligned': - case 'group-thousands': - this.assertEmpty('group'); - res.group = stem; - break; - // numberingSystem - case 'latin': - this.assertEmpty('numberingSystem'); - res.numberingSystem = 'latn'; - break; - case 'numbering-system': - { - if (isNumberingSystem(option)) { - this.assertEmpty('numberingSystem'); - res.numberingSystem = option; - } else this.badOption(stem, option); - break; - } - // sign - case 'sign-auto': - case 'sign-always': - case 'sign-never': - case 'sign-accounting': - case 'sign-accounting-always': - case 'sign-except-zero': - case 'sign-accounting-except-zero': - this.assertEmpty('sign'); - res.sign = stem; - break; - // decimal - case 'decimal-auto': - case 'decimal-always': - this.assertEmpty('decimal'); - res.decimal = stem; - break; - // precision blueprint - default: - { - const precision = parsePrecisionBlueprint(stem, options, this.onError); - if (precision) { - this.assertEmpty('precision'); - res.precision = precision; - } else { - this.onError(new BadStemError(stem)); - } - } - } - } - } - - /** - * Parse an {@link - * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md - * | ICU NumberFormatter skeleton} string into a {@link Skeleton} structure. - * - * @public - * @param src - The skeleton string - * @param onError - Called when the parser encounters a syntax error. The - * function will still return a {@link Skeleton}, but it may not contain - * information for all tokens. If not defined, the error will be thrown - * instead. - * - * @example - * ```js - * import { parseNumberSkeleton } from '@messageformat/number-skeleton' - * - * parseNumberSkeleton('compact-short currency/GBP', console.error) - * // { - * // notation: { style: 'compact-short' }, - * // unit: { style: 'currency', currency: 'GBP' } - * // } - * ``` - */ - function parseNumberSkeleton(src) { - let onError = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : error => { - throw error; - }; - const tokens = []; - for (const part of src.split(' ')) { - if (part) { - const options = part.split('/'); - const stem = options.shift() || ''; - tokens.push({ - stem, - options - }); - } - } - const parser = new TokenParser(onError); - for (const { - stem, - options - } of tokens) { - parser.parseToken(stem, options); - } - return parser.skeleton; - } - - /** - * Returns a number formatter function for the given locales and number skeleton - * - * @remarks - * Uses `Intl.NumberFormat` (ES2020) internally. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param skeleton - An ICU NumberFormatter pattern or `::`-prefixed skeleton - * string, or a parsed `Skeleton` structure - * @param currency - If `skeleton` is a pattern string that includes ¤ tokens, - * their skeleton representation requires a three-letter currency code. - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getNumberFormatter } from '@messageformat/number-skeleton' - * - * let src = ':: currency/CAD unit-width-narrow' - * let fmt = getNumberFormatter('en-CA', src, console.error) - * fmt(42) // '$42.00' - * - * src = '::percent scale/100' - * fmt = getNumberFormatter('en', src, console.error) - * fmt(0.3) // '30%' - * ``` - */ - function getNumberFormatter(locales, skeleton, currency, onError) { - if (typeof skeleton === 'string') { - skeleton = skeleton.indexOf('::') === 0 ? parseNumberSkeleton(skeleton.slice(2), onError) : parseNumberPattern(skeleton, currency, onError); - } - const lc = getNumberFormatLocales(locales, skeleton); - const opt = getNumberFormatOptions(skeleton, onError); - const mod = getNumberFormatModifier(skeleton); - const nf = new Intl.NumberFormat(lc, opt); - if (skeleton.affix) { - const [p0, p1] = skeleton.affix.pos; - const [n0, n1] = skeleton.affix.neg || ['', '']; - return value => { - const n = nf.format(mod(value)); - return value < 0 ? `${n0}${n}${n1}` : `${p0}${n}${p1}`; - }; - } - return value => nf.format(mod(value)); - } - /** - * Returns a string of JavaScript source that evaluates to a number formatter - * function with the same `(value: number) => string` signature as the function - * returned by {@link getNumberFormatter}. - * - * @remarks - * The returned function will memoize an `Intl.NumberFormat` instance. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param skeleton - An ICU NumberFormatter pattern or `::`-prefixed skeleton - * string, or a parsed `Skeleton` structure - * @param currency - If `skeleton` is a pattern string that includes ¤ tokens, - * their skeleton representation requires a three-letter currency code. - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getNumberFormatterSource } from '@messageformat/number-skeleton' - * - * getNumberFormatterSource('en', '::percent', console.error) - * // '(function() {\n' + - * // ' var opt = {"style":"percent"};\n' + - * // ' var nf = new Intl.NumberFormat(["en"], opt);\n' + - * // ' var mod = function(n) { return n * 0.01; };\n' + - * // ' return function(value) { return nf.format(mod(value)); }\n' + - * // '})()' - * - * const src = getNumberFormatterSource('en-CA', ':: currency/CAD unit-width-narrow', console.error) - * // '(function() {\n' + - * // ' var opt = {"style":"currency","currency":"CAD","currencyDisplay":"narrowSymbol","unitDisplay":"narrow"};\n' + - * // ' var nf = new Intl.NumberFormat(["en-CA"], opt);\n' - * // ' return function(value) { return nf.format(value); }\n' + - * // '})()' - * const fmt = new Function(`return ${src}`)() - * fmt(42) // '$42.00' - * ``` - */ - function getNumberFormatterSource(locales, skeleton, currency, onError) { - if (typeof skeleton === 'string') { - skeleton = skeleton.indexOf('::') === 0 ? parseNumberSkeleton(skeleton.slice(2), onError) : parseNumberPattern(skeleton, currency, onError); - } - const lc = getNumberFormatLocales(locales, skeleton); - const opt = getNumberFormatOptions(skeleton, onError); - const modSrc = getNumberFormatModifierSource(skeleton); - const lines = [`(function() {`, `var opt = ${JSON.stringify(opt)};`, `var nf = new Intl.NumberFormat(${JSON.stringify(lc)}, opt);`]; - let res = 'nf.format(value)'; - if (modSrc) { - lines.push(`var mod = ${modSrc};`); - res = 'nf.format(mod(value))'; - } - if (skeleton.affix) { - const [p0, p1] = skeleton.affix.pos.map(s => JSON.stringify(s)); - if (skeleton.affix.neg) { - const [n0, n1] = skeleton.affix.neg.map(s => JSON.stringify(s)); - res = `value < 0 ? ${n0} + ${res} + ${n1} : ${p0} + ${res} + ${p1}`; - } else { - res = `${p0} + ${res} + ${p1}`; - } - } - lines.push(`return function(value) { return ${res}; }`); - return lines.join('\n ') + '\n})()'; - } - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - var parser = {}; - - var lexer = {}; - - var mooExports = {}; - var moo = { - get exports(){ return mooExports; }, - set exports(v){ mooExports = v; }, - }; - - (function (module) { - (function (root, factory) { - if (module.exports) { - module.exports = factory(); - } else { - root.moo = factory(); - } - })(commonjsGlobal, function () { - - var hasOwnProperty = Object.prototype.hasOwnProperty; - var toString = Object.prototype.toString; - var hasSticky = typeof new RegExp().sticky === 'boolean'; - - /***************************************************************************/ - - function isRegExp(o) { - return o && toString.call(o) === '[object RegExp]'; - } - function isObject(o) { - return o && typeof o === 'object' && !isRegExp(o) && !Array.isArray(o); - } - function reEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); - } - function reGroups(s) { - var re = new RegExp('|' + s); - return re.exec('').length - 1; - } - function reCapture(s) { - return '(' + s + ')'; - } - function reUnion(regexps) { - if (!regexps.length) return '(?!)'; - var source = regexps.map(function (s) { - return "(?:" + s + ")"; - }).join('|'); - return "(?:" + source + ")"; - } - function regexpOrLiteral(obj) { - if (typeof obj === 'string') { - return '(?:' + reEscape(obj) + ')'; - } else if (isRegExp(obj)) { - // TODO: consider /u support - if (obj.ignoreCase) throw new Error('RegExp /i flag not allowed'); - if (obj.global) throw new Error('RegExp /g flag is implied'); - if (obj.sticky) throw new Error('RegExp /y flag is implied'); - if (obj.multiline) throw new Error('RegExp /m flag is implied'); - return obj.source; - } else { - throw new Error('Not a pattern: ' + obj); - } - } - function pad(s, length) { - if (s.length > length) { - return s; - } - return Array(length - s.length + 1).join(" ") + s; - } - function lastNLines(string, numLines) { - var position = string.length; - var lineBreaks = 0; - while (true) { - var idx = string.lastIndexOf("\n", position - 1); - if (idx === -1) { - break; - } else { - lineBreaks++; - } - position = idx; - if (lineBreaks === numLines) { - break; - } - if (position === 0) { - break; - } - } - var startPosition = lineBreaks < numLines ? 0 : position + 1; - return string.substring(startPosition).split("\n"); - } - function objectToRules(object) { - var keys = Object.getOwnPropertyNames(object); - var result = []; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var thing = object[key]; - var rules = [].concat(thing); - if (key === 'include') { - for (var j = 0; j < rules.length; j++) { - result.push({ - include: rules[j] - }); - } - continue; - } - var match = []; - rules.forEach(function (rule) { - if (isObject(rule)) { - if (match.length) result.push(ruleOptions(key, match)); - result.push(ruleOptions(key, rule)); - match = []; - } else { - match.push(rule); - } - }); - if (match.length) result.push(ruleOptions(key, match)); - } - return result; - } - function arrayToRules(array) { - var result = []; - for (var i = 0; i < array.length; i++) { - var obj = array[i]; - if (obj.include) { - var include = [].concat(obj.include); - for (var j = 0; j < include.length; j++) { - result.push({ - include: include[j] - }); - } - continue; - } - if (!obj.type) { - throw new Error('Rule has no type: ' + JSON.stringify(obj)); - } - result.push(ruleOptions(obj.type, obj)); - } - return result; - } - function ruleOptions(type, obj) { - if (!isObject(obj)) { - obj = { - match: obj - }; - } - if (obj.include) { - throw new Error('Matching rules cannot also include states'); - } - - // nb. error and fallback imply lineBreaks - var options = { - defaultType: type, - lineBreaks: !!obj.error || !!obj.fallback, - pop: false, - next: null, - push: null, - error: false, - fallback: false, - value: null, - type: null, - shouldThrow: false - }; - - // Avoid Object.assign(), so we support IE9+ - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - options[key] = obj[key]; - } - } - - // type transform cannot be a string - if (typeof options.type === 'string' && type !== options.type) { - throw new Error("Type transform cannot be a string (type '" + options.type + "' for token '" + type + "')"); - } - - // convert to array - var match = options.match; - options.match = Array.isArray(match) ? match : match ? [match] : []; - options.match.sort(function (a, b) { - return isRegExp(a) && isRegExp(b) ? 0 : isRegExp(b) ? -1 : isRegExp(a) ? +1 : b.length - a.length; - }); - return options; - } - function toRules(spec) { - return Array.isArray(spec) ? arrayToRules(spec) : objectToRules(spec); - } - var defaultErrorRule = ruleOptions('error', { - lineBreaks: true, - shouldThrow: true - }); - function compileRules(rules, hasStates) { - var errorRule = null; - var fast = Object.create(null); - var fastAllowed = true; - var unicodeFlag = null; - var groups = []; - var parts = []; - - // If there is a fallback rule, then disable fast matching - for (var i = 0; i < rules.length; i++) { - if (rules[i].fallback) { - fastAllowed = false; - } - } - for (var i = 0; i < rules.length; i++) { - var options = rules[i]; - if (options.include) { - // all valid inclusions are removed by states() preprocessor - throw new Error('Inheritance is not allowed in stateless lexers'); - } - if (options.error || options.fallback) { - // errorRule can only be set once - if (errorRule) { - if (!options.fallback === !errorRule.fallback) { - throw new Error("Multiple " + (options.fallback ? "fallback" : "error") + " rules not allowed (for token '" + options.defaultType + "')"); - } else { - throw new Error("fallback and error are mutually exclusive (for token '" + options.defaultType + "')"); - } - } - errorRule = options; - } - var match = options.match.slice(); - if (fastAllowed) { - while (match.length && typeof match[0] === 'string' && match[0].length === 1) { - var word = match.shift(); - fast[word.charCodeAt(0)] = options; - } - } - - // Warn about inappropriate state-switching options - if (options.pop || options.push || options.next) { - if (!hasStates) { - throw new Error("State-switching options are not allowed in stateless lexers (for token '" + options.defaultType + "')"); - } - if (options.fallback) { - throw new Error("State-switching options are not allowed on fallback tokens (for token '" + options.defaultType + "')"); - } - } - - // Only rules with a .match are included in the RegExp - if (match.length === 0) { - continue; - } - fastAllowed = false; - groups.push(options); - - // Check unicode flag is used everywhere or nowhere - for (var j = 0; j < match.length; j++) { - var obj = match[j]; - if (!isRegExp(obj)) { - continue; - } - if (unicodeFlag === null) { - unicodeFlag = obj.unicode; - } else if (unicodeFlag !== obj.unicode && options.fallback === false) { - throw new Error('If one rule is /u then all must be'); - } - } - - // convert to RegExp - var pat = reUnion(match.map(regexpOrLiteral)); - - // validate - var regexp = new RegExp(pat); - if (regexp.test("")) { - throw new Error("RegExp matches empty string: " + regexp); - } - var groupCount = reGroups(pat); - if (groupCount > 0) { - throw new Error("RegExp has capture groups: " + regexp + "\nUse (?: … ) instead"); - } - - // try and detect rules matching newlines - if (!options.lineBreaks && regexp.test('\n')) { - throw new Error('Rule should declare lineBreaks: ' + regexp); - } - - // store regex - parts.push(reCapture(pat)); - } - - // If there's no fallback rule, use the sticky flag so we only look for - // matches at the current index. - // - // If we don't support the sticky flag, then fake it using an irrefutable - // match (i.e. an empty pattern). - var fallbackRule = errorRule && errorRule.fallback; - var flags = hasSticky && !fallbackRule ? 'ym' : 'gm'; - var suffix = hasSticky || fallbackRule ? '' : '|'; - if (unicodeFlag === true) flags += "u"; - var combined = new RegExp(reUnion(parts) + suffix, flags); - return { - regexp: combined, - groups: groups, - fast: fast, - error: errorRule || defaultErrorRule - }; - } - function compile(rules) { - var result = compileRules(toRules(rules)); - return new Lexer({ - start: result - }, 'start'); - } - function checkStateGroup(g, name, map) { - var state = g && (g.push || g.next); - if (state && !map[state]) { - throw new Error("Missing state '" + state + "' (in token '" + g.defaultType + "' of state '" + name + "')"); - } - if (g && g.pop && +g.pop !== 1) { - throw new Error("pop must be 1 (in token '" + g.defaultType + "' of state '" + name + "')"); - } - } - function compileStates(states, start) { - var all = states.$all ? toRules(states.$all) : []; - delete states.$all; - var keys = Object.getOwnPropertyNames(states); - if (!start) start = keys[0]; - var ruleMap = Object.create(null); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - ruleMap[key] = toRules(states[key]).concat(all); - } - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var rules = ruleMap[key]; - var included = Object.create(null); - for (var j = 0; j < rules.length; j++) { - var rule = rules[j]; - if (!rule.include) continue; - var splice = [j, 1]; - if (rule.include !== key && !included[rule.include]) { - included[rule.include] = true; - var newRules = ruleMap[rule.include]; - if (!newRules) { - throw new Error("Cannot include nonexistent state '" + rule.include + "' (in state '" + key + "')"); - } - for (var k = 0; k < newRules.length; k++) { - var newRule = newRules[k]; - if (rules.indexOf(newRule) !== -1) continue; - splice.push(newRule); - } - } - rules.splice.apply(rules, splice); - j--; - } - } - var map = Object.create(null); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - map[key] = compileRules(ruleMap[key], true); - } - for (var i = 0; i < keys.length; i++) { - var name = keys[i]; - var state = map[name]; - var groups = state.groups; - for (var j = 0; j < groups.length; j++) { - checkStateGroup(groups[j], name, map); - } - var fastKeys = Object.getOwnPropertyNames(state.fast); - for (var j = 0; j < fastKeys.length; j++) { - checkStateGroup(state.fast[fastKeys[j]], name, map); - } - } - return new Lexer(map, start); - } - function keywordTransform(map) { - // Use a JavaScript Map to map keywords to their corresponding token type - // unless Map is unsupported, then fall back to using an Object: - var isMap = typeof Map !== 'undefined'; - var reverseMap = isMap ? new Map() : Object.create(null); - var types = Object.getOwnPropertyNames(map); - for (var i = 0; i < types.length; i++) { - var tokenType = types[i]; - var item = map[tokenType]; - var keywordList = Array.isArray(item) ? item : [item]; - keywordList.forEach(function (keyword) { - if (typeof keyword !== 'string') { - throw new Error("keyword must be string (in keyword '" + tokenType + "')"); - } - if (isMap) { - reverseMap.set(keyword, tokenType); - } else { - reverseMap[keyword] = tokenType; - } - }); - } - return function (k) { - return isMap ? reverseMap.get(k) : reverseMap[k]; - }; - } - - /***************************************************************************/ - - var Lexer = function (states, state) { - this.startState = state; - this.states = states; - this.buffer = ''; - this.stack = []; - this.reset(); - }; - Lexer.prototype.reset = function (data, info) { - this.buffer = data || ''; - this.index = 0; - this.line = info ? info.line : 1; - this.col = info ? info.col : 1; - this.queuedToken = info ? info.queuedToken : null; - this.queuedText = info ? info.queuedText : ""; - this.queuedThrow = info ? info.queuedThrow : null; - this.setState(info ? info.state : this.startState); - this.stack = info && info.stack ? info.stack.slice() : []; - return this; - }; - Lexer.prototype.save = function () { - return { - line: this.line, - col: this.col, - state: this.state, - stack: this.stack.slice(), - queuedToken: this.queuedToken, - queuedText: this.queuedText, - queuedThrow: this.queuedThrow - }; - }; - Lexer.prototype.setState = function (state) { - if (!state || this.state === state) return; - this.state = state; - var info = this.states[state]; - this.groups = info.groups; - this.error = info.error; - this.re = info.regexp; - this.fast = info.fast; - }; - Lexer.prototype.popState = function () { - this.setState(this.stack.pop()); - }; - Lexer.prototype.pushState = function (state) { - this.stack.push(this.state); - this.setState(state); - }; - var eat = hasSticky ? function (re, buffer) { - // assume re is /y - return re.exec(buffer); - } : function (re, buffer) { - // assume re is /g - var match = re.exec(buffer); - // will always match, since we used the |(?:) trick - if (match[0].length === 0) { - return null; - } - return match; - }; - Lexer.prototype._getGroup = function (match) { - var groupCount = this.groups.length; - for (var i = 0; i < groupCount; i++) { - if (match[i + 1] !== undefined) { - return this.groups[i]; - } - } - throw new Error('Cannot find token type for matched text'); - }; - function tokenToString() { - return this.value; - } - Lexer.prototype.next = function () { - var index = this.index; - - // If a fallback token matched, we don't need to re-run the RegExp - if (this.queuedGroup) { - var token = this._token(this.queuedGroup, this.queuedText, index); - this.queuedGroup = null; - this.queuedText = ""; - return token; - } - var buffer = this.buffer; - if (index === buffer.length) { - return; // EOF - } - - // Fast matching for single characters - var group = this.fast[buffer.charCodeAt(index)]; - if (group) { - return this._token(group, buffer.charAt(index), index); - } - - // Execute RegExp - var re = this.re; - re.lastIndex = index; - var match = eat(re, buffer); - - // Error tokens match the remaining buffer - var error = this.error; - if (match == null) { - return this._token(error, buffer.slice(index, buffer.length), index); - } - var group = this._getGroup(match); - var text = match[0]; - if (error.fallback && match.index !== index) { - this.queuedGroup = group; - this.queuedText = text; - - // Fallback tokens contain the unmatched portion of the buffer - return this._token(error, buffer.slice(index, match.index), index); - } - return this._token(group, text, index); - }; - Lexer.prototype._token = function (group, text, offset) { - // count line breaks - var lineBreaks = 0; - if (group.lineBreaks) { - var matchNL = /\n/g; - var nl = 1; - if (text === '\n') { - lineBreaks = 1; - } else { - while (matchNL.exec(text)) { - lineBreaks++; - nl = matchNL.lastIndex; - } - } - } - var token = { - type: typeof group.type === 'function' && group.type(text) || group.defaultType, - value: typeof group.value === 'function' ? group.value(text) : text, - text: text, - toString: tokenToString, - offset: offset, - lineBreaks: lineBreaks, - line: this.line, - col: this.col - }; - // nb. adding more props to token object will make V8 sad! - - var size = text.length; - this.index += size; - this.line += lineBreaks; - if (lineBreaks !== 0) { - this.col = size - nl + 1; - } else { - this.col += size; - } - - // throw, if no rule with {error: true} - if (group.shouldThrow) { - var err = new Error(this.formatError(token, "invalid syntax")); - throw err; - } - if (group.pop) this.popState();else if (group.push) this.pushState(group.push);else if (group.next) this.setState(group.next); - return token; - }; - if (typeof Symbol !== 'undefined' && Symbol.iterator) { - var LexerIterator = function (lexer) { - this.lexer = lexer; - }; - LexerIterator.prototype.next = function () { - var token = this.lexer.next(); - return { - value: token, - done: !token - }; - }; - LexerIterator.prototype[Symbol.iterator] = function () { - return this; - }; - Lexer.prototype[Symbol.iterator] = function () { - return new LexerIterator(this); - }; - } - Lexer.prototype.formatError = function (token, message) { - if (token == null) { - // An undefined token indicates EOF - var text = this.buffer.slice(this.index); - var token = { - text: text, - offset: this.index, - lineBreaks: text.indexOf('\n') === -1 ? 0 : 1, - line: this.line, - col: this.col - }; - } - var numLinesAround = 2; - var firstDisplayedLine = Math.max(token.line - numLinesAround, 1); - var lastDisplayedLine = token.line + numLinesAround; - var lastLineDigits = String(lastDisplayedLine).length; - var displayedLines = lastNLines(this.buffer, this.line - token.line + numLinesAround + 1).slice(0, 5); - var errorLines = []; - errorLines.push(message + " at line " + token.line + " col " + token.col + ":"); - errorLines.push(""); - for (var i = 0; i < displayedLines.length; i++) { - var line = displayedLines[i]; - var lineNo = firstDisplayedLine + i; - errorLines.push(pad(String(lineNo), lastLineDigits) + " " + line); - if (lineNo === token.line) { - errorLines.push(pad("", lastLineDigits + token.col + 1) + "^"); - } - } - return errorLines.join("\n"); - }; - Lexer.prototype.clone = function () { - return new Lexer(this.states, this.state); - }; - Lexer.prototype.has = function (tokenType) { - return true; - }; - return { - compile: compile, - states: compileStates, - error: Object.freeze({ - error: true - }), - fallback: Object.freeze({ - fallback: true - }), - keywords: keywordTransform - }; - }); - })(moo); - - (function (exports) { - - var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function (mod) { - return mod && mod.__esModule ? mod : { - "default": mod - }; - }; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.lexer = exports.states = void 0; - const moo_1 = __importDefault(mooExports); - exports.states = { - body: { - doubleapos: { - match: "''", - value: () => "'" - }, - quoted: { - lineBreaks: true, - match: /'[{}#](?:[^]*?[^'])?'(?!')/u, - value: src => src.slice(1, -1).replace(/''/g, "'") - }, - argument: { - lineBreaks: true, - match: /\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u, - push: 'arg', - value: src => src.substring(1).trim() - }, - octothorpe: '#', - end: { - match: '}', - pop: 1 - }, - content: { - lineBreaks: true, - match: /[^][^{}#']*/u - } - }, - arg: { - select: { - lineBreaks: true, - match: /,\s*(?:plural|select|selectordinal)\s*,\s*/u, - next: 'select', - value: src => src.split(',')[1].trim() - }, - 'func-args': { - lineBreaks: true, - match: /,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u, - next: 'body', - value: src => src.split(',')[1].trim() - }, - 'func-simple': { - lineBreaks: true, - match: /,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u, - value: src => src.substring(1).trim() - }, - end: { - match: '}', - pop: 1 - } - }, - select: { - offset: { - lineBreaks: true, - match: /\s*offset\s*:\s*\d+\s*/u, - value: src => src.split(':')[1].trim() - }, - case: { - lineBreaks: true, - match: /\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u, - push: 'body', - value: src => src.substring(0, src.indexOf('{')).trim() - }, - end: { - match: /\s*\}/u, - pop: 1 - } - } - }; - exports.lexer = moo_1.default.states(exports.states); - })(lexer); - - /** - * An AST parser for ICU MessageFormat strings - * - * @packageDocumentation - * @example - * ``` - * import { parse } from '@messageformat/parser - * - * parse('So {wow}.') - * [ { type: 'content', value: 'So ' }, - * { type: 'argument', arg: 'wow' }, - * { type: 'content', value: '.' } ] - * - * - * parse('Such { thing }. { count, selectordinal, one {First} two {Second}' + - * ' few {Third} other {#th} } word.') - * [ { type: 'content', value: 'Such ' }, - * { type: 'argument', arg: 'thing' }, - * { type: 'content', value: '. ' }, - * { type: 'selectordinal', - * arg: 'count', - * cases: [ - * { key: 'one', tokens: [ { type: 'content', value: 'First' } ] }, - * { key: 'two', tokens: [ { type: 'content', value: 'Second' } ] }, - * { key: 'few', tokens: [ { type: 'content', value: 'Third' } ] }, - * { key: 'other', - * tokens: [ { type: 'octothorpe' }, { type: 'content', value: 'th' } ] } - * ] }, - * { type: 'content', value: ' word.' } ] - * - * - * parse('Many{type,select,plural{ numbers}selectordinal{ counting}' + - * 'select{ choices}other{ some {type}}}.') - * [ { type: 'content', value: 'Many' }, - * { type: 'select', - * arg: 'type', - * cases: [ - * { key: 'plural', tokens: [ { type: 'content', value: 'numbers' } ] }, - * { key: 'selectordinal', tokens: [ { type: 'content', value: 'counting' } ] }, - * { key: 'select', tokens: [ { type: 'content', value: 'choices' } ] }, - * { key: 'other', - * tokens: [ { type: 'content', value: 'some ' }, { type: 'argument', arg: 'type' } ] } - * ] }, - * { type: 'content', value: '.' } ] - * - * - * parse('{Such compliance') - * // ParseError: invalid syntax at line 1 col 7: - * // - * // {Such compliance - * // ^ - * - * - * const msg = '{words, plural, zero{No words} one{One word} other{# words}}' - * parse(msg) - * [ { type: 'plural', - * arg: 'words', - * cases: [ - * { key: 'zero', tokens: [ { type: 'content', value: 'No words' } ] }, - * { key: 'one', tokens: [ { type: 'content', value: 'One word' } ] }, - * { key: 'other', - * tokens: [ { type: 'octothorpe' }, { type: 'content', value: ' words' } ] } - * ] } ] - * - * - * parse(msg, { cardinal: [ 'one', 'other' ], ordinal: [ 'one', 'two', 'few', 'other' ] }) - * // ParseError: The plural case zero is not valid in this locale at line 1 col 17: - * // - * // {words, plural, zero{ - * // ^ - * ``` - */ - Object.defineProperty(parser, "__esModule", { - value: true - }); - var parse_1 = parser.parse = parser.ParseError = void 0; - const lexer_js_1 = lexer; - const getContext = lt => ({ - offset: lt.offset, - line: lt.line, - col: lt.col, - text: lt.text, - lineBreaks: lt.lineBreaks - }); - const isSelectType = type => type === 'plural' || type === 'select' || type === 'selectordinal'; - function strictArgStyleParam(lt, param) { - let value = ''; - let text = ''; - for (const p of param) { - const pText = p.ctx.text; - text += pText; - switch (p.type) { - case 'content': - value += p.value; - break; - case 'argument': - case 'function': - case 'octothorpe': - value += pText; - break; - default: - throw new ParseError(lt, `Unsupported part in strict mode function arg style: ${pText}`); - } - } - const c = { - type: 'content', - value: value.trim(), - ctx: Object.assign({}, param[0].ctx, { - text - }) - }; - return [c]; - } - const strictArgTypes = ['number', 'date', 'time', 'spellout', 'ordinal', 'duration']; - const defaultPluralKeys = ['zero', 'one', 'two', 'few', 'many', 'other']; - /** - * Thrown by {@link parse} on error - * - * @public - */ - class ParseError extends Error { - /** @internal */ - constructor(lt, msg) { - super(lexer_js_1.lexer.formatError(lt, msg)); - } - } - parser.ParseError = ParseError; - class Parser { - constructor(src, opt) { - var _a, _b, _c, _d; - this.lexer = lexer_js_1.lexer.reset(src); - this.cardinalKeys = (_a = opt === null || opt === void 0 ? void 0 : opt.cardinal) !== null && _a !== void 0 ? _a : defaultPluralKeys; - this.ordinalKeys = (_b = opt === null || opt === void 0 ? void 0 : opt.ordinal) !== null && _b !== void 0 ? _b : defaultPluralKeys; - this.strict = (_c = opt === null || opt === void 0 ? void 0 : opt.strict) !== null && _c !== void 0 ? _c : false; - this.strictPluralKeys = (_d = opt === null || opt === void 0 ? void 0 : opt.strictPluralKeys) !== null && _d !== void 0 ? _d : true; - } - parse() { - return this.parseBody(false, true); - } - checkSelectKey(lt, type, key) { - if (key[0] === '=') { - if (type === 'select') throw new ParseError(lt, `The case ${key} is not valid with select`); - } else if (type !== 'select') { - const keys = type === 'plural' ? this.cardinalKeys : this.ordinalKeys; - if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) { - const msg = `The ${type} case ${key} is not valid in this locale`; - throw new ParseError(lt, msg); - } - } - } - parseSelect(_ref, inPlural, ctx, type) { - let { - value: arg - } = _ref; - const sel = { - type, - arg, - cases: [], - ctx - }; - if (type === 'plural' || type === 'selectordinal') inPlural = true;else if (this.strict) inPlural = false; - for (const lt of this.lexer) { - switch (lt.type) { - case 'offset': - if (type === 'select') throw new ParseError(lt, 'Unexpected plural offset for select'); - if (sel.cases.length > 0) throw new ParseError(lt, 'Plural offset must be set before cases'); - sel.pluralOffset = Number(lt.value); - ctx.text += lt.text; - ctx.lineBreaks += lt.lineBreaks; - break; - case 'case': - { - this.checkSelectKey(lt, type, lt.value); - sel.cases.push({ - key: lt.value, - tokens: this.parseBody(inPlural), - ctx: getContext(lt) - }); - break; - } - case 'end': - return sel; - /* istanbul ignore next: never happens */ - default: - throw new ParseError(lt, `Unexpected lexer token: ${lt.type}`); - } - } - throw new ParseError(null, 'Unexpected message end'); - } - parseArgToken(lt, inPlural) { - const ctx = getContext(lt); - const argType = this.lexer.next(); - if (!argType) throw new ParseError(null, 'Unexpected message end'); - ctx.text += argType.text; - ctx.lineBreaks += argType.lineBreaks; - if (this.strict && (argType.type === 'func-simple' || argType.type === 'func-args') && !strictArgTypes.includes(argType.value)) { - const msg = `Invalid strict mode function arg type: ${argType.value}`; - throw new ParseError(lt, msg); - } - switch (argType.type) { - case 'end': - return { - type: 'argument', - arg: lt.value, - ctx - }; - case 'func-simple': - { - const end = this.lexer.next(); - if (!end) throw new ParseError(null, 'Unexpected message end'); - /* istanbul ignore if: never happens */ - if (end.type !== 'end') throw new ParseError(end, `Unexpected lexer token: ${end.type}`); - ctx.text += end.text; - if (isSelectType(argType.value.toLowerCase())) throw new ParseError(argType, `Invalid type identifier: ${argType.value}`); - return { - type: 'function', - arg: lt.value, - key: argType.value, - ctx - }; - } - case 'func-args': - { - if (isSelectType(argType.value.toLowerCase())) { - const msg = `Invalid type identifier: ${argType.value}`; - throw new ParseError(argType, msg); - } - let param = this.parseBody(this.strict ? false : inPlural); - if (this.strict && param.length > 0) param = strictArgStyleParam(lt, param); - return { - type: 'function', - arg: lt.value, - key: argType.value, - param, - ctx - }; - } - case 'select': - /* istanbul ignore else: never happens */ - if (isSelectType(argType.value)) return this.parseSelect(lt, inPlural, ctx, argType.value);else throw new ParseError(argType, `Unexpected select type ${argType.value}`); - /* istanbul ignore next: never happens */ - default: - throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`); - } - } - parseBody(inPlural, atRoot) { - const tokens = []; - let content = null; - for (const lt of this.lexer) { - if (lt.type === 'argument') { - if (content) content = null; - tokens.push(this.parseArgToken(lt, inPlural)); - } else if (lt.type === 'octothorpe' && inPlural) { - if (content) content = null; - tokens.push({ - type: 'octothorpe', - ctx: getContext(lt) - }); - } else if (lt.type === 'end' && !atRoot) { - return tokens; - } else { - let value = lt.value; - if (!inPlural && lt.type === 'quoted' && value[0] === '#') { - if (value.includes('{')) { - const errMsg = `Unsupported escape pattern: ${value}`; - throw new ParseError(lt, errMsg); - } - value = lt.text; - } - if (content) { - content.value += value; - content.ctx.text += lt.text; - content.ctx.lineBreaks += lt.lineBreaks; - } else { - content = { - type: 'content', - value, - ctx: getContext(lt) - }; - tokens.push(content); - } - } - } - if (atRoot) return tokens; - throw new ParseError(null, 'Unexpected message end'); - } - } - /** - * Parse an input string into an array of tokens - * - * @public - * @remarks - * The parser only supports the default `DOUBLE_OPTIONAL` - * {@link http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b | apostrophe mode}. - */ - function parse(src) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - const parser = new Parser(src, options); - return parser.parse(); - } - parse_1 = parser.parse = parse; - - /** - * A set of utility functions that are called by the compiled Javascript - * functions, these are included locally in the output of {@link MessageFormat.compile compile()}. - */ - /** @private */ - function _nf$1(lc) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - return _nf$1[lc] || (_nf$1[lc] = new Intl.NumberFormat(lc)); - } - /** - * Utility function for `#` in plural rules - * - * @param lc The current locale - * @param value The value to operate on - * @param offset An offset, set by the surrounding context - * @returns The result of applying the offset to the input value - */ - function number(lc, value, offset) { - return _nf$1(lc).format(value - offset); - } - /** - * Strict utility function for `#` in plural rules - * - * Will throw an Error if `value` or `offset` are non-numeric. - * - * @param lc The current locale - * @param value The value to operate on - * @param offset An offset, set by the surrounding context - * @param name The name of the argument, used for error reporting - * @returns The result of applying the offset to the input value - */ - function strictNumber(lc, value, offset, name) { - var n = value - offset; - if (isNaN(n)) throw new Error('`' + name + '` or its offset is not a number'); - return _nf$1(lc).format(n); - } - /** - * Utility function for `{N, plural|selectordinal, ...}` - * - * @param value The key to use to find a pluralization rule - * @param offset An offset to apply to `value` - * @param lcfunc A locale function from `pluralFuncs` - * @param data The object from which results are looked up - * @param isOrdinal If true, use ordinal rather than cardinal rules - * @returns The result of the pluralization - */ - function plural(value, offset, lcfunc, data, isOrdinal) { - if ({}.hasOwnProperty.call(data, value)) return data[value]; - if (offset) value -= offset; - var key = lcfunc(value, isOrdinal); - return key in data ? data[key] : data.other; - } - /** - * Utility function for `{N, select, ...}` - * - * @param value The key to use to find a selection - * @param data The object from which results are looked up - * @returns The result of the select statement - */ - function select(value, data) { - return {}.hasOwnProperty.call(data, value) ? data[value] : data.other; - } - /** - * Checks that all required arguments are set to defined values - * - * Throws on failure; otherwise returns undefined - * - * @param keys The required keys - * @param data The data object being checked - */ - function reqArgs(keys, data) { - for (var i = 0; i < keys.length; ++i) if (!data || data[keys[i]] === undefined) throw new Error("Message requires argument '".concat(keys[i], "'")); - } - - var Runtime = /*#__PURE__*/Object.freeze({ - __proto__: null, - _nf: _nf$1, - number: number, - plural: plural, - reqArgs: reqArgs, - select: select, - strictNumber: strictNumber - }); - - /** - * Represent a date as a short/default/long/full string - * - * @param value Either a Unix epoch time in milliseconds, or a string value - * representing a date. Parsed with `new Date(value)` - * - * @example - * ```js - * var mf = new MessageFormat(['en', 'fi']); - * - * mf.compile('Today is {T, date}')({ T: Date.now() }) - * // 'Today is Feb 21, 2016' - * - * mf.compile('Tänään on {T, date}', 'fi')({ T: Date.now() }) - * // 'Tänään on 21. helmikuuta 2016' - * - * mf.compile('Unix time started on {T, date, full}')({ T: 0 }) - * // 'Unix time started on Thursday, January 1, 1970' - * - * var cf = mf.compile('{sys} became operational on {d0, date, short}'); - * cf({ sys: 'HAL 9000', d0: '12 January 1999' }) - * // 'HAL 9000 became operational on 1/12/1999' - * ``` - */ - function date(value, lc, size) { - var o = { - day: 'numeric', - month: 'short', - year: 'numeric' - }; - /* eslint-disable no-fallthrough */ - switch (size) { - case 'full': - o.weekday = 'long'; - case 'long': - o.month = 'long'; - break; - case 'short': - o.month = 'numeric'; - } - return new Date(value).toLocaleDateString(lc, o); - } - - /** - * Represent a duration in seconds as a string - * - * @param value A finite number, or its string representation - * @return Includes one or two `:` separators, and matches the pattern - * `hhhh:mm:ss`, possibly with a leading `-` for negative values and a - * trailing `.sss` part for non-integer input - * - * @example - * ```js - * var mf = new MessageFormat(); - * - * mf.compile('It has been {D, duration}')({ D: 123 }) - * // 'It has been 2:03' - * - * mf.compile('Countdown: {D, duration}')({ D: -151200.42 }) - * // 'Countdown: -42:00:00.420' - * ``` - */ - function duration(value) { - if (typeof value !== 'number') value = Number(value); - if (!isFinite(value)) return String(value); - var sign = ''; - if (value < 0) { - sign = '-'; - value = Math.abs(value); - } else { - value = Number(value); - } - var sec = value % 60; - var parts = [Math.round(sec) === sec ? sec : sec.toFixed(3)]; - if (value < 60) { - parts.unshift(0); // at least one : is required - } else { - value = Math.round((value - Number(parts[0])) / 60); - parts.unshift(value % 60); // minutes - if (value >= 60) { - value = Math.round((value - Number(parts[0])) / 60); - parts.unshift(value); // hours - } - } - - var first = parts.shift(); - return sign + first + ':' + parts.map(function (n) { - return Number(n) < 10 ? '0' + String(n) : String(n); - }).join(':'); - } - - /** - * Represent a number as an integer, percent or currency value - * - * Available in MessageFormat strings as `{VAR, number, integer|percent|currency}`. - * Internally, calls Intl.NumberFormat with appropriate parameters. `currency` will - * default to USD; to change, set `MessageFormat#currency` to the appropriate - * three-letter currency code, or use the `currency:EUR` form of the argument. - * - * @example - * ```js - * var mf = new MessageFormat('en', { currency: 'EUR'}); - * - * mf.compile('{N} is almost {N, number, integer}')({ N: 3.14 }) - * // '3.14 is almost 3' - * - * mf.compile('{P, number, percent} complete')({ P: 0.99 }) - * // '99% complete' - * - * mf.compile('The total is {V, number, currency}.')({ V: 5.5 }) - * // 'The total is €5.50.' - * - * mf.compile('The total is {V, number, currency:GBP}.')({ V: 5.5 }) - * // 'The total is £5.50.' - * ``` - */ - var _nf = {}; - function nf(lc, opt) { - var key = String(lc) + JSON.stringify(opt); - if (!_nf[key]) _nf[key] = new Intl.NumberFormat(lc, opt); - return _nf[key]; - } - function numberFmt(value, lc, arg, defaultCurrency) { - var _a = arg && arg.split(':') || [], - type = _a[0], - currency = _a[1]; - var opt = { - integer: { - maximumFractionDigits: 0 - }, - percent: { - style: 'percent' - }, - currency: { - style: 'currency', - currency: currency && currency.trim() || defaultCurrency, - minimumFractionDigits: 2, - maximumFractionDigits: 2 - } - }; - return nf(lc, opt[type] || {}).format(value); - } - var numberCurrency = function (value, lc, arg) { - return nf(lc, { - style: 'currency', - currency: arg, - minimumFractionDigits: 2, - maximumFractionDigits: 2 - }).format(value); - }; - var numberInteger = function (value, lc) { - return nf(lc, { - maximumFractionDigits: 0 - }).format(value); - }; - var numberPercent = function (value, lc) { - return nf(lc, { - style: 'percent' - }).format(value); - }; - - /** - * Represent a time as a short/default/long string - * - * @param value Either a Unix epoch time in milliseconds, or a string value - * representing a date. Parsed with `new Date(value)` - * - * @example - * ```js - * var mf = new MessageFormat(['en', 'fi']); - * - * mf.compile('The time is now {T, time}')({ T: Date.now() }) - * // 'The time is now 11:26:35 PM' - * - * mf.compile('Kello on nyt {T, time}', 'fi')({ T: Date.now() }) - * // 'Kello on nyt 23.26.35' - * - * var cf = mf.compile('The Eagle landed at {T, time, full} on {T, date, full}'); - * cf({ T: '1969-07-20 20:17:40 UTC' }) - * // 'The Eagle landed at 10:17:40 PM GMT+2 on Sunday, July 20, 1969' - * ``` - */ - function time(value, lc, size) { - var o = { - second: 'numeric', - minute: 'numeric', - hour: 'numeric' - }; - /* eslint-disable no-fallthrough */ - switch (size) { - case 'full': - case 'long': - o.timeZoneName = 'short'; - break; - case 'short': - delete o.second; - } - return new Date(value).toLocaleTimeString(lc, o); - } - - var Formatters = /*#__PURE__*/Object.freeze({ - __proto__: null, - date: date, - duration: duration, - numberCurrency: numberCurrency, - numberFmt: numberFmt, - numberInteger: numberInteger, - numberPercent: numberPercent, - time: time - }); - - const ES3 = { - break: true, - continue: true, - delete: true, - else: true, - for: true, - function: true, - if: true, - in: true, - new: true, - return: true, - this: true, - typeof: true, - var: true, - void: true, - while: true, - with: true, - case: true, - catch: true, - default: true, - do: true, - finally: true, - instanceof: true, - switch: true, - throw: true, - try: true - }; - const ESnext = { - // in addition to reservedES3 - await: true, - debugger: true, - class: true, - enum: true, - extends: true, - super: true, - const: true, - export: true, - import: true, - null: true, - true: true, - false: true, - implements: true, - let: true, - private: true, - public: true, - yield: true, - interface: true, - package: true, - protected: true, - static: true - }; - var reserved = { - ES3, - ESnext - }; - var reserved$1 = reserved; - - // from https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/ - function hashCode(str) { - let hash = 0; - for (let i = 0; i < str.length; ++i) { - const char = str.charCodeAt(i); - hash = (hash << 5) - hash + char; - hash |= 0; // Convert to 32bit integer - } - - return hash; - } - function identifier(key, unique) { - if (unique) key += ' ' + hashCode(key).toString(36); - const id = key.trim().replace(/\W+/g, '_'); - return reserved$1.ES3[id] || reserved$1.ESnext[id] || /^\d/.test(id) ? '_' + id : id; - } - function property(obj, key) { - if (/^[A-Z_$][0-9A-Z_$]*$/i.test(key) && !reserved$1.ES3[key]) { - return obj ? obj + '.' + key : key; - } else { - const jkey = JSON.stringify(key); - return obj ? obj + '[' + jkey + ']' : jkey; - } - } - - var rtlLanguages = [ - 'ar', - 'ckb', - 'fa', - 'he', - 'ks($|[^bfh])', - 'lrc', - 'mzn', - 'pa-Arab', - 'ps', - 'ug', - 'ur', - 'uz-Arab', - 'yi' - ]; - var rtlRegExp = new RegExp('^' + rtlLanguages.join('|^')); - function biDiMarkText(text, locale) { - var isLocaleRTL = rtlRegExp.test(locale); - var mark = JSON.stringify(isLocaleRTL ? '\u200F' : '\u200E'); - return "".concat(mark, " + ").concat(text, " + ").concat(mark); - } - - var RUNTIME_MODULE = '@messageformat/runtime'; - var CARDINAL_MODULE = '@messageformat/runtime/lib/cardinals'; - var PLURAL_MODULE = '@messageformat/runtime/lib/plurals'; - var FORMATTER_MODULE = '@messageformat/runtime/lib/formatters'; - var Compiler = (function () { - function Compiler(options) { - this.arguments = []; - this.runtime = {}; - this.options = options; - } - Compiler.prototype.compile = function (src, plural, plurals) { - var e_1, _a; - var _this = this; - var _b = this.options, localeCodeFromKey = _b.localeCodeFromKey, requireAllArguments = _b.requireAllArguments, strict = _b.strict, strictPluralKeys = _b.strictPluralKeys; - if (typeof src === 'object') { - var result = {}; - try { - for (var _c = __values(Object.keys(src)), _d = _c.next(); !_d.done; _d = _c.next()) { - var key = _d.value; - var lc = localeCodeFromKey ? localeCodeFromKey(key) : key; - var pl = (plurals && lc && plurals[lc]) || plural; - result[key] = this.compile(src[key], pl, plurals); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_d && !_d.done && (_a = _c.return)) _a.call(_c); - } - finally { if (e_1) throw e_1.error; } - } - return result; - } - this.plural = plural; - var parserOptions = { - cardinal: plural.cardinals, - ordinal: plural.ordinals, - strict: strict, - strictPluralKeys: strictPluralKeys - }; - this.arguments = []; - var r = parse_1(src, parserOptions).map(function (token) { return _this.token(token, null); }); - var hasArgs = this.arguments.length > 0; - var res = this.concatenate(r, true); - if (requireAllArguments && hasArgs) { - this.setRuntimeFn('reqArgs'); - var reqArgs = JSON.stringify(this.arguments); - return "(d) => { reqArgs(".concat(reqArgs, ", d); return ").concat(res, "; }"); - } - return "(".concat(hasArgs ? 'd' : '', ") => ").concat(res); - }; - Compiler.prototype.cases = function (token, pluralToken) { - var _this = this; - var needOther = true; - var r = token.cases.map(function (_a) { - var key = _a.key, tokens = _a.tokens; - if (key === 'other') - needOther = false; - var s = tokens.map(function (tok) { return _this.token(tok, pluralToken); }); - return "".concat(property(null, key.replace(/^=/, '')), ": ").concat(_this.concatenate(s, false)); - }); - if (needOther) { - var type = token.type; - var _a = this.plural, cardinals = _a.cardinals, ordinals = _a.ordinals; - if (type === 'select' || - (type === 'plural' && cardinals.includes('other')) || - (type === 'selectordinal' && ordinals.includes('other'))) - throw new Error("No 'other' form found in ".concat(JSON.stringify(token))); - } - return "{ ".concat(r.join(', '), " }"); - }; - Compiler.prototype.concatenate = function (tokens, root) { - var asValues = this.options.returnType === 'values'; - return asValues && (root || tokens.length > 1) - ? '[' + tokens.join(', ') + ']' - : tokens.join(' + ') || '""'; - }; - Compiler.prototype.token = function (token, pluralToken) { - if (token.type === 'content') - return JSON.stringify(token.value); - var _a = this.plural, id = _a.id, lc = _a.lc; - var args, fn; - if ('arg' in token) { - this.arguments.push(token.arg); - args = [property('d', token.arg)]; - } - else - args = []; - switch (token.type) { - case 'argument': - return this.options.biDiSupport - ? biDiMarkText(String(args[0]), lc) - : String(args[0]); - case 'select': - fn = 'select'; - if (pluralToken && this.options.strict) - pluralToken = null; - args.push(this.cases(token, pluralToken)); - this.setRuntimeFn('select'); - break; - case 'selectordinal': - fn = 'plural'; - args.push(token.pluralOffset || 0, id, this.cases(token, token), 1); - this.setLocale(id, true); - this.setRuntimeFn('plural'); - break; - case 'plural': - fn = 'plural'; - args.push(token.pluralOffset || 0, id, this.cases(token, token)); - this.setLocale(id, false); - this.setRuntimeFn('plural'); - break; - case 'function': - if (!this.options.customFormatters[token.key]) { - if (token.key === 'date') { - fn = this.setDateFormatter(token, args, pluralToken); - break; - } - else if (token.key === 'number') { - fn = this.setNumberFormatter(token, args, pluralToken); - break; - } - } - args.push(JSON.stringify(this.plural.locale)); - if (token.param) { - if (pluralToken && this.options.strict) - pluralToken = null; - var arg = this.getFormatterArg(token, pluralToken); - if (arg) - args.push(arg); - } - fn = token.key; - this.setFormatter(fn); - break; - case 'octothorpe': - if (!pluralToken) - return '"#"'; - args = [ - JSON.stringify(this.plural.locale), - property('d', pluralToken.arg), - pluralToken.pluralOffset || 0 - ]; - if (this.options.strict) { - fn = 'strictNumber'; - args.push(JSON.stringify(pluralToken.arg)); - this.setRuntimeFn('strictNumber'); - } - else { - fn = 'number'; - this.setRuntimeFn('number'); - } - break; - } - if (!fn) - throw new Error('Parser error for token ' + JSON.stringify(token)); - return "".concat(fn, "(").concat(args.join(', '), ")"); - }; - Compiler.prototype.runtimeIncludes = function (key, type) { - if (identifier(key) !== key) - throw new SyntaxError("Reserved word used as ".concat(type, " identifier: ").concat(key)); - var prev = this.runtime[key]; - if (!prev || prev.type === type) - return prev; - throw new TypeError("Cannot override ".concat(prev.type, " runtime function as ").concat(type, ": ").concat(key)); - }; - Compiler.prototype.setLocale = function (key, ord) { - var prev = this.runtimeIncludes(key, 'locale'); - var _a = this.plural, getCardinal = _a.getCardinal, getPlural = _a.getPlural, isDefault = _a.isDefault; - var pf, module, toString; - if (!ord && isDefault && getCardinal) { - if (prev) - return; - pf = function (n) { return getCardinal(n); }; - module = CARDINAL_MODULE; - toString = function () { return String(getCardinal); }; - } - else { - if (prev && (!isDefault || prev.module === PLURAL_MODULE)) - return; - pf = function (n, ord) { return getPlural(n, ord); }; - module = isDefault ? PLURAL_MODULE : getPlural.module || null; - toString = function () { return String(getPlural); }; - } - this.runtime[key] = Object.assign(pf, { - id: key, - module: module, - toString: toString, - type: 'locale' - }); - }; - Compiler.prototype.setRuntimeFn = function (key) { - if (this.runtimeIncludes(key, 'runtime')) - return; - this.runtime[key] = Object.assign(Runtime[key], { - id: key, - module: RUNTIME_MODULE, - type: 'runtime' - }); - }; - Compiler.prototype.getFormatterArg = function (_a, pluralToken) { - var e_2, _b, e_3, _c; - var _this = this; - var key = _a.key, param = _a.param; - var fmt = this.options.customFormatters[key] || - (isFormatterKey(key) && Formatters[key]); - if (!fmt || !param) - return null; - var argShape = ('arg' in fmt && fmt.arg) || 'string'; - if (argShape === 'options') { - var value = ''; - try { - for (var param_1 = __values(param), param_1_1 = param_1.next(); !param_1_1.done; param_1_1 = param_1.next()) { - var tok = param_1_1.value; - if (tok.type === 'content') - value += tok.value; - else - throw new SyntaxError("Expected literal options for ".concat(key, " formatter")); - } - } - catch (e_2_1) { e_2 = { error: e_2_1 }; } - finally { - try { - if (param_1_1 && !param_1_1.done && (_b = param_1.return)) _b.call(param_1); - } - finally { if (e_2) throw e_2.error; } - } - var options = {}; - try { - for (var _d = __values(value.split(',')), _e = _d.next(); !_e.done; _e = _d.next()) { - var pair = _e.value; - var keyEnd = pair.indexOf(':'); - if (keyEnd === -1) - options[pair.trim()] = null; - else { - var k = pair.substring(0, keyEnd).trim(); - var v = pair.substring(keyEnd + 1).trim(); - if (v === 'true') - options[k] = true; - else if (v === 'false') - options[k] = false; - else if (v === 'null') - options[k] = null; - else { - var n = Number(v); - options[k] = Number.isFinite(n) ? n : v; - } - } - } - } - catch (e_3_1) { e_3 = { error: e_3_1 }; } - finally { - try { - if (_e && !_e.done && (_c = _d.return)) _c.call(_d); - } - finally { if (e_3) throw e_3.error; } - } - return JSON.stringify(options); - } - else { - var parts = param.map(function (tok) { return _this.token(tok, pluralToken); }); - if (argShape === 'raw') - return "[".concat(parts.join(', '), "]"); - var s = parts.join(' + '); - return s ? "(".concat(s, ").trim()") : '""'; - } - }; - Compiler.prototype.setFormatter = function (key) { - if (this.runtimeIncludes(key, 'formatter')) - return; - var cf = this.options.customFormatters[key]; - if (cf) { - if (typeof cf === 'function') - cf = { formatter: cf }; - this.runtime[key] = Object.assign(cf.formatter, { type: 'formatter' }, 'module' in cf && cf.module && cf.id - ? { id: identifier(cf.id), module: cf.module } - : { id: null, module: null }); - } - else if (isFormatterKey(key)) { - this.runtime[key] = Object.assign(Formatters[key], { type: 'formatter' }, { id: key, module: FORMATTER_MODULE }); - } - else { - throw new Error("Formatting function not found: ".concat(key)); - } - }; - Compiler.prototype.setDateFormatter = function (_a, args, plural) { - var _this = this; - var param = _a.param; - var locale = this.plural.locale; - var argStyle = param && param.length === 1 && param[0]; - if (argStyle && - argStyle.type === 'content' && - /^\s*::/.test(argStyle.value)) { - var argSkeletonText_1 = argStyle.value.trim().substr(2); - var key = identifier("date_".concat(locale, "_").concat(argSkeletonText_1), true); - if (!this.runtimeIncludes(key, 'formatter')) { - var fmt = getDateFormatter(locale, argSkeletonText_1); - this.runtime[key] = Object.assign(fmt, { - id: key, - module: null, - toString: function () { return getDateFormatterSource(locale, argSkeletonText_1); }, - type: 'formatter' - }); - } - return key; - } - args.push(JSON.stringify(locale)); - if (param && param.length > 0) { - if (plural && this.options.strict) - plural = null; - var s = param.map(function (tok) { return _this.token(tok, plural); }); - args.push('(' + (s.join(' + ') || '""') + ').trim()'); - } - this.setFormatter('date'); - return 'date'; - }; - Compiler.prototype.setNumberFormatter = function (_a, args, plural) { - var _this = this; - var param = _a.param; - var locale = this.plural.locale; - if (!param || param.length === 0) { - args.unshift(JSON.stringify(locale)); - args.push('0'); - this.setRuntimeFn('number'); - return 'number'; - } - args.push(JSON.stringify(locale)); - if (param.length === 1 && param[0].type === 'content') { - var fmtArg_1 = param[0].value.trim(); - switch (fmtArg_1) { - case 'currency': - args.push(JSON.stringify(this.options.currency)); - this.setFormatter('numberCurrency'); - return 'numberCurrency'; - case 'integer': - this.setFormatter('numberInteger'); - return 'numberInteger'; - case 'percent': - this.setFormatter('numberPercent'); - return 'numberPercent'; - } - var cm = fmtArg_1.match(/^currency:([A-Z]+)$/); - if (cm) { - args.push(JSON.stringify(cm[1])); - this.setFormatter('numberCurrency'); - return 'numberCurrency'; - } - var key = identifier("number_".concat(locale, "_").concat(fmtArg_1), true); - if (!this.runtimeIncludes(key, 'formatter')) { - var currency_1 = this.options.currency; - var fmt = getNumberFormatter(locale, fmtArg_1, currency_1); - this.runtime[key] = Object.assign(fmt, { - id: null, - module: null, - toString: function () { return getNumberFormatterSource(locale, fmtArg_1, currency_1); }, - type: 'formatter' - }); - } - return key; - } - if (plural && this.options.strict) - plural = null; - var s = param.map(function (tok) { return _this.token(tok, plural); }); - args.push('(' + (s.join(' + ') || '""') + ').trim()'); - args.push(JSON.stringify(this.options.currency)); - this.setFormatter('numberFmt'); - return 'numberFmt'; - }; - return Compiler; - }()); - function isFormatterKey(key) { - return key in Formatters; - } - - const a$2 = n => n == 1 ? 'one' : 'other'; - const b$2 = n => n == 0 || n == 1 ? 'one' : 'other'; - const c$2 = n => n >= 0 && n <= 1 ? 'one' : 'other'; - const d$2 = n => { - const s = String(n).split('.'), - v0 = !s[1]; - return n == 1 && v0 ? 'one' : 'other'; - }; - const e$1 = n => 'other'; - const f$2 = n => n == 1 ? 'one' : n == 2 ? 'two' : 'other'; - const af$2 = a$2; - const ak$2 = b$2; - const am$2 = c$2; - const an$2 = a$2; - const ar$2 = n => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2); - return n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 99 ? 'many' : 'other'; - }; - const ars$2 = n => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2); - return n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 99 ? 'many' : 'other'; - }; - const as$2 = c$2; - const asa$2 = a$2; - const ast$2 = d$2; - const az$2 = a$2; - const bal$2 = a$2; - const be$2 = n => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2); - return n10 == 1 && n100 != 11 ? 'one' : n10 >= 2 && n10 <= 4 && (n100 < 12 || n100 > 14) ? 'few' : t0 && n10 == 0 || n10 >= 5 && n10 <= 9 || n100 >= 11 && n100 <= 14 ? 'many' : 'other'; - }; - const bem$2 = a$2; - const bez$2 = a$2; - const bg$2 = a$2; - const bho$2 = b$2; - const bm$2 = e$1; - const bn$2 = c$2; - const bo$2 = e$1; - const br$2 = n => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2), - n1000000 = t0 && s[0].slice(-6); - return n10 == 1 && n100 != 11 && n100 != 71 && n100 != 91 ? 'one' : n10 == 2 && n100 != 12 && n100 != 72 && n100 != 92 ? 'two' : (n10 == 3 || n10 == 4 || n10 == 9) && (n100 < 10 || n100 > 19) && (n100 < 70 || n100 > 79) && (n100 < 90 || n100 > 99) ? 'few' : n != 0 && t0 && n1000000 == 0 ? 'many' : 'other'; - }; - const brx$2 = a$2; - const bs$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2), - f10 = f.slice(-1), - f100 = f.slice(-2); - return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other'; - }; - const ca$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const ce$2 = a$2; - const ceb$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - f10 = f.slice(-1); - return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other'; - }; - const cgg$2 = a$2; - const chr$2 = a$2; - const ckb$2 = a$2; - const cs$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1]; - return n == 1 && v0 ? 'one' : i >= 2 && i <= 4 && v0 ? 'few' : !v0 ? 'many' : 'other'; - }; - const cy$2 = n => n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n == 3 ? 'few' : n == 6 ? 'many' : 'other'; - const da$2 = n => { - const s = String(n).split('.'), - i = s[0], - t0 = Number(s[0]) == n; - return n == 1 || !t0 && (i == 0 || i == 1) ? 'one' : 'other'; - }; - const de$2 = d$2; - const doi$2 = c$2; - const dsb$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i100 = i.slice(-2), - f100 = f.slice(-2); - return v0 && i100 == 1 || f100 == 1 ? 'one' : v0 && i100 == 2 || f100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || f100 == 3 || f100 == 4 ? 'few' : 'other'; - }; - const dv$2 = a$2; - const dz$2 = e$1; - const ee$2 = a$2; - const el$2 = a$2; - const en$2 = d$2; - const eo$2 = a$2; - const es$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - return n == 1 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const et$2 = d$2; - const eu$2 = a$2; - const fa$2 = c$2; - const ff$2 = n => n >= 0 && n < 2 ? 'one' : 'other'; - const fi$2 = d$2; - const fil$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - f10 = f.slice(-1); - return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other'; - }; - const fo$2 = a$2; - const fr$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - return n >= 0 && n < 2 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const fur$2 = a$2; - const fy$2 = d$2; - const ga$2 = n => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n; - return n == 1 ? 'one' : n == 2 ? 'two' : t0 && n >= 3 && n <= 6 ? 'few' : t0 && n >= 7 && n <= 10 ? 'many' : 'other'; - }; - const gd$2 = n => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n; - return n == 1 || n == 11 ? 'one' : n == 2 || n == 12 ? 'two' : t0 && n >= 3 && n <= 10 || t0 && n >= 13 && n <= 19 ? 'few' : 'other'; - }; - const gl$2 = d$2; - const gsw$2 = a$2; - const gu$2 = c$2; - const guw$2 = b$2; - const gv$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2); - return v0 && i10 == 1 ? 'one' : v0 && i10 == 2 ? 'two' : v0 && (i100 == 0 || i100 == 20 || i100 == 40 || i100 == 60 || i100 == 80) ? 'few' : !v0 ? 'many' : 'other'; - }; - const ha$2 = a$2; - const haw$2 = a$2; - const he$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1]; - return i == 1 && v0 || i == 0 && !v0 ? 'one' : i == 2 && v0 ? 'two' : 'other'; - }; - const hi$2 = c$2; - const hnj$2 = e$1; - const hr$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2), - f10 = f.slice(-1), - f100 = f.slice(-2); - return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other'; - }; - const hsb$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i100 = i.slice(-2), - f100 = f.slice(-2); - return v0 && i100 == 1 || f100 == 1 ? 'one' : v0 && i100 == 2 || f100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || f100 == 3 || f100 == 4 ? 'few' : 'other'; - }; - const hu$2 = a$2; - const hy$2 = n => n >= 0 && n < 2 ? 'one' : 'other'; - const ia$2 = d$2; - const id$2 = e$1; - const ig$2 = e$1; - const ii$2 = e$1; - const io$2 = d$2; - const is$2 = n => { - const s = String(n).split('.'), - i = s[0], - t = (s[1] || '').replace(/0+$/, ''), - t0 = Number(s[0]) == n, - i10 = i.slice(-1), - i100 = i.slice(-2); - return t0 && i10 == 1 && i100 != 11 || t % 10 == 1 && t % 100 != 11 ? 'one' : 'other'; - }; - const it$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const iu$2 = f$2; - const ja$2 = e$1; - const jbo$2 = e$1; - const jgo$2 = a$2; - const jmc$2 = a$2; - const jv$2 = e$1; - const jw$2 = e$1; - const ka$2 = a$2; - const kab$2 = n => n >= 0 && n < 2 ? 'one' : 'other'; - const kaj$2 = a$2; - const kcg$2 = a$2; - const kde$2 = e$1; - const kea$2 = e$1; - const kk$2 = a$2; - const kkj$2 = a$2; - const kl$2 = a$2; - const km$2 = e$1; - const kn$2 = c$2; - const ko$2 = e$1; - const ks$2 = a$2; - const ksb$2 = a$2; - const ksh$2 = n => n == 0 ? 'zero' : n == 1 ? 'one' : 'other'; - const ku$2 = a$2; - const kw$2 = n => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2), - n1000 = t0 && s[0].slice(-3), - n100000 = t0 && s[0].slice(-5), - n1000000 = t0 && s[0].slice(-6); - return n == 0 ? 'zero' : n == 1 ? 'one' : n100 == 2 || n100 == 22 || n100 == 42 || n100 == 62 || n100 == 82 || t0 && n1000 == 0 && (n100000 >= 1000 && n100000 <= 20000 || n100000 == 40000 || n100000 == 60000 || n100000 == 80000) || n != 0 && n1000000 == 100000 ? 'two' : n100 == 3 || n100 == 23 || n100 == 43 || n100 == 63 || n100 == 83 ? 'few' : n != 1 && (n100 == 1 || n100 == 21 || n100 == 41 || n100 == 61 || n100 == 81) ? 'many' : 'other'; - }; - const ky$2 = a$2; - const lag$2 = n => { - const s = String(n).split('.'), - i = s[0]; - return n == 0 ? 'zero' : (i == 0 || i == 1) && n != 0 ? 'one' : 'other'; - }; - const lb$2 = a$2; - const lg$2 = a$2; - const lij$2 = d$2; - const lkt$2 = e$1; - const ln$2 = b$2; - const lo$2 = e$1; - const lt$2 = n => { - const s = String(n).split('.'), - f = s[1] || '', - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2); - return n10 == 1 && (n100 < 11 || n100 > 19) ? 'one' : n10 >= 2 && n10 <= 9 && (n100 < 11 || n100 > 19) ? 'few' : f != 0 ? 'many' : 'other'; - }; - const lv$2 = n => { - const s = String(n).split('.'), - f = s[1] || '', - v = f.length, - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2), - f100 = f.slice(-2), - f10 = f.slice(-1); - return t0 && n10 == 0 || n100 >= 11 && n100 <= 19 || v == 2 && f100 >= 11 && f100 <= 19 ? 'zero' : n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11 || v != 2 && f10 == 1 ? 'one' : 'other'; - }; - const mas$2 = a$2; - const mg$2 = b$2; - const mgo$2 = a$2; - const mk$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2), - f10 = f.slice(-1), - f100 = f.slice(-2); - return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : 'other'; - }; - const ml$2 = a$2; - const mn$2 = a$2; - const mo$2 = n => { - const s = String(n).split('.'), - v0 = !s[1], - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2); - return n == 1 && v0 ? 'one' : !v0 || n == 0 || n != 1 && n100 >= 1 && n100 <= 19 ? 'few' : 'other'; - }; - const mr$2 = a$2; - const ms$2 = e$1; - const mt$2 = n => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2); - return n == 1 ? 'one' : n == 2 ? 'two' : n == 0 || n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 19 ? 'many' : 'other'; - }; - const my$2 = e$1; - const nah$2 = a$2; - const naq$2 = f$2; - const nb$2 = a$2; - const nd$2 = a$2; - const ne$2 = a$2; - const nl$2 = d$2; - const nn$2 = a$2; - const nnh$2 = a$2; - const no$2 = a$2; - const nqo$2 = e$1; - const nr$2 = a$2; - const nso$2 = b$2; - const ny$2 = a$2; - const nyn$2 = a$2; - const om$2 = a$2; - const or$2 = a$2; - const os$2 = a$2; - const osa$2 = e$1; - const pa$2 = b$2; - const pap$2 = a$2; - const pcm$2 = c$2; - const pl$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2); - return n == 1 && v0 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i != 1 && (i10 == 0 || i10 == 1) || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 12 && i100 <= 14 ? 'many' : 'other'; - }; - const prg$2 = n => { - const s = String(n).split('.'), - f = s[1] || '', - v = f.length, - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2), - f100 = f.slice(-2), - f10 = f.slice(-1); - return t0 && n10 == 0 || n100 >= 11 && n100 <= 19 || v == 2 && f100 >= 11 && f100 <= 19 ? 'zero' : n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11 || v != 2 && f10 == 1 ? 'one' : 'other'; - }; - const ps$2 = a$2; - const pt$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - return i == 0 || i == 1 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const pt_PT$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const rm$2 = a$2; - const ro$2 = n => { - const s = String(n).split('.'), - v0 = !s[1], - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2); - return n == 1 && v0 ? 'one' : !v0 || n == 0 || n != 1 && n100 >= 1 && n100 <= 19 ? 'few' : 'other'; - }; - const rof$2 = a$2; - const ru$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2); - return v0 && i10 == 1 && i100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i10 == 0 || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 11 && i100 <= 14 ? 'many' : 'other'; - }; - const rwk$2 = a$2; - const sah$2 = e$1; - const saq$2 = a$2; - const sat$2 = f$2; - const sc$2 = d$2; - const scn$2 = d$2; - const sd$2 = a$2; - const sdh$2 = a$2; - const se$2 = f$2; - const seh$2 = a$2; - const ses$2 = e$1; - const sg$2 = e$1; - const sh$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2), - f10 = f.slice(-1), - f100 = f.slice(-2); - return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other'; - }; - const shi$2 = n => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n; - return n >= 0 && n <= 1 ? 'one' : t0 && n >= 2 && n <= 10 ? 'few' : 'other'; - }; - const si$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || ''; - return n == 0 || n == 1 || i == 0 && f == 1 ? 'one' : 'other'; - }; - const sk$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1]; - return n == 1 && v0 ? 'one' : i >= 2 && i <= 4 && v0 ? 'few' : !v0 ? 'many' : 'other'; - }; - const sl$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i100 = i.slice(-2); - return v0 && i100 == 1 ? 'one' : v0 && i100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || !v0 ? 'few' : 'other'; - }; - const sma$2 = f$2; - const smi$2 = f$2; - const smj$2 = f$2; - const smn$2 = f$2; - const sms$2 = f$2; - const sn$2 = a$2; - const so$2 = a$2; - const sq$2 = a$2; - const sr$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2), - f10 = f.slice(-1), - f100 = f.slice(-2); - return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other'; - }; - const ss$2 = a$2; - const ssy$2 = a$2; - const st$2 = a$2; - const su$2 = e$1; - const sv$2 = d$2; - const sw$2 = d$2; - const syr$2 = a$2; - const ta$2 = a$2; - const te$2 = a$2; - const teo$2 = a$2; - const th$2 = e$1; - const ti$2 = b$2; - const tig$2 = a$2; - const tk$2 = a$2; - const tl$2 = n => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - f10 = f.slice(-1); - return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other'; - }; - const tn$2 = a$2; - const to$2 = e$1; - const tpi$2 = e$1; - const tr$2 = a$2; - const ts$2 = a$2; - const tzm$2 = n => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n; - return n == 0 || n == 1 || t0 && n >= 11 && n <= 99 ? 'one' : 'other'; - }; - const ug$2 = a$2; - const uk$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2); - return v0 && i10 == 1 && i100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i10 == 0 || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 11 && i100 <= 14 ? 'many' : 'other'; - }; - const und$2 = e$1; - const ur$2 = d$2; - const uz$2 = a$2; - const ve$2 = a$2; - const vec$2 = n => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const vi$2 = e$1; - const vo$2 = a$2; - const vun$2 = a$2; - const wa$2 = b$2; - const wae$2 = a$2; - const wo$2 = e$1; - const xh$2 = a$2; - const xog$2 = a$2; - const yi$2 = d$2; - const yo$2 = e$1; - const yue$2 = e$1; - const zh$2 = e$1; - const zu$2 = c$2; - - var Cardinals = /*#__PURE__*/Object.freeze({ - __proto__: null, - af: af$2, - ak: ak$2, - am: am$2, - an: an$2, - ar: ar$2, - ars: ars$2, - as: as$2, - asa: asa$2, - ast: ast$2, - az: az$2, - bal: bal$2, - be: be$2, - bem: bem$2, - bez: bez$2, - bg: bg$2, - bho: bho$2, - bm: bm$2, - bn: bn$2, - bo: bo$2, - br: br$2, - brx: brx$2, - bs: bs$2, - ca: ca$2, - ce: ce$2, - ceb: ceb$2, - cgg: cgg$2, - chr: chr$2, - ckb: ckb$2, - cs: cs$2, - cy: cy$2, - da: da$2, - de: de$2, - doi: doi$2, - dsb: dsb$2, - dv: dv$2, - dz: dz$2, - ee: ee$2, - el: el$2, - en: en$2, - eo: eo$2, - es: es$2, - et: et$2, - eu: eu$2, - fa: fa$2, - ff: ff$2, - fi: fi$2, - fil: fil$2, - fo: fo$2, - fr: fr$2, - fur: fur$2, - fy: fy$2, - ga: ga$2, - gd: gd$2, - gl: gl$2, - gsw: gsw$2, - gu: gu$2, - guw: guw$2, - gv: gv$2, - ha: ha$2, - haw: haw$2, - he: he$2, - hi: hi$2, - hnj: hnj$2, - hr: hr$2, - hsb: hsb$2, - hu: hu$2, - hy: hy$2, - ia: ia$2, - id: id$2, - ig: ig$2, - ii: ii$2, - io: io$2, - is: is$2, - it: it$2, - iu: iu$2, - ja: ja$2, - jbo: jbo$2, - jgo: jgo$2, - jmc: jmc$2, - jv: jv$2, - jw: jw$2, - ka: ka$2, - kab: kab$2, - kaj: kaj$2, - kcg: kcg$2, - kde: kde$2, - kea: kea$2, - kk: kk$2, - kkj: kkj$2, - kl: kl$2, - km: km$2, - kn: kn$2, - ko: ko$2, - ks: ks$2, - ksb: ksb$2, - ksh: ksh$2, - ku: ku$2, - kw: kw$2, - ky: ky$2, - lag: lag$2, - lb: lb$2, - lg: lg$2, - lij: lij$2, - lkt: lkt$2, - ln: ln$2, - lo: lo$2, - lt: lt$2, - lv: lv$2, - mas: mas$2, - mg: mg$2, - mgo: mgo$2, - mk: mk$2, - ml: ml$2, - mn: mn$2, - mo: mo$2, - mr: mr$2, - ms: ms$2, - mt: mt$2, - my: my$2, - nah: nah$2, - naq: naq$2, - nb: nb$2, - nd: nd$2, - ne: ne$2, - nl: nl$2, - nn: nn$2, - nnh: nnh$2, - no: no$2, - nqo: nqo$2, - nr: nr$2, - nso: nso$2, - ny: ny$2, - nyn: nyn$2, - om: om$2, - or: or$2, - os: os$2, - osa: osa$2, - pa: pa$2, - pap: pap$2, - pcm: pcm$2, - pl: pl$2, - prg: prg$2, - ps: ps$2, - pt: pt$2, - pt_PT: pt_PT$2, - rm: rm$2, - ro: ro$2, - rof: rof$2, - ru: ru$2, - rwk: rwk$2, - sah: sah$2, - saq: saq$2, - sat: sat$2, - sc: sc$2, - scn: scn$2, - sd: sd$2, - sdh: sdh$2, - se: se$2, - seh: seh$2, - ses: ses$2, - sg: sg$2, - sh: sh$2, - shi: shi$2, - si: si$2, - sk: sk$2, - sl: sl$2, - sma: sma$2, - smi: smi$2, - smj: smj$2, - smn: smn$2, - sms: sms$2, - sn: sn$2, - so: so$2, - sq: sq$2, - sr: sr$2, - ss: ss$2, - ssy: ssy$2, - st: st$2, - su: su$2, - sv: sv$2, - sw: sw$2, - syr: syr$2, - ta: ta$2, - te: te$2, - teo: teo$2, - th: th$2, - ti: ti$2, - tig: tig$2, - tk: tk$2, - tl: tl$2, - tn: tn$2, - to: to$2, - tpi: tpi$2, - tr: tr$2, - ts: ts$2, - tzm: tzm$2, - ug: ug$2, - uk: uk$2, - und: und$2, - ur: ur$2, - uz: uz$2, - ve: ve$2, - vec: vec$2, - vi: vi$2, - vo: vo$2, - vun: vun$2, - wa: wa$2, - wae: wae$2, - wo: wo$2, - xh: xh$2, - xog: xog$2, - yi: yi$2, - yo: yo$2, - yue: yue$2, - zh: zh$2, - zu: zu$2 - }); - - const z = "zero", - o = "one", - t = "two", - f$1 = "few", - m = "many", - x = "other"; - const a$1 = { - cardinal: [o, x], - ordinal: [x] - }; - const b$1 = { - cardinal: [o, x], - ordinal: [o, x] - }; - const c$1 = { - cardinal: [x], - ordinal: [x] - }; - const d$1 = { - cardinal: [o, t, x], - ordinal: [x] - }; - const af$1 = a$1; - const ak$1 = a$1; - const am$1 = a$1; - const an$1 = a$1; - const ar$1 = { - cardinal: [z, o, t, f$1, m, x], - ordinal: [x] - }; - const ars$1 = { - cardinal: [z, o, t, f$1, m, x], - ordinal: [x] - }; - const as$1 = { - cardinal: [o, x], - ordinal: [o, t, f$1, m, x] - }; - const asa$1 = a$1; - const ast$1 = a$1; - const az$1 = { - cardinal: [o, x], - ordinal: [o, f$1, m, x] - }; - const bal$1 = b$1; - const be$1 = { - cardinal: [o, f$1, m, x], - ordinal: [f$1, x] - }; - const bem$1 = a$1; - const bez$1 = a$1; - const bg$1 = a$1; - const bho$1 = a$1; - const bm$1 = c$1; - const bn$1 = { - cardinal: [o, x], - ordinal: [o, t, f$1, m, x] - }; - const bo$1 = c$1; - const br$1 = { - cardinal: [o, t, f$1, m, x], - ordinal: [x] - }; - const brx$1 = a$1; - const bs$1 = { - cardinal: [o, f$1, x], - ordinal: [x] - }; - const ca$1 = { - cardinal: [o, m, x], - ordinal: [o, t, f$1, x] - }; - const ce$1 = a$1; - const ceb$1 = a$1; - const cgg$1 = a$1; - const chr$1 = a$1; - const ckb$1 = a$1; - const cs$1 = { - cardinal: [o, f$1, m, x], - ordinal: [x] - }; - const cy$1 = { - cardinal: [z, o, t, f$1, m, x], - ordinal: [z, o, t, f$1, m, x] - }; - const da$1 = a$1; - const de$1 = a$1; - const doi$1 = a$1; - const dsb$1 = { - cardinal: [o, t, f$1, x], - ordinal: [x] - }; - const dv$1 = a$1; - const dz$1 = c$1; - const ee$1 = a$1; - const el$1 = a$1; - const en$1 = { - cardinal: [o, x], - ordinal: [o, t, f$1, x] - }; - const eo$1 = a$1; - const es$1 = { - cardinal: [o, m, x], - ordinal: [x] - }; - const et$1 = a$1; - const eu$1 = a$1; - const fa$1 = a$1; - const ff$1 = a$1; - const fi$1 = a$1; - const fil$1 = b$1; - const fo$1 = a$1; - const fr$1 = { - cardinal: [o, m, x], - ordinal: [o, x] - }; - const fur$1 = a$1; - const fy$1 = a$1; - const ga$1 = { - cardinal: [o, t, f$1, m, x], - ordinal: [o, x] - }; - const gd$1 = { - cardinal: [o, t, f$1, x], - ordinal: [o, t, f$1, x] - }; - const gl$1 = a$1; - const gsw$1 = a$1; - const gu$1 = { - cardinal: [o, x], - ordinal: [o, t, f$1, m, x] - }; - const guw$1 = a$1; - const gv$1 = { - cardinal: [o, t, f$1, m, x], - ordinal: [x] - }; - const ha$1 = a$1; - const haw$1 = a$1; - const he$1 = d$1; - const hi$1 = { - cardinal: [o, x], - ordinal: [o, t, f$1, m, x] - }; - const hnj$1 = c$1; - const hr$1 = { - cardinal: [o, f$1, x], - ordinal: [x] - }; - const hsb$1 = { - cardinal: [o, t, f$1, x], - ordinal: [x] - }; - const hu$1 = b$1; - const hy$1 = b$1; - const ia$1 = a$1; - const id$1 = c$1; - const ig$1 = c$1; - const ii$1 = c$1; - const io$1 = a$1; - const is$1 = a$1; - const it$1 = { - cardinal: [o, m, x], - ordinal: [m, x] - }; - const iu$1 = d$1; - const ja$1 = c$1; - const jbo$1 = c$1; - const jgo$1 = a$1; - const jmc$1 = a$1; - const jv$1 = c$1; - const jw$1 = c$1; - const ka$1 = { - cardinal: [o, x], - ordinal: [o, m, x] - }; - const kab$1 = a$1; - const kaj$1 = a$1; - const kcg$1 = a$1; - const kde$1 = c$1; - const kea$1 = c$1; - const kk$1 = { - cardinal: [o, x], - ordinal: [m, x] - }; - const kkj$1 = a$1; - const kl$1 = a$1; - const km$1 = c$1; - const kn$1 = a$1; - const ko$1 = c$1; - const ks$1 = a$1; - const ksb$1 = a$1; - const ksh$1 = { - cardinal: [z, o, x], - ordinal: [x] - }; - const ku$1 = a$1; - const kw$1 = { - cardinal: [z, o, t, f$1, m, x], - ordinal: [o, m, x] - }; - const ky$1 = a$1; - const lag$1 = { - cardinal: [z, o, x], - ordinal: [x] - }; - const lb$1 = a$1; - const lg$1 = a$1; - const lij$1 = { - cardinal: [o, x], - ordinal: [m, x] - }; - const lkt$1 = c$1; - const ln$1 = a$1; - const lo$1 = { - cardinal: [x], - ordinal: [o, x] - }; - const lt$1 = { - cardinal: [o, f$1, m, x], - ordinal: [x] - }; - const lv$1 = { - cardinal: [z, o, x], - ordinal: [x] - }; - const mas$1 = a$1; - const mg$1 = a$1; - const mgo$1 = a$1; - const mk$1 = { - cardinal: [o, x], - ordinal: [o, t, m, x] - }; - const ml$1 = a$1; - const mn$1 = a$1; - const mo$1 = { - cardinal: [o, f$1, x], - ordinal: [o, x] - }; - const mr$1 = { - cardinal: [o, x], - ordinal: [o, t, f$1, x] - }; - const ms$1 = { - cardinal: [x], - ordinal: [o, x] - }; - const mt$1 = { - cardinal: [o, t, f$1, m, x], - ordinal: [x] - }; - const my$1 = c$1; - const nah$1 = a$1; - const naq$1 = d$1; - const nb$1 = a$1; - const nd$1 = a$1; - const ne$1 = b$1; - const nl$1 = a$1; - const nn$1 = a$1; - const nnh$1 = a$1; - const no$1 = a$1; - const nqo$1 = c$1; - const nr$1 = a$1; - const nso$1 = a$1; - const ny$1 = a$1; - const nyn$1 = a$1; - const om$1 = a$1; - const or$1 = { - cardinal: [o, x], - ordinal: [o, t, f$1, m, x] - }; - const os$1 = a$1; - const osa$1 = c$1; - const pa$1 = a$1; - const pap$1 = a$1; - const pcm$1 = a$1; - const pl$1 = { - cardinal: [o, f$1, m, x], - ordinal: [x] - }; - const prg$1 = { - cardinal: [z, o, x], - ordinal: [x] - }; - const ps$1 = a$1; - const pt$1 = { - cardinal: [o, m, x], - ordinal: [x] - }; - const pt_PT$1 = { - cardinal: [o, m, x], - ordinal: [x] - }; - const rm$1 = a$1; - const ro$1 = { - cardinal: [o, f$1, x], - ordinal: [o, x] - }; - const rof$1 = a$1; - const ru$1 = { - cardinal: [o, f$1, m, x], - ordinal: [x] - }; - const rwk$1 = a$1; - const sah$1 = c$1; - const saq$1 = a$1; - const sat$1 = d$1; - const sc$1 = { - cardinal: [o, x], - ordinal: [m, x] - }; - const scn$1 = { - cardinal: [o, x], - ordinal: [m, x] - }; - const sd$1 = a$1; - const sdh$1 = a$1; - const se$1 = d$1; - const seh$1 = a$1; - const ses$1 = c$1; - const sg$1 = c$1; - const sh$1 = { - cardinal: [o, f$1, x], - ordinal: [x] - }; - const shi$1 = { - cardinal: [o, f$1, x], - ordinal: [x] - }; - const si$1 = a$1; - const sk$1 = { - cardinal: [o, f$1, m, x], - ordinal: [x] - }; - const sl$1 = { - cardinal: [o, t, f$1, x], - ordinal: [x] - }; - const sma$1 = d$1; - const smi$1 = d$1; - const smj$1 = d$1; - const smn$1 = d$1; - const sms$1 = d$1; - const sn$1 = a$1; - const so$1 = a$1; - const sq$1 = { - cardinal: [o, x], - ordinal: [o, m, x] - }; - const sr$1 = { - cardinal: [o, f$1, x], - ordinal: [x] - }; - const ss$1 = a$1; - const ssy$1 = a$1; - const st$1 = a$1; - const su$1 = c$1; - const sv$1 = b$1; - const sw$1 = a$1; - const syr$1 = a$1; - const ta$1 = a$1; - const te$1 = a$1; - const teo$1 = a$1; - const th$1 = c$1; - const ti$1 = a$1; - const tig$1 = a$1; - const tk$1 = { - cardinal: [o, x], - ordinal: [f$1, x] - }; - const tl$1 = b$1; - const tn$1 = a$1; - const to$1 = c$1; - const tpi$1 = c$1; - const tr$1 = a$1; - const ts$1 = a$1; - const tzm$1 = a$1; - const ug$1 = a$1; - const uk$1 = { - cardinal: [o, f$1, m, x], - ordinal: [f$1, x] - }; - const und$1 = c$1; - const ur$1 = a$1; - const uz$1 = a$1; - const ve$1 = a$1; - const vec$1 = { - cardinal: [o, m, x], - ordinal: [m, x] - }; - const vi$1 = { - cardinal: [x], - ordinal: [o, x] - }; - const vo$1 = a$1; - const vun$1 = a$1; - const wa$1 = a$1; - const wae$1 = a$1; - const wo$1 = c$1; - const xh$1 = a$1; - const xog$1 = a$1; - const yi$1 = a$1; - const yo$1 = c$1; - const yue$1 = c$1; - const zh$1 = c$1; - const zu$1 = a$1; - - var PluralCategories = /*#__PURE__*/Object.freeze({ - __proto__: null, - af: af$1, - ak: ak$1, - am: am$1, - an: an$1, - ar: ar$1, - ars: ars$1, - as: as$1, - asa: asa$1, - ast: ast$1, - az: az$1, - bal: bal$1, - be: be$1, - bem: bem$1, - bez: bez$1, - bg: bg$1, - bho: bho$1, - bm: bm$1, - bn: bn$1, - bo: bo$1, - br: br$1, - brx: brx$1, - bs: bs$1, - ca: ca$1, - ce: ce$1, - ceb: ceb$1, - cgg: cgg$1, - chr: chr$1, - ckb: ckb$1, - cs: cs$1, - cy: cy$1, - da: da$1, - de: de$1, - doi: doi$1, - dsb: dsb$1, - dv: dv$1, - dz: dz$1, - ee: ee$1, - el: el$1, - en: en$1, - eo: eo$1, - es: es$1, - et: et$1, - eu: eu$1, - fa: fa$1, - ff: ff$1, - fi: fi$1, - fil: fil$1, - fo: fo$1, - fr: fr$1, - fur: fur$1, - fy: fy$1, - ga: ga$1, - gd: gd$1, - gl: gl$1, - gsw: gsw$1, - gu: gu$1, - guw: guw$1, - gv: gv$1, - ha: ha$1, - haw: haw$1, - he: he$1, - hi: hi$1, - hnj: hnj$1, - hr: hr$1, - hsb: hsb$1, - hu: hu$1, - hy: hy$1, - ia: ia$1, - id: id$1, - ig: ig$1, - ii: ii$1, - io: io$1, - is: is$1, - it: it$1, - iu: iu$1, - ja: ja$1, - jbo: jbo$1, - jgo: jgo$1, - jmc: jmc$1, - jv: jv$1, - jw: jw$1, - ka: ka$1, - kab: kab$1, - kaj: kaj$1, - kcg: kcg$1, - kde: kde$1, - kea: kea$1, - kk: kk$1, - kkj: kkj$1, - kl: kl$1, - km: km$1, - kn: kn$1, - ko: ko$1, - ks: ks$1, - ksb: ksb$1, - ksh: ksh$1, - ku: ku$1, - kw: kw$1, - ky: ky$1, - lag: lag$1, - lb: lb$1, - lg: lg$1, - lij: lij$1, - lkt: lkt$1, - ln: ln$1, - lo: lo$1, - lt: lt$1, - lv: lv$1, - mas: mas$1, - mg: mg$1, - mgo: mgo$1, - mk: mk$1, - ml: ml$1, - mn: mn$1, - mo: mo$1, - mr: mr$1, - ms: ms$1, - mt: mt$1, - my: my$1, - nah: nah$1, - naq: naq$1, - nb: nb$1, - nd: nd$1, - ne: ne$1, - nl: nl$1, - nn: nn$1, - nnh: nnh$1, - no: no$1, - nqo: nqo$1, - nr: nr$1, - nso: nso$1, - ny: ny$1, - nyn: nyn$1, - om: om$1, - or: or$1, - os: os$1, - osa: osa$1, - pa: pa$1, - pap: pap$1, - pcm: pcm$1, - pl: pl$1, - prg: prg$1, - ps: ps$1, - pt: pt$1, - pt_PT: pt_PT$1, - rm: rm$1, - ro: ro$1, - rof: rof$1, - ru: ru$1, - rwk: rwk$1, - sah: sah$1, - saq: saq$1, - sat: sat$1, - sc: sc$1, - scn: scn$1, - sd: sd$1, - sdh: sdh$1, - se: se$1, - seh: seh$1, - ses: ses$1, - sg: sg$1, - sh: sh$1, - shi: shi$1, - si: si$1, - sk: sk$1, - sl: sl$1, - sma: sma$1, - smi: smi$1, - smj: smj$1, - smn: smn$1, - sms: sms$1, - sn: sn$1, - so: so$1, - sq: sq$1, - sr: sr$1, - ss: ss$1, - ssy: ssy$1, - st: st$1, - su: su$1, - sv: sv$1, - sw: sw$1, - syr: syr$1, - ta: ta$1, - te: te$1, - teo: teo$1, - th: th$1, - ti: ti$1, - tig: tig$1, - tk: tk$1, - tl: tl$1, - tn: tn$1, - to: to$1, - tpi: tpi$1, - tr: tr$1, - ts: ts$1, - tzm: tzm$1, - ug: ug$1, - uk: uk$1, - und: und$1, - ur: ur$1, - uz: uz$1, - ve: ve$1, - vec: vec$1, - vi: vi$1, - vo: vo$1, - vun: vun$1, - wa: wa$1, - wae: wae$1, - wo: wo$1, - xh: xh$1, - xog: xog$1, - yi: yi$1, - yo: yo$1, - yue: yue$1, - zh: zh$1, - zu: zu$1 - }); - - const a = (n, ord) => { - if (ord) return 'other'; - return n == 1 ? 'one' : 'other'; - }; - const b = (n, ord) => { - if (ord) return 'other'; - return n == 0 || n == 1 ? 'one' : 'other'; - }; - const c = (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; - }; - const d = (n, ord) => { - const s = String(n).split('.'), - v0 = !s[1]; - if (ord) return 'other'; - return n == 1 && v0 ? 'one' : 'other'; - }; - const e = (n, ord) => 'other'; - const f = (n, ord) => { - if (ord) return 'other'; - return n == 1 ? 'one' : n == 2 ? 'two' : 'other'; - }; - const af = a; - const ak = b; - const am = c; - const an = a; - const ar = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2); - if (ord) return 'other'; - return n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 99 ? 'many' : 'other'; - }; - const ars = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2); - if (ord) return 'other'; - return n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 99 ? 'many' : 'other'; - }; - const as = (n, ord) => { - if (ord) return n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : n == 6 ? 'many' : 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; - }; - const asa = a; - const ast = d; - const az = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - i10 = i.slice(-1), - i100 = i.slice(-2), - i1000 = i.slice(-3); - if (ord) return i10 == 1 || i10 == 2 || i10 == 5 || i10 == 7 || i10 == 8 || i100 == 20 || i100 == 50 || i100 == 70 || i100 == 80 ? 'one' : i10 == 3 || i10 == 4 || i1000 == 100 || i1000 == 200 || i1000 == 300 || i1000 == 400 || i1000 == 500 || i1000 == 600 || i1000 == 700 || i1000 == 800 || i1000 == 900 ? 'few' : i == 0 || i10 == 6 || i100 == 40 || i100 == 60 || i100 == 90 ? 'many' : 'other'; - return n == 1 ? 'one' : 'other'; - }; - const bal = (n, ord) => n == 1 ? 'one' : 'other'; - const be = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2); - if (ord) return (n10 == 2 || n10 == 3) && n100 != 12 && n100 != 13 ? 'few' : 'other'; - return n10 == 1 && n100 != 11 ? 'one' : n10 >= 2 && n10 <= 4 && (n100 < 12 || n100 > 14) ? 'few' : t0 && n10 == 0 || n10 >= 5 && n10 <= 9 || n100 >= 11 && n100 <= 14 ? 'many' : 'other'; - }; - const bem = a; - const bez = a; - const bg = a; - const bho = b; - const bm = e; - const bn = (n, ord) => { - if (ord) return n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : n == 6 ? 'many' : 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; - }; - const bo = e; - const br = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2), - n1000000 = t0 && s[0].slice(-6); - if (ord) return 'other'; - return n10 == 1 && n100 != 11 && n100 != 71 && n100 != 91 ? 'one' : n10 == 2 && n100 != 12 && n100 != 72 && n100 != 92 ? 'two' : (n10 == 3 || n10 == 4 || n10 == 9) && (n100 < 10 || n100 > 19) && (n100 < 70 || n100 > 79) && (n100 < 90 || n100 > 99) ? 'few' : n != 0 && t0 && n1000000 == 0 ? 'many' : 'other'; - }; - const brx = a; - const bs = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2), - f10 = f.slice(-1), - f100 = f.slice(-2); - if (ord) return 'other'; - return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other'; - }; - const ca = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - if (ord) return n == 1 || n == 3 ? 'one' : n == 2 ? 'two' : n == 4 ? 'few' : 'other'; - return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const ce = a; - const ceb = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - f10 = f.slice(-1); - if (ord) return 'other'; - return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other'; - }; - const cgg = a; - const chr = a; - const ckb = a; - const cs = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1]; - if (ord) return 'other'; - return n == 1 && v0 ? 'one' : i >= 2 && i <= 4 && v0 ? 'few' : !v0 ? 'many' : 'other'; - }; - const cy = (n, ord) => { - if (ord) return n == 0 || n == 7 || n == 8 || n == 9 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n == 3 || n == 4 ? 'few' : n == 5 || n == 6 ? 'many' : 'other'; - return n == 0 ? 'zero' : n == 1 ? 'one' : n == 2 ? 'two' : n == 3 ? 'few' : n == 6 ? 'many' : 'other'; - }; - const da = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - t0 = Number(s[0]) == n; - if (ord) return 'other'; - return n == 1 || !t0 && (i == 0 || i == 1) ? 'one' : 'other'; - }; - const de = d; - const doi = c; - const dsb = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i100 = i.slice(-2), - f100 = f.slice(-2); - if (ord) return 'other'; - return v0 && i100 == 1 || f100 == 1 ? 'one' : v0 && i100 == 2 || f100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || f100 == 3 || f100 == 4 ? 'few' : 'other'; - }; - const dv = a; - const dz = e; - const ee = a; - const el = a; - const en = (n, ord) => { - const s = String(n).split('.'), - v0 = !s[1], - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2); - if (ord) return n10 == 1 && n100 != 11 ? 'one' : n10 == 2 && n100 != 12 ? 'two' : n10 == 3 && n100 != 13 ? 'few' : 'other'; - return n == 1 && v0 ? 'one' : 'other'; - }; - const eo = a; - const es = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - if (ord) return 'other'; - return n == 1 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const et = d; - const eu = a; - const fa = c; - const ff = (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n < 2 ? 'one' : 'other'; - }; - const fi = d; - const fil = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - f10 = f.slice(-1); - if (ord) return n == 1 ? 'one' : 'other'; - return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other'; - }; - const fo = a; - const fr = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - if (ord) return n == 1 ? 'one' : 'other'; - return n >= 0 && n < 2 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const fur = a; - const fy = d; - const ga = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n; - if (ord) return n == 1 ? 'one' : 'other'; - return n == 1 ? 'one' : n == 2 ? 'two' : t0 && n >= 3 && n <= 6 ? 'few' : t0 && n >= 7 && n <= 10 ? 'many' : 'other'; - }; - const gd = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n; - if (ord) return n == 1 || n == 11 ? 'one' : n == 2 || n == 12 ? 'two' : n == 3 || n == 13 ? 'few' : 'other'; - return n == 1 || n == 11 ? 'one' : n == 2 || n == 12 ? 'two' : t0 && n >= 3 && n <= 10 || t0 && n >= 13 && n <= 19 ? 'few' : 'other'; - }; - const gl = d; - const gsw = a; - const gu = (n, ord) => { - if (ord) return n == 1 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : n == 6 ? 'many' : 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; - }; - const guw = b; - const gv = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2); - if (ord) return 'other'; - return v0 && i10 == 1 ? 'one' : v0 && i10 == 2 ? 'two' : v0 && (i100 == 0 || i100 == 20 || i100 == 40 || i100 == 60 || i100 == 80) ? 'few' : !v0 ? 'many' : 'other'; - }; - const ha = a; - const haw = a; - const he = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1]; - if (ord) return 'other'; - return i == 1 && v0 || i == 0 && !v0 ? 'one' : i == 2 && v0 ? 'two' : 'other'; - }; - const hi = (n, ord) => { - if (ord) return n == 1 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : n == 6 ? 'many' : 'other'; - return n >= 0 && n <= 1 ? 'one' : 'other'; - }; - const hnj = e; - const hr = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2), - f10 = f.slice(-1), - f100 = f.slice(-2); - if (ord) return 'other'; - return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other'; - }; - const hsb = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i100 = i.slice(-2), - f100 = f.slice(-2); - if (ord) return 'other'; - return v0 && i100 == 1 || f100 == 1 ? 'one' : v0 && i100 == 2 || f100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || f100 == 3 || f100 == 4 ? 'few' : 'other'; - }; - const hu = (n, ord) => { - if (ord) return n == 1 || n == 5 ? 'one' : 'other'; - return n == 1 ? 'one' : 'other'; - }; - const hy = (n, ord) => { - if (ord) return n == 1 ? 'one' : 'other'; - return n >= 0 && n < 2 ? 'one' : 'other'; - }; - const ia = d; - const id = e; - const ig = e; - const ii = e; - const io = d; - const is = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - t = (s[1] || '').replace(/0+$/, ''), - t0 = Number(s[0]) == n, - i10 = i.slice(-1), - i100 = i.slice(-2); - if (ord) return 'other'; - return t0 && i10 == 1 && i100 != 11 || t % 10 == 1 && t % 100 != 11 ? 'one' : 'other'; - }; - const it = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - if (ord) return n == 11 || n == 8 || n == 80 || n == 800 ? 'many' : 'other'; - return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const iu = f; - const ja = e; - const jbo = e; - const jgo = a; - const jmc = a; - const jv = e; - const jw = e; - const ka = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - i100 = i.slice(-2); - if (ord) return i == 1 ? 'one' : i == 0 || i100 >= 2 && i100 <= 20 || i100 == 40 || i100 == 60 || i100 == 80 ? 'many' : 'other'; - return n == 1 ? 'one' : 'other'; - }; - const kab = (n, ord) => { - if (ord) return 'other'; - return n >= 0 && n < 2 ? 'one' : 'other'; - }; - const kaj = a; - const kcg = a; - const kde = e; - const kea = e; - const kk = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1); - if (ord) return n10 == 6 || n10 == 9 || t0 && n10 == 0 && n != 0 ? 'many' : 'other'; - return n == 1 ? 'one' : 'other'; - }; - const kkj = a; - const kl = a; - const km = e; - const kn = c; - const ko = e; - const ks = a; - const ksb = a; - const ksh = (n, ord) => { - if (ord) return 'other'; - return n == 0 ? 'zero' : n == 1 ? 'one' : 'other'; - }; - const ku = a; - const kw = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2), - n1000 = t0 && s[0].slice(-3), - n100000 = t0 && s[0].slice(-5), - n1000000 = t0 && s[0].slice(-6); - if (ord) return t0 && n >= 1 && n <= 4 || n100 >= 1 && n100 <= 4 || n100 >= 21 && n100 <= 24 || n100 >= 41 && n100 <= 44 || n100 >= 61 && n100 <= 64 || n100 >= 81 && n100 <= 84 ? 'one' : n == 5 || n100 == 5 ? 'many' : 'other'; - return n == 0 ? 'zero' : n == 1 ? 'one' : n100 == 2 || n100 == 22 || n100 == 42 || n100 == 62 || n100 == 82 || t0 && n1000 == 0 && (n100000 >= 1000 && n100000 <= 20000 || n100000 == 40000 || n100000 == 60000 || n100000 == 80000) || n != 0 && n1000000 == 100000 ? 'two' : n100 == 3 || n100 == 23 || n100 == 43 || n100 == 63 || n100 == 83 ? 'few' : n != 1 && (n100 == 1 || n100 == 21 || n100 == 41 || n100 == 61 || n100 == 81) ? 'many' : 'other'; - }; - const ky = a; - const lag = (n, ord) => { - const s = String(n).split('.'), - i = s[0]; - if (ord) return 'other'; - return n == 0 ? 'zero' : (i == 0 || i == 1) && n != 0 ? 'one' : 'other'; - }; - const lb = a; - const lg = a; - const lij = (n, ord) => { - const s = String(n).split('.'), - v0 = !s[1], - t0 = Number(s[0]) == n; - if (ord) return n == 11 || n == 8 || t0 && n >= 80 && n <= 89 || t0 && n >= 800 && n <= 899 ? 'many' : 'other'; - return n == 1 && v0 ? 'one' : 'other'; - }; - const lkt = e; - const ln = b; - const lo = (n, ord) => { - if (ord) return n == 1 ? 'one' : 'other'; - return 'other'; - }; - const lt = (n, ord) => { - const s = String(n).split('.'), - f = s[1] || '', - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2); - if (ord) return 'other'; - return n10 == 1 && (n100 < 11 || n100 > 19) ? 'one' : n10 >= 2 && n10 <= 9 && (n100 < 11 || n100 > 19) ? 'few' : f != 0 ? 'many' : 'other'; - }; - const lv = (n, ord) => { - const s = String(n).split('.'), - f = s[1] || '', - v = f.length, - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2), - f100 = f.slice(-2), - f10 = f.slice(-1); - if (ord) return 'other'; - return t0 && n10 == 0 || n100 >= 11 && n100 <= 19 || v == 2 && f100 >= 11 && f100 <= 19 ? 'zero' : n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11 || v != 2 && f10 == 1 ? 'one' : 'other'; - }; - const mas = a; - const mg = b; - const mgo = a; - const mk = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2), - f10 = f.slice(-1), - f100 = f.slice(-2); - if (ord) return i10 == 1 && i100 != 11 ? 'one' : i10 == 2 && i100 != 12 ? 'two' : (i10 == 7 || i10 == 8) && i100 != 17 && i100 != 18 ? 'many' : 'other'; - return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : 'other'; - }; - const ml = a; - const mn = a; - const mo = (n, ord) => { - const s = String(n).split('.'), - v0 = !s[1], - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2); - if (ord) return n == 1 ? 'one' : 'other'; - return n == 1 && v0 ? 'one' : !v0 || n == 0 || n != 1 && n100 >= 1 && n100 <= 19 ? 'few' : 'other'; - }; - const mr = (n, ord) => { - if (ord) return n == 1 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : 'other'; - return n == 1 ? 'one' : 'other'; - }; - const ms = (n, ord) => { - if (ord) return n == 1 ? 'one' : 'other'; - return 'other'; - }; - const mt = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2); - if (ord) return 'other'; - return n == 1 ? 'one' : n == 2 ? 'two' : n == 0 || n100 >= 3 && n100 <= 10 ? 'few' : n100 >= 11 && n100 <= 19 ? 'many' : 'other'; - }; - const my = e; - const nah = a; - const naq = f; - const nb = a; - const nd = a; - const ne = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n; - if (ord) return t0 && n >= 1 && n <= 4 ? 'one' : 'other'; - return n == 1 ? 'one' : 'other'; - }; - const nl = d; - const nn = a; - const nnh = a; - const no = a; - const nqo = e; - const nr = a; - const nso = b; - const ny = a; - const nyn = a; - const om = a; - const or = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n; - if (ord) return n == 1 || n == 5 || t0 && n >= 7 && n <= 9 ? 'one' : n == 2 || n == 3 ? 'two' : n == 4 ? 'few' : n == 6 ? 'many' : 'other'; - return n == 1 ? 'one' : 'other'; - }; - const os = a; - const osa = e; - const pa = b; - const pap = a; - const pcm = c; - const pl = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2); - if (ord) return 'other'; - return n == 1 && v0 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i != 1 && (i10 == 0 || i10 == 1) || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 12 && i100 <= 14 ? 'many' : 'other'; - }; - const prg = (n, ord) => { - const s = String(n).split('.'), - f = s[1] || '', - v = f.length, - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2), - f100 = f.slice(-2), - f10 = f.slice(-1); - if (ord) return 'other'; - return t0 && n10 == 0 || n100 >= 11 && n100 <= 19 || v == 2 && f100 >= 11 && f100 <= 19 ? 'zero' : n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11 || v != 2 && f10 == 1 ? 'one' : 'other'; - }; - const ps = a; - const pt = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - if (ord) return 'other'; - return i == 0 || i == 1 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const pt_PT = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - if (ord) return 'other'; - return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const rm = a; - const ro = (n, ord) => { - const s = String(n).split('.'), - v0 = !s[1], - t0 = Number(s[0]) == n, - n100 = t0 && s[0].slice(-2); - if (ord) return n == 1 ? 'one' : 'other'; - return n == 1 && v0 ? 'one' : !v0 || n == 0 || n != 1 && n100 >= 1 && n100 <= 19 ? 'few' : 'other'; - }; - const rof = a; - const ru = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2); - if (ord) return 'other'; - return v0 && i10 == 1 && i100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i10 == 0 || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 11 && i100 <= 14 ? 'many' : 'other'; - }; - const rwk = a; - const sah = e; - const saq = a; - const sat = f; - const sc = (n, ord) => { - const s = String(n).split('.'), - v0 = !s[1]; - if (ord) return n == 11 || n == 8 || n == 80 || n == 800 ? 'many' : 'other'; - return n == 1 && v0 ? 'one' : 'other'; - }; - const scn = (n, ord) => { - const s = String(n).split('.'), - v0 = !s[1]; - if (ord) return n == 11 || n == 8 || n == 80 || n == 800 ? 'many' : 'other'; - return n == 1 && v0 ? 'one' : 'other'; - }; - const sd = a; - const sdh = a; - const se = f; - const seh = a; - const ses = e; - const sg = e; - const sh = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2), - f10 = f.slice(-1), - f100 = f.slice(-2); - if (ord) return 'other'; - return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other'; - }; - const shi = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n; - if (ord) return 'other'; - return n >= 0 && n <= 1 ? 'one' : t0 && n >= 2 && n <= 10 ? 'few' : 'other'; - }; - const si = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || ''; - if (ord) return 'other'; - return n == 0 || n == 1 || i == 0 && f == 1 ? 'one' : 'other'; - }; - const sk = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1]; - if (ord) return 'other'; - return n == 1 && v0 ? 'one' : i >= 2 && i <= 4 && v0 ? 'few' : !v0 ? 'many' : 'other'; - }; - const sl = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i100 = i.slice(-2); - if (ord) return 'other'; - return v0 && i100 == 1 ? 'one' : v0 && i100 == 2 ? 'two' : v0 && (i100 == 3 || i100 == 4) || !v0 ? 'few' : 'other'; - }; - const sma = f; - const smi = f; - const smj = f; - const smn = f; - const sms = f; - const sn = a; - const so = a; - const sq = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2); - if (ord) return n == 1 ? 'one' : n10 == 4 && n100 != 14 ? 'many' : 'other'; - return n == 1 ? 'one' : 'other'; - }; - const sr = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - i100 = i.slice(-2), - f10 = f.slice(-1), - f100 = f.slice(-2); - if (ord) return 'other'; - return v0 && i10 == 1 && i100 != 11 || f10 == 1 && f100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) || f10 >= 2 && f10 <= 4 && (f100 < 12 || f100 > 14) ? 'few' : 'other'; - }; - const ss = a; - const ssy = a; - const st = a; - const su = e; - const sv = (n, ord) => { - const s = String(n).split('.'), - v0 = !s[1], - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2); - if (ord) return (n10 == 1 || n10 == 2) && n100 != 11 && n100 != 12 ? 'one' : 'other'; - return n == 1 && v0 ? 'one' : 'other'; - }; - const sw = d; - const syr = a; - const ta = a; - const te = a; - const teo = a; - const th = e; - const ti = b; - const tig = a; - const tk = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1); - if (ord) return n10 == 6 || n10 == 9 || n == 10 ? 'few' : 'other'; - return n == 1 ? 'one' : 'other'; - }; - const tl = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - f = s[1] || '', - v0 = !s[1], - i10 = i.slice(-1), - f10 = f.slice(-1); - if (ord) return n == 1 ? 'one' : 'other'; - return v0 && (i == 1 || i == 2 || i == 3) || v0 && i10 != 4 && i10 != 6 && i10 != 9 || !v0 && f10 != 4 && f10 != 6 && f10 != 9 ? 'one' : 'other'; - }; - const tn = a; - const to = e; - const tpi = e; - const tr = a; - const ts = a; - const tzm = (n, ord) => { - const s = String(n).split('.'), - t0 = Number(s[0]) == n; - if (ord) return 'other'; - return n == 0 || n == 1 || t0 && n >= 11 && n <= 99 ? 'one' : 'other'; - }; - const ug = a; - const uk = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2), - i10 = i.slice(-1), - i100 = i.slice(-2); - if (ord) return n10 == 3 && n100 != 13 ? 'few' : 'other'; - return v0 && i10 == 1 && i100 != 11 ? 'one' : v0 && i10 >= 2 && i10 <= 4 && (i100 < 12 || i100 > 14) ? 'few' : v0 && i10 == 0 || v0 && i10 >= 5 && i10 <= 9 || v0 && i100 >= 11 && i100 <= 14 ? 'many' : 'other'; - }; - const und = e; - const ur = d; - const uz = a; - const ve = a; - const vec = (n, ord) => { - const s = String(n).split('.'), - i = s[0], - v0 = !s[1], - i1000000 = i.slice(-6); - if (ord) return n == 11 || n == 8 || n == 80 || n == 800 ? 'many' : 'other'; - return n == 1 && v0 ? 'one' : i != 0 && i1000000 == 0 && v0 ? 'many' : 'other'; - }; - const vi = (n, ord) => { - if (ord) return n == 1 ? 'one' : 'other'; - return 'other'; - }; - const vo = a; - const vun = a; - const wa = b; - const wae = a; - const wo = e; - const xh = a; - const xog = a; - const yi = d; - const yo = e; - const yue = e; - const zh = e; - const zu = c; - - var Plurals = /*#__PURE__*/Object.freeze({ - __proto__: null, - af: af, - ak: ak, - am: am, - an: an, - ar: ar, - ars: ars, - as: as, - asa: asa, - ast: ast, - az: az, - bal: bal, - be: be, - bem: bem, - bez: bez, - bg: bg, - bho: bho, - bm: bm, - bn: bn, - bo: bo, - br: br, - brx: brx, - bs: bs, - ca: ca, - ce: ce, - ceb: ceb, - cgg: cgg, - chr: chr, - ckb: ckb, - cs: cs, - cy: cy, - da: da, - de: de, - doi: doi, - dsb: dsb, - dv: dv, - dz: dz, - ee: ee, - el: el, - en: en, - eo: eo, - es: es, - et: et, - eu: eu, - fa: fa, - ff: ff, - fi: fi, - fil: fil, - fo: fo, - fr: fr, - fur: fur, - fy: fy, - ga: ga, - gd: gd, - gl: gl, - gsw: gsw, - gu: gu, - guw: guw, - gv: gv, - ha: ha, - haw: haw, - he: he, - hi: hi, - hnj: hnj, - hr: hr, - hsb: hsb, - hu: hu, - hy: hy, - ia: ia, - id: id, - ig: ig, - ii: ii, - io: io, - is: is, - it: it, - iu: iu, - ja: ja, - jbo: jbo, - jgo: jgo, - jmc: jmc, - jv: jv, - jw: jw, - ka: ka, - kab: kab, - kaj: kaj, - kcg: kcg, - kde: kde, - kea: kea, - kk: kk, - kkj: kkj, - kl: kl, - km: km, - kn: kn, - ko: ko, - ks: ks, - ksb: ksb, - ksh: ksh, - ku: ku, - kw: kw, - ky: ky, - lag: lag, - lb: lb, - lg: lg, - lij: lij, - lkt: lkt, - ln: ln, - lo: lo, - lt: lt, - lv: lv, - mas: mas, - mg: mg, - mgo: mgo, - mk: mk, - ml: ml, - mn: mn, - mo: mo, - mr: mr, - ms: ms, - mt: mt, - my: my, - nah: nah, - naq: naq, - nb: nb, - nd: nd, - ne: ne, - nl: nl, - nn: nn, - nnh: nnh, - no: no, - nqo: nqo, - nr: nr, - nso: nso, - ny: ny, - nyn: nyn, - om: om, - or: or, - os: os, - osa: osa, - pa: pa, - pap: pap, - pcm: pcm, - pl: pl, - prg: prg, - ps: ps, - pt: pt, - pt_PT: pt_PT, - rm: rm, - ro: ro, - rof: rof, - ru: ru, - rwk: rwk, - sah: sah, - saq: saq, - sat: sat, - sc: sc, - scn: scn, - sd: sd, - sdh: sdh, - se: se, - seh: seh, - ses: ses, - sg: sg, - sh: sh, - shi: shi, - si: si, - sk: sk, - sl: sl, - sma: sma, - smi: smi, - smj: smj, - smn: smn, - sms: sms, - sn: sn, - so: so, - sq: sq, - sr: sr, - ss: ss, - ssy: ssy, - st: st, - su: su, - sv: sv, - sw: sw, - syr: syr, - ta: ta, - te: te, - teo: teo, - th: th, - ti: ti, - tig: tig, - tk: tk, - tl: tl, - tn: tn, - to: to, - tpi: tpi, - tr: tr, - ts: ts, - tzm: tzm, - ug: ug, - uk: uk, - und: und, - ur: ur, - uz: uz, - ve: ve, - vec: vec, - vi: vi, - vo: vo, - vun: vun, - wa: wa, - wae: wae, - wo: wo, - xh: xh, - xog: xog, - yi: yi, - yo: yo, - yue: yue, - zh: zh, - zu: zu - }); - - function normalize(locale) { - if (typeof locale !== 'string' || locale.length < 2) - throw new RangeError("Invalid language tag: ".concat(locale)); - if (locale.startsWith('pt-PT')) - return 'pt-PT'; - var m = locale.match(/.+?(?=[-_])/); - return m ? m[0] : locale; - } - function getPlural(locale) { - if (typeof locale === 'function') { - var lc_1 = normalize(locale.name); - return { - isDefault: false, - id: identifier(lc_1), - lc: lc_1, - locale: locale.name, - getPlural: locale, - cardinals: locale.cardinals || [], - ordinals: locale.ordinals || [] - }; - } - var lc = normalize(locale); - var id = identifier(lc); - if (isPluralId(id)) { - return { - isDefault: true, - id: id, - lc: lc, - locale: locale, - getCardinal: Cardinals[id], - getPlural: Plurals[id], - cardinals: PluralCategories[id].cardinal, - ordinals: PluralCategories[id].ordinal - }; - } - return null; - } - function getAllPlurals(firstLocale) { - var keys = Object.keys(Plurals).filter(function (key) { return key !== firstLocale; }); - keys.unshift(firstLocale); - return keys.map(getPlural); - } - function hasPlural(locale) { - var lc = normalize(locale); - return identifier(lc) in Plurals; - } - function isPluralId(id) { - return id in Plurals; - } - - var MessageFormat = (function () { - function MessageFormat(locale, options) { - this.plurals = []; - this.options = Object.assign({ - biDiSupport: false, - currency: 'USD', - customFormatters: {}, - localeCodeFromKey: null, - requireAllArguments: false, - returnType: 'string', - strict: (options && options.strictNumberSign) || false, - strictPluralKeys: true - }, options); - if (locale === '*') { - this.plurals = getAllPlurals(MessageFormat.defaultLocale); - } - else if (Array.isArray(locale)) { - this.plurals = locale.map(getPlural).filter(Boolean); - } - else if (locale) { - var pl = getPlural(locale); - if (pl) - this.plurals = [pl]; - } - if (this.plurals.length === 0) { - var pl = getPlural(MessageFormat.defaultLocale); - this.plurals = [pl]; - } - } - MessageFormat.escape = function (str, octothorpe) { - var esc = octothorpe ? /[#{}]/g : /[{}]/g; - return String(str).replace(esc, "'$&'"); - }; - MessageFormat.supportedLocalesOf = function (locales) { - var la = Array.isArray(locales) ? locales : [locales]; - return la.filter(hasPlural); - }; - MessageFormat.prototype.resolvedOptions = function () { - return __assign(__assign({}, this.options), { locale: this.plurals[0].locale, plurals: this.plurals }); - }; - MessageFormat.prototype.compile = function (message) { - var e_1, _a; - var compiler = new Compiler(this.options); - var fnBody = 'return ' + compiler.compile(message, this.plurals[0]); - var nfArgs = []; - var fnArgs = []; - try { - for (var _b = __values(Object.entries(compiler.runtime)), _c = _b.next(); !_c.done; _c = _b.next()) { - var _d = __read(_c.value, 2), key = _d[0], fmt = _d[1]; - nfArgs.push(key); - fnArgs.push(fmt); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - var fn = new (Function.bind.apply(Function, __spreadArray(__spreadArray([void 0], __read(nfArgs), false), [fnBody], false)))(); - return fn.apply(void 0, __spreadArray([], __read(fnArgs), false)); - }; - MessageFormat.defaultLocale = 'en'; - return MessageFormat; - }()); - - return MessageFormat; - -})); diff --git a/node_modules/@messageformat/core/package.json b/node_modules/@messageformat/core/package.json deleted file mode 100644 index 7bba516..0000000 --- a/node_modules/@messageformat/core/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "@messageformat/core", - "version": "3.2.0", - "description": "PluralFormat and SelectFormat Message and i18n Tool - A JavaScript Implemenation of the ICU standards.", - "keywords": [ - "i18n", - "pluralformat", - "icu", - "gettext", - "selectformat", - "messageformat", - "internationalization" - ], - "contributors": [ - "Alex Sexton ", - "Eemeli Aro " - ], - "license": "MIT", - "homepage": "http://messageformat.github.io/messageformat/api/core/", - "repository": { - "type": "git", - "url": "https://github.com/messageformat/messageformat.git", - "directory": "packages/core" - }, - "main": "lib/messageformat.js", - "browser": "./messageformat.js", - "files": [ - "compile-module.js", - "lib/", - "messageformat.js" - ], - "dependencies": { - "@messageformat/date-skeleton": "^1.0.0", - "@messageformat/number-skeleton": "^1.0.0", - "@messageformat/parser": "^5.1.0", - "@messageformat/runtime": "^3.0.1", - "make-plural": "^7.0.0", - "safe-identifier": "^0.4.1" - }, - "scripts": { - "build": "rollup -c", - "postbuild": "tsc -p tsconfig.declarations.json", - "extract-api": "api-extractor run --verbose" - } -} diff --git a/node_modules/@messageformat/date-skeleton/LICENSE b/node_modules/@messageformat/date-skeleton/LICENSE deleted file mode 100644 index 78918d5..0000000 --- a/node_modules/@messageformat/date-skeleton/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright OpenJS Foundation and contributors, https://openjsf.org/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@messageformat/date-skeleton/README.md b/node_modules/@messageformat/date-skeleton/README.md deleted file mode 100644 index b667925..0000000 --- a/node_modules/@messageformat/date-skeleton/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# @messageformat/date-skeleton - -Tools for working with [ICU DateFormat skeletons](http://userguide.icu-project.org/formatparse/datetime). - -```js -import { - DateFormatError, - DateToken, // TS only - getDateFormatter, - getDateFormatterSource, - parseDateTokens -} from '@messageformat/date-skeleton'; -``` - -The package is released as an ES module only. If using from a CommonJS context, you may need to `import()` it, or use a module loader like [esm](https://www.npmjs.com/package/esm). - -Uses [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat) internally. Position-dependent ICU DateFormat [patterns](https://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns) are not supported, as they cannot be represented with Intl.DateTimeFormat options. - -## Classes - -| Class | Description | -| ----------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -| [DateFormatError](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-date-skeleton.dateformaterror.md) | Parent class for errors. | - -## Functions - -| Function | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [getDateFormatter(locales, tokens, onError)](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-date-skeleton.getdateformatter.md) | Returns a date formatter function for the given locales and date skeleton | -| [getDateFormatterSource(locales, tokens, onError)](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-date-skeleton.getdateformattersource.md) | Returns a string of JavaScript source that evaluates to a date formatter function with the same (date: Date | number) => string signature as the function returned by [getDateFormatter()](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-date-skeleton.getdateformatter.md). | -| [parseDateTokens(src)](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-date-skeleton.parsedatetokens.md) | Parse an [ICU DateFormat skeleton](http://userguide.icu-project.org/formatparse/datetime) string into a [DateToken](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-date-skeleton.datetoken.md) array. | - -## Type Aliases - -| Type Alias | Description | -| ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | -| [DateToken](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-date-skeleton.datetoken.md) | An object representation of a parsed date skeleton token | - ---- - -[Messageformat] is an OpenJS Foundation project, and we follow its [Code of Conduct]. - -[messageformat]: https://messageformat.github.io/ -[code of conduct]: https://github.com/openjs-foundation/cross-project-council/blob/master/CODE_OF_CONDUCT.md - - -OpenJS Foundation - diff --git a/node_modules/@messageformat/date-skeleton/lib/get-date-formatter.d.ts b/node_modules/@messageformat/date-skeleton/lib/get-date-formatter.d.ts deleted file mode 100644 index 63f9a73..0000000 --- a/node_modules/@messageformat/date-skeleton/lib/get-date-formatter.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { DateFormatError } from './options.js'; -import { DateToken } from './tokens.js'; -/** - * Returns a date formatter function for the given locales and date skeleton - * - * @remarks - * Uses `Intl.DateTimeFormat` internally. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param tokens - An ICU DateFormat skeleton string, or an array or parsed - * `DateToken` tokens - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getDateFormatter } from '@messageformat/date-skeleton' - * - * // 2006 Jan 2, 15:04:05.789 in local time - * const date = new Date(2006, 0, 2, 15, 4, 5, 789) - * - * let fmt = getDateFormatter('en-CA', 'GrMMMdd', console.error) - * fmt(date) // 'Jan. 02, 2006 AD' - * - * fmt = getDateFormatter('en-CA', 'hamszzzz', console.error) - * fmt(date) // '3:04:05 p.m. Newfoundland Daylight Time' - * ``` - */ -export declare function getDateFormatter(locales: string | string[], tokens: string | DateToken[], onError?: (error: DateFormatError) => void): (date: Date | number) => string; -/** - * Returns a string of JavaScript source that evaluates to a date formatter - * function with the same `(date: Date | number) => string` signature as the - * function returned by {@link getDateFormatter}. - * - * @remarks - * The returned function will memoize an `Intl.DateTimeFormat` instance. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param tokens - An ICU DateFormat skeleton string, or an array or parsed - * `DateToken` tokens - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getDateFormatterSource } from '@messageformat/date-skeleton' - * - * getDateFormatterSource('en-CA', 'GrMMMdd', console.error) - * // '(function() {\n' + - * // ' var opt = {"era":"short","calendar":"gregory","year":"numeric",' + - * // '"month":"short","day":"2-digit"};\n' + - * // ' var dtf = new Intl.DateTimeFormat("en-CA", opt);\n' + - * // ' return function(value) { return dtf.format(value); }\n' + - * // '})()' - * - * const src = getDateFormatterSource('en-CA', 'hamszzzz', console.error) - * // '(function() {\n' + - * // ' var opt = {"hour":"numeric","hourCycle":"h12","minute":"numeric",' + - * // '"second":"numeric","timeZoneName":"long"};\n' + - * // ' var dtf = new Intl.DateTimeFormat("en-CA", opt);\n' + - * // ' return function(value) { return dtf.format(value); }\n' + - * // '})()' - * - * const fmt = new Function(`return ${src}`)() - * const date = new Date(2006, 0, 2, 15, 4, 5, 789) - * fmt(date) // '3:04:05 p.m. Newfoundland Daylight Time' - * ``` - */ -export declare function getDateFormatterSource(locales: string | string[], tokens: string | DateToken[], onError?: (err: DateFormatError) => void): string; diff --git a/node_modules/@messageformat/date-skeleton/lib/get-date-formatter.js b/node_modules/@messageformat/date-skeleton/lib/get-date-formatter.js deleted file mode 100644 index 3ad0d95..0000000 --- a/node_modules/@messageformat/date-skeleton/lib/get-date-formatter.js +++ /dev/null @@ -1,86 +0,0 @@ -import { getDateFormatOptions } from './options.js'; -import { parseDateTokens } from './tokens.js'; -/** - * Returns a date formatter function for the given locales and date skeleton - * - * @remarks - * Uses `Intl.DateTimeFormat` internally. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param tokens - An ICU DateFormat skeleton string, or an array or parsed - * `DateToken` tokens - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getDateFormatter } from '@messageformat/date-skeleton' - * - * // 2006 Jan 2, 15:04:05.789 in local time - * const date = new Date(2006, 0, 2, 15, 4, 5, 789) - * - * let fmt = getDateFormatter('en-CA', 'GrMMMdd', console.error) - * fmt(date) // 'Jan. 02, 2006 AD' - * - * fmt = getDateFormatter('en-CA', 'hamszzzz', console.error) - * fmt(date) // '3:04:05 p.m. Newfoundland Daylight Time' - * ``` - */ -export function getDateFormatter(locales, tokens, onError) { - if (typeof tokens === 'string') - tokens = parseDateTokens(tokens); - const opt = getDateFormatOptions(tokens, onError); - const dtf = new Intl.DateTimeFormat(locales, opt); - return (date) => dtf.format(date); -} -/** - * Returns a string of JavaScript source that evaluates to a date formatter - * function with the same `(date: Date | number) => string` signature as the - * function returned by {@link getDateFormatter}. - * - * @remarks - * The returned function will memoize an `Intl.DateTimeFormat` instance. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param tokens - An ICU DateFormat skeleton string, or an array or parsed - * `DateToken` tokens - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getDateFormatterSource } from '@messageformat/date-skeleton' - * - * getDateFormatterSource('en-CA', 'GrMMMdd', console.error) - * // '(function() {\n' + - * // ' var opt = {"era":"short","calendar":"gregory","year":"numeric",' + - * // '"month":"short","day":"2-digit"};\n' + - * // ' var dtf = new Intl.DateTimeFormat("en-CA", opt);\n' + - * // ' return function(value) { return dtf.format(value); }\n' + - * // '})()' - * - * const src = getDateFormatterSource('en-CA', 'hamszzzz', console.error) - * // '(function() {\n' + - * // ' var opt = {"hour":"numeric","hourCycle":"h12","minute":"numeric",' + - * // '"second":"numeric","timeZoneName":"long"};\n' + - * // ' var dtf = new Intl.DateTimeFormat("en-CA", opt);\n' + - * // ' return function(value) { return dtf.format(value); }\n' + - * // '})()' - * - * const fmt = new Function(`return ${src}`)() - * const date = new Date(2006, 0, 2, 15, 4, 5, 789) - * fmt(date) // '3:04:05 p.m. Newfoundland Daylight Time' - * ``` - */ -export function getDateFormatterSource(locales, tokens, onError) { - if (typeof tokens === 'string') - tokens = parseDateTokens(tokens); - const opt = getDateFormatOptions(tokens, onError); - const lines = [ - `(function() {`, - `var opt = ${JSON.stringify(opt)};`, - `var dtf = new Intl.DateTimeFormat(${JSON.stringify(locales)}, opt);`, - `return function(value) { return dtf.format(value); }` - ]; - return lines.join('\n ') + '\n})()'; -} diff --git a/node_modules/@messageformat/date-skeleton/lib/index.d.ts b/node_modules/@messageformat/date-skeleton/lib/index.d.ts deleted file mode 100644 index 756aa26..0000000 --- a/node_modules/@messageformat/date-skeleton/lib/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Tools for working with - * {@link http://userguide.icu-project.org/formatparse/datetime | ICU DateFormat skeletons}. - * - * @remarks - * ```js - * import { - * DateFormatError, - * DateToken, // TS only - * getDateFormatter, - * getDateFormatterSource, - * parseDateTokens - * } from '@messageformat/date-skeleton' - * ``` - * - * The package is released as an ES module only. If using from a CommonJS - * context, you may need to `import()` it, or use a module loader like - * {@link https://www.npmjs.com/package/esm | esm}. - * - * Uses - * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat | Intl.DateTimeFormat} - * internally. Position-dependent ICU DateFormat - * {@link https://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns | patterns} - * are not supported, as they cannot be represented with Intl.DateTimeFormat options. - * - * @packageDocumentation - */ -export { getDateFormatter, getDateFormatterSource } from './get-date-formatter.js'; -export { DateFormatError } from './options.js'; -export { DateToken, parseDateTokens } from './tokens.js'; diff --git a/node_modules/@messageformat/date-skeleton/lib/index.js b/node_modules/@messageformat/date-skeleton/lib/index.js deleted file mode 100644 index 3f86966..0000000 --- a/node_modules/@messageformat/date-skeleton/lib/index.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Tools for working with - * {@link http://userguide.icu-project.org/formatparse/datetime | ICU DateFormat skeletons}. - * - * @remarks - * ```js - * import { - * DateFormatError, - * DateToken, // TS only - * getDateFormatter, - * getDateFormatterSource, - * parseDateTokens - * } from '@messageformat/date-skeleton' - * ``` - * - * The package is released as an ES module only. If using from a CommonJS - * context, you may need to `import()` it, or use a module loader like - * {@link https://www.npmjs.com/package/esm | esm}. - * - * Uses - * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat | Intl.DateTimeFormat} - * internally. Position-dependent ICU DateFormat - * {@link https://unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns | patterns} - * are not supported, as they cannot be represented with Intl.DateTimeFormat options. - * - * @packageDocumentation - */ -export { getDateFormatter, getDateFormatterSource } from './get-date-formatter.js'; -export { DateFormatError } from './options.js'; -export { parseDateTokens } from './tokens.js'; diff --git a/node_modules/@messageformat/date-skeleton/lib/options.d.ts b/node_modules/@messageformat/date-skeleton/lib/options.d.ts deleted file mode 100644 index 1325e2c..0000000 --- a/node_modules/@messageformat/date-skeleton/lib/options.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { DateToken } from './tokens.js'; -/** - * Parent class for errors. - * - * @remarks - * Errors with `type: "warning"` do not necessarily indicate that the parser - * encountered an error. In addition to a human-friendly `message`, may also - * includes the `token` at which the error was encountered. - * - * @public - */ -export declare class DateFormatError extends Error { - static ERROR: 'error'; - static WARNING: 'warning'; - token: DateToken; - type: 'error' | 'warning'; - /** @internal */ - constructor(msg: string, token: DateToken, type?: 'error' | 'warning'); -} -export declare function getDateFormatOptions(tokens: DateToken[], onError?: (error: DateFormatError) => void): Intl.DateTimeFormatOptions; diff --git a/node_modules/@messageformat/date-skeleton/lib/options.js b/node_modules/@messageformat/date-skeleton/lib/options.js deleted file mode 100644 index 616bade..0000000 --- a/node_modules/@messageformat/date-skeleton/lib/options.js +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Parent class for errors. - * - * @remarks - * Errors with `type: "warning"` do not necessarily indicate that the parser - * encountered an error. In addition to a human-friendly `message`, may also - * includes the `token` at which the error was encountered. - * - * @public - */ -export class DateFormatError extends Error { - /** @internal */ - constructor(msg, token, type) { - super(msg); - this.token = token; - this.type = type || 'error'; - } -} -const alpha = (width) => width < 4 ? 'short' : width === 4 ? 'long' : 'narrow'; -const numeric = (width) => (width % 2 === 0 ? '2-digit' : 'numeric'); -function yearOptions(token, onError) { - switch (token.char) { - case 'y': - return { year: numeric(token.width) }; - case 'r': - return { calendar: 'gregory', year: 'numeric' }; - case 'u': - case 'U': - case 'Y': - default: - onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING); - return { year: 'numeric' }; - } -} -function monthStyle(token, onError) { - switch (token.width) { - case 1: - return 'numeric'; - case 2: - return '2-digit'; - case 3: - return 'short'; - case 4: - return 'long'; - case 5: - return 'narrow'; - default: - onError(`${token.desc} is not supported with width ${token.width}`); - return undefined; - } -} -function dayStyle(token, onError) { - const { char, desc, width } = token; - if (char === 'd') - return numeric(width); - else { - onError(`${desc} is not supported`); - return undefined; - } -} -function weekdayStyle(token, onError) { - const { char, desc, width } = token; - if ((char === 'c' || char === 'e') && width < 3) { - // ignoring stand-alone-ness - const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`; - onError(msg, DateFormatError.WARNING); - } - // merging narrow styles - return alpha(width); -} -function hourOptions(token) { - const hour = numeric(token.width); - let hourCycle; - switch (token.char) { - case 'h': - hourCycle = 'h12'; - break; - case 'H': - hourCycle = 'h23'; - break; - case 'k': - hourCycle = 'h24'; - break; - case 'K': - hourCycle = 'h11'; - break; - } - return hourCycle ? { hour, hourCycle } : { hour }; -} -function timeZoneNameStyle(token, onError) { - // so much fallback behaviour here - const { char, desc, width } = token; - switch (char) { - case 'v': - case 'z': - return width === 4 ? 'long' : 'short'; - case 'V': - if (width === 4) - return 'long'; - onError(`${desc} is not supported with width ${width}`); - return undefined; - case 'X': - onError(`${desc} is not supported`); - return undefined; - } - return 'short'; -} -function compileOptions(token, onError) { - switch (token.field) { - case 'era': - return { era: alpha(token.width) }; - case 'year': - return yearOptions(token, onError); - case 'month': - return { month: monthStyle(token, onError) }; - case 'day': - return { day: dayStyle(token, onError) }; - case 'weekday': - return { weekday: weekdayStyle(token, onError) }; - case 'period': - return undefined; - case 'hour': - return hourOptions(token); - case 'min': - return { minute: numeric(token.width) }; - case 'sec': - return { second: numeric(token.width) }; - case 'tz': - return { timeZoneName: timeZoneNameStyle(token, onError) }; - case 'quarter': - case 'week': - case 'sec-frac': - case 'ms': - onError(`${token.desc} is not supported`); - } - return undefined; -} -export function getDateFormatOptions(tokens, onError = error => { - throw error; -}) { - const options = {}; - const fields = []; - for (const token of tokens) { - const { error, field, str } = token; - if (error) { - const dte = new DateFormatError(error.message, token); - dte.stack = error.stack; - onError(dte); - } - if (str) { - const msg = `Ignoring string part: ${str}`; - onError(new DateFormatError(msg, token, DateFormatError.WARNING)); - } - if (field) { - if (fields.indexOf(field) === -1) - fields.push(field); - else - onError(new DateFormatError(`Duplicate ${field} token`, token)); - } - const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning))); - if (opt) - Object.assign(options, opt); - } - return options; -} diff --git a/node_modules/@messageformat/date-skeleton/lib/tokens.d.ts b/node_modules/@messageformat/date-skeleton/lib/tokens.d.ts deleted file mode 100644 index 716e51e..0000000 --- a/node_modules/@messageformat/date-skeleton/lib/tokens.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -export declare type DateField = 'era' | 'year' | 'quarter' | 'month' | 'week' | 'day' | 'weekday' | 'period' | 'hour' | 'min' | 'sec' | 'sec-frac' | 'ms' | 'tz'; -export declare const fields: { - [symbol: string]: { - field: DateField; - desc: string; - }; -}; -/** - * An object representation of a parsed date skeleton token - * - * @public - */ -export declare type DateToken = { - char: string; - error?: Error; - field?: DateField; - desc?: string; - str?: string; - width: number; -}; -/** - * Parse an {@link http://userguide.icu-project.org/formatparse/datetime | ICU - * DateFormat skeleton} string into a {@link DateToken} array. - * - * @remarks - * Errors will not be thrown, but if encountered are included as the relevant - * token's `error` value. - * - * @public - * @param src - The skeleton string - * - * @example - * ```js - * import { parseDateTokens } from '@messageformat/date-skeleton' - * - * parseDateTokens('GrMMMdd', console.error) - * // [ - * // { char: 'G', field: 'era', desc: 'Era', width: 1 }, - * // { char: 'r', field: 'year', desc: 'Related Gregorian year', width: 1 }, - * // { char: 'M', field: 'month', desc: 'Month in year', width: 3 }, - * // { char: 'd', field: 'day', desc: 'Day in month', width: 2 } - * // ] - * ``` - */ -export declare function parseDateTokens(src: string): DateToken[]; diff --git a/node_modules/@messageformat/date-skeleton/lib/tokens.js b/node_modules/@messageformat/date-skeleton/lib/tokens.js deleted file mode 100644 index 66ba943..0000000 --- a/node_modules/@messageformat/date-skeleton/lib/tokens.js +++ /dev/null @@ -1,129 +0,0 @@ -export const fields = { - G: { field: 'era', desc: 'Era' }, - y: { field: 'year', desc: 'Year' }, - Y: { field: 'year', desc: 'Year of "Week of Year"' }, - u: { field: 'year', desc: 'Extended year' }, - U: { field: 'year', desc: 'Cyclic year name' }, - r: { field: 'year', desc: 'Related Gregorian year' }, - Q: { field: 'quarter', desc: 'Quarter' }, - q: { field: 'quarter', desc: 'Stand-alone quarter' }, - M: { field: 'month', desc: 'Month in year' }, - L: { field: 'month', desc: 'Stand-alone month in year' }, - w: { field: 'week', desc: 'Week of year' }, - W: { field: 'week', desc: 'Week of month' }, - d: { field: 'day', desc: 'Day in month' }, - D: { field: 'day', desc: 'Day of year' }, - F: { field: 'day', desc: 'Day of week in month' }, - g: { field: 'day', desc: 'Modified julian day' }, - E: { field: 'weekday', desc: 'Day of week' }, - e: { field: 'weekday', desc: 'Local day of week' }, - c: { field: 'weekday', desc: 'Stand-alone local day of week' }, - a: { field: 'period', desc: 'AM/PM marker' }, - b: { field: 'period', desc: 'AM/PM/noon/midnight marker' }, - B: { field: 'period', desc: 'Flexible day period' }, - h: { field: 'hour', desc: 'Hour in AM/PM (1~12)' }, - H: { field: 'hour', desc: 'Hour in day (0~23)' }, - k: { field: 'hour', desc: 'Hour in day (1~24)' }, - K: { field: 'hour', desc: 'Hour in AM/PM (0~11)' }, - j: { field: 'hour', desc: 'Hour in preferred cycle' }, - J: { field: 'hour', desc: 'Hour in preferred cycle without marker' }, - C: { field: 'hour', desc: 'Hour in preferred cycle with flexible marker' }, - m: { field: 'min', desc: 'Minute in hour' }, - s: { field: 'sec', desc: 'Second in minute' }, - S: { field: 'sec-frac', desc: 'Fractional second' }, - A: { field: 'ms', desc: 'Milliseconds in day' }, - z: { field: 'tz', desc: 'Time Zone: specific non-location' }, - Z: { field: 'tz', desc: 'Time Zone' }, - O: { field: 'tz', desc: 'Time Zone: localized' }, - v: { field: 'tz', desc: 'Time Zone: generic non-location' }, - V: { field: 'tz', desc: 'Time Zone: ID' }, - X: { field: 'tz', desc: 'Time Zone: ISO8601 with Z' }, - x: { field: 'tz', desc: 'Time Zone: ISO8601' } -}; -const isLetter = (char) => (char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z'); -function readFieldToken(src, pos) { - const char = src[pos]; - let width = 1; - while (src[++pos] === char) - ++width; - const field = fields[char]; - if (!field) { - const msg = `The letter ${char} is not a valid field identifier`; - return { char, error: new Error(msg), width }; - } - return { char, field: field.field, desc: field.desc, width }; -} -function readQuotedToken(src, pos) { - let str = src[++pos]; - let width = 2; - if (str === "'") - return { char: "'", str, width }; - while (true) { - const next = src[++pos]; - ++width; - if (next === undefined) { - const msg = `Unterminated quoted literal in pattern: ${str || src}`; - return { char: "'", error: new Error(msg), str, width }; - } - else if (next === "'") { - if (src[++pos] !== "'") - return { char: "'", str, width }; - else - ++width; - } - str += next; - } -} -function readToken(src, pos) { - const char = src[pos]; - if (!char) - return null; - if (isLetter(char)) - return readFieldToken(src, pos); - if (char === "'") - return readQuotedToken(src, pos); - let str = char; - let width = 1; - while (true) { - const next = src[++pos]; - if (!next || isLetter(next) || next === "'") - return { char, str, width }; - str += next; - width += 1; - } -} -/** - * Parse an {@link http://userguide.icu-project.org/formatparse/datetime | ICU - * DateFormat skeleton} string into a {@link DateToken} array. - * - * @remarks - * Errors will not be thrown, but if encountered are included as the relevant - * token's `error` value. - * - * @public - * @param src - The skeleton string - * - * @example - * ```js - * import { parseDateTokens } from '@messageformat/date-skeleton' - * - * parseDateTokens('GrMMMdd', console.error) - * // [ - * // { char: 'G', field: 'era', desc: 'Era', width: 1 }, - * // { char: 'r', field: 'year', desc: 'Related Gregorian year', width: 1 }, - * // { char: 'M', field: 'month', desc: 'Month in year', width: 3 }, - * // { char: 'd', field: 'day', desc: 'Day in month', width: 2 } - * // ] - * ``` - */ -export function parseDateTokens(src) { - const tokens = []; - let pos = 0; - while (true) { - const token = readToken(src, pos); - if (!token) - return tokens; - tokens.push(token); - pos += token.width; - } -} diff --git a/node_modules/@messageformat/date-skeleton/package.json b/node_modules/@messageformat/date-skeleton/package.json deleted file mode 100644 index 86bd9e8..0000000 --- a/node_modules/@messageformat/date-skeleton/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@messageformat/date-skeleton", - "version": "1.0.1", - "description": "A parser & formatter for ICU DateFormat skeleton strings", - "keywords": [ - "icu", - "messageformat", - "dateformat", - "skeleton", - "parser", - "formatter" - ], - "contributors": [ - "Eemeli Aro " - ], - "license": "MIT", - "homepage": "http://messageformat.github.io/messageformat/api/date-skeleton/", - "repository": { - "type": "git", - "url": "https://github.com/messageformat/messageformat.git", - "directory": "packages/date-skeleton" - }, - "files": [ - "lib/" - ], - "type": "module", - "main": "lib/index.js", - "scripts": { - "build": "tsc --project tsconfig.build.json", - "extract-api": "api-extractor run --verbose" - } -} diff --git a/node_modules/@messageformat/number-skeleton/LICENSE b/node_modules/@messageformat/number-skeleton/LICENSE deleted file mode 100644 index 78918d5..0000000 --- a/node_modules/@messageformat/number-skeleton/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright OpenJS Foundation and contributors, https://openjsf.org/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@messageformat/number-skeleton/README.md b/node_modules/@messageformat/number-skeleton/README.md deleted file mode 100644 index 457a479..0000000 --- a/node_modules/@messageformat/number-skeleton/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# @messageformat/number-skeleton - -Tools for working with [ICU NumberFormat skeletons](https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md) and [patterns](http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns). - -```js -import { - getNumberFormatter, - getNumberFormatterSource, - NumberFormatError, - parseNumberPattern, - parseNumberSkeleton, - Skeleton, // TS only - Unit // TS only -} from '@messageformat/number-skeleton'; -``` - -The package is released as an ES module only. If using from a CommonJS context, you may need to `import()` it, or use a module loader like [esm](https://www.npmjs.com/package/esm). - -Uses [Intl.NumberFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat) internally, including features provided by the [Unified API Proposal](https://github.com/tc39/proposal-unified-intl-numberformat). - -## Classes - -| Class | Description | -| ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [NumberFormatError](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-number-skeleton.numberformaterror.md) | Base class for errors. In addition to a code and a human-friendly message, may also includes the token stem as well as other fields. | - -## Functions - -| Function | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [getNumberFormatter(locales, skeleton, currency, onError)](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-number-skeleton.getnumberformatter.md) | Returns a number formatter function for the given locales and number skeleton | -| [getNumberFormatterSource(locales, skeleton, currency, onError)](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-number-skeleton.getnumberformattersource.md) | Returns a string of JavaScript source that evaluates to a number formatter function with the same (value: number) => string signature as the function returned by [getNumberFormatter()](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-number-skeleton.getnumberformatter.md). | -| [parseNumberPattern(src, currency, onError)](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-number-skeleton.parsenumberpattern.md) | Parse an [ICU NumberFormatter pattern](http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns) string into a [Skeleton](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-number-skeleton.skeleton.md) structure. | -| [parseNumberSkeleton(src, onError)](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-number-skeleton.parsenumberskeleton.md) | Parse an [ICU NumberFormatter skeleton](https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md) string into a [Skeleton](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-number-skeleton.skeleton.md) structure. | - -## Interfaces - -| Interface | Description | -| ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| [Skeleton](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-number-skeleton.skeleton.md) | An object representation of a parsed string skeleton, with token values grouped by type. | - -## Type Aliases - -| Type Alias | Description | -| --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -| [Unit](https://github.com/messageformat/skeletons/blob/master/docs/messageformat-number-skeleton.unit.md) | Measurement units defined by the [Unicode CLDR](https://github.com/unicode-org/cldr/blob/d4d77a2/common/validity/unit.xml) | - ---- - -[Messageformat] is an OpenJS Foundation project, and we follow its [Code of Conduct]. - -[messageformat]: https://messageformat.github.io/ -[code of conduct]: https://github.com/openjs-foundation/cross-project-council/blob/master/CODE_OF_CONDUCT.md - - -OpenJS Foundation - diff --git a/node_modules/@messageformat/number-skeleton/lib/errors.d.ts b/node_modules/@messageformat/number-skeleton/lib/errors.d.ts deleted file mode 100644 index bade832..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/errors.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Base class for errors. In addition to a `code` and a human-friendly - * `message`, may also includes the token `stem` as well as other fields. - * - * @public - */ -export declare class NumberFormatError extends Error { - code: string; - /** @internal */ - constructor(code: string, msg: string); -} -/** @internal */ -export declare class BadOptionError extends NumberFormatError { - stem: string; - option: string; - constructor(stem: string, opt: string); -} -/** @internal */ -export declare class BadStemError extends NumberFormatError { - stem: string; - constructor(stem: string); -} -/** @internal */ -export declare class MaskedValueError extends NumberFormatError { - type: string; - prev: unknown; - constructor(type: string, prev: unknown); -} -/** @internal */ -export declare class MissingOptionError extends NumberFormatError { - stem: string; - constructor(stem: string); -} -/** @internal */ -export declare class PatternError extends NumberFormatError { - char: string; - constructor(char: string, msg: string); -} -/** @internal */ -export declare class TooManyOptionsError extends NumberFormatError { - stem: string; - options: string[]; - constructor(stem: string, options: string[], maxOpt: number); -} -/** @internal */ -export declare class UnsupportedError extends NumberFormatError { - stem: string; - source?: string; - constructor(stem: string, source?: string); -} diff --git a/node_modules/@messageformat/number-skeleton/lib/errors.js b/node_modules/@messageformat/number-skeleton/lib/errors.js deleted file mode 100644 index e6497c0..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/errors.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Base class for errors. In addition to a `code` and a human-friendly - * `message`, may also includes the token `stem` as well as other fields. - * - * @public - */ -export class NumberFormatError extends Error { - /** @internal */ - constructor(code, msg) { - super(msg); - this.code = code; - } -} -/** @internal */ -export class BadOptionError extends NumberFormatError { - constructor(stem, opt) { - super('BAD_OPTION', `Unknown ${stem} option: ${opt}`); - this.stem = stem; - this.option = opt; - } -} -/** @internal */ -export class BadStemError extends NumberFormatError { - constructor(stem) { - super('BAD_STEM', `Unknown stem: ${stem}`); - this.stem = stem; - } -} -/** @internal */ -export class MaskedValueError extends NumberFormatError { - constructor(type, prev) { - super('MASKED_VALUE', `Value for ${type} is set multiple times`); - this.type = type; - this.prev = prev; - } -} -/** @internal */ -export class MissingOptionError extends NumberFormatError { - constructor(stem) { - super('MISSING_OPTION', `Required option missing for ${stem}`); - this.stem = stem; - } -} -/** @internal */ -export class PatternError extends NumberFormatError { - constructor(char, msg) { - super('BAD_PATTERN', msg); - this.char = char; - } -} -/** @internal */ -export class TooManyOptionsError extends NumberFormatError { - constructor(stem, options, maxOpt) { - const maxOptStr = maxOpt > 1 ? `${maxOpt} options` : 'one option'; - super('TOO_MANY_OPTIONS', `Token ${stem} only supports ${maxOptStr} (got ${options.length})`); - this.stem = stem; - this.options = options; - } -} -/** @internal */ -export class UnsupportedError extends NumberFormatError { - constructor(stem, source) { - super('UNSUPPORTED', `The stem ${stem} is not supported`); - this.stem = stem; - if (source) { - this.message += ` with value ${source}`; - this.source = source; - } - } -} diff --git a/node_modules/@messageformat/number-skeleton/lib/get-formatter.d.ts b/node_modules/@messageformat/number-skeleton/lib/get-formatter.d.ts deleted file mode 100644 index 3e74075..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/get-formatter.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { NumberFormatError } from './errors.js'; -import { Skeleton } from './types/skeleton.js'; -/** - * Returns a number formatter function for the given locales and number skeleton - * - * @remarks - * Uses `Intl.NumberFormat` (ES2020) internally. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param skeleton - An ICU NumberFormatter pattern or `::`-prefixed skeleton - * string, or a parsed `Skeleton` structure - * @param currency - If `skeleton` is a pattern string that includes ¤ tokens, - * their skeleton representation requires a three-letter currency code. - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getNumberFormatter } from '@messageformat/number-skeleton' - * - * let src = ':: currency/CAD unit-width-narrow' - * let fmt = getNumberFormatter('en-CA', src, console.error) - * fmt(42) // '$42.00' - * - * src = '::percent scale/100' - * fmt = getNumberFormatter('en', src, console.error) - * fmt(0.3) // '30%' - * ``` - */ -export declare function getNumberFormatter(locales: string | string[], skeleton: string | Skeleton, currency?: string | null, onError?: (err: NumberFormatError) => void): (value: number) => string; -/** - * Returns a string of JavaScript source that evaluates to a number formatter - * function with the same `(value: number) => string` signature as the function - * returned by {@link getNumberFormatter}. - * - * @remarks - * The returned function will memoize an `Intl.NumberFormat` instance. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param skeleton - An ICU NumberFormatter pattern or `::`-prefixed skeleton - * string, or a parsed `Skeleton` structure - * @param currency - If `skeleton` is a pattern string that includes ¤ tokens, - * their skeleton representation requires a three-letter currency code. - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getNumberFormatterSource } from '@messageformat/number-skeleton' - * - * getNumberFormatterSource('en', '::percent', console.error) - * // '(function() {\n' + - * // ' var opt = {"style":"percent"};\n' + - * // ' var nf = new Intl.NumberFormat(["en"], opt);\n' + - * // ' var mod = function(n) { return n * 0.01; };\n' + - * // ' return function(value) { return nf.format(mod(value)); }\n' + - * // '})()' - * - * const src = getNumberFormatterSource('en-CA', ':: currency/CAD unit-width-narrow', console.error) - * // '(function() {\n' + - * // ' var opt = {"style":"currency","currency":"CAD","currencyDisplay":"narrowSymbol","unitDisplay":"narrow"};\n' + - * // ' var nf = new Intl.NumberFormat(["en-CA"], opt);\n' - * // ' return function(value) { return nf.format(value); }\n' + - * // '})()' - * const fmt = new Function(`return ${src}`)() - * fmt(42) // '$42.00' - * ``` - */ -export declare function getNumberFormatterSource(locales: string | string[], skeleton: string | Skeleton, currency?: string | null, onError?: (err: NumberFormatError) => void): string; diff --git a/node_modules/@messageformat/number-skeleton/lib/get-formatter.js b/node_modules/@messageformat/number-skeleton/lib/get-formatter.js deleted file mode 100644 index cc94cbe..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/get-formatter.js +++ /dev/null @@ -1,124 +0,0 @@ -import { getNumberFormatLocales } from './numberformat/locales.js'; -import { getNumberFormatModifier, getNumberFormatModifierSource } from './numberformat/modifier.js'; -import { getNumberFormatOptions } from './numberformat/options.js'; -import { parseNumberPattern } from './parse-pattern.js'; -import { parseNumberSkeleton } from './parse-skeleton.js'; -/** - * Returns a number formatter function for the given locales and number skeleton - * - * @remarks - * Uses `Intl.NumberFormat` (ES2020) internally. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param skeleton - An ICU NumberFormatter pattern or `::`-prefixed skeleton - * string, or a parsed `Skeleton` structure - * @param currency - If `skeleton` is a pattern string that includes ¤ tokens, - * their skeleton representation requires a three-letter currency code. - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getNumberFormatter } from '@messageformat/number-skeleton' - * - * let src = ':: currency/CAD unit-width-narrow' - * let fmt = getNumberFormatter('en-CA', src, console.error) - * fmt(42) // '$42.00' - * - * src = '::percent scale/100' - * fmt = getNumberFormatter('en', src, console.error) - * fmt(0.3) // '30%' - * ``` - */ -export function getNumberFormatter(locales, skeleton, currency, onError) { - if (typeof skeleton === 'string') { - skeleton = - skeleton.indexOf('::') === 0 - ? parseNumberSkeleton(skeleton.slice(2), onError) - : parseNumberPattern(skeleton, currency, onError); - } - const lc = getNumberFormatLocales(locales, skeleton); - const opt = getNumberFormatOptions(skeleton, onError); - const mod = getNumberFormatModifier(skeleton); - const nf = new Intl.NumberFormat(lc, opt); - if (skeleton.affix) { - const [p0, p1] = skeleton.affix.pos; - const [n0, n1] = skeleton.affix.neg || ['', '']; - return (value) => { - const n = nf.format(mod(value)); - return value < 0 ? `${n0}${n}${n1}` : `${p0}${n}${p1}`; - }; - } - return (value) => nf.format(mod(value)); -} -/** - * Returns a string of JavaScript source that evaluates to a number formatter - * function with the same `(value: number) => string` signature as the function - * returned by {@link getNumberFormatter}. - * - * @remarks - * The returned function will memoize an `Intl.NumberFormat` instance. - * - * @public - * @param locales - One or more valid BCP 47 language tags, e.g. `fr` or `en-CA` - * @param skeleton - An ICU NumberFormatter pattern or `::`-prefixed skeleton - * string, or a parsed `Skeleton` structure - * @param currency - If `skeleton` is a pattern string that includes ¤ tokens, - * their skeleton representation requires a three-letter currency code. - * @param onError - If defined, will be called separately for each encountered - * parsing error and unsupported feature. - * @example - * ```js - * import { getNumberFormatterSource } from '@messageformat/number-skeleton' - * - * getNumberFormatterSource('en', '::percent', console.error) - * // '(function() {\n' + - * // ' var opt = {"style":"percent"};\n' + - * // ' var nf = new Intl.NumberFormat(["en"], opt);\n' + - * // ' var mod = function(n) { return n * 0.01; };\n' + - * // ' return function(value) { return nf.format(mod(value)); }\n' + - * // '})()' - * - * const src = getNumberFormatterSource('en-CA', ':: currency/CAD unit-width-narrow', console.error) - * // '(function() {\n' + - * // ' var opt = {"style":"currency","currency":"CAD","currencyDisplay":"narrowSymbol","unitDisplay":"narrow"};\n' + - * // ' var nf = new Intl.NumberFormat(["en-CA"], opt);\n' - * // ' return function(value) { return nf.format(value); }\n' + - * // '})()' - * const fmt = new Function(`return ${src}`)() - * fmt(42) // '$42.00' - * ``` - */ -export function getNumberFormatterSource(locales, skeleton, currency, onError) { - if (typeof skeleton === 'string') { - skeleton = - skeleton.indexOf('::') === 0 - ? parseNumberSkeleton(skeleton.slice(2), onError) - : parseNumberPattern(skeleton, currency, onError); - } - const lc = getNumberFormatLocales(locales, skeleton); - const opt = getNumberFormatOptions(skeleton, onError); - const modSrc = getNumberFormatModifierSource(skeleton); - const lines = [ - `(function() {`, - `var opt = ${JSON.stringify(opt)};`, - `var nf = new Intl.NumberFormat(${JSON.stringify(lc)}, opt);` - ]; - let res = 'nf.format(value)'; - if (modSrc) { - lines.push(`var mod = ${modSrc};`); - res = 'nf.format(mod(value))'; - } - if (skeleton.affix) { - const [p0, p1] = skeleton.affix.pos.map(s => JSON.stringify(s)); - if (skeleton.affix.neg) { - const [n0, n1] = skeleton.affix.neg.map(s => JSON.stringify(s)); - res = `value < 0 ? ${n0} + ${res} + ${n1} : ${p0} + ${res} + ${p1}`; - } - else { - res = `${p0} + ${res} + ${p1}`; - } - } - lines.push(`return function(value) { return ${res}; }`); - return lines.join('\n ') + '\n})()'; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/index.d.ts b/node_modules/@messageformat/number-skeleton/lib/index.d.ts deleted file mode 100644 index b6afc93..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/index.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Tools for working with - * {@link https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md | ICU NumberFormat skeletons} - * and {@link http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns | patterns}. - * - * @remarks - * ```js - * import { - * getNumberFormatter, - * getNumberFormatterSource, - * NumberFormatError, - * parseNumberPattern, - * parseNumberSkeleton, - * Skeleton, // TS only - * Unit // TS only - * } from '@messageformat/number-skeleton' - * ``` - * - * The package is released as an ES module only. If using from a CommonJS - * context, you may need to `import()` it, or use a module loader like - * {@link https://www.npmjs.com/package/esm | esm}. - * - * Uses {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat | Intl.NumberFormat} - * internally (ES2020). - * - * @packageDocumentation - */ -export { BadOptionError, BadStemError, MaskedValueError, MissingOptionError, NumberFormatError, TooManyOptionsError, UnsupportedError } from './errors.js'; -export { getNumberFormatter, getNumberFormatterSource } from './get-formatter.js'; -export { parseNumberPattern } from './parse-pattern.js'; -export { parseNumberSkeleton } from './parse-skeleton.js'; -export { Skeleton } from './types/skeleton.js'; -export { Unit } from './types/unit.js'; diff --git a/node_modules/@messageformat/number-skeleton/lib/index.js b/node_modules/@messageformat/number-skeleton/lib/index.js deleted file mode 100644 index 2efa379..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Tools for working with - * {@link https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md | ICU NumberFormat skeletons} - * and {@link http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns | patterns}. - * - * @remarks - * ```js - * import { - * getNumberFormatter, - * getNumberFormatterSource, - * NumberFormatError, - * parseNumberPattern, - * parseNumberSkeleton, - * Skeleton, // TS only - * Unit // TS only - * } from '@messageformat/number-skeleton' - * ``` - * - * The package is released as an ES module only. If using from a CommonJS - * context, you may need to `import()` it, or use a module loader like - * {@link https://www.npmjs.com/package/esm | esm}. - * - * Uses {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat | Intl.NumberFormat} - * internally (ES2020). - * - * @packageDocumentation - */ -export { BadOptionError, BadStemError, MaskedValueError, MissingOptionError, NumberFormatError, TooManyOptionsError, UnsupportedError } from './errors.js'; -export { getNumberFormatter, getNumberFormatterSource } from './get-formatter.js'; -export { parseNumberPattern } from './parse-pattern.js'; -export { parseNumberSkeleton } from './parse-skeleton.js'; diff --git a/node_modules/@messageformat/number-skeleton/lib/numberformat/locales.d.ts b/node_modules/@messageformat/number-skeleton/lib/numberformat/locales.d.ts deleted file mode 100644 index 138b46d..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/numberformat/locales.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Skeleton } from '../types/skeleton.js'; -/** - * Add - * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation | numbering-system tags} - * to locale identifiers - * - * @internal - */ -export declare function getNumberFormatLocales(locales: string | string[], { numberingSystem }: Skeleton): string[]; diff --git a/node_modules/@messageformat/number-skeleton/lib/numberformat/locales.js b/node_modules/@messageformat/number-skeleton/lib/numberformat/locales.js deleted file mode 100644 index 2f28cd9..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/numberformat/locales.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Add - * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation | numbering-system tags} - * to locale identifiers - * - * @internal - */ -export function getNumberFormatLocales(locales, { numberingSystem }) { - if (!Array.isArray(locales)) - locales = [locales]; - return numberingSystem - ? locales - .map(lc => { - const ext = lc.indexOf('-u-') === -1 ? 'u-nu' : 'nu'; - return `${lc}-${ext}-${numberingSystem}`; - }) - .concat(locales) - : locales; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/numberformat/modifier.d.ts b/node_modules/@messageformat/number-skeleton/lib/numberformat/modifier.d.ts deleted file mode 100644 index 5d1d49d..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/numberformat/modifier.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Skeleton } from '../types/skeleton.js'; -/** - * Determine a modifier for the input value to account for any `scale`, - * `percent`, and `precision-increment` tokens in the skeleton. - * - * @internal - * @remarks - * With ICU NumberFormatter, the `percent` skeleton would style `25` as "25%". - * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`. - */ -export declare function getNumberFormatModifier(skeleton: Skeleton): (n: number) => number; -/** - * Returns a string of JavaScript source that evaluates to a modifier for the - * input value to account for any `scale`, `percent`, and `precision-increment` - * tokens in the skeleton. - * - * @internal - * @remarks - * With ICU NumberFormatter, the `percent` skeleton would style `25` as "25%". - * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`. - */ -export declare function getNumberFormatModifierSource(skeleton: Skeleton): string | null; diff --git a/node_modules/@messageformat/number-skeleton/lib/numberformat/modifier.js b/node_modules/@messageformat/number-skeleton/lib/numberformat/modifier.js deleted file mode 100644 index ed8637a..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/numberformat/modifier.js +++ /dev/null @@ -1,53 +0,0 @@ -// from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round -function round(x, precision) { - const y = +x + precision / 2; - return y - (y % +precision); -} -function getNumberFormatMultiplier({ scale, unit }) { - let mult = typeof scale === 'number' && scale >= 0 ? scale : 1; - if (unit && unit.style === 'percent') - mult *= 0.01; - return mult; -} -/** - * Determine a modifier for the input value to account for any `scale`, - * `percent`, and `precision-increment` tokens in the skeleton. - * - * @internal - * @remarks - * With ICU NumberFormatter, the `percent` skeleton would style `25` as "25%". - * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`. - */ -export function getNumberFormatModifier(skeleton) { - const mult = getNumberFormatMultiplier(skeleton); - const { precision } = skeleton; - if (precision && precision.style === 'precision-increment') { - return (n) => round(n, precision.increment) * mult; - } - else { - return (n) => n * mult; - } -} -/** - * Returns a string of JavaScript source that evaluates to a modifier for the - * input value to account for any `scale`, `percent`, and `precision-increment` - * tokens in the skeleton. - * - * @internal - * @remarks - * With ICU NumberFormatter, the `percent` skeleton would style `25` as "25%". - * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`. - */ -export function getNumberFormatModifierSource(skeleton) { - const mult = getNumberFormatMultiplier(skeleton); - const { precision } = skeleton; - if (precision && precision.style === 'precision-increment') { - // see round() above for source - const setX = `+n + ${precision.increment / 2}`; - let res = `x - (x % +${precision.increment})`; - if (mult !== 1) - res = `(${res}) * ${mult}`; - return `function(n) { var x = ${setX}; return ${res}; }`; - } - return mult !== 1 ? `function(n) { return n * ${mult}; }` : null; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/numberformat/options.d.ts b/node_modules/@messageformat/number-skeleton/lib/numberformat/options.d.ts deleted file mode 100644 index c45f4e9..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/numberformat/options.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { UnsupportedError } from '../errors.js'; -import { Skeleton } from '../types/skeleton.js'; -/** - * Extends `Intl.NumberFormat` options to include some features brought by the - * {@link https://github.com/tc39/proposal-intl-numberformat-v3 | ECMA-402 - * Proposal: Intl.NumberFormat V3} - * - * @internal - */ -export interface NumberFormatOptions extends Intl.NumberFormatOptions { - trailingZeroDisplay?: 'auto' | 'stripIfInteger'; -} -/** - * Given an input ICU NumberFormatter skeleton, does its best to construct a - * corresponding `Intl.NumberFormat` options structure. - * - * @remarks - * Some features depend on `Intl.NumberFormat` features defined in ES2020. - * - * @internal - * @param onUnsupported - If defined, called when encountering unsupported (but - * valid) tokens, such as `decimal-always` or `permille`. The error `source` - * may specify the source of an unsupported option. - * - * @example - * ```js - * import { - * getNumberFormatOptions, - * parseNumberSkeleton - * } from '@messageformat/number-skeleton' - * - * const src = 'currency/CAD unit-width-narrow' - * const skeleton = parseNumberSkeleton(src, console.error) - * // { - * // unit: { style: 'currency', currency: 'CAD' }, - * // unitWidth: 'unit-width-narrow' - * // } - * - * getNumberFormatOptions(skeleton, console.error) - * // { - * // style: 'currency', - * // currency: 'CAD', - * // currencyDisplay: 'narrowSymbol', - * // unitDisplay: 'narrow' - * // } - * - * const sk2 = parseNumberSkeleton('group-min2') - * // { group: 'group-min2' } - * - * getNumberFormatOptions(sk2, console.error) - * // Error: The stem group-min2 is not supported - * // at UnsupportedError.NumberFormatError ... { - * // code: 'UNSUPPORTED', - * // stem: 'group-min2' - * // } - * // {} - * ``` - */ -export declare function getNumberFormatOptions(skeleton: Skeleton, onUnsupported?: (err: UnsupportedError) => void): NumberFormatOptions; diff --git a/node_modules/@messageformat/number-skeleton/lib/numberformat/options.js b/node_modules/@messageformat/number-skeleton/lib/numberformat/options.js deleted file mode 100644 index 9395282..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/numberformat/options.js +++ /dev/null @@ -1,215 +0,0 @@ -import { UnsupportedError } from '../errors.js'; -/** - * Given an input ICU NumberFormatter skeleton, does its best to construct a - * corresponding `Intl.NumberFormat` options structure. - * - * @remarks - * Some features depend on `Intl.NumberFormat` features defined in ES2020. - * - * @internal - * @param onUnsupported - If defined, called when encountering unsupported (but - * valid) tokens, such as `decimal-always` or `permille`. The error `source` - * may specify the source of an unsupported option. - * - * @example - * ```js - * import { - * getNumberFormatOptions, - * parseNumberSkeleton - * } from '@messageformat/number-skeleton' - * - * const src = 'currency/CAD unit-width-narrow' - * const skeleton = parseNumberSkeleton(src, console.error) - * // { - * // unit: { style: 'currency', currency: 'CAD' }, - * // unitWidth: 'unit-width-narrow' - * // } - * - * getNumberFormatOptions(skeleton, console.error) - * // { - * // style: 'currency', - * // currency: 'CAD', - * // currencyDisplay: 'narrowSymbol', - * // unitDisplay: 'narrow' - * // } - * - * const sk2 = parseNumberSkeleton('group-min2') - * // { group: 'group-min2' } - * - * getNumberFormatOptions(sk2, console.error) - * // Error: The stem group-min2 is not supported - * // at UnsupportedError.NumberFormatError ... { - * // code: 'UNSUPPORTED', - * // stem: 'group-min2' - * // } - * // {} - * ``` - */ -export function getNumberFormatOptions(skeleton, onUnsupported) { - const { decimal, group, integerWidth, notation, precision, roundingMode, sign, unit, unitPer, unitWidth } = skeleton; - const fail = (stem, source) => { - if (onUnsupported) - onUnsupported(new UnsupportedError(stem, source)); - }; - const opt = {}; - if (unit) { - switch (unit.style) { - case 'base-unit': - opt.style = 'decimal'; - break; - case 'currency': - opt.style = 'currency'; - opt.currency = unit.currency; - break; - case 'measure-unit': - opt.style = 'unit'; - opt.unit = unit.unit.replace(/.*-/, ''); - if (unitPer) - opt.unit += '-per-' + unitPer.replace(/.*-/, ''); - break; - case 'percent': - opt.style = 'percent'; - break; - case 'permille': - fail('permille'); - break; - } - } - switch (unitWidth) { - case 'unit-width-full-name': - opt.currencyDisplay = 'name'; - opt.unitDisplay = 'long'; - break; - case 'unit-width-hidden': - fail(unitWidth); - break; - case 'unit-width-iso-code': - opt.currencyDisplay = 'code'; - break; - case 'unit-width-narrow': - opt.currencyDisplay = 'narrowSymbol'; - opt.unitDisplay = 'narrow'; - break; - case 'unit-width-short': - opt.currencyDisplay = 'symbol'; - opt.unitDisplay = 'short'; - break; - } - switch (group) { - case 'group-off': - opt.useGrouping = false; - break; - case 'group-auto': - opt.useGrouping = true; - break; - case 'group-min2': - case 'group-on-aligned': - case 'group-thousands': - fail(group); - opt.useGrouping = true; - break; - } - if (precision) { - switch (precision.style) { - case 'precision-fraction': { - const { minFraction: minF, maxFraction: maxF, minSignificant: minS, maxSignificant: maxS, source } = precision; - if (typeof minF === 'number') { - opt.minimumFractionDigits = minF; - if (typeof minS === 'number') - fail('precision-fraction', source); - } - if (typeof maxF === 'number') - opt.maximumFractionDigits = maxF; - if (typeof minS === 'number') - opt.minimumSignificantDigits = minS; - if (typeof maxS === 'number') - opt.maximumSignificantDigits = maxS; - break; - } - case 'precision-integer': - opt.maximumFractionDigits = 0; - break; - case 'precision-unlimited': - opt.maximumFractionDigits = 20; - break; - case 'precision-increment': - break; - case 'precision-currency-standard': - opt.trailingZeroDisplay = precision.trailingZero; - break; - case 'precision-currency-cash': - fail(precision.style); - break; - } - } - if (notation) { - switch (notation.style) { - case 'compact-short': - opt.notation = 'compact'; - opt.compactDisplay = 'short'; - break; - case 'compact-long': - opt.notation = 'compact'; - opt.compactDisplay = 'long'; - break; - case 'notation-simple': - opt.notation = 'standard'; - break; - case 'scientific': - case 'engineering': { - const { expDigits, expSign, source, style } = notation; - opt.notation = style; - if ((expDigits && expDigits > 1) || - (expSign && expSign !== 'sign-auto')) - fail(style, source); - break; - } - } - } - if (integerWidth) { - const { min, max, source } = integerWidth; - if (min > 0) - opt.minimumIntegerDigits = min; - if (Number(max) > 0) { - const hasExp = opt.notation === 'engineering' || opt.notation === 'scientific'; - if (max === 3 && hasExp) - opt.notation = 'engineering'; - else - fail('integer-width', source); - } - } - switch (sign) { - case 'sign-auto': - opt.signDisplay = 'auto'; - break; - case 'sign-always': - opt.signDisplay = 'always'; - break; - case 'sign-except-zero': - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore https://github.com/microsoft/TypeScript/issues/46712 - opt.signDisplay = 'exceptZero'; - break; - case 'sign-never': - opt.signDisplay = 'never'; - break; - case 'sign-accounting': - opt.currencySign = 'accounting'; - break; - case 'sign-accounting-always': - opt.currencySign = 'accounting'; - opt.signDisplay = 'always'; - break; - case 'sign-accounting-except-zero': - opt.currencySign = 'accounting'; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore https://github.com/microsoft/TypeScript/issues/46712 - opt.signDisplay = 'exceptZero'; - break; - } - if (decimal === 'decimal-always') - fail(decimal); - if (roundingMode) - fail(roundingMode); - return opt; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/parse-pattern.d.ts b/node_modules/@messageformat/number-skeleton/lib/parse-pattern.d.ts deleted file mode 100644 index ce493c5..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/parse-pattern.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Skeleton } from './types/skeleton.js'; -import { NumberFormatError } from './errors.js'; -/** - * Parse an {@link - * http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns | - * ICU NumberFormatter pattern} string into a {@link Skeleton} structure. - * - * @public - * @param src - The pattern string - * @param currency - If the pattern includes ¤ tokens, their skeleton - * representation requires a three-letter currency code. - * @param onError - Called when the parser encounters a syntax error. The - * function will still return a {@link Skeleton}, but it will be incomplete - * and/or inaccurate. If not defined, the error will be thrown instead. - * - * @remarks - * Unlike the skeleton parser, the pattern parser is not able to return partial - * results on error, and will instead throw. Output padding is not supported. - * - * @example - * ```js - * import { parseNumberPattern } from '@messageformat/number-skeleton' - * - * parseNumberPattern('#,##0.00 ¤', 'EUR', console.error) - * // { - * // group: 'group-auto', - * // precision: { - * // style: 'precision-fraction', - * // minFraction: 2, - * // maxFraction: 2 - * // }, - * // unit: { style: 'currency', currency: 'EUR' } - * // } - * ``` - */ -export declare function parseNumberPattern(src: string, currency?: string | null, onError?: (error: NumberFormatError) => void): Skeleton; diff --git a/node_modules/@messageformat/number-skeleton/lib/parse-pattern.js b/node_modules/@messageformat/number-skeleton/lib/parse-pattern.js deleted file mode 100644 index a4ff549..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/parse-pattern.js +++ /dev/null @@ -1,128 +0,0 @@ -import { parseTokens } from './pattern-parser/parse-tokens.js'; -import { parseNumberAsSkeleton } from './pattern-parser/number-as-skeleton.js'; -import { PatternError } from './errors.js'; -function handleAffix(affixTokens, res, currency, onError, isPrefix) { - let inFmt = false; - let str = ''; - for (const token of affixTokens) { - switch (token.char) { - case '%': - res.unit = { style: token.style }; - if (isPrefix) - inFmt = true; - else - str = ''; - break; - case '¤': - if (!currency) { - const msg = `The ¤ pattern requires a currency`; - onError(new PatternError('¤', msg)); - break; - } - res.unit = { style: 'currency', currency }; - switch (token.currency) { - case 'iso-code': - res.unitWidth = 'unit-width-iso-code'; - break; - case 'full-name': - res.unitWidth = 'unit-width-full-name'; - break; - case 'narrow': - res.unitWidth = 'unit-width-narrow'; - break; - } - if (isPrefix) - inFmt = true; - else - str = ''; - break; - case '*': - // TODO - break; - case '+': - if (!inFmt) - str += '+'; - break; - case "'": - if (!inFmt) - str += token.str; - break; - } - } - return str; -} -function getNegativeAffix(affixTokens, isPrefix) { - let inFmt = false; - let str = ''; - for (const token of affixTokens) { - switch (token.char) { - case '%': - case '¤': - if (isPrefix) - inFmt = true; - else - str = ''; - break; - case '-': - if (!inFmt) - str += '-'; - break; - case "'": - if (!inFmt) - str += token.str; - break; - } - } - return str; -} -/** - * Parse an {@link - * http://unicode.org/reports/tr35/tr35-numbers.html#Number_Format_Patterns | - * ICU NumberFormatter pattern} string into a {@link Skeleton} structure. - * - * @public - * @param src - The pattern string - * @param currency - If the pattern includes ¤ tokens, their skeleton - * representation requires a three-letter currency code. - * @param onError - Called when the parser encounters a syntax error. The - * function will still return a {@link Skeleton}, but it will be incomplete - * and/or inaccurate. If not defined, the error will be thrown instead. - * - * @remarks - * Unlike the skeleton parser, the pattern parser is not able to return partial - * results on error, and will instead throw. Output padding is not supported. - * - * @example - * ```js - * import { parseNumberPattern } from '@messageformat/number-skeleton' - * - * parseNumberPattern('#,##0.00 ¤', 'EUR', console.error) - * // { - * // group: 'group-auto', - * // precision: { - * // style: 'precision-fraction', - * // minFraction: 2, - * // maxFraction: 2 - * // }, - * // unit: { style: 'currency', currency: 'EUR' } - * // } - * ``` - */ -export function parseNumberPattern(src, currency, onError = error => { - throw error; -}) { - const { tokens, negative } = parseTokens(src, onError); - const res = parseNumberAsSkeleton(tokens.number, onError); - const prefix = handleAffix(tokens.prefix, res, currency, onError, true); - const suffix = handleAffix(tokens.suffix, res, currency, onError, false); - if (negative) { - const negPrefix = getNegativeAffix(negative.prefix, true); - const negSuffix = getNegativeAffix(negative.suffix, false); - res.affix = { pos: [prefix, suffix], neg: [negPrefix, negSuffix] }; - res.sign = 'sign-never'; - } - else if (prefix || suffix) { - res.affix = { pos: [prefix, suffix] }; - } - return res; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/parse-skeleton.d.ts b/node_modules/@messageformat/number-skeleton/lib/parse-skeleton.d.ts deleted file mode 100644 index 2cdf916..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/parse-skeleton.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { NumberFormatError } from './errors.js'; -import { Skeleton } from './types/skeleton.js'; -/** - * Parse an {@link - * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md - * | ICU NumberFormatter skeleton} string into a {@link Skeleton} structure. - * - * @public - * @param src - The skeleton string - * @param onError - Called when the parser encounters a syntax error. The - * function will still return a {@link Skeleton}, but it may not contain - * information for all tokens. If not defined, the error will be thrown - * instead. - * - * @example - * ```js - * import { parseNumberSkeleton } from '@messageformat/number-skeleton' - * - * parseNumberSkeleton('compact-short currency/GBP', console.error) - * // { - * // notation: { style: 'compact-short' }, - * // unit: { style: 'currency', currency: 'GBP' } - * // } - * ``` - */ -export declare function parseNumberSkeleton(src: string, onError?: (err: NumberFormatError) => void): Skeleton; diff --git a/node_modules/@messageformat/number-skeleton/lib/parse-skeleton.js b/node_modules/@messageformat/number-skeleton/lib/parse-skeleton.js deleted file mode 100644 index 7ebed31..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/parse-skeleton.js +++ /dev/null @@ -1,41 +0,0 @@ -import { TokenParser } from './skeleton-parser/token-parser.js'; -/** - * Parse an {@link - * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md - * | ICU NumberFormatter skeleton} string into a {@link Skeleton} structure. - * - * @public - * @param src - The skeleton string - * @param onError - Called when the parser encounters a syntax error. The - * function will still return a {@link Skeleton}, but it may not contain - * information for all tokens. If not defined, the error will be thrown - * instead. - * - * @example - * ```js - * import { parseNumberSkeleton } from '@messageformat/number-skeleton' - * - * parseNumberSkeleton('compact-short currency/GBP', console.error) - * // { - * // notation: { style: 'compact-short' }, - * // unit: { style: 'currency', currency: 'GBP' } - * // } - * ``` - */ -export function parseNumberSkeleton(src, onError = error => { - throw error; -}) { - const tokens = []; - for (const part of src.split(' ')) { - if (part) { - const options = part.split('/'); - const stem = options.shift() || ''; - tokens.push({ stem, options }); - } - } - const parser = new TokenParser(onError); - for (const { stem, options } of tokens) { - parser.parseToken(stem, options); - } - return parser.skeleton; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/affix-tokens.d.ts b/node_modules/@messageformat/number-skeleton/lib/pattern-parser/affix-tokens.d.ts deleted file mode 100644 index 53e0f11..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/affix-tokens.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { PatternError } from '../errors.js'; -export type AffixToken = { - char: '%'; - width: number; - style: 'percent' | 'permille'; -} | { - char: '¤'; - width: number; - currency: 'default' | 'iso-code' | 'full-name' | 'narrow'; -} | { - char: '*'; - width: number; - pad: string; -} | { - char: '+' | '-'; - width: number; -} | { - char: "'"; - width: number; - str: string; -}; -export declare function parseAffixToken(src: string, pos: number, onError: (err: PatternError) => void): AffixToken | null; diff --git a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/affix-tokens.js b/node_modules/@messageformat/number-skeleton/lib/pattern-parser/affix-tokens.js deleted file mode 100644 index ca7ff84..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/affix-tokens.js +++ /dev/null @@ -1,62 +0,0 @@ -import { PatternError } from '../errors.js'; -export function parseAffixToken(src, pos, onError) { - const char = src[pos]; - switch (char) { - case '%': - return { char: '%', style: 'percent', width: 1 }; - case '‰': - return { char: '%', style: 'permille', width: 1 }; - case '¤': { - let width = 1; - while (src[++pos] === '¤') - ++width; - switch (width) { - case 1: - return { char, currency: 'default', width }; - case 2: - return { char, currency: 'iso-code', width }; - case 3: - return { char, currency: 'full-name', width }; - case 5: - return { char, currency: 'narrow', width }; - default: { - const msg = `Invalid number (${width}) of ¤ chars in pattern`; - onError(new PatternError('¤', msg)); - return null; - } - } - } - case '*': { - const pad = src[pos + 1]; - if (pad) - return { char, pad, width: 2 }; - break; - } - case '+': - case '-': - return { char, width: 1 }; - case "'": { - let str = src[++pos]; - let width = 2; - if (str === "'") - return { char, str, width }; - while (true) { - const next = src[++pos]; - ++width; - if (next === undefined) { - const msg = `Unterminated quoted literal in pattern: ${str}`; - onError(new PatternError("'", msg)); - return { char, str, width }; - } - else if (next === "'") { - if (src[++pos] !== "'") - return { char, str, width }; - else - ++width; - } - str += next; - } - } - } - return null; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-as-skeleton.d.ts b/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-as-skeleton.d.ts deleted file mode 100644 index 48998f4..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-as-skeleton.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { NumberFormatError } from '../errors.js'; -import { Skeleton } from '../types/skeleton.js'; -import { NumberToken } from './number-tokens.js'; -export declare function parseNumberAsSkeleton(tokens: NumberToken[], onError: (error: NumberFormatError) => void): Skeleton; diff --git a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-as-skeleton.js b/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-as-skeleton.js deleted file mode 100644 index db36374..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-as-skeleton.js +++ /dev/null @@ -1,122 +0,0 @@ -import { MaskedValueError, PatternError } from '../errors.js'; -export function parseNumberAsSkeleton(tokens, onError) { - const res = {}; - let hasGroups = false; - let hasExponent = false; - let intOptional = 0; - let intDigits = ''; - let decimalPos = -1; - let fracDigits = ''; - let fracOptional = 0; - for (let pos = 0; pos < tokens.length; ++pos) { - const token = tokens[pos]; - switch (token.char) { - case '#': { - if (decimalPos === -1) { - if (intDigits) { - const msg = 'Pattern has # after integer digits'; - onError(new PatternError('#', msg)); - } - intOptional += token.width; - } - else { - fracOptional += token.width; - } - break; - } - case '0': { - if (decimalPos === -1) { - intDigits += token.digits; - } - else { - if (fracOptional) { - const msg = 'Pattern has digits after # in fraction'; - onError(new PatternError('0', msg)); - } - fracDigits += token.digits; - } - break; - } - case '@': { - if (res.precision) - onError(new MaskedValueError('precision', res.precision)); - res.precision = { - style: 'precision-fraction', - minSignificant: token.min, - maxSignificant: token.width - }; - break; - } - case ',': - hasGroups = true; - break; - case '.': - if (decimalPos === 1) { - const msg = 'Pattern has more than one decimal separator'; - onError(new PatternError('.', msg)); - } - decimalPos = pos; - break; - case 'E': { - if (hasExponent) - onError(new MaskedValueError('exponent', res.notation)); - if (hasGroups) { - const msg = 'Exponential patterns may not contain grouping separators'; - onError(new PatternError('E', msg)); - } - res.notation = { style: 'scientific' }; - if (token.expDigits > 1) - res.notation.expDigits = token.expDigits; - if (token.plus) - res.notation.expSign = 'sign-always'; - hasExponent = true; - } - } - } - // imprecise mapping due to paradigm differences - if (hasGroups) - res.group = 'group-auto'; - else if (intOptional + intDigits.length > 3) - res.group = 'group-off'; - const increment = Number(`${intDigits || '0'}.${fracDigits}`); - if (increment) - res.precision = { style: 'precision-increment', increment }; - if (!hasExponent) { - if (intDigits.length > 1) - res.integerWidth = { min: intDigits.length }; - if (!res.precision && (fracDigits.length || fracOptional)) { - res.precision = { - style: 'precision-fraction', - minFraction: fracDigits.length, - maxFraction: fracDigits.length + fracOptional - }; - } - } - else { - if (!res.precision || increment) { - res.integerWidth = intOptional - ? { min: 1, max: intOptional + intDigits.length } - : { min: Math.max(1, intDigits.length) }; - } - if (res.precision) { - if (!increment) - res.integerWidth = { min: 1, max: 1 }; - } - else { - const dc = intDigits.length + fracDigits.length; - if (decimalPos === -1) { - if (dc > 0) - res.precision = { style: 'precision-fraction', maxSignificant: dc }; - } - else { - res.precision = { - style: 'precision-fraction', - maxSignificant: Math.max(1, dc) + fracOptional - }; - if (dc > 1) - res.precision.minSignificant = dc; - } - } - } - return res; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-tokens.d.ts b/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-tokens.d.ts deleted file mode 100644 index 5bc5495..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-tokens.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -export type NumberToken = { - char: '.'; - width: number; -} | { - char: '#'; - width: number; -} | { - char: ','; - width: number; -} | { - char: '0'; - width: number; - digits: string; -} | { - char: '@'; - width: number; - min: number; -} | { - char: 'E'; - width: number; - expDigits: number; - plus: boolean; -}; -export declare function parseNumberToken(src: string, pos: number): NumberToken | null; diff --git a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-tokens.js b/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-tokens.js deleted file mode 100644 index b3d2e09..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/number-tokens.js +++ /dev/null @@ -1,49 +0,0 @@ -const isDigit = (char) => char >= '0' && char <= '9'; -export function parseNumberToken(src, pos) { - const char = src[pos]; - if (isDigit(char)) { - let digits = char; - while (true) { - const next = src[++pos]; - if (isDigit(next)) - digits += next; - else - return { char: '0', digits, width: digits.length }; - } - } - switch (char) { - case '#': { - let width = 1; - while (src[++pos] === '#') - ++width; - return { char, width }; - } - case '@': { - let min = 1; - while (src[++pos] === '@') - ++min; - let width = min; - pos -= 1; - while (src[++pos] === '#') - ++width; - return { char, min, width }; - } - case 'E': { - const plus = src[pos + 1] === '+'; - if (plus) - ++pos; - let expDigits = 0; - while (src[++pos] === '0') - ++expDigits; - const width = (plus ? 2 : 1) + expDigits; - if (expDigits) - return { char, expDigits, plus, width }; - else - break; - } - case '.': - case ',': - return { char, width: 1 }; - } - return null; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/parse-tokens.d.ts b/node_modules/@messageformat/number-skeleton/lib/pattern-parser/parse-tokens.d.ts deleted file mode 100644 index 302f7af..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/parse-tokens.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { AffixToken } from './affix-tokens.js'; -import { NumberToken } from './number-tokens.js'; -import { PatternError } from '../errors.js'; -export declare function parseTokens(src: string, onError: (err: PatternError) => void): { - tokens: { - prefix: AffixToken[]; - number: NumberToken[]; - suffix: AffixToken[]; - }; - negative: { - prefix: AffixToken[]; - number: NumberToken[]; - suffix: AffixToken[]; - }; -} | { - tokens: { - prefix: AffixToken[]; - number: NumberToken[]; - suffix: AffixToken[]; - }; - negative?: undefined; -}; diff --git a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/parse-tokens.js b/node_modules/@messageformat/number-skeleton/lib/pattern-parser/parse-tokens.js deleted file mode 100644 index f3b9709..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/pattern-parser/parse-tokens.js +++ /dev/null @@ -1,90 +0,0 @@ -import { parseAffixToken } from './affix-tokens.js'; -import { parseNumberToken } from './number-tokens.js'; -function parseSubpattern(src, pos, onError) { - let State; - (function (State) { - State[State["Prefix"] = 0] = "Prefix"; - State[State["Number"] = 1] = "Number"; - State[State["Suffix"] = 2] = "Suffix"; - })(State || (State = {})); - const prefix = []; - const number = []; - const suffix = []; - let state = State.Prefix; - let str = ''; - while (pos < src.length) { - const char = src[pos]; - if (char === ';') { - pos += 1; - break; - } - switch (state) { - case State.Prefix: { - const token = parseAffixToken(src, pos, onError); - if (token) { - if (str) { - prefix.push({ char: "'", str, width: str.length }); - str = ''; - } - prefix.push(token); - pos += token.width; - } - else { - const token = parseNumberToken(src, pos); - if (token) { - if (str) { - prefix.push({ char: "'", str, width: str.length }); - str = ''; - } - state = State.Number; - number.push(token); - pos += token.width; - } - else { - str += char; - pos += 1; - } - } - break; - } - case State.Number: { - const token = parseNumberToken(src, pos); - if (token) { - number.push(token); - pos += token.width; - } - else { - state = State.Suffix; - } - break; - } - case State.Suffix: { - const token = parseAffixToken(src, pos, onError); - if (token) { - if (str) { - suffix.push({ char: "'", str, width: str.length }); - str = ''; - } - suffix.push(token); - pos += token.width; - } - else { - str += char; - pos += 1; - } - break; - } - } - } - if (str) - suffix.push({ char: "'", str, width: str.length }); - return { pattern: { prefix, number, suffix }, pos }; -} -export function parseTokens(src, onError) { - const { pattern, pos } = parseSubpattern(src, 0, onError); - if (pos < src.length) { - const { pattern: negative } = parseSubpattern(src, pos, onError); - return { tokens: pattern, negative }; - } - return { tokens: pattern }; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/options.d.ts b/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/options.d.ts deleted file mode 100644 index 001b36f..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/options.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { NumberFormatError } from '../errors.js'; -/** @internal */ -export declare function validOptions(stem: string, options: string[], onError: (err: NumberFormatError) => void): boolean; diff --git a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/options.js b/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/options.js deleted file mode 100644 index b4d308f..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/options.js +++ /dev/null @@ -1,86 +0,0 @@ -import { BadOptionError, MissingOptionError, TooManyOptionsError } from '../errors.js'; -const maxOptions = { - 'compact-short': 0, - 'compact-long': 0, - 'notation-simple': 0, - scientific: 2, - engineering: 2, - percent: 0, - permille: 0, - 'base-unit': 0, - currency: 1, - 'measure-unit': 1, - 'per-measure-unit': 1, - 'unit-width-narrow': 0, - 'unit-width-short': 0, - 'unit-width-full-name': 0, - 'unit-width-iso-code': 0, - 'unit-width-hidden': 0, - 'precision-integer': 0, - 'precision-unlimited': 0, - 'precision-currency-standard': 1, - 'precision-currency-cash': 0, - 'precision-increment': 1, - 'rounding-mode-ceiling': 0, - 'rounding-mode-floor': 0, - 'rounding-mode-down': 0, - 'rounding-mode-up': 0, - 'rounding-mode-half-even': 0, - 'rounding-mode-half-down': 0, - 'rounding-mode-half-up': 0, - 'rounding-mode-unnecessary': 0, - 'integer-width': 1, - scale: 1, - 'group-off': 0, - 'group-min2': 0, - 'group-auto': 0, - 'group-on-aligned': 0, - 'group-thousands': 0, - latin: 0, - 'numbering-system': 1, - 'sign-auto': 0, - 'sign-always': 0, - 'sign-never': 0, - 'sign-accounting': 0, - 'sign-accounting-always': 0, - 'sign-except-zero': 0, - 'sign-accounting-except-zero': 0, - 'decimal-auto': 0, - 'decimal-always': 0 -}; -const minOptions = { - currency: 1, - 'integer-width': 1, - 'measure-unit': 1, - 'numbering-system': 1, - 'per-measure-unit': 1, - 'precision-increment': 1, - scale: 1 -}; -function hasMaxOption(stem) { - return stem in maxOptions; -} -function hasMinOption(stem) { - return stem in minOptions; -} -/** @internal */ -export function validOptions(stem, options, onError) { - if (hasMaxOption(stem)) { - const maxOpt = maxOptions[stem]; - if (options.length > maxOpt) { - if (maxOpt === 0) { - for (const opt of options) - onError(new BadOptionError(stem, opt)); - } - else { - onError(new TooManyOptionsError(stem, options, maxOpt)); - } - return false; - } - else if (hasMinOption(stem) && options.length < minOptions[stem]) { - onError(new MissingOptionError(stem)); - return false; - } - } - return true; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/parse-precision-blueprint.d.ts b/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/parse-precision-blueprint.d.ts deleted file mode 100644 index 1fc43fa..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/parse-precision-blueprint.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { NumberFormatError } from '../errors.js'; -export declare function parsePrecisionBlueprint(stem: string, options: string[], onError: (err: NumberFormatError) => void): { - style: "precision-fraction"; - minFraction?: number | undefined; - maxFraction?: number | undefined; - minSignificant?: number | undefined; - maxSignificant?: number | undefined; - source?: string | undefined; -} | null; diff --git a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/parse-precision-blueprint.js b/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/parse-precision-blueprint.js deleted file mode 100644 index 5b516f7..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/parse-precision-blueprint.js +++ /dev/null @@ -1,57 +0,0 @@ -import { BadOptionError, TooManyOptionsError } from '../errors.js'; -function parseBlueprintDigits(src, style) { - const re = style === 'fraction' ? /^\.(0*)(\+|#*)$/ : /^(@+)(\+|#*)$/; - const match = src && src.match(re); - if (match) { - const min = match[1].length; - switch (match[2].charAt(0)) { - case '': - return { min, max: min }; - case '+': - return { min, max: null }; - case '#': { - return { min, max: min + match[2].length }; - } - } - } - return null; -} -export function parsePrecisionBlueprint(stem, options, onError) { - const fd = parseBlueprintDigits(stem, 'fraction'); - if (fd) { - if (options.length > 1) - onError(new TooManyOptionsError(stem, options, 1)); - const res = { - style: 'precision-fraction', - source: stem, - minFraction: fd.min - }; - if (fd.max != null) - res.maxFraction = fd.max; - const option = options[0]; - const sd = parseBlueprintDigits(option, 'significant'); - if (sd) { - res.source = `${stem}/${option}`; - res.minSignificant = sd.min; - if (sd.max != null) - res.maxSignificant = sd.max; - } - else if (option) - onError(new BadOptionError(stem, option)); - return res; - } - const sd = parseBlueprintDigits(stem, 'significant'); - if (sd) { - for (const opt of options) - onError(new BadOptionError(stem, opt)); - const res = { - style: 'precision-fraction', - source: stem, - minSignificant: sd.min - }; - if (sd.max != null) - res.maxSignificant = sd.max; - return res; - } - return null; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/token-parser.d.ts b/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/token-parser.d.ts deleted file mode 100644 index 7b79d98..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/token-parser.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { NumberFormatError } from '../errors.js'; -import { Skeleton } from '../types/skeleton.js'; -/** @internal */ -export declare class TokenParser { - onError: (err: NumberFormatError) => void; - skeleton: Skeleton; - constructor(onError: (err: NumberFormatError) => void); - badOption(stem: string, opt: string): void; - assertEmpty(key: keyof Skeleton): void; - parseToken(stem: string, options: string[]): void; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/token-parser.js b/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/token-parser.js deleted file mode 100644 index 9b2e017..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/skeleton-parser/token-parser.js +++ /dev/null @@ -1,237 +0,0 @@ -import { BadOptionError, BadStemError, MaskedValueError } from '../errors.js'; -import { isNumberingSystem } from '../types/skeleton.js'; -import { isUnit } from '../types/unit.js'; -import { validOptions } from './options.js'; -import { parsePrecisionBlueprint } from './parse-precision-blueprint.js'; -/** @internal */ -export class TokenParser { - constructor(onError) { - this.skeleton = {}; - this.onError = onError; - } - badOption(stem, opt) { - this.onError(new BadOptionError(stem, opt)); - } - assertEmpty(key) { - const prev = this.skeleton[key]; - if (prev) - this.onError(new MaskedValueError(key, prev)); - } - parseToken(stem, options) { - if (!validOptions(stem, options, this.onError)) - return; - const option = options[0]; - const res = this.skeleton; - switch (stem) { - // notation - case 'compact-short': - case 'compact-long': - case 'notation-simple': - this.assertEmpty('notation'); - res.notation = { style: stem }; - break; - case 'scientific': - case 'engineering': { - let expDigits = null; - let expSign = undefined; - for (const opt of options) { - switch (opt) { - case 'sign-auto': - case 'sign-always': - case 'sign-never': - case 'sign-accounting': - case 'sign-accounting-always': - case 'sign-except-zero': - case 'sign-accounting-except-zero': - expSign = opt; - break; - default: - if (/^\+e+$/.test(opt)) - expDigits = opt.length - 1; - else { - this.badOption(stem, opt); - } - } - } - this.assertEmpty('notation'); - const source = options.join('/'); - res.notation = - expDigits && expSign - ? { style: stem, source, expDigits, expSign } - : expDigits - ? { style: stem, source, expDigits } - : expSign - ? { style: stem, source, expSign } - : { style: stem, source }; - break; - } - // unit - case 'percent': - case 'permille': - case 'base-unit': - this.assertEmpty('unit'); - res.unit = { style: stem }; - break; - case 'currency': - if (/^[A-Z]{3}$/.test(option)) { - this.assertEmpty('unit'); - res.unit = { style: stem, currency: option }; - } - else - this.badOption(stem, option); - break; - case 'measure-unit': { - if (isUnit(option)) { - this.assertEmpty('unit'); - res.unit = { style: stem, unit: option }; - } - else - this.badOption(stem, option); - break; - } - // unitPer - case 'per-measure-unit': { - if (isUnit(option)) { - this.assertEmpty('unitPer'); - res.unitPer = option; - } - else - this.badOption(stem, option); - break; - } - // unitWidth - case 'unit-width-narrow': - case 'unit-width-short': - case 'unit-width-full-name': - case 'unit-width-iso-code': - case 'unit-width-hidden': - this.assertEmpty('unitWidth'); - res.unitWidth = stem; - break; - // precision - case 'precision-integer': - case 'precision-unlimited': - case 'precision-currency-cash': - this.assertEmpty('precision'); - res.precision = { style: stem }; - break; - case 'precision-currency-standard': - this.assertEmpty('precision'); - if (option === 'w') { - res.precision = { style: stem, trailingZero: 'stripIfInteger' }; - } - else { - res.precision = { style: stem }; - } - break; - case 'precision-increment': { - const increment = Number(option); - if (increment > 0) { - this.assertEmpty('precision'); - res.precision = { style: stem, increment }; - } - else - this.badOption(stem, option); - break; - } - // roundingMode - case 'rounding-mode-ceiling': - case 'rounding-mode-floor': - case 'rounding-mode-down': - case 'rounding-mode-up': - case 'rounding-mode-half-even': - case 'rounding-mode-half-odd': - case 'rounding-mode-half-ceiling': - case 'rounding-mode-half-floor': - case 'rounding-mode-half-down': - case 'rounding-mode-half-up': - case 'rounding-mode-unnecessary': - this.assertEmpty('roundingMode'); - res.roundingMode = stem; - break; - // integerWidth - case 'integer-width': { - if (/^\+0*$/.test(option)) { - this.assertEmpty('integerWidth'); - res.integerWidth = { source: option, min: option.length - 1 }; - } - else { - const m = option.match(/^#*(0*)$/); - if (m) { - this.assertEmpty('integerWidth'); - res.integerWidth = { - source: option, - min: m[1].length, - max: m[0].length - }; - } - else - this.badOption(stem, option); - } - break; - } - // scale - case 'scale': { - const scale = Number(option); - if (scale > 0) { - this.assertEmpty('scale'); - res.scale = scale; - } - else - this.badOption(stem, option); - break; - } - // group - case 'group-off': - case 'group-min2': - case 'group-auto': - case 'group-on-aligned': - case 'group-thousands': - this.assertEmpty('group'); - res.group = stem; - break; - // numberingSystem - case 'latin': - this.assertEmpty('numberingSystem'); - res.numberingSystem = 'latn'; - break; - case 'numbering-system': { - if (isNumberingSystem(option)) { - this.assertEmpty('numberingSystem'); - res.numberingSystem = option; - } - else - this.badOption(stem, option); - break; - } - // sign - case 'sign-auto': - case 'sign-always': - case 'sign-never': - case 'sign-accounting': - case 'sign-accounting-always': - case 'sign-except-zero': - case 'sign-accounting-except-zero': - this.assertEmpty('sign'); - res.sign = stem; - break; - // decimal - case 'decimal-auto': - case 'decimal-always': - this.assertEmpty('decimal'); - res.decimal = stem; - break; - // precision blueprint - default: { - const precision = parsePrecisionBlueprint(stem, options, this.onError); - if (precision) { - this.assertEmpty('precision'); - res.precision = precision; - } - else { - this.onError(new BadStemError(stem)); - } - } - } - } -} diff --git a/node_modules/@messageformat/number-skeleton/lib/tsdoc-metadata.json b/node_modules/@messageformat/number-skeleton/lib/tsdoc-metadata.json deleted file mode 100644 index f092560..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "7.35.0" - } - ] -} diff --git a/node_modules/@messageformat/number-skeleton/lib/types/skeleton.d.ts b/node_modules/@messageformat/number-skeleton/lib/types/skeleton.d.ts deleted file mode 100644 index df47382..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/types/skeleton.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { Unit } from './unit.js'; -/** - * An object representation of a parsed string skeleton, with token values - * grouped by type. - * - * @public - */ -export interface Skeleton { - /** - * @remarks - * The prefix and suffix of an ICU NumberFormatter pattern. Not used for skeletons. - */ - affix?: { - pos: [string, string]; - neg?: [string, string]; - }; - decimal?: 'decimal-auto' | 'decimal-always'; - group?: 'group-off' | 'group-min2' | 'group-auto' | 'group-on-aligned' | 'group-thousands'; - integerWidth?: { - min: number; - max?: number; - source?: string; - }; - notation?: { - style: 'compact-short' | 'compact-long' | 'notation-simple'; - } | { - style: 'scientific' | 'engineering'; - expDigits?: number; - expSign?: Skeleton['sign']; - source?: string; - }; - /** - * @remarks - * List collected from - * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat | MDN documentation} - */ - numberingSystem?: 'arab' | 'arabext' | 'bali' | 'beng' | 'deva' | 'fullwide' | 'gujr' | 'guru' | 'hanidec' | 'khmr' | 'knda' | 'laoo' | 'latn' | 'limb' | 'mlym' | 'mong' | 'mymr' | 'orya' | 'tamldec' | 'telu' | 'thai' | 'tibt'; - precision?: { - style: 'precision-integer' | 'precision-unlimited' | 'precision-currency-cash'; - } | { - style: 'precision-currency-standard'; - trailingZero?: 'auto' | 'stripIfInteger' | undefined; - } | { - style: 'precision-increment'; - increment: number; - } | { - style: 'precision-fraction'; - minFraction?: number; - maxFraction?: number; - minSignificant?: number; - maxSignificant?: number; - source?: string; - }; - roundingMode?: 'rounding-mode-ceiling' | 'rounding-mode-floor' | 'rounding-mode-down' | 'rounding-mode-up' | 'rounding-mode-half-even' | 'rounding-mode-half-odd' | 'rounding-mode-half-ceiling' | 'rounding-mode-half-floor' | 'rounding-mode-half-down' | 'rounding-mode-half-up' | 'rounding-mode-unnecessary'; - scale?: number; - sign?: 'sign-auto' | 'sign-always' | 'sign-never' | 'sign-accounting' | 'sign-accounting-always' | 'sign-except-zero' | 'sign-accounting-except-zero'; - unit?: { - style: 'percent' | 'permille' | 'base-unit'; - } | { - style: 'currency'; - currency: string; - } | { - style: 'measure-unit'; - unit: Unit; - }; - unitPer?: Unit; - unitWidth?: 'unit-width-narrow' | 'unit-width-short' | 'unit-width-full-name' | 'unit-width-iso-code' | 'unit-width-hidden'; -} -/** @internal */ -export declare function isNumberingSystem(ns: string): ns is string & Skeleton['numberingSystem']; diff --git a/node_modules/@messageformat/number-skeleton/lib/types/skeleton.js b/node_modules/@messageformat/number-skeleton/lib/types/skeleton.js deleted file mode 100644 index caffc73..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/types/skeleton.js +++ /dev/null @@ -1,28 +0,0 @@ -/** @internal */ -export function isNumberingSystem(ns) { - const systems = [ - 'arab', - 'arabext', - 'bali', - 'beng', - 'deva', - 'fullwide', - 'gujr', - 'guru', - 'hanidec', - 'khmr', - 'knda', - 'laoo', - 'latn', - 'limb', - 'mlym', - 'mong', - 'mymr', - 'orya', - 'tamldec', - 'telu', - 'thai', - 'tibt' - ]; - return systems.indexOf(ns) !== -1; -} diff --git a/node_modules/@messageformat/number-skeleton/lib/types/unit.d.ts b/node_modules/@messageformat/number-skeleton/lib/types/unit.d.ts deleted file mode 100644 index 9a197b6..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/types/unit.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Measurement units defined by the {@link - * https://github.com/unicode-org/cldr/blob/d4d77a2/common/validity/unit.xml | - * Unicode CLDR} - * - * @public - */ -export type Unit = 'acceleration-g-force' | 'acceleration-meter-per-second-squared' | 'angle-arc-minute' | 'angle-arc-second' | 'angle-degree' | 'angle-radian' | 'angle-revolution' | 'area-acre' | 'area-dunam' | 'area-hectare' | 'area-square-centimeter' | 'area-square-foot' | 'area-square-inch' | 'area-square-kilometer' | 'area-square-meter' | 'area-square-mile' | 'area-square-yard' | 'concentr-karat' | 'concentr-milligram-per-deciliter' | 'concentr-millimole-per-liter' | 'concentr-mole' | 'concentr-part-per-million' | 'concentr-percent' | 'concentr-permille' | 'concentr-permyriad' | 'consumption-liter-per-100kilometers' | 'consumption-liter-per-kilometer' | 'consumption-mile-per-gallon' | 'consumption-mile-per-gallon-imperial' | 'digital-bit' | 'digital-byte' | 'digital-gigabit' | 'digital-gigabyte' | 'digital-kilobit' | 'digital-kilobyte' | 'digital-megabit' | 'digital-megabyte' | 'digital-petabyte' | 'digital-terabit' | 'digital-terabyte' | 'duration-century' | 'duration-decade' | 'duration-day' | 'duration-day-person' | 'duration-hour' | 'duration-microsecond' | 'duration-millisecond' | 'duration-minute' | 'duration-month' | 'duration-month-person' | 'duration-nanosecond' | 'duration-second' | 'duration-week' | 'duration-week-person' | 'duration-year' | 'duration-year-person' | 'electric-ampere' | 'electric-milliampere' | 'electric-ohm' | 'electric-volt' | 'energy-calorie' | 'energy-foodcalorie' | 'energy-joule' | 'energy-kilocalorie' | 'energy-kilojoule' | 'energy-kilowatt-hour' | 'energy-electronvolt' | 'energy-therm-us' | 'energy-british-thermal-unit' | 'force-pound-force' | 'force-newton' | 'frequency-gigahertz' | 'frequency-hertz' | 'frequency-kilohertz' | 'frequency-megahertz' | 'graphics-dot-per-centimeter' | 'graphics-dot-per-inch' | 'graphics-em' | 'graphics-megapixel' | 'graphics-pixel' | 'graphics-pixel-per-centimeter' | 'graphics-pixel-per-inch' | 'length-astronomical-unit' | 'length-centimeter' | 'length-decimeter' | 'length-fathom' | 'length-foot' | 'length-furlong' | 'length-inch' | 'length-kilometer' | 'length-light-year' | 'length-meter' | 'length-micrometer' | 'length-mile' | 'length-mile-scandinavian' | 'length-millimeter' | 'length-nanometer' | 'length-nautical-mile' | 'length-parsec' | 'length-picometer' | 'length-point' | 'length-yard' | 'length-solar-radius' | 'light-lux' | 'light-solar-luminosity' | 'mass-carat' | 'mass-gram' | 'mass-kilogram' | 'mass-metric-ton' | 'mass-microgram' | 'mass-milligram' | 'mass-ounce' | 'mass-ounce-troy' | 'mass-pound' | 'mass-stone' | 'mass-ton' | 'mass-dalton' | 'mass-earth-mass' | 'mass-solar-mass' | 'power-gigawatt' | 'power-horsepower' | 'power-kilowatt' | 'power-megawatt' | 'power-milliwatt' | 'power-watt' | 'pressure-atmosphere' | 'pressure-hectopascal' | 'pressure-inch-hg' | 'pressure-bar' | 'pressure-millibar' | 'pressure-millimeter-of-mercury' | 'pressure-pound-per-square-inch' | 'pressure-pascal' | 'pressure-kilopascal' | 'pressure-megapascal' | 'speed-kilometer-per-hour' | 'speed-knot' | 'speed-meter-per-second' | 'speed-mile-per-hour' | 'temperature-celsius' | 'temperature-fahrenheit' | 'temperature-generic' | 'temperature-kelvin' | 'torque-newton-meter' | 'torque-pound-foot' | 'volume-acre-foot' | 'volume-barrel' | 'volume-bushel' | 'volume-centiliter' | 'volume-cubic-centimeter' | 'volume-cubic-foot' | 'volume-cubic-inch' | 'volume-cubic-kilometer' | 'volume-cubic-meter' | 'volume-cubic-mile' | 'volume-cubic-yard' | 'volume-cup' | 'volume-cup-metric' | 'volume-deciliter' | 'volume-fluid-ounce' | 'volume-fluid-ounce-imperial' | 'volume-gallon' | 'volume-gallon-imperial' | 'volume-hectoliter' | 'volume-liter' | 'volume-megaliter' | 'volume-milliliter' | 'volume-pint' | 'volume-pint-metric' | 'volume-quart' | 'volume-tablespoon' | 'volume-teaspoon'; -/** @internal */ -export declare function isUnit(unit: string): unit is Unit; diff --git a/node_modules/@messageformat/number-skeleton/lib/types/unit.js b/node_modules/@messageformat/number-skeleton/lib/types/unit.js deleted file mode 100644 index c992423..0000000 --- a/node_modules/@messageformat/number-skeleton/lib/types/unit.js +++ /dev/null @@ -1,29 +0,0 @@ -// FIXME: subtype is not checked -/** @internal */ -export function isUnit(unit) { - const types = [ - 'acceleration', - 'angle', - 'area', - 'concentr', - 'consumption', - 'digital', - 'duration', - 'electric', - 'energy', - 'force', - 'frequency', - 'graphics', - 'length', - 'light', - 'mass', - 'power', - 'pressure', - 'speed', - 'temperature', - 'torque', - 'volume' - ]; - const [type] = unit.split('-', 1); - return types.indexOf(type) !== -1; -} diff --git a/node_modules/@messageformat/number-skeleton/package.json b/node_modules/@messageformat/number-skeleton/package.json deleted file mode 100644 index 3802cea..0000000 --- a/node_modules/@messageformat/number-skeleton/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@messageformat/number-skeleton", - "version": "1.2.0", - "description": "A parser & formatter for ICU NumberFormat skeleton strings & patterns", - "keywords": [ - "icu", - "messageformat", - "numberformatter", - "skeleton", - "parser", - "formatter" - ], - "contributors": [ - "Eemeli Aro " - ], - "license": "MIT", - "homepage": "http://messageformat.github.io/messageformat/api/number-skeleton/", - "repository": { - "type": "git", - "url": "https://github.com/messageformat/messageformat.git", - "directory": "packages/number-skeleton" - }, - "files": [ - "lib/" - ], - "type": "module", - "main": "lib/index.js", - "scripts": { - "build": "tsc --project tsconfig.build.json", - "extract-api": "api-extractor run --verbose" - } -} diff --git a/node_modules/@messageformat/parser/LICENSE b/node_modules/@messageformat/parser/LICENSE deleted file mode 100644 index 78918d5..0000000 --- a/node_modules/@messageformat/parser/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright OpenJS Foundation and contributors, https://openjsf.org/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@messageformat/parser/README.md b/node_modules/@messageformat/parser/README.md deleted file mode 100644 index 93f92c9..0000000 --- a/node_modules/@messageformat/parser/README.md +++ /dev/null @@ -1,178 +0,0 @@ -# @messageformat/parser - -An AST parser for [ICU MessageFormat] strings – part of [messageformat]. - -The `parse(src, [options])` function takes two parameters, first the -string to be parsed, and a second optional parameter `options`, an object with -the following possible keys: - -- `cardinal` and `ordinal` – Arrays of valid plural categories for the current - locale, used to validate `plural` and `selectordinal` keys. If these are - missing or set to false, the full set of valid [Unicode CLDR] keys is used: - `'zero', 'one', 'two', 'few', 'many', 'other'`. To disable this check, pass in - an empty array. - -- `strict` – By default, the parsing applies a few relaxations to the ICU - MessageFormat spec. Setting `strict: true` will disable these relaxations: - - The `argType` of `simpleArg` formatting functions will be restricted to the - set of `number`, `date`, `time`, `spellout`, `ordinal`, and `duration`, - rather than accepting any lower-case identifier that does not start with a - number. - - The optional `argStyle` of `simpleArg` formatting functions will not be - parsed as any other text, but instead as the spec requires: "In - argStyleText, every single ASCII apostrophe begins and ends quoted literal - text, and unquoted {curly braces} must occur in matched pairs." - - Inside a `plural` or `selectordinal` statement, a pound symbol (`#`) is - replaced with the input number. By default, `#` is also parsed as a special - character in nested statements too, and can be escaped using apostrophes - (`'#'`). In strict mode `#` will be parsed as a special character only - directly inside a `plural` or `selectordinal` statement. Outside those, `#` - and `'#'` will be parsed as literal text. - -The parser only supports the default `DOUBLE_OPTIONAL` [apostrophe mode], in -which a single apostrophe only starts quoted literal text if it immediately -precedes a curly brace `{}`, or a pound symbol `#` if inside a plural format. A -literal apostrophe `'` is represented by either a single `'` or a doubled `''` -apostrophe character. - -This package was previously named [messageformat-parser](https://www.npmjs.com/package/messageformat-parser). - -[icu messageformat]: https://messageformat.github.io/guide/ -[messageformat]: https://messageformat.github.io/ -[unicode cldr]: http://cldr.unicode.org/index/cldr-spec/plural-rules -[apostrophe mode]: http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b - -## Installation - -```sh -npm install @messageformat/parser -``` - -## Usage - -```js -> const { parse } = require('@messageformat/parser') -// For clarity, the examples below do not show the ctx object included for each token - -> parse('So {wow}.') -[ { type: 'content', value: 'So ' }, - { type: 'argument', arg: 'wow' }, - { type: 'content', value: '.' } ] - -> parse('Such { thing }. { count, selectordinal, one {First} two {Second}' + - ' few {Third} other {#th} } word.') -[ { type: 'content', value: 'Such ' }, - { type: 'argument', arg: 'thing' }, - { type: 'content', value: '. ' }, - { type: 'selectordinal', - arg: 'count', - cases: [ - { key: 'one', tokens: [ { type: 'content', value: 'First' } ] }, - { key: 'two', tokens: [ { type: 'content', value: 'Second' } ] }, - { key: 'few', tokens: [ { type: 'content', value: 'Third' } ] }, - { key: 'other', - tokens: [ { type: 'octothorpe' }, { type: 'content', value: 'th' } ] } - ] }, - { type: 'content', value: ' word.' } ] - -> parse('Many{type,select,plural{ numbers}selectordinal{ counting}' + - 'select{ choices}other{ some {type}}}.') -[ { type: 'content', value: 'Many' }, - { type: 'select', - arg: 'type', - cases: [ - { key: 'plural', tokens: [ { type: 'content', value: 'numbers' } ] }, - { key: 'selectordinal', tokens: [ { type: 'content', value: 'counting' } ] }, - { key: 'select', tokens: [ { type: 'content', value: 'choices' } ] }, - { key: 'other', - tokens: [ { type: 'content', value: 'some ' }, { type: 'argument', arg: 'type' } ] } - ] }, - { type: 'content', value: '.' } ] - -> parse('{Such compliance') -// ParseError: invalid syntax at line 1 col 7: -// -// {Such compliance -// ^ - -> const msg = '{words, plural, zero{No words} one{One word} other{# words}}' -> parse(msg) -[ { type: 'plural', - arg: 'words', - cases: [ - { key: 'zero', tokens: [ { type: 'content', value: 'No words' } ] }, - { key: 'one', tokens: [ { type: 'content', value: 'One word' } ] }, - { key: 'other', - tokens: [ { type: 'octothorpe' }, { type: 'content', value: ' words' } ] } - ] } ] - -> parse(msg, { cardinal: [ 'one', 'other' ], ordinal: [ 'one', 'two', 'few', 'other' ] }) -// ParseError: The plural case zero is not valid in this locale at line 1 col 17: -// -// {words, plural, zero{ -// ^ -``` - -For more example usage, please take a look at our [test suite](src/parser.test.ts). - -## Structure - -The output of `parse()` is an array of tokens, `Array`: - - -```typescript -interface Content { - type: 'content' - value: string - ctx: Context -} - -interface PlainArg { - type: 'argument' - arg: string - ctx: Context -} - -interface FunctionArg { - type: 'function' - arg: string - key: string - param?: Array - ctx: Context -} - -interface Select { - type: 'plural' | 'select' | 'selectordinal' - arg: string - cases: Array - pluralOffset?: number - ctx: Context -} - -interface SelectCase { - key: string - tokens: Array - ctx: Context -} - -interface Octothorpe { - type: 'octothorpe' - ctx: Context -} - -interface Context { - offset: number - line: number - col: number - text: string - lineBreaks: number -} -``` - ---- - -[Messageformat](https://messageformat.github.io/) is an OpenJS Foundation project, and we follow its [Code of Conduct](https://code-of-conduct.openjsf.org/). - - -OpenJS Foundation - diff --git a/node_modules/@messageformat/parser/codemod-fix-backslash-escapes.js b/node_modules/@messageformat/parser/codemod-fix-backslash-escapes.js deleted file mode 100644 index bc929ac..0000000 --- a/node_modules/@messageformat/parser/codemod-fix-backslash-escapes.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * codemod for fixing backslash \escapes to quote 'escapes' in MessageFormat strings - * - * messageformat-parser v3 (used by messageformat v2) no longer allows for the - * characters #{}\ to be escaped with a \ prefix, as well as dropping support - * for \u0123 character escapes. This codemod can help fix your MessageFormat - * JSON sources to use ICU MessageFormat 'escapes' instead. - * - * To enable jscodeshift to handle JSON input, you'll need to have an - * appropriate parser available: - * - * npm install --no-save json-estree-ast - * - * Then apply the codemod: - * - * npx jscodeshift -t node_modules/messageformat-parser/codemod-fix-backslash-escapes.js [input] - * - * If your input includes doubled single quotes '', they will need to be - * escaped as well; use the command-line option --doubleSingleQuotes=true to - * enable that. Note that applying the codemod with that option multiple times - * will double your doubled quotes each time. - */ - -let doubleSingleQuotes = false; - -const fixEscapes = node => { - if (node.type !== 'Literal' || typeof node.value !== 'string') return; - if (doubleSingleQuotes) node.value = node.value.replace(/''+/g, '$&$&'); - node.value = node.value.replace( - /('*)\\([#{}\\]|u[0-9a-f]{4})('*)/g, - (_, start, char, end) => { - switch (char[0]) { - case 'u': { - const code = parseInt(char.slice(1), 16); - return start + String.fromCharCode(code) + end; - } - case '\\': - return `${start}\\${end}`; - default: - // Assume multiple ' are already escaped - if (start === "'") start = "''"; - if (end === "'") end = "''"; - return `'${start}${char}${end}'`; - } - } - ); -}; - -module.exports = ({ source }, { jscodeshift: j }, options) => { - if (options.doubleSingleQuotes) doubleSingleQuotes = true; - const ast = j(source); - ast.find(j.Property).forEach(({ value: { value } }) => fixEscapes(value)); - ast - .find(j.ArrayExpression) - .forEach(({ value: { elements } }) => elements.forEach(fixEscapes)); - return ast.toSource(); -}; - -module.exports.parser = require('json-estree-ast'); diff --git a/node_modules/@messageformat/parser/lib/lexer.d.ts b/node_modules/@messageformat/parser/lib/lexer.d.ts deleted file mode 100644 index 95e108d..0000000 --- a/node_modules/@messageformat/parser/lib/lexer.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import moo, { Rules } from 'moo'; -export declare const states: { - [state: string]: Rules; -}; -export declare const lexer: moo.Lexer; diff --git a/node_modules/@messageformat/parser/lib/lexer.js b/node_modules/@messageformat/parser/lib/lexer.js deleted file mode 100644 index 49e2977..0000000 --- a/node_modules/@messageformat/parser/lib/lexer.js +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.lexer = exports.states = void 0; -const moo_1 = __importDefault(require("moo")); -exports.states = { - body: { - doubleapos: { match: "''", value: () => "'" }, - quoted: { - lineBreaks: true, - match: /'[{}#](?:[^]*?[^'])?'(?!')/u, - value: src => src.slice(1, -1).replace(/''/g, "'") - }, - argument: { - lineBreaks: true, - match: /\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u, - push: 'arg', - value: src => src.substring(1).trim() - }, - octothorpe: '#', - end: { match: '}', pop: 1 }, - content: { lineBreaks: true, match: /[^][^{}#']*/u } - }, - arg: { - select: { - lineBreaks: true, - match: /,\s*(?:plural|select|selectordinal)\s*,\s*/u, - next: 'select', - value: src => src.split(',')[1].trim() - }, - 'func-args': { - lineBreaks: true, - match: /,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u, - next: 'body', - value: src => src.split(',')[1].trim() - }, - 'func-simple': { - lineBreaks: true, - match: /,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u, - value: src => src.substring(1).trim() - }, - end: { match: '}', pop: 1 } - }, - select: { - offset: { - lineBreaks: true, - match: /\s*offset\s*:\s*\d+\s*/u, - value: src => src.split(':')[1].trim() - }, - case: { - lineBreaks: true, - match: /\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u, - push: 'body', - value: src => src.substring(0, src.indexOf('{')).trim() - }, - end: { match: /\s*\}/u, pop: 1 } - } -}; -exports.lexer = moo_1.default.states(exports.states); diff --git a/node_modules/@messageformat/parser/lib/parser.d.ts b/node_modules/@messageformat/parser/lib/parser.d.ts deleted file mode 100644 index 07dbf5e..0000000 --- a/node_modules/@messageformat/parser/lib/parser.d.ts +++ /dev/null @@ -1,239 +0,0 @@ -/** - * An AST parser for ICU MessageFormat strings - * - * @packageDocumentation - * @example - * ``` - * import { parse } from '@messageformat/parser - * - * parse('So {wow}.') - * [ { type: 'content', value: 'So ' }, - * { type: 'argument', arg: 'wow' }, - * { type: 'content', value: '.' } ] - * - * - * parse('Such { thing }. { count, selectordinal, one {First} two {Second}' + - * ' few {Third} other {#th} } word.') - * [ { type: 'content', value: 'Such ' }, - * { type: 'argument', arg: 'thing' }, - * { type: 'content', value: '. ' }, - * { type: 'selectordinal', - * arg: 'count', - * cases: [ - * { key: 'one', tokens: [ { type: 'content', value: 'First' } ] }, - * { key: 'two', tokens: [ { type: 'content', value: 'Second' } ] }, - * { key: 'few', tokens: [ { type: 'content', value: 'Third' } ] }, - * { key: 'other', - * tokens: [ { type: 'octothorpe' }, { type: 'content', value: 'th' } ] } - * ] }, - * { type: 'content', value: ' word.' } ] - * - * - * parse('Many{type,select,plural{ numbers}selectordinal{ counting}' + - * 'select{ choices}other{ some {type}}}.') - * [ { type: 'content', value: 'Many' }, - * { type: 'select', - * arg: 'type', - * cases: [ - * { key: 'plural', tokens: [ { type: 'content', value: 'numbers' } ] }, - * { key: 'selectordinal', tokens: [ { type: 'content', value: 'counting' } ] }, - * { key: 'select', tokens: [ { type: 'content', value: 'choices' } ] }, - * { key: 'other', - * tokens: [ { type: 'content', value: 'some ' }, { type: 'argument', arg: 'type' } ] } - * ] }, - * { type: 'content', value: '.' } ] - * - * - * parse('{Such compliance') - * // ParseError: invalid syntax at line 1 col 7: - * // - * // {Such compliance - * // ^ - * - * - * const msg = '{words, plural, zero{No words} one{One word} other{# words}}' - * parse(msg) - * [ { type: 'plural', - * arg: 'words', - * cases: [ - * { key: 'zero', tokens: [ { type: 'content', value: 'No words' } ] }, - * { key: 'one', tokens: [ { type: 'content', value: 'One word' } ] }, - * { key: 'other', - * tokens: [ { type: 'octothorpe' }, { type: 'content', value: ' words' } ] } - * ] } ] - * - * - * parse(msg, { cardinal: [ 'one', 'other' ], ordinal: [ 'one', 'two', 'few', 'other' ] }) - * // ParseError: The plural case zero is not valid in this locale at line 1 col 17: - * // - * // {words, plural, zero{ - * // ^ - * ``` - */ -import { Token as LexerToken } from 'moo'; -/** @internal */ -export type Token = Content | PlainArg | FunctionArg | Select | Octothorpe; -/** - * Text content of the message - * - * @public - */ -export interface Content { - type: 'content'; - value: string; - ctx: Context; -} -/** - * A simple placeholder - * - * @public - * @remarks - * `arg` identifies an input variable, the value of which is used directly in the output. - */ -export interface PlainArg { - type: 'argument'; - arg: string; - ctx: Context; -} -/** - * A placeholder for a mapped argument - * - * @public - * @remarks - * `arg` identifies an input variable, the value of which is passed to the function identified by `key`, with `param` as an optional argument. - * The output of the function is used in the output. - * - * In strict mode, `param` (if defined) may only be an array containing one {@link Content} token. - */ -export interface FunctionArg { - type: 'function'; - arg: string; - key: string; - param?: Array; - ctx: Context; -} -/** - * A selector between multiple variants - * - * @public - * @remarks - * The value of the `arg` input variable determines which of the `cases` is used as the output value of this placeholder. - * - * For `plural` and `selectordinal`, the value of `arg` is expected to be numeric, and will be matched either to an exact case with a key like `=3`, - * or to a case with a key that has a matching plural category as the input number. - */ -export interface Select { - type: 'plural' | 'select' | 'selectordinal'; - arg: string; - cases: SelectCase[]; - pluralOffset?: number; - ctx: Context; -} -/** - * A case within a {@link Select} - * - * @public - */ -export interface SelectCase { - key: string; - tokens: Array; - ctx: Context; -} -/** - * Represents the `#` character - * - * @public - * @remarks - * Within a `plural` or `selectordinal` {@link Select}, the `#` character should be replaced with a formatted representation of the Select's input value. - */ -export interface Octothorpe { - type: 'octothorpe'; - ctx: Context; -} -/** - * The parsing context for a token - * - * @public - */ -export interface Context { - /** Token start index from the beginning of the input string */ - offset: number; - /** Token start line number, starting from 1 */ - line: number; - /** Token start column, starting from 1 */ - col: number; - /** The raw input source for the token */ - text: string; - /** The number of line breaks consumed while parsing the token */ - lineBreaks: number; -} -/** - * Thrown by {@link parse} on error - * - * @public - */ -export declare class ParseError extends Error { - /** @internal */ - constructor(lt: LexerToken | null, msg: string); -} -/** - * One of the valid {@link http://cldr.unicode.org/index/cldr-spec/plural-rules | Unicode CLDR} plural category keys - * - * @public - */ -export type PluralCategory = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other'; -/** - * Options for the parser - * - * @public - */ -export interface ParseOptions { - /** - * Array of valid plural categories for the current locale, used to validate `plural` keys. - * - * If undefined, the full set of valid {@link PluralCategory} keys is used. - * To disable this check, pass in an empty array. - */ - cardinal?: PluralCategory[]; - /** - * Array of valid plural categories for the current locale, used to validate `selectordinal` keys. - * - * If undefined, the full set of valid {@link PluralCategory} keys is used. - * To disable this check, pass in an empty array. - */ - ordinal?: PluralCategory[]; - /** - * By default, the parsing applies a few relaxations to the ICU MessageFormat spec. - * Setting `strict: true` will disable these relaxations. - * - * @remarks - * - The `argType` of `simpleArg` formatting functions will be restricted to the set of - * `number`, `date`, `time`, `spellout`, `ordinal`, and `duration`, - * rather than accepting any lower-case identifier that does not start with a number. - * - * - The optional `argStyle` of `simpleArg` formatting functions will not be parsed as any other text, but instead as the spec requires: - * "In argStyleText, every single ASCII apostrophe begins and ends quoted literal text, and unquoted \{curly braces\} must occur in matched pairs." - * - * - Inside a `plural` or `selectordinal` statement, a pound symbol (`#`) is replaced with the input number. - * By default, `#` is also parsed as a special character in nested statements too, and can be escaped using apostrophes (`'#'`). - * In strict mode `#` will be parsed as a special character only directly inside a `plural` or `selectordinal` statement. - * Outside those, `#` and `'#'` will be parsed as literal text. - */ - strict?: boolean; - /** - * By default, the parser will reject any plural keys that are not valid - * {@link http://cldr.unicode.org/index/cldr-spec/plural-rules | Unicode CLDR} - * plural category keys. - * Setting `strictPluralKeys: false` will disable this check. - */ - strictPluralKeys?: boolean; -} -/** - * Parse an input string into an array of tokens - * - * @public - * @remarks - * The parser only supports the default `DOUBLE_OPTIONAL` - * {@link http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b | apostrophe mode}. - */ -export declare function parse(src: string, options?: ParseOptions): Array; diff --git a/node_modules/@messageformat/parser/lib/parser.js b/node_modules/@messageformat/parser/lib/parser.js deleted file mode 100644 index ffdc78a..0000000 --- a/node_modules/@messageformat/parser/lib/parser.js +++ /dev/null @@ -1,306 +0,0 @@ -"use strict"; -/** - * An AST parser for ICU MessageFormat strings - * - * @packageDocumentation - * @example - * ``` - * import { parse } from '@messageformat/parser - * - * parse('So {wow}.') - * [ { type: 'content', value: 'So ' }, - * { type: 'argument', arg: 'wow' }, - * { type: 'content', value: '.' } ] - * - * - * parse('Such { thing }. { count, selectordinal, one {First} two {Second}' + - * ' few {Third} other {#th} } word.') - * [ { type: 'content', value: 'Such ' }, - * { type: 'argument', arg: 'thing' }, - * { type: 'content', value: '. ' }, - * { type: 'selectordinal', - * arg: 'count', - * cases: [ - * { key: 'one', tokens: [ { type: 'content', value: 'First' } ] }, - * { key: 'two', tokens: [ { type: 'content', value: 'Second' } ] }, - * { key: 'few', tokens: [ { type: 'content', value: 'Third' } ] }, - * { key: 'other', - * tokens: [ { type: 'octothorpe' }, { type: 'content', value: 'th' } ] } - * ] }, - * { type: 'content', value: ' word.' } ] - * - * - * parse('Many{type,select,plural{ numbers}selectordinal{ counting}' + - * 'select{ choices}other{ some {type}}}.') - * [ { type: 'content', value: 'Many' }, - * { type: 'select', - * arg: 'type', - * cases: [ - * { key: 'plural', tokens: [ { type: 'content', value: 'numbers' } ] }, - * { key: 'selectordinal', tokens: [ { type: 'content', value: 'counting' } ] }, - * { key: 'select', tokens: [ { type: 'content', value: 'choices' } ] }, - * { key: 'other', - * tokens: [ { type: 'content', value: 'some ' }, { type: 'argument', arg: 'type' } ] } - * ] }, - * { type: 'content', value: '.' } ] - * - * - * parse('{Such compliance') - * // ParseError: invalid syntax at line 1 col 7: - * // - * // {Such compliance - * // ^ - * - * - * const msg = '{words, plural, zero{No words} one{One word} other{# words}}' - * parse(msg) - * [ { type: 'plural', - * arg: 'words', - * cases: [ - * { key: 'zero', tokens: [ { type: 'content', value: 'No words' } ] }, - * { key: 'one', tokens: [ { type: 'content', value: 'One word' } ] }, - * { key: 'other', - * tokens: [ { type: 'octothorpe' }, { type: 'content', value: ' words' } ] } - * ] } ] - * - * - * parse(msg, { cardinal: [ 'one', 'other' ], ordinal: [ 'one', 'two', 'few', 'other' ] }) - * // ParseError: The plural case zero is not valid in this locale at line 1 col 17: - * // - * // {words, plural, zero{ - * // ^ - * ``` - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.parse = exports.ParseError = void 0; -const lexer_js_1 = require("./lexer.js"); -const getContext = (lt) => ({ - offset: lt.offset, - line: lt.line, - col: lt.col, - text: lt.text, - lineBreaks: lt.lineBreaks -}); -const isSelectType = (type) => type === 'plural' || type === 'select' || type === 'selectordinal'; -function strictArgStyleParam(lt, param) { - let value = ''; - let text = ''; - for (const p of param) { - const pText = p.ctx.text; - text += pText; - switch (p.type) { - case 'content': - value += p.value; - break; - case 'argument': - case 'function': - case 'octothorpe': - value += pText; - break; - default: - throw new ParseError(lt, `Unsupported part in strict mode function arg style: ${pText}`); - } - } - const c = { - type: 'content', - value: value.trim(), - ctx: Object.assign({}, param[0].ctx, { text }) - }; - return [c]; -} -const strictArgTypes = [ - 'number', - 'date', - 'time', - 'spellout', - 'ordinal', - 'duration' -]; -const defaultPluralKeys = ['zero', 'one', 'two', 'few', 'many', 'other']; -/** - * Thrown by {@link parse} on error - * - * @public - */ -class ParseError extends Error { - /** @internal */ - constructor(lt, msg) { - super(lexer_js_1.lexer.formatError(lt, msg)); - } -} -exports.ParseError = ParseError; -class Parser { - constructor(src, opt) { - var _a, _b, _c, _d; - this.lexer = lexer_js_1.lexer.reset(src); - this.cardinalKeys = (_a = opt === null || opt === void 0 ? void 0 : opt.cardinal) !== null && _a !== void 0 ? _a : defaultPluralKeys; - this.ordinalKeys = (_b = opt === null || opt === void 0 ? void 0 : opt.ordinal) !== null && _b !== void 0 ? _b : defaultPluralKeys; - this.strict = (_c = opt === null || opt === void 0 ? void 0 : opt.strict) !== null && _c !== void 0 ? _c : false; - this.strictPluralKeys = (_d = opt === null || opt === void 0 ? void 0 : opt.strictPluralKeys) !== null && _d !== void 0 ? _d : true; - } - parse() { - return this.parseBody(false, true); - } - checkSelectKey(lt, type, key) { - if (key[0] === '=') { - if (type === 'select') - throw new ParseError(lt, `The case ${key} is not valid with select`); - } - else if (type !== 'select') { - const keys = type === 'plural' ? this.cardinalKeys : this.ordinalKeys; - if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) { - const msg = `The ${type} case ${key} is not valid in this locale`; - throw new ParseError(lt, msg); - } - } - } - parseSelect({ value: arg }, inPlural, ctx, type) { - const sel = { type, arg, cases: [], ctx }; - if (type === 'plural' || type === 'selectordinal') - inPlural = true; - else if (this.strict) - inPlural = false; - for (const lt of this.lexer) { - switch (lt.type) { - case 'offset': - if (type === 'select') - throw new ParseError(lt, 'Unexpected plural offset for select'); - if (sel.cases.length > 0) - throw new ParseError(lt, 'Plural offset must be set before cases'); - sel.pluralOffset = Number(lt.value); - ctx.text += lt.text; - ctx.lineBreaks += lt.lineBreaks; - break; - case 'case': { - this.checkSelectKey(lt, type, lt.value); - sel.cases.push({ - key: lt.value, - tokens: this.parseBody(inPlural), - ctx: getContext(lt) - }); - break; - } - case 'end': - return sel; - /* istanbul ignore next: never happens */ - default: - throw new ParseError(lt, `Unexpected lexer token: ${lt.type}`); - } - } - throw new ParseError(null, 'Unexpected message end'); - } - parseArgToken(lt, inPlural) { - const ctx = getContext(lt); - const argType = this.lexer.next(); - if (!argType) - throw new ParseError(null, 'Unexpected message end'); - ctx.text += argType.text; - ctx.lineBreaks += argType.lineBreaks; - if (this.strict && - (argType.type === 'func-simple' || argType.type === 'func-args') && - !strictArgTypes.includes(argType.value)) { - const msg = `Invalid strict mode function arg type: ${argType.value}`; - throw new ParseError(lt, msg); - } - switch (argType.type) { - case 'end': - return { type: 'argument', arg: lt.value, ctx }; - case 'func-simple': { - const end = this.lexer.next(); - if (!end) - throw new ParseError(null, 'Unexpected message end'); - /* istanbul ignore if: never happens */ - if (end.type !== 'end') - throw new ParseError(end, `Unexpected lexer token: ${end.type}`); - ctx.text += end.text; - if (isSelectType(argType.value.toLowerCase())) - throw new ParseError(argType, `Invalid type identifier: ${argType.value}`); - return { - type: 'function', - arg: lt.value, - key: argType.value, - ctx - }; - } - case 'func-args': { - if (isSelectType(argType.value.toLowerCase())) { - const msg = `Invalid type identifier: ${argType.value}`; - throw new ParseError(argType, msg); - } - let param = this.parseBody(this.strict ? false : inPlural); - if (this.strict && param.length > 0) - param = strictArgStyleParam(lt, param); - return { - type: 'function', - arg: lt.value, - key: argType.value, - param, - ctx - }; - } - case 'select': - /* istanbul ignore else: never happens */ - if (isSelectType(argType.value)) - return this.parseSelect(lt, inPlural, ctx, argType.value); - else - throw new ParseError(argType, `Unexpected select type ${argType.value}`); - /* istanbul ignore next: never happens */ - default: - throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`); - } - } - parseBody(inPlural, atRoot) { - const tokens = []; - let content = null; - for (const lt of this.lexer) { - if (lt.type === 'argument') { - if (content) - content = null; - tokens.push(this.parseArgToken(lt, inPlural)); - } - else if (lt.type === 'octothorpe' && inPlural) { - if (content) - content = null; - tokens.push({ type: 'octothorpe', ctx: getContext(lt) }); - } - else if (lt.type === 'end' && !atRoot) { - return tokens; - } - else { - let value = lt.value; - if (!inPlural && lt.type === 'quoted' && value[0] === '#') { - if (value.includes('{')) { - const errMsg = `Unsupported escape pattern: ${value}`; - throw new ParseError(lt, errMsg); - } - value = lt.text; - } - if (content) { - content.value += value; - content.ctx.text += lt.text; - content.ctx.lineBreaks += lt.lineBreaks; - } - else { - content = { type: 'content', value, ctx: getContext(lt) }; - tokens.push(content); - } - } - } - if (atRoot) - return tokens; - throw new ParseError(null, 'Unexpected message end'); - } -} -/** - * Parse an input string into an array of tokens - * - * @public - * @remarks - * The parser only supports the default `DOUBLE_OPTIONAL` - * {@link http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b | apostrophe mode}. - */ -function parse(src, options = {}) { - const parser = new Parser(src, options); - return parser.parse(); -} -exports.parse = parse; diff --git a/node_modules/@messageformat/parser/lib/tsdoc-metadata.json b/node_modules/@messageformat/parser/lib/tsdoc-metadata.json deleted file mode 100644 index ea81a7a..0000000 --- a/node_modules/@messageformat/parser/lib/tsdoc-metadata.json +++ /dev/null @@ -1,11 +0,0 @@ -// This file is read by tools that parse documentation comments conforming to the TSDoc standard. -// It should be published with your NPM package. It should not be tracked by Git. -{ - "tsdocVersion": "0.12", - "toolPackages": [ - { - "packageName": "@microsoft/api-extractor", - "packageVersion": "7.35.2" - } - ] -} diff --git a/node_modules/@messageformat/parser/package.json b/node_modules/@messageformat/parser/package.json deleted file mode 100644 index 85c4acd..0000000 --- a/node_modules/@messageformat/parser/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@messageformat/parser", - "version": "5.1.0", - "description": "An AST parser for ICU MessageFormat strings", - "keywords": [ - "icu", - "messageformat", - "parser" - ], - "contributors": [ - "Alex Sexton ", - "Eemeli Aro ", - "Nikola Kovacs ", - "Adrian Vogelsgesang " - ], - "license": "MIT", - "homepage": "http://messageformat.github.io/messageformat/api/parser/", - "repository": { - "type": "git", - "url": "https://github.com/messageformat/messageformat.git", - "directory": "packages/parser" - }, - "type": "commonjs", - "main": "lib/parser.js", - "files": [ - "lib/", - "codemod-fix-backslash-escapes.js" - ], - "exports": { - ".": "./lib/parser.js", - "./package.json": "./package.json" - }, - "dependencies": { - "moo": "^0.5.1" - }, - "scripts": { - "build": "tsc --project tsconfig.build.json", - "extract-api": "api-extractor run --verbose" - } -} diff --git a/node_modules/@messageformat/runtime/LICENSE b/node_modules/@messageformat/runtime/LICENSE deleted file mode 100644 index 78918d5..0000000 --- a/node_modules/@messageformat/runtime/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright OpenJS Foundation and contributors, https://openjsf.org/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@messageformat/runtime/README.md b/node_modules/@messageformat/runtime/README.md deleted file mode 100644 index e109ff1..0000000 --- a/node_modules/@messageformat/runtime/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# @messageformat/runtime - -A collection of [messageformat](http://messageformat.github.io/) runtime utility functions. - -``` -npm install @messageformat/runtime -``` - -This package should be marked as a dependency for any package that publishes the output of [compileModule()](http://messageformat.github.io/messageformat/api/core.compilemodule/), as the compiled ES source output may include references to it. - -For applications that bundle their output using e.g. Webpack this is not necessary. - -The [`Messages` accessor class](http://messageformat.github.io/messageformat/api/runtime.messages/) is a completely optional addition. -See also [@messageformat/react](http://messageformat.github.io/messageformat/api/react/) for a React-specific solution. - -This package was previously named [messageformat-runtime](https://www.npmjs.com/package/messageformat-runtime). - ---- - -[Messageformat](https://messageformat.github.io/) is an OpenJS Foundation project, and we follow its [Code of Conduct](https://github.com/openjs-foundation/cross-project-council/blob/master/CODE_OF_CONDUCT.md). - - -OpenJS Foundation - diff --git a/node_modules/@messageformat/runtime/esm/cardinals.js b/node_modules/@messageformat/runtime/esm/cardinals.js deleted file mode 100644 index 6fd3450..0000000 --- a/node_modules/@messageformat/runtime/esm/cardinals.js +++ /dev/null @@ -1 +0,0 @@ -export * from 'make-plural/cardinals'; diff --git a/node_modules/@messageformat/runtime/esm/fmt/date.js b/node_modules/@messageformat/runtime/esm/fmt/date.js deleted file mode 100644 index d26715f..0000000 --- a/node_modules/@messageformat/runtime/esm/fmt/date.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Represent a date as a short/default/long/full string - * - * @param value Either a Unix epoch time in milliseconds, or a string value - * representing a date. Parsed with `new Date(value)` - * - * @example - * ```js - * var mf = new MessageFormat(['en', 'fi']); - * - * mf.compile('Today is {T, date}')({ T: Date.now() }) - * // 'Today is Feb 21, 2016' - * - * mf.compile('Tänään on {T, date}', 'fi')({ T: Date.now() }) - * // 'Tänään on 21. helmikuuta 2016' - * - * mf.compile('Unix time started on {T, date, full}')({ T: 0 }) - * // 'Unix time started on Thursday, January 1, 1970' - * - * var cf = mf.compile('{sys} became operational on {d0, date, short}'); - * cf({ sys: 'HAL 9000', d0: '12 January 1999' }) - * // 'HAL 9000 became operational on 1/12/1999' - * ``` - */ -export function date(value, lc, size) { - var o = { - day: 'numeric', - month: 'short', - year: 'numeric' - }; - /* eslint-disable no-fallthrough */ - switch (size) { - case 'full': - o.weekday = 'long'; - case 'long': - o.month = 'long'; - break; - case 'short': - o.month = 'numeric'; - } - return new Date(value).toLocaleDateString(lc, o); -} diff --git a/node_modules/@messageformat/runtime/esm/fmt/duration.js b/node_modules/@messageformat/runtime/esm/fmt/duration.js deleted file mode 100644 index 0e96d39..0000000 --- a/node_modules/@messageformat/runtime/esm/fmt/duration.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Represent a duration in seconds as a string - * - * @param value A finite number, or its string representation - * @return Includes one or two `:` separators, and matches the pattern - * `hhhh:mm:ss`, possibly with a leading `-` for negative values and a - * trailing `.sss` part for non-integer input - * - * @example - * ```js - * var mf = new MessageFormat(); - * - * mf.compile('It has been {D, duration}')({ D: 123 }) - * // 'It has been 2:03' - * - * mf.compile('Countdown: {D, duration}')({ D: -151200.42 }) - * // 'Countdown: -42:00:00.420' - * ``` - */ -export function duration(value) { - if (typeof value !== 'number') - value = Number(value); - if (!isFinite(value)) - return String(value); - var sign = ''; - if (value < 0) { - sign = '-'; - value = Math.abs(value); - } - else { - value = Number(value); - } - var sec = value % 60; - var parts = [Math.round(sec) === sec ? sec : sec.toFixed(3)]; - if (value < 60) { - parts.unshift(0); // at least one : is required - } - else { - value = Math.round((value - Number(parts[0])) / 60); - parts.unshift(value % 60); // minutes - if (value >= 60) { - value = Math.round((value - Number(parts[0])) / 60); - parts.unshift(value); // hours - } - } - var first = parts.shift(); - return (sign + - first + - ':' + - parts.map(function (n) { return (n < 10 ? '0' + String(n) : String(n)); }).join(':')); -} diff --git a/node_modules/@messageformat/runtime/esm/fmt/number.js b/node_modules/@messageformat/runtime/esm/fmt/number.js deleted file mode 100644 index 5f3a21b..0000000 --- a/node_modules/@messageformat/runtime/esm/fmt/number.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Represent a number as an integer, percent or currency value - * - * Available in MessageFormat strings as `{VAR, number, integer|percent|currency}`. - * Internally, calls Intl.NumberFormat with appropriate parameters. `currency` will - * default to USD; to change, set `MessageFormat#currency` to the appropriate - * three-letter currency code, or use the `currency:EUR` form of the argument. - * - * @example - * ```js - * var mf = new MessageFormat('en', { currency: 'EUR'}); - * - * mf.compile('{N} is almost {N, number, integer}')({ N: 3.14 }) - * // '3.14 is almost 3' - * - * mf.compile('{P, number, percent} complete')({ P: 0.99 }) - * // '99% complete' - * - * mf.compile('The total is {V, number, currency}.')({ V: 5.5 }) - * // 'The total is €5.50.' - * - * mf.compile('The total is {V, number, currency:GBP}.')({ V: 5.5 }) - * // 'The total is £5.50.' - * ``` - */ -var _nf = {}; -function nf(lc, opt) { - var key = String(lc) + JSON.stringify(opt); - if (!_nf[key]) - _nf[key] = new Intl.NumberFormat(lc, opt); - return _nf[key]; -} -export function numberFmt(value, lc, arg, defaultCurrency) { - var _a = (arg && arg.split(':')) || [], type = _a[0], currency = _a[1]; - var opt = { - integer: { maximumFractionDigits: 0 }, - percent: { style: 'percent' }, - currency: { - style: 'currency', - currency: (currency && currency.trim()) || defaultCurrency, - minimumFractionDigits: 2, - maximumFractionDigits: 2 - } - }; - return nf(lc, opt[type] || {}).format(value); -} -export var numberCurrency = function (value, lc, arg) { - return nf(lc, { - style: 'currency', - currency: arg, - minimumFractionDigits: 2, - maximumFractionDigits: 2 - }).format(value); -}; -export var numberInteger = function (value, lc) { - return nf(lc, { maximumFractionDigits: 0 }).format(value); -}; -export var numberPercent = function (value, lc) { - return nf(lc, { style: 'percent' }).format(value); -}; diff --git a/node_modules/@messageformat/runtime/esm/fmt/time.js b/node_modules/@messageformat/runtime/esm/fmt/time.js deleted file mode 100644 index a9af972..0000000 --- a/node_modules/@messageformat/runtime/esm/fmt/time.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Represent a time as a short/default/long string - * - * @param value Either a Unix epoch time in milliseconds, or a string value - * representing a date. Parsed with `new Date(value)` - * - * @example - * ```js - * var mf = new MessageFormat(['en', 'fi']); - * - * mf.compile('The time is now {T, time}')({ T: Date.now() }) - * // 'The time is now 11:26:35 PM' - * - * mf.compile('Kello on nyt {T, time}', 'fi')({ T: Date.now() }) - * // 'Kello on nyt 23.26.35' - * - * var cf = mf.compile('The Eagle landed at {T, time, full} on {T, date, full}'); - * cf({ T: '1969-07-20 20:17:40 UTC' }) - * // 'The Eagle landed at 10:17:40 PM GMT+2 on Sunday, July 20, 1969' - * ``` - */ -export function time(value, lc, size) { - var o = { - second: 'numeric', - minute: 'numeric', - hour: 'numeric' - }; - /* eslint-disable no-fallthrough */ - switch (size) { - case 'full': - case 'long': - o.timeZoneName = 'short'; - break; - case 'short': - delete o.second; - } - return new Date(value).toLocaleTimeString(lc, o); -} diff --git a/node_modules/@messageformat/runtime/esm/formatters.js b/node_modules/@messageformat/runtime/esm/formatters.js deleted file mode 100644 index a17c76d..0000000 --- a/node_modules/@messageformat/runtime/esm/formatters.js +++ /dev/null @@ -1,4 +0,0 @@ -export { date } from './fmt/date.js'; -export { duration } from './fmt/duration.js'; -export { numberCurrency, numberFmt, numberInteger, numberPercent } from './fmt/number.js'; -export { time } from './fmt/time.js'; diff --git a/node_modules/@messageformat/runtime/esm/messages.js b/node_modules/@messageformat/runtime/esm/messages.js deleted file mode 100644 index 3fedae0..0000000 --- a/node_modules/@messageformat/runtime/esm/messages.js +++ /dev/null @@ -1,319 +0,0 @@ -/** - * A collection of runtime utility functions - * - * @remarks - * This package should be marked as a dependency for any package that publishes the output of {@link @messageformat/core#compileModule}, - * as it may be included in its ES module source output as a dependency. - * - * For applications that bundle their output using e.g. Webpack this is not necessary. - * - * The `Messages` accessor class is a completely optional addition. - * See also {@link @messageformat/react# | @messageformat/react} for a React-specific solution. - * - * @packageDocumentation - */ -/** - * Accessor class for compiled message functions generated by - * {@link @messageformat/core#compileModule} - * - * @public - * @remarks - * ```js - * import Messages from '@messageformat/runtime/messages' - * ``` - * - * @example - * ```js - * // build.js - * import { writeFileSync } from 'fs'; - * import MessageFormat from '@messageformat/core'; - * import compileModule from '@messageformat/core/compile-module' - * - * const mf = new MessageFormat(['en', 'fi']); - * const msgSet = { - * en: { - * a: 'A {TYPE} example.', - * b: 'This has {COUNT, plural, one{one user} other{# users}}.', - * c: { - * d: 'We have {P, number, percent} code coverage.' - * } - * }, - * fi: { - * b: 'Tällä on {COUNT, plural, one{yksi käyttäjä} other{# käyttäjää}}.', - * e: 'Minä puhun vain suomea.' - * } - * }; - * writeFileSync('messages.js', compileModule(mf, msgSet)); - * ``` - * - * ```js - * // runtime.js - * import Messages from '@messageformat/runtime/messages'; - * import msgData from './messages'; - * - * const messages = new Messages(msgData, 'en'); - * - * messages.hasMessage('a') // true - * messages.hasObject('c') // true - * messages.get('b', { COUNT: 3 }) // 'This has 3 users.' - * messages.get(['c', 'd'], { P: 0.314 }) // 'We have 31% code coverage.' - * - * messages.get('e') // 'e' - * messages.setFallback('en', ['foo', 'fi']) - * messages.get('e') // 'Minä puhun vain suomea.' - * - * messages.locale = 'fi' - * messages.hasMessage('a') // false - * messages.hasMessage('a', 'en') // true - * messages.hasMessage('a', null, true) // true - * messages.hasObject('c') // false - * messages.get('b', { COUNT: 3 }) // 'Tällä on 3 käyttäjää.' - * messages.get('c').d({ P: 0.628 }) // 'We have 63% code coverage.' - * ``` - */ -var Messages = /** @class */ (function () { - /** - * @param msgData - A map of locale codes to their function objects - * @param defaultLocale - If not defined, default and initial locale is the first key of `msgData` - */ - function Messages(msgData, defaultLocale) { - var _this = this; - /** @internal */ - this._data = {}; - /** @internal */ - this._fallback = {}; - /** @internal */ - this._defaultLocale = null; - /** @internal */ - this._locale = null; - Object.keys(msgData).forEach(function (lc) { - if (lc !== 'toString') { - _this._data[lc] = msgData[lc]; - if (defaultLocale === undefined) - defaultLocale = lc; - } - }); - this.locale = defaultLocale || null; - this._defaultLocale = this.locale; - } - Object.defineProperty(Messages.prototype, "availableLocales", { - /** Read-only list of available locales */ - get: function () { - return Object.keys(this._data); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Messages.prototype, "locale", { - /** - * Current locale - * - * @remarks - * One of {@link Messages.availableLocales} or `null`. - * Partial matches of language tags are supported, so e.g. with an `en` locale defined, it will be selected by `messages.locale = 'en-US'` and vice versa. - */ - get: function () { - return this._locale; - }, - set: function (locale) { - this._locale = this.resolveLocale(locale); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Messages.prototype, "defaultLocale", { - /** - * Default fallback locale - * - * @remarks - * One of {@link Messages.availableLocales} or `null`. - * Partial matches of language tags are supported, so e.g. with an `en` locale defined, it will be selected by `messages.defaultLocale = 'en-US'` and vice versa. - */ - get: function () { - return this._defaultLocale; - }, - set: function (locale) { - this._defaultLocale = this.resolveLocale(locale); - }, - enumerable: false, - configurable: true - }); - /** - * Add new messages to the accessor; useful if loading data dynamically - * - * @remarks - * The locale code `lc` should be an exact match for the locale being updated, or empty to default to the current locale. - * Use {@link Messages.resolveLocale} for resolving partial locale strings. - * - * If `keypath` is empty, adds or sets the complete message object for the corresponding locale. - * If any keys in `keypath` do not exist, a new object will be created at that key. - * - * @param data - Hierarchical map of keys to functions, or a single message function - * @param locale - If empty or undefined, defaults to `this.locale` - * @param keypath - The keypath being added - */ - Messages.prototype.addMessages = function (data, locale, keypath) { - var lc = locale || String(this.locale); - if (typeof data !== 'function') { - data = Object.keys(data).reduce(function (map, key) { - if (key !== 'toString') - map[key] = data[key]; - return map; - }, {}); - } - if (Array.isArray(keypath) && keypath.length > 0) { - var parent_1 = this._data[lc]; - for (var i = 0; i < keypath.length - 1; ++i) { - var key = keypath[i]; - if (!parent_1[key]) - parent_1[key] = {}; - parent_1 = parent_1[key]; - } - parent_1[keypath[keypath.length - 1]] = data; - } - else { - this._data[lc] = data; - } - return this; - }; - /** - * Resolve `lc` to the key of an available locale or `null`, allowing for partial matches. - * - * @remarks - * For example, with an `en` locale defined, it will be selected by `messages.defaultLocale = 'en-US'` and vice versa. - */ - Messages.prototype.resolveLocale = function (locale) { - var lc = String(locale); - if (this._data[lc]) - return locale; - if (locale) { - while ((lc = lc.replace(/[-_]?[^-_]*$/, ''))) { - if (this._data[lc]) - return lc; - } - var ll = this.availableLocales; - var re = new RegExp('^' + locale + '[-_]'); - for (var i = 0; i < ll.length; ++i) { - if (re.test(ll[i])) - return ll[i]; - } - } - return null; - }; - /** - * Get the list of fallback locales - * - * @param locale - If empty or undefined, defaults to `this.locale` - */ - Messages.prototype.getFallback = function (locale) { - var lc = locale || String(this.locale); - return (this._fallback[lc] || - (lc === this.defaultLocale || !this.defaultLocale - ? [] - : [this.defaultLocale])); - }; - /** - * Set the fallback locale or locales for `lc` - * - * @remarks - * To disable fallback for the locale, use `setFallback(lc, [])`. - * To use the default fallback, use `setFallback(lc, null)`. - */ - Messages.prototype.setFallback = function (lc, fallback) { - this._fallback[lc] = Array.isArray(fallback) ? fallback : null; - return this; - }; - /** - * Check if `key` is a message function for the locale - * - * @remarks - * `key` may be a `string` for functions at the root level, or `string[]` for - * accessing hierarchical objects. If an exact match is not found and - * `fallback` is true, the fallback locales are checked for the first match. - * - * @param key - The key or keypath being sought - * @param locale - If empty or undefined, defaults to `this.locale` - * @param fallback - If true, also checks fallback locales - */ - Messages.prototype.hasMessage = function (key, locale, fallback) { - var lc = locale || String(this.locale); - var fb = fallback ? this.getFallback(lc) : null; - return _has(this._data, lc, key, fb, 'function'); - }; - /** - * Check if `key` is a message object for the locale - * - * @remarks - * `key` may be a `string` for functions at the root level, or `string[]` for - * accessing hierarchical objects. If an exact match is not found and - * `fallback` is true, the fallback locales are checked for the first match. - * - * @param key - The key or keypath being sought - * @param locale - If empty or undefined, defaults to `this.locale` - * @param fallback - If true, also checks fallback locales - */ - Messages.prototype.hasObject = function (key, locale, fallback) { - var lc = locale || String(this.locale); - var fb = fallback ? this.getFallback(lc) : null; - return _has(this._data, lc, key, fb, 'object'); - }; - /** - * Get the message or object corresponding to `key` - * - * @remarks - * `key` may be a `string` for functions at the root level, or `string[]` for accessing hierarchical objects. - * If an exact match is not found, the fallback locales are checked for the first match. - * - * If `key` maps to a message function, the returned value will be the result of calling it with `props`. - * If it maps to an object, the object is returned directly. - * If nothing is found, `key` is returned. - * - * @param key - The key or keypath being sought - * @param props - Optional properties passed to the function - * @param lc - If empty or undefined, defaults to `this.locale` - */ - Messages.prototype.get = function (key, props, locale) { - var lc = locale || String(this.locale); - var msg = _get(this._data[lc], key); - if (msg) - return typeof msg == 'function' ? msg(props) : msg; - var fb = this.getFallback(lc); - for (var i = 0; i < fb.length; ++i) { - msg = _get(this._data[fb[i]], key); - if (msg) - return typeof msg == 'function' ? msg(props) : msg; - } - return key; - }; - return Messages; -}()); -export default Messages; -function _get(obj, key) { - if (!obj) - return null; - var res = obj; - if (Array.isArray(key)) { - for (var i = 0; i < key.length; ++i) { - if (typeof res !== 'object') - return null; - res = res[key[i]]; - if (!res) - return null; - } - return res; - } - return typeof res === 'object' ? res[key] : null; -} -function _has(data, lc, key, fallback, type) { - var msg = _get(data[lc], key); - if (msg) - return typeof msg === type; - if (fallback) { - for (var i = 0; i < fallback.length; ++i) { - msg = _get(data[fallback[i]], key); - if (msg) - return typeof msg === type; - } - } - return false; -} diff --git a/node_modules/@messageformat/runtime/esm/package.json b/node_modules/@messageformat/runtime/esm/package.json deleted file mode 100644 index 5ffd980..0000000 --- a/node_modules/@messageformat/runtime/esm/package.json +++ /dev/null @@ -1 +0,0 @@ -{ "type": "module" } diff --git a/node_modules/@messageformat/runtime/esm/plurals.js b/node_modules/@messageformat/runtime/esm/plurals.js deleted file mode 100644 index 91f8a9e..0000000 --- a/node_modules/@messageformat/runtime/esm/plurals.js +++ /dev/null @@ -1 +0,0 @@ -export * from 'make-plural/plurals'; diff --git a/node_modules/@messageformat/runtime/esm/runtime.js b/node_modules/@messageformat/runtime/esm/runtime.js deleted file mode 100644 index 455a506..0000000 --- a/node_modules/@messageformat/runtime/esm/runtime.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * A set of utility functions that are called by the compiled Javascript - * functions, these are included locally in the output of {@link MessageFormat.compile compile()}. - */ -/** @private */ -export function _nf(lc) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - return _nf[lc] || (_nf[lc] = new Intl.NumberFormat(lc)); -} -/** - * Utility function for `#` in plural rules - * - * @param lc The current locale - * @param value The value to operate on - * @param offset An offset, set by the surrounding context - * @returns The result of applying the offset to the input value - */ -export function number(lc, value, offset) { - return _nf(lc).format(value - offset); -} -/** - * Strict utility function for `#` in plural rules - * - * Will throw an Error if `value` or `offset` are non-numeric. - * - * @param lc The current locale - * @param value The value to operate on - * @param offset An offset, set by the surrounding context - * @param name The name of the argument, used for error reporting - * @returns The result of applying the offset to the input value - */ -export function strictNumber(lc, value, offset, name) { - var n = value - offset; - if (isNaN(n)) - throw new Error('`' + name + '` or its offset is not a number'); - return _nf(lc).format(n); -} -/** - * Utility function for `{N, plural|selectordinal, ...}` - * - * @param value The key to use to find a pluralization rule - * @param offset An offset to apply to `value` - * @param lcfunc A locale function from `pluralFuncs` - * @param data The object from which results are looked up - * @param isOrdinal If true, use ordinal rather than cardinal rules - * @returns The result of the pluralization - */ -export function plural(value, offset, lcfunc, data, isOrdinal) { - if ({}.hasOwnProperty.call(data, value)) - return data[value]; - if (offset) - value -= offset; - var key = lcfunc(value, isOrdinal); - return key in data ? data[key] : data.other; -} -/** - * Utility function for `{N, select, ...}` - * - * @param value The key to use to find a selection - * @param data The object from which results are looked up - * @returns The result of the select statement - */ -export function select(value, data) { - return {}.hasOwnProperty.call(data, value) ? data[value] : data.other; -} -/** - * Checks that all required arguments are set to defined values - * - * Throws on failure; otherwise returns undefined - * - * @param keys The required keys - * @param data The data object being checked - */ -export function reqArgs(keys, data) { - for (var i = 0; i < keys.length; ++i) - if (!data || data[keys[i]] === undefined) - throw new Error("Message requires argument '".concat(keys[i], "'")); -} diff --git a/node_modules/@messageformat/runtime/lib/cardinals.d.ts b/node_modules/@messageformat/runtime/lib/cardinals.d.ts deleted file mode 100644 index 6fd3450..0000000 --- a/node_modules/@messageformat/runtime/lib/cardinals.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'make-plural/cardinals'; diff --git a/node_modules/@messageformat/runtime/lib/cardinals.js b/node_modules/@messageformat/runtime/lib/cardinals.js deleted file mode 100644 index ae05dab..0000000 --- a/node_modules/@messageformat/runtime/lib/cardinals.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("make-plural/cardinals"), exports); diff --git a/node_modules/@messageformat/runtime/lib/fmt/date.d.ts b/node_modules/@messageformat/runtime/lib/fmt/date.d.ts deleted file mode 100644 index a6e88f9..0000000 --- a/node_modules/@messageformat/runtime/lib/fmt/date.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Represent a date as a short/default/long/full string - * - * @param value Either a Unix epoch time in milliseconds, or a string value - * representing a date. Parsed with `new Date(value)` - * - * @example - * ```js - * var mf = new MessageFormat(['en', 'fi']); - * - * mf.compile('Today is {T, date}')({ T: Date.now() }) - * // 'Today is Feb 21, 2016' - * - * mf.compile('Tänään on {T, date}', 'fi')({ T: Date.now() }) - * // 'Tänään on 21. helmikuuta 2016' - * - * mf.compile('Unix time started on {T, date, full}')({ T: 0 }) - * // 'Unix time started on Thursday, January 1, 1970' - * - * var cf = mf.compile('{sys} became operational on {d0, date, short}'); - * cf({ sys: 'HAL 9000', d0: '12 January 1999' }) - * // 'HAL 9000 became operational on 1/12/1999' - * ``` - */ -export declare function date(value: number | string, lc: string | string[], size?: 'short' | 'default' | 'long' | 'full'): string; diff --git a/node_modules/@messageformat/runtime/lib/fmt/date.js b/node_modules/@messageformat/runtime/lib/fmt/date.js deleted file mode 100644 index 5bc514e..0000000 --- a/node_modules/@messageformat/runtime/lib/fmt/date.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.date = void 0; -/** - * Represent a date as a short/default/long/full string - * - * @param value Either a Unix epoch time in milliseconds, or a string value - * representing a date. Parsed with `new Date(value)` - * - * @example - * ```js - * var mf = new MessageFormat(['en', 'fi']); - * - * mf.compile('Today is {T, date}')({ T: Date.now() }) - * // 'Today is Feb 21, 2016' - * - * mf.compile('Tänään on {T, date}', 'fi')({ T: Date.now() }) - * // 'Tänään on 21. helmikuuta 2016' - * - * mf.compile('Unix time started on {T, date, full}')({ T: 0 }) - * // 'Unix time started on Thursday, January 1, 1970' - * - * var cf = mf.compile('{sys} became operational on {d0, date, short}'); - * cf({ sys: 'HAL 9000', d0: '12 January 1999' }) - * // 'HAL 9000 became operational on 1/12/1999' - * ``` - */ -function date(value, lc, size) { - var o = { - day: 'numeric', - month: 'short', - year: 'numeric' - }; - /* eslint-disable no-fallthrough */ - switch (size) { - case 'full': - o.weekday = 'long'; - case 'long': - o.month = 'long'; - break; - case 'short': - o.month = 'numeric'; - } - return new Date(value).toLocaleDateString(lc, o); -} -exports.date = date; diff --git a/node_modules/@messageformat/runtime/lib/fmt/duration.d.ts b/node_modules/@messageformat/runtime/lib/fmt/duration.d.ts deleted file mode 100644 index 2098f90..0000000 --- a/node_modules/@messageformat/runtime/lib/fmt/duration.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Represent a duration in seconds as a string - * - * @param value A finite number, or its string representation - * @return Includes one or two `:` separators, and matches the pattern - * `hhhh:mm:ss`, possibly with a leading `-` for negative values and a - * trailing `.sss` part for non-integer input - * - * @example - * ```js - * var mf = new MessageFormat(); - * - * mf.compile('It has been {D, duration}')({ D: 123 }) - * // 'It has been 2:03' - * - * mf.compile('Countdown: {D, duration}')({ D: -151200.42 }) - * // 'Countdown: -42:00:00.420' - * ``` - */ -export declare function duration(value: number | string): string; diff --git a/node_modules/@messageformat/runtime/lib/fmt/duration.js b/node_modules/@messageformat/runtime/lib/fmt/duration.js deleted file mode 100644 index 061f0af..0000000 --- a/node_modules/@messageformat/runtime/lib/fmt/duration.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.duration = void 0; -/** - * Represent a duration in seconds as a string - * - * @param value A finite number, or its string representation - * @return Includes one or two `:` separators, and matches the pattern - * `hhhh:mm:ss`, possibly with a leading `-` for negative values and a - * trailing `.sss` part for non-integer input - * - * @example - * ```js - * var mf = new MessageFormat(); - * - * mf.compile('It has been {D, duration}')({ D: 123 }) - * // 'It has been 2:03' - * - * mf.compile('Countdown: {D, duration}')({ D: -151200.42 }) - * // 'Countdown: -42:00:00.420' - * ``` - */ -function duration(value) { - if (typeof value !== 'number') - value = Number(value); - if (!isFinite(value)) - return String(value); - var sign = ''; - if (value < 0) { - sign = '-'; - value = Math.abs(value); - } - else { - value = Number(value); - } - var sec = value % 60; - var parts = [Math.round(sec) === sec ? sec : sec.toFixed(3)]; - if (value < 60) { - parts.unshift(0); // at least one : is required - } - else { - value = Math.round((value - Number(parts[0])) / 60); - parts.unshift(value % 60); // minutes - if (value >= 60) { - value = Math.round((value - Number(parts[0])) / 60); - parts.unshift(value); // hours - } - } - var first = parts.shift(); - return (sign + - first + - ':' + - parts.map(function (n) { return (n < 10 ? '0' + String(n) : String(n)); }).join(':')); -} -exports.duration = duration; diff --git a/node_modules/@messageformat/runtime/lib/fmt/number.d.ts b/node_modules/@messageformat/runtime/lib/fmt/number.d.ts deleted file mode 100644 index 3a7b186..0000000 --- a/node_modules/@messageformat/runtime/lib/fmt/number.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Represent a number as an integer, percent or currency value - * - * Available in MessageFormat strings as `{VAR, number, integer|percent|currency}`. - * Internally, calls Intl.NumberFormat with appropriate parameters. `currency` will - * default to USD; to change, set `MessageFormat#currency` to the appropriate - * three-letter currency code, or use the `currency:EUR` form of the argument. - * - * @example - * ```js - * var mf = new MessageFormat('en', { currency: 'EUR'}); - * - * mf.compile('{N} is almost {N, number, integer}')({ N: 3.14 }) - * // '3.14 is almost 3' - * - * mf.compile('{P, number, percent} complete')({ P: 0.99 }) - * // '99% complete' - * - * mf.compile('The total is {V, number, currency}.')({ V: 5.5 }) - * // 'The total is €5.50.' - * - * mf.compile('The total is {V, number, currency:GBP}.')({ V: 5.5 }) - * // 'The total is £5.50.' - * ``` - */ -export declare function numberFmt(value: number, lc: string | string[], arg: string, defaultCurrency: string): string; -export declare const numberCurrency: (value: number, lc: string | string[], arg: string) => string; -export declare const numberInteger: (value: number, lc: string | string[]) => string; -export declare const numberPercent: (value: number, lc: string | string[]) => string; diff --git a/node_modules/@messageformat/runtime/lib/fmt/number.js b/node_modules/@messageformat/runtime/lib/fmt/number.js deleted file mode 100644 index 59b721a..0000000 --- a/node_modules/@messageformat/runtime/lib/fmt/number.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -/** - * Represent a number as an integer, percent or currency value - * - * Available in MessageFormat strings as `{VAR, number, integer|percent|currency}`. - * Internally, calls Intl.NumberFormat with appropriate parameters. `currency` will - * default to USD; to change, set `MessageFormat#currency` to the appropriate - * three-letter currency code, or use the `currency:EUR` form of the argument. - * - * @example - * ```js - * var mf = new MessageFormat('en', { currency: 'EUR'}); - * - * mf.compile('{N} is almost {N, number, integer}')({ N: 3.14 }) - * // '3.14 is almost 3' - * - * mf.compile('{P, number, percent} complete')({ P: 0.99 }) - * // '99% complete' - * - * mf.compile('The total is {V, number, currency}.')({ V: 5.5 }) - * // 'The total is €5.50.' - * - * mf.compile('The total is {V, number, currency:GBP}.')({ V: 5.5 }) - * // 'The total is £5.50.' - * ``` - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.numberPercent = exports.numberInteger = exports.numberCurrency = exports.numberFmt = void 0; -var _nf = {}; -function nf(lc, opt) { - var key = String(lc) + JSON.stringify(opt); - if (!_nf[key]) - _nf[key] = new Intl.NumberFormat(lc, opt); - return _nf[key]; -} -function numberFmt(value, lc, arg, defaultCurrency) { - var _a = (arg && arg.split(':')) || [], type = _a[0], currency = _a[1]; - var opt = { - integer: { maximumFractionDigits: 0 }, - percent: { style: 'percent' }, - currency: { - style: 'currency', - currency: (currency && currency.trim()) || defaultCurrency, - minimumFractionDigits: 2, - maximumFractionDigits: 2 - } - }; - return nf(lc, opt[type] || {}).format(value); -} -exports.numberFmt = numberFmt; -var numberCurrency = function (value, lc, arg) { - return nf(lc, { - style: 'currency', - currency: arg, - minimumFractionDigits: 2, - maximumFractionDigits: 2 - }).format(value); -}; -exports.numberCurrency = numberCurrency; -var numberInteger = function (value, lc) { - return nf(lc, { maximumFractionDigits: 0 }).format(value); -}; -exports.numberInteger = numberInteger; -var numberPercent = function (value, lc) { - return nf(lc, { style: 'percent' }).format(value); -}; -exports.numberPercent = numberPercent; diff --git a/node_modules/@messageformat/runtime/lib/fmt/time.d.ts b/node_modules/@messageformat/runtime/lib/fmt/time.d.ts deleted file mode 100644 index f2b8a64..0000000 --- a/node_modules/@messageformat/runtime/lib/fmt/time.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Represent a time as a short/default/long string - * - * @param value Either a Unix epoch time in milliseconds, or a string value - * representing a date. Parsed with `new Date(value)` - * - * @example - * ```js - * var mf = new MessageFormat(['en', 'fi']); - * - * mf.compile('The time is now {T, time}')({ T: Date.now() }) - * // 'The time is now 11:26:35 PM' - * - * mf.compile('Kello on nyt {T, time}', 'fi')({ T: Date.now() }) - * // 'Kello on nyt 23.26.35' - * - * var cf = mf.compile('The Eagle landed at {T, time, full} on {T, date, full}'); - * cf({ T: '1969-07-20 20:17:40 UTC' }) - * // 'The Eagle landed at 10:17:40 PM GMT+2 on Sunday, July 20, 1969' - * ``` - */ -export declare function time(value: number | string, lc: string | string[], size?: 'short' | 'default' | 'long' | 'full'): string; diff --git a/node_modules/@messageformat/runtime/lib/fmt/time.js b/node_modules/@messageformat/runtime/lib/fmt/time.js deleted file mode 100644 index 061db83..0000000 --- a/node_modules/@messageformat/runtime/lib/fmt/time.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.time = void 0; -/** - * Represent a time as a short/default/long string - * - * @param value Either a Unix epoch time in milliseconds, or a string value - * representing a date. Parsed with `new Date(value)` - * - * @example - * ```js - * var mf = new MessageFormat(['en', 'fi']); - * - * mf.compile('The time is now {T, time}')({ T: Date.now() }) - * // 'The time is now 11:26:35 PM' - * - * mf.compile('Kello on nyt {T, time}', 'fi')({ T: Date.now() }) - * // 'Kello on nyt 23.26.35' - * - * var cf = mf.compile('The Eagle landed at {T, time, full} on {T, date, full}'); - * cf({ T: '1969-07-20 20:17:40 UTC' }) - * // 'The Eagle landed at 10:17:40 PM GMT+2 on Sunday, July 20, 1969' - * ``` - */ -function time(value, lc, size) { - var o = { - second: 'numeric', - minute: 'numeric', - hour: 'numeric' - }; - /* eslint-disable no-fallthrough */ - switch (size) { - case 'full': - case 'long': - o.timeZoneName = 'short'; - break; - case 'short': - delete o.second; - } - return new Date(value).toLocaleTimeString(lc, o); -} -exports.time = time; diff --git a/node_modules/@messageformat/runtime/lib/formatters.d.ts b/node_modules/@messageformat/runtime/lib/formatters.d.ts deleted file mode 100644 index a17c76d..0000000 --- a/node_modules/@messageformat/runtime/lib/formatters.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { date } from './fmt/date.js'; -export { duration } from './fmt/duration.js'; -export { numberCurrency, numberFmt, numberInteger, numberPercent } from './fmt/number.js'; -export { time } from './fmt/time.js'; diff --git a/node_modules/@messageformat/runtime/lib/formatters.js b/node_modules/@messageformat/runtime/lib/formatters.js deleted file mode 100644 index 0bcf095..0000000 --- a/node_modules/@messageformat/runtime/lib/formatters.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.time = exports.numberPercent = exports.numberInteger = exports.numberFmt = exports.numberCurrency = exports.duration = exports.date = void 0; -var date_js_1 = require("./fmt/date.js"); -Object.defineProperty(exports, "date", { enumerable: true, get: function () { return date_js_1.date; } }); -var duration_js_1 = require("./fmt/duration.js"); -Object.defineProperty(exports, "duration", { enumerable: true, get: function () { return duration_js_1.duration; } }); -var number_js_1 = require("./fmt/number.js"); -Object.defineProperty(exports, "numberCurrency", { enumerable: true, get: function () { return number_js_1.numberCurrency; } }); -Object.defineProperty(exports, "numberFmt", { enumerable: true, get: function () { return number_js_1.numberFmt; } }); -Object.defineProperty(exports, "numberInteger", { enumerable: true, get: function () { return number_js_1.numberInteger; } }); -Object.defineProperty(exports, "numberPercent", { enumerable: true, get: function () { return number_js_1.numberPercent; } }); -var time_js_1 = require("./fmt/time.js"); -Object.defineProperty(exports, "time", { enumerable: true, get: function () { return time_js_1.time; } }); diff --git a/node_modules/@messageformat/runtime/lib/messages.d.ts b/node_modules/@messageformat/runtime/lib/messages.d.ts deleted file mode 100644 index e2e56cf..0000000 --- a/node_modules/@messageformat/runtime/lib/messages.d.ts +++ /dev/null @@ -1,206 +0,0 @@ -/** - * A collection of runtime utility functions - * - * @remarks - * This package should be marked as a dependency for any package that publishes the output of {@link @messageformat/core#compileModule}, - * as it may be included in its ES module source output as a dependency. - * - * For applications that bundle their output using e.g. Webpack this is not necessary. - * - * The `Messages` accessor class is a completely optional addition. - * See also {@link @messageformat/react# | @messageformat/react} for a React-specific solution. - * - * @packageDocumentation - */ -/** - * A message function, as generated by {@link @messageformat/core#MessageFormat.compile} - * - * @public - */ -export declare type MessageFunction = (param?: Record) => string | unknown[]; -/** - * Hierarchical message object - * - * @public - */ -export interface MessageData { - [key: string]: MessageData | MessageFunction | string; -} -/** - * Accessor class for compiled message functions generated by - * {@link @messageformat/core#compileModule} - * - * @public - * @remarks - * ```js - * import Messages from '@messageformat/runtime/messages' - * ``` - * - * @example - * ```js - * // build.js - * import { writeFileSync } from 'fs'; - * import MessageFormat from '@messageformat/core'; - * import compileModule from '@messageformat/core/compile-module' - * - * const mf = new MessageFormat(['en', 'fi']); - * const msgSet = { - * en: { - * a: 'A {TYPE} example.', - * b: 'This has {COUNT, plural, one{one user} other{# users}}.', - * c: { - * d: 'We have {P, number, percent} code coverage.' - * } - * }, - * fi: { - * b: 'Tällä on {COUNT, plural, one{yksi käyttäjä} other{# käyttäjää}}.', - * e: 'Minä puhun vain suomea.' - * } - * }; - * writeFileSync('messages.js', compileModule(mf, msgSet)); - * ``` - * - * ```js - * // runtime.js - * import Messages from '@messageformat/runtime/messages'; - * import msgData from './messages'; - * - * const messages = new Messages(msgData, 'en'); - * - * messages.hasMessage('a') // true - * messages.hasObject('c') // true - * messages.get('b', { COUNT: 3 }) // 'This has 3 users.' - * messages.get(['c', 'd'], { P: 0.314 }) // 'We have 31% code coverage.' - * - * messages.get('e') // 'e' - * messages.setFallback('en', ['foo', 'fi']) - * messages.get('e') // 'Minä puhun vain suomea.' - * - * messages.locale = 'fi' - * messages.hasMessage('a') // false - * messages.hasMessage('a', 'en') // true - * messages.hasMessage('a', null, true) // true - * messages.hasObject('c') // false - * messages.get('b', { COUNT: 3 }) // 'Tällä on 3 käyttäjää.' - * messages.get('c').d({ P: 0.628 }) // 'We have 63% code coverage.' - * ``` - */ -export default class Messages { - /** @internal */ - _data: { - [key: string]: MessageData; - }; - /** @internal */ - _fallback: { - [key: string]: string[] | null; - }; - /** @internal */ - _defaultLocale: string | null; - /** @internal */ - _locale: string | null; - /** - * @param msgData - A map of locale codes to their function objects - * @param defaultLocale - If not defined, default and initial locale is the first key of `msgData` - */ - constructor(msgData: { - [key: string]: MessageData; - }, defaultLocale?: string); - /** Read-only list of available locales */ - get availableLocales(): string[]; - /** - * Current locale - * - * @remarks - * One of {@link Messages.availableLocales} or `null`. - * Partial matches of language tags are supported, so e.g. with an `en` locale defined, it will be selected by `messages.locale = 'en-US'` and vice versa. - */ - get locale(): string | null; - set locale(locale: string | null); - /** - * Default fallback locale - * - * @remarks - * One of {@link Messages.availableLocales} or `null`. - * Partial matches of language tags are supported, so e.g. with an `en` locale defined, it will be selected by `messages.defaultLocale = 'en-US'` and vice versa. - */ - get defaultLocale(): string | null; - set defaultLocale(locale: string | null); - /** - * Add new messages to the accessor; useful if loading data dynamically - * - * @remarks - * The locale code `lc` should be an exact match for the locale being updated, or empty to default to the current locale. - * Use {@link Messages.resolveLocale} for resolving partial locale strings. - * - * If `keypath` is empty, adds or sets the complete message object for the corresponding locale. - * If any keys in `keypath` do not exist, a new object will be created at that key. - * - * @param data - Hierarchical map of keys to functions, or a single message function - * @param locale - If empty or undefined, defaults to `this.locale` - * @param keypath - The keypath being added - */ - addMessages(data: MessageData | MessageFunction, locale?: string, keypath?: string[]): this; - /** - * Resolve `lc` to the key of an available locale or `null`, allowing for partial matches. - * - * @remarks - * For example, with an `en` locale defined, it will be selected by `messages.defaultLocale = 'en-US'` and vice versa. - */ - resolveLocale(locale: string | null): string | null; - /** - * Get the list of fallback locales - * - * @param locale - If empty or undefined, defaults to `this.locale` - */ - getFallback(locale?: string | null): string[]; - /** - * Set the fallback locale or locales for `lc` - * - * @remarks - * To disable fallback for the locale, use `setFallback(lc, [])`. - * To use the default fallback, use `setFallback(lc, null)`. - */ - setFallback(lc: string, fallback: string[] | null): this; - /** - * Check if `key` is a message function for the locale - * - * @remarks - * `key` may be a `string` for functions at the root level, or `string[]` for - * accessing hierarchical objects. If an exact match is not found and - * `fallback` is true, the fallback locales are checked for the first match. - * - * @param key - The key or keypath being sought - * @param locale - If empty or undefined, defaults to `this.locale` - * @param fallback - If true, also checks fallback locales - */ - hasMessage(key: string | string[], locale?: string, fallback?: boolean): boolean; - /** - * Check if `key` is a message object for the locale - * - * @remarks - * `key` may be a `string` for functions at the root level, or `string[]` for - * accessing hierarchical objects. If an exact match is not found and - * `fallback` is true, the fallback locales are checked for the first match. - * - * @param key - The key or keypath being sought - * @param locale - If empty or undefined, defaults to `this.locale` - * @param fallback - If true, also checks fallback locales - */ - hasObject(key: string | string[], locale?: string, fallback?: boolean): boolean; - /** - * Get the message or object corresponding to `key` - * - * @remarks - * `key` may be a `string` for functions at the root level, or `string[]` for accessing hierarchical objects. - * If an exact match is not found, the fallback locales are checked for the first match. - * - * If `key` maps to a message function, the returned value will be the result of calling it with `props`. - * If it maps to an object, the object is returned directly. - * If nothing is found, `key` is returned. - * - * @param key - The key or keypath being sought - * @param props - Optional properties passed to the function - * @param lc - If empty or undefined, defaults to `this.locale` - */ - get(key: string | string[], props?: Record, locale?: string): string | unknown[] | MessageData; -} diff --git a/node_modules/@messageformat/runtime/lib/messages.js b/node_modules/@messageformat/runtime/lib/messages.js deleted file mode 100644 index 41002cd..0000000 --- a/node_modules/@messageformat/runtime/lib/messages.js +++ /dev/null @@ -1,321 +0,0 @@ -"use strict"; -/** - * A collection of runtime utility functions - * - * @remarks - * This package should be marked as a dependency for any package that publishes the output of {@link @messageformat/core#compileModule}, - * as it may be included in its ES module source output as a dependency. - * - * For applications that bundle their output using e.g. Webpack this is not necessary. - * - * The `Messages` accessor class is a completely optional addition. - * See also {@link @messageformat/react# | @messageformat/react} for a React-specific solution. - * - * @packageDocumentation - */ -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Accessor class for compiled message functions generated by - * {@link @messageformat/core#compileModule} - * - * @public - * @remarks - * ```js - * import Messages from '@messageformat/runtime/messages' - * ``` - * - * @example - * ```js - * // build.js - * import { writeFileSync } from 'fs'; - * import MessageFormat from '@messageformat/core'; - * import compileModule from '@messageformat/core/compile-module' - * - * const mf = new MessageFormat(['en', 'fi']); - * const msgSet = { - * en: { - * a: 'A {TYPE} example.', - * b: 'This has {COUNT, plural, one{one user} other{# users}}.', - * c: { - * d: 'We have {P, number, percent} code coverage.' - * } - * }, - * fi: { - * b: 'Tällä on {COUNT, plural, one{yksi käyttäjä} other{# käyttäjää}}.', - * e: 'Minä puhun vain suomea.' - * } - * }; - * writeFileSync('messages.js', compileModule(mf, msgSet)); - * ``` - * - * ```js - * // runtime.js - * import Messages from '@messageformat/runtime/messages'; - * import msgData from './messages'; - * - * const messages = new Messages(msgData, 'en'); - * - * messages.hasMessage('a') // true - * messages.hasObject('c') // true - * messages.get('b', { COUNT: 3 }) // 'This has 3 users.' - * messages.get(['c', 'd'], { P: 0.314 }) // 'We have 31% code coverage.' - * - * messages.get('e') // 'e' - * messages.setFallback('en', ['foo', 'fi']) - * messages.get('e') // 'Minä puhun vain suomea.' - * - * messages.locale = 'fi' - * messages.hasMessage('a') // false - * messages.hasMessage('a', 'en') // true - * messages.hasMessage('a', null, true) // true - * messages.hasObject('c') // false - * messages.get('b', { COUNT: 3 }) // 'Tällä on 3 käyttäjää.' - * messages.get('c').d({ P: 0.628 }) // 'We have 63% code coverage.' - * ``` - */ -var Messages = /** @class */ (function () { - /** - * @param msgData - A map of locale codes to their function objects - * @param defaultLocale - If not defined, default and initial locale is the first key of `msgData` - */ - function Messages(msgData, defaultLocale) { - var _this = this; - /** @internal */ - this._data = {}; - /** @internal */ - this._fallback = {}; - /** @internal */ - this._defaultLocale = null; - /** @internal */ - this._locale = null; - Object.keys(msgData).forEach(function (lc) { - if (lc !== 'toString') { - _this._data[lc] = msgData[lc]; - if (defaultLocale === undefined) - defaultLocale = lc; - } - }); - this.locale = defaultLocale || null; - this._defaultLocale = this.locale; - } - Object.defineProperty(Messages.prototype, "availableLocales", { - /** Read-only list of available locales */ - get: function () { - return Object.keys(this._data); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Messages.prototype, "locale", { - /** - * Current locale - * - * @remarks - * One of {@link Messages.availableLocales} or `null`. - * Partial matches of language tags are supported, so e.g. with an `en` locale defined, it will be selected by `messages.locale = 'en-US'` and vice versa. - */ - get: function () { - return this._locale; - }, - set: function (locale) { - this._locale = this.resolveLocale(locale); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Messages.prototype, "defaultLocale", { - /** - * Default fallback locale - * - * @remarks - * One of {@link Messages.availableLocales} or `null`. - * Partial matches of language tags are supported, so e.g. with an `en` locale defined, it will be selected by `messages.defaultLocale = 'en-US'` and vice versa. - */ - get: function () { - return this._defaultLocale; - }, - set: function (locale) { - this._defaultLocale = this.resolveLocale(locale); - }, - enumerable: false, - configurable: true - }); - /** - * Add new messages to the accessor; useful if loading data dynamically - * - * @remarks - * The locale code `lc` should be an exact match for the locale being updated, or empty to default to the current locale. - * Use {@link Messages.resolveLocale} for resolving partial locale strings. - * - * If `keypath` is empty, adds or sets the complete message object for the corresponding locale. - * If any keys in `keypath` do not exist, a new object will be created at that key. - * - * @param data - Hierarchical map of keys to functions, or a single message function - * @param locale - If empty or undefined, defaults to `this.locale` - * @param keypath - The keypath being added - */ - Messages.prototype.addMessages = function (data, locale, keypath) { - var lc = locale || String(this.locale); - if (typeof data !== 'function') { - data = Object.keys(data).reduce(function (map, key) { - if (key !== 'toString') - map[key] = data[key]; - return map; - }, {}); - } - if (Array.isArray(keypath) && keypath.length > 0) { - var parent_1 = this._data[lc]; - for (var i = 0; i < keypath.length - 1; ++i) { - var key = keypath[i]; - if (!parent_1[key]) - parent_1[key] = {}; - parent_1 = parent_1[key]; - } - parent_1[keypath[keypath.length - 1]] = data; - } - else { - this._data[lc] = data; - } - return this; - }; - /** - * Resolve `lc` to the key of an available locale or `null`, allowing for partial matches. - * - * @remarks - * For example, with an `en` locale defined, it will be selected by `messages.defaultLocale = 'en-US'` and vice versa. - */ - Messages.prototype.resolveLocale = function (locale) { - var lc = String(locale); - if (this._data[lc]) - return locale; - if (locale) { - while ((lc = lc.replace(/[-_]?[^-_]*$/, ''))) { - if (this._data[lc]) - return lc; - } - var ll = this.availableLocales; - var re = new RegExp('^' + locale + '[-_]'); - for (var i = 0; i < ll.length; ++i) { - if (re.test(ll[i])) - return ll[i]; - } - } - return null; - }; - /** - * Get the list of fallback locales - * - * @param locale - If empty or undefined, defaults to `this.locale` - */ - Messages.prototype.getFallback = function (locale) { - var lc = locale || String(this.locale); - return (this._fallback[lc] || - (lc === this.defaultLocale || !this.defaultLocale - ? [] - : [this.defaultLocale])); - }; - /** - * Set the fallback locale or locales for `lc` - * - * @remarks - * To disable fallback for the locale, use `setFallback(lc, [])`. - * To use the default fallback, use `setFallback(lc, null)`. - */ - Messages.prototype.setFallback = function (lc, fallback) { - this._fallback[lc] = Array.isArray(fallback) ? fallback : null; - return this; - }; - /** - * Check if `key` is a message function for the locale - * - * @remarks - * `key` may be a `string` for functions at the root level, or `string[]` for - * accessing hierarchical objects. If an exact match is not found and - * `fallback` is true, the fallback locales are checked for the first match. - * - * @param key - The key or keypath being sought - * @param locale - If empty or undefined, defaults to `this.locale` - * @param fallback - If true, also checks fallback locales - */ - Messages.prototype.hasMessage = function (key, locale, fallback) { - var lc = locale || String(this.locale); - var fb = fallback ? this.getFallback(lc) : null; - return _has(this._data, lc, key, fb, 'function'); - }; - /** - * Check if `key` is a message object for the locale - * - * @remarks - * `key` may be a `string` for functions at the root level, or `string[]` for - * accessing hierarchical objects. If an exact match is not found and - * `fallback` is true, the fallback locales are checked for the first match. - * - * @param key - The key or keypath being sought - * @param locale - If empty or undefined, defaults to `this.locale` - * @param fallback - If true, also checks fallback locales - */ - Messages.prototype.hasObject = function (key, locale, fallback) { - var lc = locale || String(this.locale); - var fb = fallback ? this.getFallback(lc) : null; - return _has(this._data, lc, key, fb, 'object'); - }; - /** - * Get the message or object corresponding to `key` - * - * @remarks - * `key` may be a `string` for functions at the root level, or `string[]` for accessing hierarchical objects. - * If an exact match is not found, the fallback locales are checked for the first match. - * - * If `key` maps to a message function, the returned value will be the result of calling it with `props`. - * If it maps to an object, the object is returned directly. - * If nothing is found, `key` is returned. - * - * @param key - The key or keypath being sought - * @param props - Optional properties passed to the function - * @param lc - If empty or undefined, defaults to `this.locale` - */ - Messages.prototype.get = function (key, props, locale) { - var lc = locale || String(this.locale); - var msg = _get(this._data[lc], key); - if (msg) - return typeof msg == 'function' ? msg(props) : msg; - var fb = this.getFallback(lc); - for (var i = 0; i < fb.length; ++i) { - msg = _get(this._data[fb[i]], key); - if (msg) - return typeof msg == 'function' ? msg(props) : msg; - } - return key; - }; - return Messages; -}()); -exports.default = Messages; -function _get(obj, key) { - if (!obj) - return null; - var res = obj; - if (Array.isArray(key)) { - for (var i = 0; i < key.length; ++i) { - if (typeof res !== 'object') - return null; - res = res[key[i]]; - if (!res) - return null; - } - return res; - } - return typeof res === 'object' ? res[key] : null; -} -function _has(data, lc, key, fallback, type) { - var msg = _get(data[lc], key); - if (msg) - return typeof msg === type; - if (fallback) { - for (var i = 0; i < fallback.length; ++i) { - msg = _get(data[fallback[i]], key); - if (msg) - return typeof msg === type; - } - } - return false; -} diff --git a/node_modules/@messageformat/runtime/lib/plurals.d.ts b/node_modules/@messageformat/runtime/lib/plurals.d.ts deleted file mode 100644 index 91f8a9e..0000000 --- a/node_modules/@messageformat/runtime/lib/plurals.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from 'make-plural/plurals'; diff --git a/node_modules/@messageformat/runtime/lib/plurals.js b/node_modules/@messageformat/runtime/lib/plurals.js deleted file mode 100644 index 9578e53..0000000 --- a/node_modules/@messageformat/runtime/lib/plurals.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("make-plural/plurals"), exports); diff --git a/node_modules/@messageformat/runtime/lib/runtime.d.ts b/node_modules/@messageformat/runtime/lib/runtime.d.ts deleted file mode 100644 index 8597b07..0000000 --- a/node_modules/@messageformat/runtime/lib/runtime.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * A set of utility functions that are called by the compiled Javascript - * functions, these are included locally in the output of {@link MessageFormat.compile compile()}. - */ -/** @private */ -export declare function _nf(lc: string): Intl.NumberFormat; -/** - * Utility function for `#` in plural rules - * - * @param lc The current locale - * @param value The value to operate on - * @param offset An offset, set by the surrounding context - * @returns The result of applying the offset to the input value - */ -export declare function number(lc: string, value: number, offset: number): string; -/** - * Strict utility function for `#` in plural rules - * - * Will throw an Error if `value` or `offset` are non-numeric. - * - * @param lc The current locale - * @param value The value to operate on - * @param offset An offset, set by the surrounding context - * @param name The name of the argument, used for error reporting - * @returns The result of applying the offset to the input value - */ -export declare function strictNumber(lc: string, value: number, offset: number, name: string): string; -/** - * Utility function for `{N, plural|selectordinal, ...}` - * - * @param value The key to use to find a pluralization rule - * @param offset An offset to apply to `value` - * @param lcfunc A locale function from `pluralFuncs` - * @param data The object from which results are looked up - * @param isOrdinal If true, use ordinal rather than cardinal rules - * @returns The result of the pluralization - */ -export declare function plural(value: number, offset: number, lcfunc: (value: number, isOrdinal?: boolean) => string, data: { - [key: string]: unknown; -}, isOrdinal?: boolean): unknown; -/** - * Utility function for `{N, select, ...}` - * - * @param value The key to use to find a selection - * @param data The object from which results are looked up - * @returns The result of the select statement - */ -export declare function select(value: string, data: { - [key: string]: unknown; -}): unknown; -/** - * Checks that all required arguments are set to defined values - * - * Throws on failure; otherwise returns undefined - * - * @param keys The required keys - * @param data The data object being checked - */ -export declare function reqArgs(keys: string[], data: { - [key: string]: unknown; -}): void; diff --git a/node_modules/@messageformat/runtime/lib/runtime.js b/node_modules/@messageformat/runtime/lib/runtime.js deleted file mode 100644 index ab25f9d..0000000 --- a/node_modules/@messageformat/runtime/lib/runtime.js +++ /dev/null @@ -1,88 +0,0 @@ -"use strict"; -/** - * A set of utility functions that are called by the compiled Javascript - * functions, these are included locally in the output of {@link MessageFormat.compile compile()}. - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.reqArgs = exports.select = exports.plural = exports.strictNumber = exports.number = exports._nf = void 0; -/** @private */ -function _nf(lc) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - return _nf[lc] || (_nf[lc] = new Intl.NumberFormat(lc)); -} -exports._nf = _nf; -/** - * Utility function for `#` in plural rules - * - * @param lc The current locale - * @param value The value to operate on - * @param offset An offset, set by the surrounding context - * @returns The result of applying the offset to the input value - */ -function number(lc, value, offset) { - return _nf(lc).format(value - offset); -} -exports.number = number; -/** - * Strict utility function for `#` in plural rules - * - * Will throw an Error if `value` or `offset` are non-numeric. - * - * @param lc The current locale - * @param value The value to operate on - * @param offset An offset, set by the surrounding context - * @param name The name of the argument, used for error reporting - * @returns The result of applying the offset to the input value - */ -function strictNumber(lc, value, offset, name) { - var n = value - offset; - if (isNaN(n)) - throw new Error('`' + name + '` or its offset is not a number'); - return _nf(lc).format(n); -} -exports.strictNumber = strictNumber; -/** - * Utility function for `{N, plural|selectordinal, ...}` - * - * @param value The key to use to find a pluralization rule - * @param offset An offset to apply to `value` - * @param lcfunc A locale function from `pluralFuncs` - * @param data The object from which results are looked up - * @param isOrdinal If true, use ordinal rather than cardinal rules - * @returns The result of the pluralization - */ -function plural(value, offset, lcfunc, data, isOrdinal) { - if ({}.hasOwnProperty.call(data, value)) - return data[value]; - if (offset) - value -= offset; - var key = lcfunc(value, isOrdinal); - return key in data ? data[key] : data.other; -} -exports.plural = plural; -/** - * Utility function for `{N, select, ...}` - * - * @param value The key to use to find a selection - * @param data The object from which results are looked up - * @returns The result of the select statement - */ -function select(value, data) { - return {}.hasOwnProperty.call(data, value) ? data[value] : data.other; -} -exports.select = select; -/** - * Checks that all required arguments are set to defined values - * - * Throws on failure; otherwise returns undefined - * - * @param keys The required keys - * @param data The data object being checked - */ -function reqArgs(keys, data) { - for (var i = 0; i < keys.length; ++i) - if (!data || data[keys[i]] === undefined) - throw new Error("Message requires argument '".concat(keys[i], "'")); -} -exports.reqArgs = reqArgs; diff --git a/node_modules/@messageformat/runtime/messages.d.ts b/node_modules/@messageformat/runtime/messages.d.ts deleted file mode 100644 index e005c1d..0000000 --- a/node_modules/@messageformat/runtime/messages.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './lib/messages'; -export { default } from './lib/messages'; diff --git a/node_modules/@messageformat/runtime/messages.js b/node_modules/@messageformat/runtime/messages.js deleted file mode 100644 index 5390c22..0000000 --- a/node_modules/@messageformat/runtime/messages.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/messages').default; diff --git a/node_modules/@messageformat/runtime/package.json b/node_modules/@messageformat/runtime/package.json deleted file mode 100644 index 2501381..0000000 --- a/node_modules/@messageformat/runtime/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "@messageformat/runtime", - "version": "3.0.1", - "description": "Runtime components of messageformat", - "keywords": [ - "i18n", - "icu", - "messageformat", - "internationalization" - ], - "contributors": [ - "Eemeli Aro " - ], - "license": "MIT", - "homepage": "https://messageformat.github.io/", - "repository": { - "type": "git", - "url": "https://github.com/messageformat/messageformat.git", - "directory": "packages/runtime" - }, - "files": [ - "esm/", - "lib/", - "messages.*" - ], - "type": "commonjs", - "main": "./lib/runtime.js", - "exports": { - ".": { - "import": "./esm/runtime.js", - "default": "./lib/runtime.js" - }, - "./lib/cardinals": { - "import": "./esm/cardinals.js", - "default": "./lib/cardinals.js" - }, - "./lib/formatters": { - "import": "./esm/formatters.js", - "default": "./lib/formatters.js" - }, - "./lib/plurals": { - "import": "./esm/plurals.js", - "default": "./lib/plurals.js" - }, - "./messages": { - "import": "./esm/messages.js", - "default": "./messages.js" - } - }, - "browser": { - "./lib/runtime.js": "./esm/runtime.js", - "./lib/cardinals.js": "./esm/cardinals.js", - "./lib/formatters.js": "./esm/formatters.js", - "./lib/plurals.js": "./esm/plurals.js", - "./messages.js": "./esm/messages.js" - }, - "sideEffects": false, - "scripts": { - "build:cjs": "tsc --project tsconfig.build.json --declaration --module CommonJS --outDir lib", - "build:esm": "tsc --project tsconfig.build.json --module ES6 --outDir esm", - "build": "npm run build:cjs && npm run build:esm", - "extract-api": "api-extractor run --local --verbose", - "prepublishOnly": "npm run build" - }, - "dependencies": { - "make-plural": "^7.0.0" - }, - "browserslist": [ - "last 1 version", - "> 1%", - "maintained node versions", - "not dead" - ] -} diff --git a/node_modules/accepts/HISTORY.md b/node_modules/accepts/HISTORY.md deleted file mode 100644 index cb5990c..0000000 --- a/node_modules/accepts/HISTORY.md +++ /dev/null @@ -1,243 +0,0 @@ -1.3.8 / 2022-02-02 -================== - - * deps: mime-types@~2.1.34 - - deps: mime-db@~1.51.0 - * deps: negotiator@0.6.3 - -1.3.7 / 2019-04-29 -================== - - * deps: negotiator@0.6.2 - - Fix sorting charset, encoding, and language with extra parameters - -1.3.6 / 2019-04-28 -================== - - * deps: mime-types@~2.1.24 - - deps: mime-db@~1.40.0 - -1.3.5 / 2018-02-28 -================== - - * deps: mime-types@~2.1.18 - - deps: mime-db@~1.33.0 - -1.3.4 / 2017-08-22 -================== - - * deps: mime-types@~2.1.16 - - deps: mime-db@~1.29.0 - -1.3.3 / 2016-05-02 -================== - - * deps: mime-types@~2.1.11 - - deps: mime-db@~1.23.0 - * deps: negotiator@0.6.1 - - perf: improve `Accept` parsing speed - - perf: improve `Accept-Charset` parsing speed - - perf: improve `Accept-Encoding` parsing speed - - perf: improve `Accept-Language` parsing speed - -1.3.2 / 2016-03-08 -================== - - * deps: mime-types@~2.1.10 - - Fix extension of `application/dash+xml` - - Update primary extension for `audio/mp4` - - deps: mime-db@~1.22.0 - -1.3.1 / 2016-01-19 -================== - - * deps: mime-types@~2.1.9 - - deps: mime-db@~1.21.0 - -1.3.0 / 2015-09-29 -================== - - * deps: mime-types@~2.1.7 - - deps: mime-db@~1.19.0 - * deps: negotiator@0.6.0 - - Fix including type extensions in parameters in `Accept` parsing - - Fix parsing `Accept` parameters with quoted equals - - Fix parsing `Accept` parameters with quoted semicolons - - Lazy-load modules from main entry point - - perf: delay type concatenation until needed - - perf: enable strict mode - - perf: hoist regular expressions - - perf: remove closures getting spec properties - - perf: remove a closure from media type parsing - - perf: remove property delete from media type parsing - -1.2.13 / 2015-09-06 -=================== - - * deps: mime-types@~2.1.6 - - deps: mime-db@~1.18.0 - -1.2.12 / 2015-07-30 -=================== - - * deps: mime-types@~2.1.4 - - deps: mime-db@~1.16.0 - -1.2.11 / 2015-07-16 -=================== - - * deps: mime-types@~2.1.3 - - deps: mime-db@~1.15.0 - -1.2.10 / 2015-07-01 -=================== - - * deps: mime-types@~2.1.2 - - deps: mime-db@~1.14.0 - -1.2.9 / 2015-06-08 -================== - - * deps: mime-types@~2.1.1 - - perf: fix deopt during mapping - -1.2.8 / 2015-06-07 -================== - - * deps: mime-types@~2.1.0 - - deps: mime-db@~1.13.0 - * perf: avoid argument reassignment & argument slice - * perf: avoid negotiator recursive construction - * perf: enable strict mode - * perf: remove unnecessary bitwise operator - -1.2.7 / 2015-05-10 -================== - - * deps: negotiator@0.5.3 - - Fix media type parameter matching to be case-insensitive - -1.2.6 / 2015-05-07 -================== - - * deps: mime-types@~2.0.11 - - deps: mime-db@~1.9.1 - * deps: negotiator@0.5.2 - - Fix comparing media types with quoted values - - Fix splitting media types with quoted commas - -1.2.5 / 2015-03-13 -================== - - * deps: mime-types@~2.0.10 - - deps: mime-db@~1.8.0 - -1.2.4 / 2015-02-14 -================== - - * Support Node.js 0.6 - * deps: mime-types@~2.0.9 - - deps: mime-db@~1.7.0 - * deps: negotiator@0.5.1 - - Fix preference sorting to be stable for long acceptable lists - -1.2.3 / 2015-01-31 -================== - - * deps: mime-types@~2.0.8 - - deps: mime-db@~1.6.0 - -1.2.2 / 2014-12-30 -================== - - * deps: mime-types@~2.0.7 - - deps: mime-db@~1.5.0 - -1.2.1 / 2014-12-30 -================== - - * deps: mime-types@~2.0.5 - - deps: mime-db@~1.3.1 - -1.2.0 / 2014-12-19 -================== - - * deps: negotiator@0.5.0 - - Fix list return order when large accepted list - - Fix missing identity encoding when q=0 exists - - Remove dynamic building of Negotiator class - -1.1.4 / 2014-12-10 -================== - - * deps: mime-types@~2.0.4 - - deps: mime-db@~1.3.0 - -1.1.3 / 2014-11-09 -================== - - * deps: mime-types@~2.0.3 - - deps: mime-db@~1.2.0 - -1.1.2 / 2014-10-14 -================== - - * deps: negotiator@0.4.9 - - Fix error when media type has invalid parameter - -1.1.1 / 2014-09-28 -================== - - * deps: mime-types@~2.0.2 - - deps: mime-db@~1.1.0 - * deps: negotiator@0.4.8 - - Fix all negotiations to be case-insensitive - - Stable sort preferences of same quality according to client order - -1.1.0 / 2014-09-02 -================== - - * update `mime-types` - -1.0.7 / 2014-07-04 -================== - - * Fix wrong type returned from `type` when match after unknown extension - -1.0.6 / 2014-06-24 -================== - - * deps: negotiator@0.4.7 - -1.0.5 / 2014-06-20 -================== - - * fix crash when unknown extension given - -1.0.4 / 2014-06-19 -================== - - * use `mime-types` - -1.0.3 / 2014-06-11 -================== - - * deps: negotiator@0.4.6 - - Order by specificity when quality is the same - -1.0.2 / 2014-05-29 -================== - - * Fix interpretation when header not in request - * deps: pin negotiator@0.4.5 - -1.0.1 / 2014-01-18 -================== - - * Identity encoding isn't always acceptable - * deps: negotiator@~0.4.0 - -1.0.0 / 2013-12-27 -================== - - * Genesis diff --git a/node_modules/accepts/LICENSE b/node_modules/accepts/LICENSE deleted file mode 100644 index 0616607..0000000 --- a/node_modules/accepts/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/accepts/README.md b/node_modules/accepts/README.md deleted file mode 100644 index 82680c5..0000000 --- a/node_modules/accepts/README.md +++ /dev/null @@ -1,140 +0,0 @@ -# accepts - -[![NPM Version][npm-version-image]][npm-url] -[![NPM Downloads][npm-downloads-image]][npm-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). -Extracted from [koa](https://www.npmjs.com/package/koa) for general use. - -In addition to negotiator, it allows: - -- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` - as well as `('text/html', 'application/json')`. -- Allows type shorthands such as `json`. -- Returns `false` when no types match -- Treats non-existent headers as `*` - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install accepts -``` - -## API - -```js -var accepts = require('accepts') -``` - -### accepts(req) - -Create a new `Accepts` object for the given `req`. - -#### .charset(charsets) - -Return the first accepted charset. If nothing in `charsets` is accepted, -then `false` is returned. - -#### .charsets() - -Return the charsets that the request accepts, in the order of the client's -preference (most preferred first). - -#### .encoding(encodings) - -Return the first accepted encoding. If nothing in `encodings` is accepted, -then `false` is returned. - -#### .encodings() - -Return the encodings that the request accepts, in the order of the client's -preference (most preferred first). - -#### .language(languages) - -Return the first accepted language. If nothing in `languages` is accepted, -then `false` is returned. - -#### .languages() - -Return the languages that the request accepts, in the order of the client's -preference (most preferred first). - -#### .type(types) - -Return the first accepted type (and it is returned as the same text as what -appears in the `types` array). If nothing in `types` is accepted, then `false` -is returned. - -The `types` array can contain full MIME types or file extensions. Any value -that is not a full MIME types is passed to `require('mime-types').lookup`. - -#### .types() - -Return the types that the request accepts, in the order of the client's -preference (most preferred first). - -## Examples - -### Simple type negotiation - -This simple example shows how to use `accepts` to return a different typed -respond body based on what the client wants to accept. The server lists it's -preferences in order and will get back the best match between the client and -server. - -```js -var accepts = require('accepts') -var http = require('http') - -function app (req, res) { - var accept = accepts(req) - - // the order of this list is significant; should be server preferred order - switch (accept.type(['json', 'html'])) { - case 'json': - res.setHeader('Content-Type', 'application/json') - res.write('{"hello":"world!"}') - break - case 'html': - res.setHeader('Content-Type', 'text/html') - res.write('hello, world!') - break - default: - // the fallback is text/plain, so no need to specify it above - res.setHeader('Content-Type', 'text/plain') - res.write('hello, world!') - break - } - - res.end() -} - -http.createServer(app).listen(3000) -``` - -You can test this out with the cURL program: -```sh -curl -I -H'Accept: text/html' http://localhost:3000/ -``` - -## License - -[MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master -[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master -[github-actions-ci-image]: https://badgen.net/github/checks/jshttp/accepts/master?label=ci -[github-actions-ci-url]: https://github.com/jshttp/accepts/actions/workflows/ci.yml -[node-version-image]: https://badgen.net/npm/node/accepts -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/accepts -[npm-url]: https://npmjs.org/package/accepts -[npm-version-image]: https://badgen.net/npm/v/accepts diff --git a/node_modules/accepts/index.js b/node_modules/accepts/index.js deleted file mode 100644 index e9b2f63..0000000 --- a/node_modules/accepts/index.js +++ /dev/null @@ -1,238 +0,0 @@ -/*! - * accepts - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var Negotiator = require('negotiator') -var mime = require('mime-types') - -/** - * Module exports. - * @public - */ - -module.exports = Accepts - -/** - * Create a new Accepts object for the given req. - * - * @param {object} req - * @public - */ - -function Accepts (req) { - if (!(this instanceof Accepts)) { - return new Accepts(req) - } - - this.headers = req.headers - this.negotiator = new Negotiator(req) -} - -/** - * Check if the given `type(s)` is acceptable, returning - * the best match when true, otherwise `undefined`, in which - * case you should respond with 406 "Not Acceptable". - * - * The `type` value may be a single mime type string - * such as "application/json", the extension name - * such as "json" or an array `["json", "html", "text/plain"]`. When a list - * or array is given the _best_ match, if any is returned. - * - * Examples: - * - * // Accept: text/html - * this.types('html'); - * // => "html" - * - * // Accept: text/*, application/json - * this.types('html'); - * // => "html" - * this.types('text/html'); - * // => "text/html" - * this.types('json', 'text'); - * // => "json" - * this.types('application/json'); - * // => "application/json" - * - * // Accept: text/*, application/json - * this.types('image/png'); - * this.types('png'); - * // => undefined - * - * // Accept: text/*;q=.5, application/json - * this.types(['html', 'json']); - * this.types('html', 'json'); - * // => "json" - * - * @param {String|Array} types... - * @return {String|Array|Boolean} - * @public - */ - -Accepts.prototype.type = -Accepts.prototype.types = function (types_) { - var types = types_ - - // support flattened arguments - if (types && !Array.isArray(types)) { - types = new Array(arguments.length) - for (var i = 0; i < types.length; i++) { - types[i] = arguments[i] - } - } - - // no types, return all requested types - if (!types || types.length === 0) { - return this.negotiator.mediaTypes() - } - - // no accept header, return first given type - if (!this.headers.accept) { - return types[0] - } - - var mimes = types.map(extToMime) - var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)) - var first = accepts[0] - - return first - ? types[mimes.indexOf(first)] - : false -} - -/** - * Return accepted encodings or best fit based on `encodings`. - * - * Given `Accept-Encoding: gzip, deflate` - * an array sorted by quality is returned: - * - * ['gzip', 'deflate'] - * - * @param {String|Array} encodings... - * @return {String|Array} - * @public - */ - -Accepts.prototype.encoding = -Accepts.prototype.encodings = function (encodings_) { - var encodings = encodings_ - - // support flattened arguments - if (encodings && !Array.isArray(encodings)) { - encodings = new Array(arguments.length) - for (var i = 0; i < encodings.length; i++) { - encodings[i] = arguments[i] - } - } - - // no encodings, return all requested encodings - if (!encodings || encodings.length === 0) { - return this.negotiator.encodings() - } - - return this.negotiator.encodings(encodings)[0] || false -} - -/** - * Return accepted charsets or best fit based on `charsets`. - * - * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` - * an array sorted by quality is returned: - * - * ['utf-8', 'utf-7', 'iso-8859-1'] - * - * @param {String|Array} charsets... - * @return {String|Array} - * @public - */ - -Accepts.prototype.charset = -Accepts.prototype.charsets = function (charsets_) { - var charsets = charsets_ - - // support flattened arguments - if (charsets && !Array.isArray(charsets)) { - charsets = new Array(arguments.length) - for (var i = 0; i < charsets.length; i++) { - charsets[i] = arguments[i] - } - } - - // no charsets, return all requested charsets - if (!charsets || charsets.length === 0) { - return this.negotiator.charsets() - } - - return this.negotiator.charsets(charsets)[0] || false -} - -/** - * Return accepted languages or best fit based on `langs`. - * - * Given `Accept-Language: en;q=0.8, es, pt` - * an array sorted by quality is returned: - * - * ['es', 'pt', 'en'] - * - * @param {String|Array} langs... - * @return {Array|String} - * @public - */ - -Accepts.prototype.lang = -Accepts.prototype.langs = -Accepts.prototype.language = -Accepts.prototype.languages = function (languages_) { - var languages = languages_ - - // support flattened arguments - if (languages && !Array.isArray(languages)) { - languages = new Array(arguments.length) - for (var i = 0; i < languages.length; i++) { - languages[i] = arguments[i] - } - } - - // no languages, return all requested languages - if (!languages || languages.length === 0) { - return this.negotiator.languages() - } - - return this.negotiator.languages(languages)[0] || false -} - -/** - * Convert extnames to mime. - * - * @param {String} type - * @return {String} - * @private - */ - -function extToMime (type) { - return type.indexOf('/') === -1 - ? mime.lookup(type) - : type -} - -/** - * Check if mime is valid. - * - * @param {String} type - * @return {String} - * @private - */ - -function validMime (type) { - return typeof type === 'string' -} diff --git a/node_modules/accepts/package.json b/node_modules/accepts/package.json deleted file mode 100644 index 0f2d15d..0000000 --- a/node_modules/accepts/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "accepts", - "description": "Higher-level content negotiation", - "version": "1.3.8", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "jshttp/accepts", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "devDependencies": { - "deep-equal": "1.0.1", - "eslint": "7.32.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.25.4", - "eslint-plugin-markdown": "2.2.1", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "4.3.1", - "eslint-plugin-standard": "4.1.0", - "mocha": "9.2.0", - "nyc": "15.1.0" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "index.js" - ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --check-leaks --bail test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - }, - "keywords": [ - "content", - "negotiation", - "accept", - "accepts" - ] -} diff --git a/node_modules/ansi-styles/index.d.ts b/node_modules/ansi-styles/index.d.ts deleted file mode 100644 index 44a907e..0000000 --- a/node_modules/ansi-styles/index.d.ts +++ /dev/null @@ -1,345 +0,0 @@ -declare type CSSColor = - | 'aliceblue' - | 'antiquewhite' - | 'aqua' - | 'aquamarine' - | 'azure' - | 'beige' - | 'bisque' - | 'black' - | 'blanchedalmond' - | 'blue' - | 'blueviolet' - | 'brown' - | 'burlywood' - | 'cadetblue' - | 'chartreuse' - | 'chocolate' - | 'coral' - | 'cornflowerblue' - | 'cornsilk' - | 'crimson' - | 'cyan' - | 'darkblue' - | 'darkcyan' - | 'darkgoldenrod' - | 'darkgray' - | 'darkgreen' - | 'darkgrey' - | 'darkkhaki' - | 'darkmagenta' - | 'darkolivegreen' - | 'darkorange' - | 'darkorchid' - | 'darkred' - | 'darksalmon' - | 'darkseagreen' - | 'darkslateblue' - | 'darkslategray' - | 'darkslategrey' - | 'darkturquoise' - | 'darkviolet' - | 'deeppink' - | 'deepskyblue' - | 'dimgray' - | 'dimgrey' - | 'dodgerblue' - | 'firebrick' - | 'floralwhite' - | 'forestgreen' - | 'fuchsia' - | 'gainsboro' - | 'ghostwhite' - | 'gold' - | 'goldenrod' - | 'gray' - | 'green' - | 'greenyellow' - | 'grey' - | 'honeydew' - | 'hotpink' - | 'indianred' - | 'indigo' - | 'ivory' - | 'khaki' - | 'lavender' - | 'lavenderblush' - | 'lawngreen' - | 'lemonchiffon' - | 'lightblue' - | 'lightcoral' - | 'lightcyan' - | 'lightgoldenrodyellow' - | 'lightgray' - | 'lightgreen' - | 'lightgrey' - | 'lightpink' - | 'lightsalmon' - | 'lightseagreen' - | 'lightskyblue' - | 'lightslategray' - | 'lightslategrey' - | 'lightsteelblue' - | 'lightyellow' - | 'lime' - | 'limegreen' - | 'linen' - | 'magenta' - | 'maroon' - | 'mediumaquamarine' - | 'mediumblue' - | 'mediumorchid' - | 'mediumpurple' - | 'mediumseagreen' - | 'mediumslateblue' - | 'mediumspringgreen' - | 'mediumturquoise' - | 'mediumvioletred' - | 'midnightblue' - | 'mintcream' - | 'mistyrose' - | 'moccasin' - | 'navajowhite' - | 'navy' - | 'oldlace' - | 'olive' - | 'olivedrab' - | 'orange' - | 'orangered' - | 'orchid' - | 'palegoldenrod' - | 'palegreen' - | 'paleturquoise' - | 'palevioletred' - | 'papayawhip' - | 'peachpuff' - | 'peru' - | 'pink' - | 'plum' - | 'powderblue' - | 'purple' - | 'rebeccapurple' - | 'red' - | 'rosybrown' - | 'royalblue' - | 'saddlebrown' - | 'salmon' - | 'sandybrown' - | 'seagreen' - | 'seashell' - | 'sienna' - | 'silver' - | 'skyblue' - | 'slateblue' - | 'slategray' - | 'slategrey' - | 'snow' - | 'springgreen' - | 'steelblue' - | 'tan' - | 'teal' - | 'thistle' - | 'tomato' - | 'turquoise' - | 'violet' - | 'wheat' - | 'white' - | 'whitesmoke' - | 'yellow' - | 'yellowgreen'; - -declare namespace ansiStyles { - interface ColorConvert { - /** - The RGB color space. - - @param red - (`0`-`255`) - @param green - (`0`-`255`) - @param blue - (`0`-`255`) - */ - rgb(red: number, green: number, blue: number): string; - - /** - The RGB HEX color space. - - @param hex - A hexadecimal string containing RGB data. - */ - hex(hex: string): string; - - /** - @param keyword - A CSS color name. - */ - keyword(keyword: CSSColor): string; - - /** - The HSL color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param lightness - (`0`-`100`) - */ - hsl(hue: number, saturation: number, lightness: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param saturation - (`0`-`100`) - @param value - (`0`-`100`) - */ - hsv(hue: number, saturation: number, value: number): string; - - /** - The HSV color space. - - @param hue - (`0`-`360`) - @param whiteness - (`0`-`100`) - @param blackness - (`0`-`100`) - */ - hwb(hue: number, whiteness: number, blackness: number): string; - - /** - Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color. - */ - ansi(ansi: number): string; - - /** - Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(ansi: number): string; - } - - interface CSPair { - /** - The ANSI terminal control sequence for starting this style. - */ - readonly open: string; - - /** - The ANSI terminal control sequence for ending this style. - */ - readonly close: string; - } - - interface ColorBase { - readonly ansi: ColorConvert; - readonly ansi256: ColorConvert; - readonly ansi16m: ColorConvert; - - /** - The ANSI terminal control sequence for ending this color. - */ - readonly close: string; - } - - interface Modifier { - /** - Resets the current color chain. - */ - readonly reset: CSPair; - - /** - Make text bold. - */ - readonly bold: CSPair; - - /** - Emitting only a small amount of light. - */ - readonly dim: CSPair; - - /** - Make text italic. (Not widely supported) - */ - readonly italic: CSPair; - - /** - Make text underline. (Not widely supported) - */ - readonly underline: CSPair; - - /** - Inverse background and foreground colors. - */ - readonly inverse: CSPair; - - /** - Prints the text, but makes it invisible. - */ - readonly hidden: CSPair; - - /** - Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: CSPair; - } - - interface ForegroundColor { - readonly black: CSPair; - readonly red: CSPair; - readonly green: CSPair; - readonly yellow: CSPair; - readonly blue: CSPair; - readonly cyan: CSPair; - readonly magenta: CSPair; - readonly white: CSPair; - - /** - Alias for `blackBright`. - */ - readonly gray: CSPair; - - /** - Alias for `blackBright`. - */ - readonly grey: CSPair; - - readonly blackBright: CSPair; - readonly redBright: CSPair; - readonly greenBright: CSPair; - readonly yellowBright: CSPair; - readonly blueBright: CSPair; - readonly cyanBright: CSPair; - readonly magentaBright: CSPair; - readonly whiteBright: CSPair; - } - - interface BackgroundColor { - readonly bgBlack: CSPair; - readonly bgRed: CSPair; - readonly bgGreen: CSPair; - readonly bgYellow: CSPair; - readonly bgBlue: CSPair; - readonly bgCyan: CSPair; - readonly bgMagenta: CSPair; - readonly bgWhite: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGray: CSPair; - - /** - Alias for `bgBlackBright`. - */ - readonly bgGrey: CSPair; - - readonly bgBlackBright: CSPair; - readonly bgRedBright: CSPair; - readonly bgGreenBright: CSPair; - readonly bgYellowBright: CSPair; - readonly bgBlueBright: CSPair; - readonly bgCyanBright: CSPair; - readonly bgMagentaBright: CSPair; - readonly bgWhiteBright: CSPair; - } -} - -declare const ansiStyles: { - readonly modifier: ansiStyles.Modifier; - readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase; - readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase; - readonly codes: ReadonlyMap; -} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier; - -export = ansiStyles; diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js deleted file mode 100644 index 5d82581..0000000 --- a/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,163 +0,0 @@ -'use strict'; - -const wrapAnsi16 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${code + offset}m`; -}; - -const wrapAnsi256 = (fn, offset) => (...args) => { - const code = fn(...args); - return `\u001B[${38 + offset};5;${code}m`; -}; - -const wrapAnsi16m = (fn, offset) => (...args) => { - const rgb = fn(...args); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; - -const ansi2ansi = n => n; -const rgb2rgb = (r, g, b) => [r, g, b]; - -const setLazyProperty = (object, property, get) => { - Object.defineProperty(object, property, { - get: () => { - const value = get(); - - Object.defineProperty(object, property, { - value, - enumerable: true, - configurable: true - }); - - return value; - }, - enumerable: true, - configurable: true - }); -}; - -/** @type {typeof import('color-convert')} */ -let colorConvert; -const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => { - if (colorConvert === undefined) { - colorConvert = require('color-convert'); - } - - const offset = isBackground ? 10 : 0; - const styles = {}; - - for (const [sourceSpace, suite] of Object.entries(colorConvert)) { - const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace; - if (sourceSpace === targetSpace) { - styles[name] = wrap(identity, offset); - } else if (typeof suite === 'object') { - styles[name] = wrap(suite[targetSpace], offset); - } - } - - return styles; -}; - -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - - // Bright color - blackBright: [90, 39], - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], - - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; - - // Alias bright black as gray (and grey) - styles.color.gray = styles.color.blackBright; - styles.bgColor.bgGray = styles.bgColor.bgBlackBright; - styles.color.grey = styles.color.blackBright; - styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; - - for (const [groupName, group] of Object.entries(styles)) { - for (const [styleName, style] of Object.entries(group)) { - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; - - group[styleName] = styles[styleName]; - - codes.set(style[0], style[1]); - } - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - } - - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; - - setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false)); - setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false)); - setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true)); - setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true)); - - return styles; -} - -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/ansi-styles/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json deleted file mode 100644 index 7539328..0000000 --- a/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "ansi-styles", - "version": "4.3.0", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": "chalk/ansi-styles", - "funding": "https://github.com/chalk/ansi-styles?sponsor=1", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd", - "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "color-convert": "^2.0.1" - }, - "devDependencies": { - "@types/color-convert": "^1.9.0", - "ava": "^2.3.0", - "svg-term-cli": "^2.1.1", - "tsd": "^0.11.0", - "xo": "^0.25.3" - } -} diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md deleted file mode 100644 index 24883de..0000000 --- a/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,152 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - - - -## Install - -``` -$ npm install ansi-styles -``` - -## Usage - -```js -const style = require('ansi-styles'); - -console.log(`${style.green.open}Hello world!${style.green.close}`); - - -// Color conversion between 16/256/truecolor -// NOTE: If conversion goes to 16 colors or 256 colors, the original color -// may be degraded to fit that color palette. This means terminals -// that do not support 16 million colors will best-match the -// original color. -console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); -console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); -console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close); -``` - -## API - -Each style has an `open` and `close` property. - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(Not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(Not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `blackBright` (alias: `gray`, `grey`) -- `redBright` -- `greenBright` -- `yellowBright` -- `blueBright` -- `magentaBright` -- `cyanBright` -- `whiteBright` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` -- `bgBlackBright` (alias: `bgGray`, `bgGrey`) -- `bgRedBright` -- `bgGreenBright` -- `bgYellowBright` -- `bgBlueBright` -- `bgMagentaBright` -- `bgCyanBright` -- `bgWhiteBright` - -## Advanced usage - -By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `style.modifier` -- `style.color` -- `style.bgColor` - -###### Example - -```js -console.log(style.color.green.open); -``` - -Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. - -###### Example - -```js -console.log(style.codes.get(36)); -//=> 39 -``` - -## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) - -`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. - -The following color spaces from `color-convert` are supported: - -- `rgb` -- `hex` -- `keyword` -- `hsl` -- `hsv` -- `hwb` -- `ansi` -- `ansi256` - -To use these, call the associated conversion function with the intended output, for example: - -```js -style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code -style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code - -style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code -style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code - -style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code -style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code -``` - -## Related - -- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal - -## Maintainers - -- [Sindre Sorhus](https://github.com/sindresorhus) -- [Josh Junon](https://github.com/qix-) - -## For enterprise - -Available as part of the Tidelift Subscription. - -The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/array-flatten/LICENSE b/node_modules/array-flatten/LICENSE deleted file mode 100644 index 983fbe8..0000000 --- a/node_modules/array-flatten/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/array-flatten/README.md b/node_modules/array-flatten/README.md deleted file mode 100644 index 91fa5b6..0000000 --- a/node_modules/array-flatten/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Array Flatten - -[![NPM version][npm-image]][npm-url] -[![NPM downloads][downloads-image]][downloads-url] -[![Build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] - -> Flatten an array of nested arrays into a single flat array. Accepts an optional depth. - -## Installation - -``` -npm install array-flatten --save -``` - -## Usage - -```javascript -var flatten = require('array-flatten') - -flatten([1, [2, [3, [4, [5], 6], 7], 8], 9]) -//=> [1, 2, 3, 4, 5, 6, 7, 8, 9] - -flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2) -//=> [1, 2, 3, [4, [5], 6], 7, 8, 9] - -(function () { - flatten(arguments) //=> [1, 2, 3] -})(1, [2, 3]) -``` - -## License - -MIT - -[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat -[npm-url]: https://npmjs.org/package/array-flatten -[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat -[downloads-url]: https://npmjs.org/package/array-flatten -[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat -[travis-url]: https://travis-ci.org/blakeembrey/array-flatten -[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat -[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master diff --git a/node_modules/array-flatten/array-flatten.js b/node_modules/array-flatten/array-flatten.js deleted file mode 100644 index 089117b..0000000 --- a/node_modules/array-flatten/array-flatten.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict' - -/** - * Expose `arrayFlatten`. - */ -module.exports = arrayFlatten - -/** - * Recursive flatten function with depth. - * - * @param {Array} array - * @param {Array} result - * @param {Number} depth - * @return {Array} - */ -function flattenWithDepth (array, result, depth) { - for (var i = 0; i < array.length; i++) { - var value = array[i] - - if (depth > 0 && Array.isArray(value)) { - flattenWithDepth(value, result, depth - 1) - } else { - result.push(value) - } - } - - return result -} - -/** - * Recursive flatten function. Omitting depth is slightly faster. - * - * @param {Array} array - * @param {Array} result - * @return {Array} - */ -function flattenForever (array, result) { - for (var i = 0; i < array.length; i++) { - var value = array[i] - - if (Array.isArray(value)) { - flattenForever(value, result) - } else { - result.push(value) - } - } - - return result -} - -/** - * Flatten an array, with the ability to define a depth. - * - * @param {Array} array - * @param {Number} depth - * @return {Array} - */ -function arrayFlatten (array, depth) { - if (depth == null) { - return flattenForever(array, []) - } - - return flattenWithDepth(array, [], depth) -} diff --git a/node_modules/array-flatten/package.json b/node_modules/array-flatten/package.json deleted file mode 100644 index 1a24e2a..0000000 --- a/node_modules/array-flatten/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "array-flatten", - "version": "1.1.1", - "description": "Flatten an array of nested arrays into a single flat array", - "main": "array-flatten.js", - "files": [ - "array-flatten.js", - "LICENSE" - ], - "scripts": { - "test": "istanbul cover _mocha -- -R spec" - }, - "repository": { - "type": "git", - "url": "git://github.com/blakeembrey/array-flatten.git" - }, - "keywords": [ - "array", - "flatten", - "arguments", - "depth" - ], - "author": { - "name": "Blake Embrey", - "email": "hello@blakeembrey.com", - "url": "http://blakeembrey.me" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/blakeembrey/array-flatten/issues" - }, - "homepage": "https://github.com/blakeembrey/array-flatten", - "devDependencies": { - "istanbul": "^0.3.13", - "mocha": "^2.2.4", - "pre-commit": "^1.0.7", - "standard": "^3.7.3" - } -} diff --git a/node_modules/async/CHANGELOG.md b/node_modules/async/CHANGELOG.md deleted file mode 100644 index 8a9a1bf..0000000 --- a/node_modules/async/CHANGELOG.md +++ /dev/null @@ -1,348 +0,0 @@ -# v3.2.4 -- Fix a bug in `priorityQueue` where it didn't wait for the result. (#1725) -- Fix a bug where `unshiftAsync` was included in `priorityQueue`. (#1790) - -# v3.2.3 -- Fix bugs in comment parsing in `autoInject`. (#1767, #1780) - -# v3.2.2 -- Fix potential prototype pollution exploit - -# v3.2.1 -- Use `queueMicrotask` if available to the environment (#1761) -- Minor perf improvement in `priorityQueue` (#1727) -- More examples in documentation (#1726) -- Various doc fixes (#1708, #1712, #1717, #1740, #1739, #1749, #1756) -- Improved test coverage (#1754) - -# v3.2.0 -- Fix a bug in Safari related to overwriting `func.name` -- Remove built-in browserify configuration (#1653) -- Varios doc fixes (#1688, #1703, #1704) - -# v3.1.1 -- Allow redefining `name` property on wrapped functions. - -# v3.1.0 - -- Added `q.pushAsync` and `q.unshiftAsync`, analagous to `q.push` and `q.unshift`, except they always do not accept a callback, and reject if processing the task errors. (#1659) -- Promises returned from `q.push` and `q.unshift` when a callback is not passed now resolve even if an error ocurred. (#1659) -- Fixed a parsing bug in `autoInject` with complicated function bodies (#1663) -- Added ES6+ configuration for Browserify bundlers (#1653) -- Various doc fixes (#1664, #1658, #1665, #1652) - -# v3.0.1 - -## Bug fixes -- Fixed a regression where arrays passed to `queue` and `cargo` would be completely flattened. (#1645) -- Clarified Async's browser support (#1643) - - -# v3.0.0 - -The `async`/`await` release! - -There are a lot of new features and subtle breaking changes in this major version, but the biggest feature is that most Async methods return a Promise if you omit the callback, meaning you can `await` them from within an `async` function. - -```js -const results = await async.mapLimit(urls, 5, async url => { - const resp = await fetch(url) - return resp.body -}) -``` - -## Breaking Changes -- Most Async methods return a Promise when the final callback is omitted, making them `await`-able! (#1572) -- We are now making heavy use of ES2015 features, this means we have dropped out-of-the-box support for Node 4 and earlier, and many old versions of browsers. (#1541, #1553) -- In `queue`, `priorityQueue`, `cargo` and `cargoQueue`, the "event"-style methods, like `q.drain` and `q.saturated` are now methods that register a callback, rather than properties you assign a callback to. They are now of the form `q.drain(callback)`. If you do not pass a callback a Promise will be returned for the next occurrence of the event, making them `await`-able, e.g. `await q.drain()`. (#1586, #1641) -- Calling `callback(false)` will cancel an async method, preventing further iteration and callback calls. This is useful for preventing memory leaks when you break out of an async flow by calling an outer callback. (#1064, #1542) -- `during` and `doDuring` have been removed, and instead `whilst`, `doWhilst`, `until` and `doUntil` now have asynchronous `test` functions. (#850, #1557) -- `limits` of less than 1 now cause an error to be thrown in queues and collection methods. (#1249, #1552) -- `memoize` no longer memoizes errors (#1465, #1466) -- `applyEach`/`applyEachSeries` have a simpler interface, to make them more easily type-able. It always returns a function that takes in a single callback argument. If that callback is omitted, a promise is returned, making it awaitable. (#1228, #1640) - -## New Features -- Async generators are now supported in all the Collection methods. (#1560) -- Added `cargoQueue`, a queue with both `concurrency` and `payload` size parameters. (#1567) -- Queue objects returned from `queue` now have a `Symbol.iterator` method, meaning they can be iterated over to inspect the current list of items in the queue. (#1459, #1556) -- A ESM-flavored `async.mjs` is included in the `async` package. This is described in the `package.json` `"module"` field, meaning it should be automatically used by Webpack and other compatible bundlers. - -## Bug fixes -- Better handle arbitrary error objects in `asyncify` (#1568, #1569) - -## Other -- Removed Lodash as a dependency (#1283, #1528) -- Miscellaneous docs fixes (#1393, #1501, #1540, #1543, #1558, #1563, #1564, #1579, #1581) -- Miscellaneous test fixes (#1538) - -------- - -# v2.6.1 -- Updated lodash to prevent `npm audit` warnings. (#1532, #1533) -- Made `async-es` more optimized for webpack users (#1517) -- Fixed a stack overflow with large collections and a synchronous iterator (#1514) -- Various small fixes/chores (#1505, #1511, #1527, #1530) - -# v2.6.0 -- Added missing aliases for many methods. Previously, you could not (e.g.) `require('async/find')` or use `async.anyLimit`. (#1483) -- Improved `queue` performance. (#1448, #1454) -- Add missing sourcemap (#1452, #1453) -- Various doc updates (#1448, #1471, #1483) - -# v2.5.0 -- Added `concatLimit`, the `Limit` equivalent of [`concat`](https://caolan.github.io/async/docs.html#concat) ([#1426](https://github.com/caolan/async/issues/1426), [#1430](https://github.com/caolan/async/pull/1430)) -- `concat` improvements: it now preserves order, handles falsy values and the `iteratee` callback takes a variable number of arguments ([#1437](https://github.com/caolan/async/issues/1437), [#1436](https://github.com/caolan/async/pull/1436)) -- Fixed an issue in `queue` where there was a size discrepancy between `workersList().length` and `running()` ([#1428](https://github.com/caolan/async/issues/1428), [#1429](https://github.com/caolan/async/pull/1429)) -- Various doc fixes ([#1422](https://github.com/caolan/async/issues/1422), [#1424](https://github.com/caolan/async/pull/1424)) - -# v2.4.1 -- Fixed a bug preventing functions wrapped with `timeout()` from being re-used. ([#1418](https://github.com/caolan/async/issues/1418), [#1419](https://github.com/caolan/async/issues/1419)) - -# v2.4.0 -- Added `tryEach`, for running async functions in parallel, where you only expect one to succeed. ([#1365](https://github.com/caolan/async/issues/1365), [#687](https://github.com/caolan/async/issues/687)) -- Improved performance, most notably in `parallel` and `waterfall` ([#1395](https://github.com/caolan/async/issues/1395)) -- Added `queue.remove()`, for removing items in a `queue` ([#1397](https://github.com/caolan/async/issues/1397), [#1391](https://github.com/caolan/async/issues/1391)) -- Fixed using `eval`, preventing Async from running in pages with Content Security Policy ([#1404](https://github.com/caolan/async/issues/1404), [#1403](https://github.com/caolan/async/issues/1403)) -- Fixed errors thrown in an `asyncify`ed function's callback being caught by the underlying Promise ([#1408](https://github.com/caolan/async/issues/1408)) -- Fixed timing of `queue.empty()` ([#1367](https://github.com/caolan/async/issues/1367)) -- Various doc fixes ([#1314](https://github.com/caolan/async/issues/1314), [#1394](https://github.com/caolan/async/issues/1394), [#1412](https://github.com/caolan/async/issues/1412)) - -# v2.3.0 -- Added support for ES2017 `async` functions. Wherever you can pass a Node-style/CPS function that uses a callback, you can also pass an `async` function. Previously, you had to wrap `async` functions with `asyncify`. The caveat is that it will only work if `async` functions are supported natively in your environment, transpiled implementations can't be detected. ([#1386](https://github.com/caolan/async/issues/1386), [#1390](https://github.com/caolan/async/issues/1390)) -- Small doc fix ([#1392](https://github.com/caolan/async/issues/1392)) - -# v2.2.0 -- Added `groupBy`, and the `Series`/`Limit` equivalents, analogous to [`_.groupBy`](http://lodash.com/docs#groupBy) ([#1364](https://github.com/caolan/async/issues/1364)) -- Fixed `transform` bug when `callback` was not passed ([#1381](https://github.com/caolan/async/issues/1381)) -- Added note about `reflect` to `parallel` docs ([#1385](https://github.com/caolan/async/issues/1385)) - -# v2.1.5 -- Fix `auto` bug when function names collided with Array.prototype ([#1358](https://github.com/caolan/async/issues/1358)) -- Improve some error messages ([#1349](https://github.com/caolan/async/issues/1349)) -- Avoid stack overflow case in queue -- Fixed an issue in `some`, `every` and `find` where processing would continue after the result was determined. -- Cleanup implementations of `some`, `every` and `find` - -# v2.1.3 -- Make bundle size smaller -- Create optimized hotpath for `filter` in array case. - -# v2.1.2 -- Fixed a stackoverflow bug with `detect`, `some`, `every` on large inputs ([#1293](https://github.com/caolan/async/issues/1293)). - -# v2.1.0 - -- `retry` and `retryable` now support an optional `errorFilter` function that determines if the `task` should retry on the error ([#1256](https://github.com/caolan/async/issues/1256), [#1261](https://github.com/caolan/async/issues/1261)) -- Optimized array iteration in `race`, `cargo`, `queue`, and `priorityQueue` ([#1253](https://github.com/caolan/async/issues/1253)) -- Added alias documentation to doc site ([#1251](https://github.com/caolan/async/issues/1251), [#1254](https://github.com/caolan/async/issues/1254)) -- Added [BootStrap scrollspy](http://getbootstrap.com/javascript/#scrollspy) to docs to highlight in the sidebar the current method being viewed ([#1289](https://github.com/caolan/async/issues/1289), [#1300](https://github.com/caolan/async/issues/1300)) -- Various minor doc fixes ([#1263](https://github.com/caolan/async/issues/1263), [#1264](https://github.com/caolan/async/issues/1264), [#1271](https://github.com/caolan/async/issues/1271), [#1278](https://github.com/caolan/async/issues/1278), [#1280](https://github.com/caolan/async/issues/1280), [#1282](https://github.com/caolan/async/issues/1282), [#1302](https://github.com/caolan/async/issues/1302)) - -# v2.0.1 - -- Significantly optimized all iteration based collection methods such as `each`, `map`, `filter`, etc ([#1245](https://github.com/caolan/async/issues/1245), [#1246](https://github.com/caolan/async/issues/1246), [#1247](https://github.com/caolan/async/issues/1247)). - -# v2.0.0 - -Lots of changes here! - -First and foremost, we have a slick new [site for docs](https://caolan.github.io/async/). Special thanks to [**@hargasinski**](https://github.com/hargasinski) for his work converting our old docs to `jsdoc` format and implementing the new website. Also huge ups to [**@ivanseidel**](https://github.com/ivanseidel) for designing our new logo. It was a long process for both of these tasks, but I think these changes turned out extraordinary well. - -The biggest feature is modularization. You can now `require("async/series")` to only require the `series` function. Every Async library function is available this way. You still can `require("async")` to require the entire library, like you could do before. - -We also provide Async as a collection of ES2015 modules. You can now `import {each} from 'async-es'` or `import waterfall from 'async-es/waterfall'`. If you are using only a few Async functions, and are using a ES bundler such as Rollup, this can significantly lower your build size. - -Major thanks to [**@Kikobeats**](github.com/Kikobeats), [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for doing the majority of the modularization work, as well as [**@jdalton**](github.com/jdalton) and [**@Rich-Harris**](github.com/Rich-Harris) for advisory work on the general modularization strategy. - -Another one of the general themes of the 2.0 release is standardization of what an "async" function is. We are now more strictly following the node-style continuation passing style. That is, an async function is a function that: - -1. Takes a variable number of arguments -2. The last argument is always a callback -3. The callback can accept any number of arguments -4. The first argument passed to the callback will be treated as an error result, if the argument is truthy -5. Any number of result arguments can be passed after the "error" argument -6. The callback is called once and exactly once, either on the same tick or later tick of the JavaScript event loop. - -There were several cases where Async accepted some functions that did not strictly have these properties, most notably `auto`, `every`, `some`, `filter`, `reject` and `detect`. - -Another theme is performance. We have eliminated internal deferrals in all cases where they make sense. For example, in `waterfall` and `auto`, there was a `setImmediate` between each task -- these deferrals have been removed. A `setImmediate` call can add up to 1ms of delay. This might not seem like a lot, but it can add up if you are using many Async functions in the course of processing a HTTP request, for example. Nearly all asynchronous functions that do I/O already have some sort of deferral built in, so the extra deferral is unnecessary. The trade-off of this change is removing our built-in stack-overflow defense. Many synchronous callback calls in series can quickly overflow the JS call stack. If you do have a function that is sometimes synchronous (calling its callback on the same tick), and are running into stack overflows, wrap it with `async.ensureAsync()`. - -Another big performance win has been re-implementing `queue`, `cargo`, and `priorityQueue` with [doubly linked lists](https://en.wikipedia.org/wiki/Doubly_linked_list) instead of arrays. This has lead to queues being an order of [magnitude faster on large sets of tasks](https://github.com/caolan/async/pull/1205). - -## New Features - -- Async is now modularized. Individual functions can be `require()`d from the main package. (`require('async/auto')`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996)) -- Async is also available as a collection of ES2015 modules in the new `async-es` package. (`import {forEachSeries} from 'async-es'`) ([#984](https://github.com/caolan/async/issues/984), [#996](https://github.com/caolan/async/issues/996)) -- Added `race`, analogous to `Promise.race()`. It will run an array of async tasks in parallel and will call its callback with the result of the first task to respond. ([#568](https://github.com/caolan/async/issues/568), [#1038](https://github.com/caolan/async/issues/1038)) -- Collection methods now accept ES2015 iterators. Maps, Sets, and anything that implements the iterator spec can now be passed directly to `each`, `map`, `parallel`, etc.. ([#579](https://github.com/caolan/async/issues/579), [#839](https://github.com/caolan/async/issues/839), [#1074](https://github.com/caolan/async/issues/1074)) -- Added `mapValues`, for mapping over the properties of an object and returning an object with the same keys. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177)) -- Added `timeout`, a wrapper for an async function that will make the task time-out after the specified time. ([#1007](https://github.com/caolan/async/issues/1007), [#1027](https://github.com/caolan/async/issues/1027)) -- Added `reflect` and `reflectAll`, analagous to [`Promise.reflect()`](http://bluebirdjs.com/docs/api/reflect.html), a wrapper for async tasks that always succeeds, by gathering results and errors into an object. ([#942](https://github.com/caolan/async/issues/942), [#1012](https://github.com/caolan/async/issues/1012), [#1095](https://github.com/caolan/async/issues/1095)) -- `constant` supports dynamic arguments -- it will now always use its last argument as the callback. ([#1016](https://github.com/caolan/async/issues/1016), [#1052](https://github.com/caolan/async/issues/1052)) -- `setImmediate` and `nextTick` now support arguments to partially apply to the deferred function, like the node-native versions do. ([#940](https://github.com/caolan/async/issues/940), [#1053](https://github.com/caolan/async/issues/1053)) -- `auto` now supports resolving cyclic dependencies using [Kahn's algorithm](https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm) ([#1140](https://github.com/caolan/async/issues/1140)). -- Added `autoInject`, a relative of `auto` that automatically spreads a task's dependencies as arguments to the task function. ([#608](https://github.com/caolan/async/issues/608), [#1055](https://github.com/caolan/async/issues/1055), [#1099](https://github.com/caolan/async/issues/1099), [#1100](https://github.com/caolan/async/issues/1100)) -- You can now limit the concurrency of `auto` tasks. ([#635](https://github.com/caolan/async/issues/635), [#637](https://github.com/caolan/async/issues/637)) -- Added `retryable`, a relative of `retry` that wraps an async function, making it retry when called. ([#1058](https://github.com/caolan/async/issues/1058)) -- `retry` now supports specifying a function that determines the next time interval, useful for exponential backoff, logging and other retry strategies. ([#1161](https://github.com/caolan/async/issues/1161)) -- `retry` will now pass all of the arguments the task function was resolved with to the callback ([#1231](https://github.com/caolan/async/issues/1231)). -- Added `q.unsaturated` -- callback called when a `queue`'s number of running workers falls below a threshold. ([#868](https://github.com/caolan/async/issues/868), [#1030](https://github.com/caolan/async/issues/1030), [#1033](https://github.com/caolan/async/issues/1033), [#1034](https://github.com/caolan/async/issues/1034)) -- Added `q.error` -- a callback called whenever a `queue` task calls its callback with an error. ([#1170](https://github.com/caolan/async/issues/1170)) -- `applyEach` and `applyEachSeries` now pass results to the final callback. ([#1088](https://github.com/caolan/async/issues/1088)) - -## Breaking changes - -- Calling a callback more than once is considered an error, and an error will be thrown. This had an explicit breaking change in `waterfall`. If you were relying on this behavior, you should more accurately represent your control flow as an event emitter or stream. ([#814](https://github.com/caolan/async/issues/814), [#815](https://github.com/caolan/async/issues/815), [#1048](https://github.com/caolan/async/issues/1048), [#1050](https://github.com/caolan/async/issues/1050)) -- `auto` task functions now always take the callback as the last argument. If a task has dependencies, the `results` object will be passed as the first argument. To migrate old task functions, wrap them with [`_.flip`](https://lodash.com/docs#flip) ([#1036](https://github.com/caolan/async/issues/1036), [#1042](https://github.com/caolan/async/issues/1042)) -- Internal `setImmediate` calls have been refactored away. This may make existing flows vulnerable to stack overflows if you use many synchronous functions in series. Use `ensureAsync` to work around this. ([#696](https://github.com/caolan/async/issues/696), [#704](https://github.com/caolan/async/issues/704), [#1049](https://github.com/caolan/async/issues/1049), [#1050](https://github.com/caolan/async/issues/1050)) -- `map` used to return an object when iterating over an object. `map` now always returns an array, like in other libraries. The previous object behavior has been split out into `mapValues`. ([#1157](https://github.com/caolan/async/issues/1157), [#1177](https://github.com/caolan/async/issues/1177)) -- `filter`, `reject`, `some`, `every`, `detect` and their families like `{METHOD}Series` and `{METHOD}Limit` now expect an error as the first callback argument, rather than just a simple boolean. Pass `null` as the first argument, or use `fs.access` instead of `fs.exists`. ([#118](https://github.com/caolan/async/issues/118), [#774](https://github.com/caolan/async/issues/774), [#1028](https://github.com/caolan/async/issues/1028), [#1041](https://github.com/caolan/async/issues/1041)) -- `{METHOD}` and `{METHOD}Series` are now implemented in terms of `{METHOD}Limit`. This is a major internal simplification, and is not expected to cause many problems, but it does subtly affect how functions execute internally. ([#778](https://github.com/caolan/async/issues/778), [#847](https://github.com/caolan/async/issues/847)) -- `retry`'s callback is now optional. Previously, omitting the callback would partially apply the function, meaning it could be passed directly as a task to `series` or `auto`. The partially applied "control-flow" behavior has been separated out into `retryable`. ([#1054](https://github.com/caolan/async/issues/1054), [#1058](https://github.com/caolan/async/issues/1058)) -- The test function for `whilst`, `until`, and `during` used to be passed non-error args from the iteratee function's callback, but this led to weirdness where the first call of the test function would be passed no args. We have made it so the test function is never passed extra arguments, and only the `doWhilst`, `doUntil`, and `doDuring` functions pass iteratee callback arguments to the test function ([#1217](https://github.com/caolan/async/issues/1217), [#1224](https://github.com/caolan/async/issues/1224)) -- The `q.tasks` array has been renamed `q._tasks` and is now implemented as a doubly linked list (DLL). Any code that used to interact with this array will need to be updated to either use the provided helpers or support DLLs ([#1205](https://github.com/caolan/async/issues/1205)). -- The timing of the `q.saturated()` callback in a `queue` has been modified to better reflect when tasks pushed to the queue will start queueing. ([#724](https://github.com/caolan/async/issues/724), [#1078](https://github.com/caolan/async/issues/1078)) -- Removed `iterator` method in favour of [ES2015 iterator protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators ) which natively supports arrays ([#1237](https://github.com/caolan/async/issues/1237)) -- Dropped support for Component, Jam, SPM, and Volo ([#1175](https://github.com/caolan/async/issues/1175), #[#176](https://github.com/caolan/async/issues/176)) - -## Bug Fixes - -- Improved handling of no dependency cases in `auto` & `autoInject` ([#1147](https://github.com/caolan/async/issues/1147)). -- Fixed a bug where the callback generated by `asyncify` with `Promises` could resolve twice ([#1197](https://github.com/caolan/async/issues/1197)). -- Fixed several documented optional callbacks not actually being optional ([#1223](https://github.com/caolan/async/issues/1223)). - -## Other - -- Added `someSeries` and `everySeries` for symmetry, as well as a complete set of `any`/`anyLimit`/`anySeries` and `all`/`/allLmit`/`allSeries` aliases. -- Added `find` as an alias for `detect. (as well as `findLimit` and `findSeries`). -- Various doc fixes ([#1005](https://github.com/caolan/async/issues/1005), [#1008](https://github.com/caolan/async/issues/1008), [#1010](https://github.com/caolan/async/issues/1010), [#1015](https://github.com/caolan/async/issues/1015), [#1021](https://github.com/caolan/async/issues/1021), [#1037](https://github.com/caolan/async/issues/1037), [#1039](https://github.com/caolan/async/issues/1039), [#1051](https://github.com/caolan/async/issues/1051), [#1102](https://github.com/caolan/async/issues/1102), [#1107](https://github.com/caolan/async/issues/1107), [#1121](https://github.com/caolan/async/issues/1121), [#1123](https://github.com/caolan/async/issues/1123), [#1129](https://github.com/caolan/async/issues/1129), [#1135](https://github.com/caolan/async/issues/1135), [#1138](https://github.com/caolan/async/issues/1138), [#1141](https://github.com/caolan/async/issues/1141), [#1153](https://github.com/caolan/async/issues/1153), [#1216](https://github.com/caolan/async/issues/1216), [#1217](https://github.com/caolan/async/issues/1217), [#1232](https://github.com/caolan/async/issues/1232), [#1233](https://github.com/caolan/async/issues/1233), [#1236](https://github.com/caolan/async/issues/1236), [#1238](https://github.com/caolan/async/issues/1238)) - -Thank you [**@aearly**](github.com/aearly) and [**@megawac**](github.com/megawac) for taking the lead on version 2 of async. - ------------------------------------------- - -# v1.5.2 -- Allow using `"constructor"` as an argument in `memoize` ([#998](https://github.com/caolan/async/issues/998)) -- Give a better error messsage when `auto` dependency checking fails ([#994](https://github.com/caolan/async/issues/994)) -- Various doc updates ([#936](https://github.com/caolan/async/issues/936), [#956](https://github.com/caolan/async/issues/956), [#979](https://github.com/caolan/async/issues/979), [#1002](https://github.com/caolan/async/issues/1002)) - -# v1.5.1 -- Fix issue with `pause` in `queue` with concurrency enabled ([#946](https://github.com/caolan/async/issues/946)) -- `while` and `until` now pass the final result to callback ([#963](https://github.com/caolan/async/issues/963)) -- `auto` will properly handle concurrency when there is no callback ([#966](https://github.com/caolan/async/issues/966)) -- `auto` will no. properly stop execution when an error occurs ([#988](https://github.com/caolan/async/issues/988), [#993](https://github.com/caolan/async/issues/993)) -- Various doc fixes ([#971](https://github.com/caolan/async/issues/971), [#980](https://github.com/caolan/async/issues/980)) - -# v1.5.0 - -- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) ([#892](https://github.com/caolan/async/issues/892)) -- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. ([#873](https://github.com/caolan/async/issues/873)) -- `auto` now accepts an optional `concurrency` argument to limit the number o. running tasks ([#637](https://github.com/caolan/async/issues/637)) -- Added `queue#workersList()`, to retrieve the lis. of currently running tasks. ([#891](https://github.com/caolan/async/issues/891)) -- Various code simplifications ([#896](https://github.com/caolan/async/issues/896), [#904](https://github.com/caolan/async/issues/904)) -- Various doc fixes :scroll: ([#890](https://github.com/caolan/async/issues/890), [#894](https://github.com/caolan/async/issues/894), [#903](https://github.com/caolan/async/issues/903), [#905](https://github.com/caolan/async/issues/905), [#912](https://github.com/caolan/async/issues/912)) - -# v1.4.2 - -- Ensure coverage files don't get published on npm ([#879](https://github.com/caolan/async/issues/879)) - -# v1.4.1 - -- Add in overlooked `detectLimit` method ([#866](https://github.com/caolan/async/issues/866)) -- Removed unnecessary files from npm releases ([#861](https://github.com/caolan/async/issues/861)) -- Removed usage of a reserved word to prevent :boom: in older environments ([#870](https://github.com/caolan/async/issues/870)) - -# v1.4.0 - -- `asyncify` now supports promises ([#840](https://github.com/caolan/async/issues/840)) -- Added `Limit` versions of `filter` and `reject` ([#836](https://github.com/caolan/async/issues/836)) -- Add `Limit` versions of `detect`, `some` and `every` ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829)) -- `some`, `every` and `detect` now short circuit early ([#828](https://github.com/caolan/async/issues/828), [#829](https://github.com/caolan/async/issues/829)) -- Improve detection of the global object ([#804](https://github.com/caolan/async/issues/804)), enabling use in WebWorkers -- `whilst` now called with arguments from iterator ([#823](https://github.com/caolan/async/issues/823)) -- `during` now gets called with arguments from iterator ([#824](https://github.com/caolan/async/issues/824)) -- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0)) - - -# v1.3.0 - -New Features: -- Added `constant` -- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. ([#671](https://github.com/caolan/async/issues/671), [#806](https://github.com/caolan/async/issues/806)) -- Added `during` and `doDuring`, which are like `whilst` with an async truth test. ([#800](https://github.com/caolan/async/issues/800)) -- `retry` now accepts an `interval` parameter to specify a delay between retries. ([#793](https://github.com/caolan/async/issues/793)) -- `async` should work better in Web Workers due to better `root` detection ([#804](https://github.com/caolan/async/issues/804)) -- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` ([#642](https://github.com/caolan/async/issues/642)) -- Various internal updates ([#786](https://github.com/caolan/async/issues/786), [#801](https://github.com/caolan/async/issues/801), [#802](https://github.com/caolan/async/issues/802), [#803](https://github.com/caolan/async/issues/803)) -- Various doc fixes ([#790](https://github.com/caolan/async/issues/790), [#794](https://github.com/caolan/async/issues/794)) - -Bug Fixes: -- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. ([#740](https://github.com/caolan/async/issues/740), [#744](https://github.com/caolan/async/issues/744), [#783](https://github.com/caolan/async/issues/783)) - - -# v1.2.1 - -Bug Fix: - -- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782)) - - -# v1.2.0 - -New Features: - -- Added `timesLimit` ([#743](https://github.com/caolan/async/issues/743)) -- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. ([#747](https://github.com/caolan/async/issues/747), [#772](https://github.com/caolan/async/issues/772)) - -Bug Fixes: - -- Fixed a regression in `each` and family with empty arrays that have additional properties. ([#775](https://github.com/caolan/async/issues/775), [#777](https://github.com/caolan/async/issues/777)) - - -# v1.1.1 - -Bug Fix: - -- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. ([#782](https://github.com/caolan/async/issues/782)) - - -# v1.1.0 - -New Features: - -- `cargo` now supports all of the same methods and event callbacks as `queue`. -- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. ([#769](https://github.com/caolan/async/issues/769)) -- Optimized `map`, `eachOf`, and `waterfall` families of functions -- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array ([#667](https://github.com/caolan/async/issues/667)). -- The callback is now optional for the composed results of `compose` and `seq`. ([#618](https://github.com/caolan/async/issues/618)) -- Reduced file size by 4kb, (minified version by 1kb) -- Added code coverage through `nyc` and `coveralls` ([#768](https://github.com/caolan/async/issues/768)) - -Bug Fixes: - -- `forever` will no longer stack overflow with a synchronous iterator ([#622](https://github.com/caolan/async/issues/622)) -- `eachLimit` and other limit functions will stop iterating once an error occurs ([#754](https://github.com/caolan/async/issues/754)) -- Always pass `null` in callbacks when there is no error ([#439](https://github.com/caolan/async/issues/439)) -- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue ([#668](https://github.com/caolan/async/issues/668)) -- `each` and family will properly handle an empty array ([#578](https://github.com/caolan/async/issues/578)) -- `eachSeries` and family will finish if the underlying array is modified during execution ([#557](https://github.com/caolan/async/issues/557)) -- `queue` will throw if a non-function is passed to `q.push()` ([#593](https://github.com/caolan/async/issues/593)) -- Doc fixes ([#629](https://github.com/caolan/async/issues/629), [#766](https://github.com/caolan/async/issues/766)) - - -# v1.0.0 - -No known breaking changes, we are simply complying with semver from here on out. - -Changes: - -- Start using a changelog! -- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) ([#168](https://github.com/caolan/async/issues/168) [#704](https://github.com/caolan/async/issues/704) [#321](https://github.com/caolan/async/issues/321)) -- Detect deadlocks in `auto` ([#663](https://github.com/caolan/async/issues/663)) -- Better support for require.js ([#527](https://github.com/caolan/async/issues/527)) -- Throw if queue created with concurrency `0` ([#714](https://github.com/caolan/async/issues/714)) -- Fix unneeded iteration in `queue.resume()` ([#758](https://github.com/caolan/async/issues/758)) -- Guard against timer mocking overriding `setImmediate` ([#609](https://github.com/caolan/async/issues/609) [#611](https://github.com/caolan/async/issues/611)) -- Miscellaneous doc fixes ([#542](https://github.com/caolan/async/issues/542) [#596](https://github.com/caolan/async/issues/596) [#615](https://github.com/caolan/async/issues/615) [#628](https://github.com/caolan/async/issues/628) [#631](https://github.com/caolan/async/issues/631) [#690](https://github.com/caolan/async/issues/690) [#729](https://github.com/caolan/async/issues/729)) -- Use single noop function internally ([#546](https://github.com/caolan/async/issues/546)) -- Optimize internal `_each`, `_map` and `_keys` functions. diff --git a/node_modules/async/LICENSE b/node_modules/async/LICENSE deleted file mode 100644 index b18aed6..0000000 --- a/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010-2018 Caolan McMahon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/node_modules/async/README.md b/node_modules/async/README.md deleted file mode 100644 index 77f645e..0000000 --- a/node_modules/async/README.md +++ /dev/null @@ -1,59 +0,0 @@ -![Async Logo](https://raw.githubusercontent.com/caolan/async/master/logo/async-logo_readme.jpg) - -![Github Actions CI status](https://github.com/caolan/async/actions/workflows/ci.yml/badge.svg) -[![NPM version](https://img.shields.io/npm/v/async.svg)](https://www.npmjs.com/package/async) -[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master) -[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/async/badge?style=rounded)](https://www.jsdelivr.com/package/npm/async) - - - -Async is a utility module which provides straight-forward, powerful functions for working with [asynchronous JavaScript](http://caolan.github.io/async/v3/global.html). Although originally designed for use with [Node.js](https://nodejs.org/) and installable via `npm i async`, it can also be used directly in the browser. A ESM/MJS version is included in the main `async` package that should automatically be used with compatible bundlers such as Webpack and Rollup. - -A pure ESM version of Async is available as [`async-es`](https://www.npmjs.com/package/async-es). - -For Documentation, visit - -*For Async v1.5.x documentation, go [HERE](https://github.com/caolan/async/blob/v1.5.2/README.md)* - - -```javascript -// for use with Node-style callbacks... -var async = require("async"); - -var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; -var configs = {}; - -async.forEachOf(obj, (value, key, callback) => { - fs.readFile(__dirname + value, "utf8", (err, data) => { - if (err) return callback(err); - try { - configs[key] = JSON.parse(data); - } catch (e) { - return callback(e); - } - callback(); - }); -}, err => { - if (err) console.error(err.message); - // configs is now a map of JSON data - doSomethingWith(configs); -}); -``` - -```javascript -var async = require("async"); - -// ...or ES2017 async functions -async.mapLimit(urls, 5, async function(url) { - const response = await fetch(url) - return response.body -}, (err, results) => { - if (err) throw err - // results is now an array of the response bodies - console.log(results) -}) -``` diff --git a/node_modules/async/all.js b/node_modules/async/all.js deleted file mode 100644 index 148db68..0000000 --- a/node_modules/async/all.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.every(fileList, fileExists, function(err, result) { - * console.log(result); - * // true - * // result is true since every file exists - * }); - * - * async.every(withMissingFileList, fileExists, function(err, result) { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }); - * - * // Using Promises - * async.every(fileList, fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.every(withMissingFileList, fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.every(fileList, fileExists); - * console.log(result); - * // true - * // result is true since every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.every(withMissingFileList, fileExists); - * console.log(result); - * // false - * // result is false since NOT every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function every(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(every, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/allLimit.js b/node_modules/async/allLimit.js deleted file mode 100644 index 25b2c08..0000000 --- a/node_modules/async/allLimit.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everyLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(everyLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/allSeries.js b/node_modules/async/allSeries.js deleted file mode 100644 index 147c3dc..0000000 --- a/node_modules/async/allSeries.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everySeries(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(everySeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/any.js b/node_modules/async/any.js deleted file mode 100644 index 2046cf6..0000000 --- a/node_modules/async/any.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - *); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // false - * // result is false since none of the files exists - * } - *); - * - * // Using Promises - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since some file in the list exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since none of the files exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); - * console.log(result); - * // false - * // result is false since none of the files exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function some(coll, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(some, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/anyLimit.js b/node_modules/async/anyLimit.js deleted file mode 100644 index c8a295a..0000000 --- a/node_modules/async/anyLimit.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(someLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/anySeries.js b/node_modules/async/anySeries.js deleted file mode 100644 index ee0654b..0000000 --- a/node_modules/async/anySeries.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someSeries(coll, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(someSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/apply.js b/node_modules/async/apply.js deleted file mode 100644 index 5246833..0000000 --- a/node_modules/async/apply.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (fn, ...args) { - return (...callArgs) => fn(...args, ...callArgs); -}; - -module.exports = exports["default"]; /** - * Creates a continuation function with some arguments already applied. - * - * Useful as a shorthand when combined with other control flow functions. Any - * arguments passed to the returned function are added to the arguments - * originally passed to apply. - * - * @name apply - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {Function} fn - The function you want to eventually apply all - * arguments to. Invokes with (arguments...). - * @param {...*} arguments... - Any number of arguments to automatically apply - * when the continuation is called. - * @returns {Function} the partially-applied function - * @example - * - * // using apply - * async.parallel([ - * async.apply(fs.writeFile, 'testfile1', 'test1'), - * async.apply(fs.writeFile, 'testfile2', 'test2') - * ]); - * - * - * // the same process without using apply - * async.parallel([ - * function(callback) { - * fs.writeFile('testfile1', 'test1', callback); - * }, - * function(callback) { - * fs.writeFile('testfile2', 'test2', callback); - * } - * ]); - * - * // It's possible to pass any number of additional arguments when calling the - * // continuation: - * - * node> var fn = async.apply(sys.puts, 'one'); - * node> fn('two', 'three'); - * one - * two - * three - */ \ No newline at end of file diff --git a/node_modules/async/applyEach.js b/node_modules/async/applyEach.js deleted file mode 100644 index b08c670..0000000 --- a/node_modules/async/applyEach.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _applyEach = require('./internal/applyEach.js'); - -var _applyEach2 = _interopRequireDefault(_applyEach); - -var _map = require('./map.js'); - -var _map2 = _interopRequireDefault(_map); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Applies the provided arguments to each function in the array, calling - * `callback` after all functions have completed. If you only provide the first - * argument, `fns`, then it will return a function which lets you pass in the - * arguments as if it were a single function call. If more arguments are - * provided, `callback` is required while `args` is still optional. The results - * for each of the applied async functions are passed to the final callback - * as an array. - * - * @name applyEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s - * to all call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - Returns a function that takes no args other than - * an optional callback, that is the result of applying the `args` to each - * of the functions. - * @example - * - * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') - * - * appliedFn((err, results) => { - * // results[0] is the results for `enableSearch` - * // results[1] is the results for `updateSchema` - * }); - * - * // partial application example: - * async.each( - * buckets, - * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), - * callback - * ); - */ -exports.default = (0, _applyEach2.default)(_map2.default); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/applyEachSeries.js b/node_modules/async/applyEachSeries.js deleted file mode 100644 index 6a19ca3..0000000 --- a/node_modules/async/applyEachSeries.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _applyEach = require('./internal/applyEach.js'); - -var _applyEach2 = _interopRequireDefault(_applyEach); - -var _mapSeries = require('./mapSeries.js'); - -var _mapSeries2 = _interopRequireDefault(_mapSeries); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. - * - * @name applyEachSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.applyEach]{@link module:ControlFlow.applyEach} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all - * call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - A function, that when called, is the result of - * appling the `args` to the list of functions. It takes no args, other than - * a callback. - */ -exports.default = (0, _applyEach2.default)(_mapSeries2.default); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/asyncify.js b/node_modules/async/asyncify.js deleted file mode 100644 index 3c3bf88..0000000 --- a/node_modules/async/asyncify.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = asyncify; - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _setImmediate = require('./internal/setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ -function asyncify(func) { - if ((0, _wrapAsync.isAsync)(func)) { - return function (...args /*, callback*/) { - const callback = args.pop(); - const promise = func.apply(this, args); - return handlePromise(promise, callback); - }; - } - - return (0, _initialParams2.default)(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (result && typeof result.then === 'function') { - return handlePromise(result, callback); - } else { - callback(null, result); - } - }); -} - -function handlePromise(promise, callback) { - return promise.then(value => { - invokeCallback(callback, null, value); - }, err => { - invokeCallback(callback, err && err.message ? err : new Error(err)); - }); -} - -function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (err) { - (0, _setImmediate2.default)(e => { - throw e; - }, err); - } -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/auto.js b/node_modules/async/auto.js deleted file mode 100644 index c4a85d4..0000000 --- a/node_modules/async/auto.js +++ /dev/null @@ -1,333 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = auto; - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _promiseCallback = require('./internal/promiseCallback.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on - * their requirements. Each function can optionally depend on other functions - * being completed first, and each function is run as soon as its requirements - * are satisfied. - * - * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence - * will stop. Further tasks will not execute (so any other functions depending - * on it will not run), and the main `callback` is immediately called with the - * error. - * - * {@link AsyncFunction}s also receive an object containing the results of functions which - * have completed so far as the first argument, if they have dependencies. If a - * task function has no dependencies, it will only be passed a callback. - * - * @name auto - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Object} tasks - An object. Each of its properties is either a - * function or an array of requirements, with the {@link AsyncFunction} itself the last item - * in the array. The object's key of a property serves as the name of the task - * defined by that property, i.e. can be used when specifying requirements for - * other tasks. The function receives one or two arguments: - * * a `results` object, containing the results of the previously executed - * functions, only passed if the task has any dependencies, - * * a `callback(err, result)` function, which must be called when finished, - * passing an `error` (which can be `null`) and the result of the function's - * execution. - * @param {number} [concurrency=Infinity] - An optional `integer` for - * determining the maximum number of tasks that can be run in parallel. By - * default, as many as possible. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback. Results are always returned; however, if an - * error occurs, no further `tasks` will be performed, and the results object - * will only contain partial results. Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * @example - * - * //Using Callbacks - * async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }, function(err, results) { - * if (err) { - * console.log('err = ', err); - * } - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }); - * - * //Using Promises - * async.auto({ - * get_data: function(callback) { - * console.log('in get_data'); - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * console.log('in make_folder'); - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }).then(results => { - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }).catch(err => { - * console.log('err = ', err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }); - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function auto(tasks, concurrency, callback) { - if (typeof concurrency !== 'number') { - // concurrency is optional, shift the args. - callback = concurrency; - concurrency = null; - } - callback = (0, _once2.default)(callback || (0, _promiseCallback.promiseCallback)()); - var numTasks = Object.keys(tasks).length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; - } - - var results = {}; - var runningTasks = 0; - var canceled = false; - var hasError = false; - - var listeners = Object.create(null); - - var readyTasks = []; - - // for cycle detection: - var readyToCheck = []; // tasks that have been identified as reachable - // without the possibility of returning to an ancestor task - var uncheckedDependencies = {}; - - Object.keys(tasks).forEach(key => { - var task = tasks[key]; - if (!Array.isArray(task)) { - // no dependencies - enqueueTask(key, [task]); - readyToCheck.push(key); - return; - } - - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; - } - uncheckedDependencies[key] = remainingDependencies; - - dependencies.forEach(dependencyName => { - if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', ')); - } - addListener(dependencyName, () => { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); - - checkForDeadlocks(); - processQueue(); - - function enqueueTask(key, task) { - readyTasks.push(() => runTask(key, task)); - } - - function processQueue() { - if (canceled) return; - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while (readyTasks.length && runningTasks < concurrency) { - var run = readyTasks.shift(); - run(); - } - } - - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } - - taskListeners.push(fn); - } - - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - taskListeners.forEach(fn => fn()); - processQueue(); - } - - function runTask(key, task) { - if (hasError) return; - - var taskCallback = (0, _onlyOnce2.default)((err, ...result) => { - runningTasks--; - if (err === false) { - canceled = true; - return; - } - if (result.length < 2) { - [result] = result; - } - if (err) { - var safeResults = {}; - Object.keys(results).forEach(rkey => { - safeResults[rkey] = results[rkey]; - }); - safeResults[key] = result; - hasError = true; - listeners = Object.create(null); - if (canceled) return; - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); - - runningTasks++; - var taskFn = (0, _wrapAsync2.default)(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } - } - - function checkForDeadlocks() { - // Kahn's algorithm - // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm - // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - getDependents(currentTask).forEach(dependent => { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } - - if (counter !== numTasks) { - throw new Error('async.auto cannot execute tasks due to a recursive dependency'); - } - } - - function getDependents(taskName) { - var result = []; - Object.keys(tasks).forEach(key => { - const task = tasks[key]; - if (Array.isArray(task) && task.indexOf(taskName) >= 0) { - result.push(key); - } - }); - return result; - } - - return callback[_promiseCallback.PROMISE_SYMBOL]; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/autoInject.js b/node_modules/async/autoInject.js deleted file mode 100644 index 393baad..0000000 --- a/node_modules/async/autoInject.js +++ /dev/null @@ -1,182 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = autoInject; - -var _auto = require('./auto.js'); - -var _auto2 = _interopRequireDefault(_auto); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; -var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; -var FN_ARG_SPLIT = /,/; -var FN_ARG = /(=.+)?(\s*)$/; - -function stripComments(string) { - let stripped = ''; - let index = 0; - let endBlockComment = string.indexOf('*/'); - while (index < string.length) { - if (string[index] === '/' && string[index + 1] === '/') { - // inline comment - let endIndex = string.indexOf('\n', index); - index = endIndex === -1 ? string.length : endIndex; - } else if (endBlockComment !== -1 && string[index] === '/' && string[index + 1] === '*') { - // block comment - let endIndex = string.indexOf('*/', index); - if (endIndex !== -1) { - index = endIndex + 2; - endBlockComment = string.indexOf('*/', index); - } else { - stripped += string[index]; - index++; - } - } else { - stripped += string[index]; - index++; - } - } - return stripped; -} - -function parseParams(func) { - const src = stripComments(func.toString()); - let match = src.match(FN_ARGS); - if (!match) { - match = src.match(ARROW_FN_ARGS); - } - if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src); - let [, args] = match; - return args.replace(/\s/g, '').split(FN_ARG_SPLIT).map(arg => arg.replace(FN_ARG, '').trim()); -} - -/** - * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent - * tasks are specified as parameters to the function, after the usual callback - * parameter, with the parameter names matching the names of the tasks it - * depends on. This can provide even more readable task graphs which can be - * easier to maintain. - * - * If a final callback is specified, the task results are similarly injected, - * specified as named parameters after the initial error parameter. - * - * The autoInject function is purely syntactic sugar and its semantics are - * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. - * - * @name autoInject - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.auto]{@link module:ControlFlow.auto} - * @category Control Flow - * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of - * the form 'func([dependencies...], callback). The object's key of a property - * serves as the name of the task defined by that property, i.e. can be used - * when specifying requirements for other tasks. - * * The `callback` parameter is a `callback(err, result)` which must be called - * when finished, passing an `error` (which can be `null`) and the result of - * the function's execution. The remaining parameters name other tasks on - * which the task is dependent, and the results from those tasks are the - * arguments of those parameters. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback, and a `results` object with any completed - * task results, similar to `auto`. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // The example from `auto` can be rewritten as follows: - * async.autoInject({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: function(get_data, make_folder, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }, - * email_link: function(write_file, callback) { - * // once the file is written let's email a link to it... - * // write_file contains the filename returned by write_file. - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * } - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - * - * // If you are using a JS minifier that mangles parameter names, `autoInject` - * // will not work with plain functions, since the parameter names will be - * // collapsed to a single letter identifier. To work around this, you can - * // explicitly specify the names of the parameters your task function needs - * // in an array, similar to Angular.js dependency injection. - * - * // This still has an advantage over plain `auto`, since the results a task - * // depends on are still spread into arguments. - * async.autoInject({ - * //... - * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(write_file, callback) { - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * }] - * //... - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - */ -function autoInject(tasks, callback) { - var newTasks = {}; - - Object.keys(tasks).forEach(key => { - var taskFn = tasks[key]; - var params; - var fnIsAsync = (0, _wrapAsync.isAsync)(taskFn); - var hasNoDeps = !fnIsAsync && taskFn.length === 1 || fnIsAsync && taskFn.length === 0; - - if (Array.isArray(taskFn)) { - params = [...taskFn]; - taskFn = params.pop(); - - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - // no dependencies, use the function as-is - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } - - // remove callback param - if (!fnIsAsync) params.pop(); - - newTasks[key] = params.concat(newTask); - } - - function newTask(results, taskCb) { - var newArgs = params.map(name => results[name]); - newArgs.push(taskCb); - (0, _wrapAsync2.default)(taskFn)(...newArgs); - } - }); - - return (0, _auto2.default)(newTasks, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/bower.json b/node_modules/async/bower.json deleted file mode 100644 index 390c650..0000000 --- a/node_modules/async/bower.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "async", - "main": "dist/async.js", - "ignore": [ - "bower_components", - "lib", - "test", - "node_modules", - "perf", - "support", - "**/.*", - "*.config.js", - "*.json", - "index.js", - "Makefile" - ] -} diff --git a/node_modules/async/cargo.js b/node_modules/async/cargo.js deleted file mode 100644 index aa385f8..0000000 --- a/node_modules/async/cargo.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cargo; - -var _queue = require('./internal/queue.js'); - -var _queue2 = _interopRequireDefault(_queue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Creates a `cargo` object with the specified payload. Tasks added to the - * cargo will be processed altogether (up to the `payload` limit). If the - * `worker` is in progress, the task is queued until it becomes available. Once - * the `worker` has completed some tasks, each callback of those tasks is - * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) - * for how `cargo` and `queue` work. - * - * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers - * at a time, cargo passes an array of tasks to a single worker, repeating - * when the worker is finished. - * - * @name cargo - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An asynchronous function for processing an array - * of queued tasks. Invoked with `(tasks, callback)`. - * @param {number} [payload=Infinity] - An optional `integer` for determining - * how many tasks should be processed per round; if omitted, the default is - * unlimited. - * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the cargo and inner queue. - * @example - * - * // create a cargo object with payload 2 - * var cargo = async.cargo(function(tasks, callback) { - * for (var i=0; i { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir) - * .then(results => { - * console.log(results); - * }).catch(err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.concat(directoryList, fs.readdir); - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.concat(withMissingDirectoryList, fs.readdir); - * console.log(results); - * } catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } - * } - * - */ -function concat(coll, iteratee, callback) { - return (0, _concatLimit2.default)(coll, Infinity, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(concat, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/concatLimit.js b/node_modules/async/concatLimit.js deleted file mode 100644 index 3d170f1..0000000 --- a/node_modules/async/concatLimit.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _mapLimit = require('./mapLimit.js'); - -var _mapLimit2 = _interopRequireDefault(_mapLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapLimit - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatLimit(coll, limit, iteratee, callback) { - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { - _iteratee(val, (err, ...args) => { - if (err) return iterCb(err); - return iterCb(err, args); - }); - }, (err, mapResults) => { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = result.concat(...mapResults[i]); - } - } - - return callback(err, result); - }); -} -exports.default = (0, _awaitify2.default)(concatLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/concatSeries.js b/node_modules/async/concatSeries.js deleted file mode 100644 index 84add3b..0000000 --- a/node_modules/async/concatSeries.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _concatLimit = require('./concatLimit.js'); - -var _concatLimit2 = _interopRequireDefault(_concatLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapSeries - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatSeries(coll, iteratee, callback) { - return (0, _concatLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(concatSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/constant.js b/node_modules/async/constant.js deleted file mode 100644 index 0759653..0000000 --- a/node_modules/async/constant.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (...args) { - return function (...ignoredArgs /*, callback*/) { - var callback = ignoredArgs.pop(); - return callback(null, ...args); - }; -}; - -module.exports = exports["default"]; /** - * Returns a function that when called, calls-back with the values provided. - * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to - * [`auto`]{@link module:ControlFlow.auto}. - * - * @name constant - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {...*} arguments... - Any number of arguments to automatically invoke - * callback with. - * @returns {AsyncFunction} Returns a function that when invoked, automatically - * invokes the callback with the previous given arguments. - * @example - * - * async.waterfall([ - * async.constant(42), - * function (value, next) { - * // value === 42 - * }, - * //... - * ], callback); - * - * async.waterfall([ - * async.constant(filename, "utf8"), - * fs.readFile, - * function (fileData, next) { - * //... - * } - * //... - * ], callback); - * - * async.auto({ - * hostname: async.constant("https://server.net/"), - * port: findFreePort, - * launchServer: ["hostname", "port", function (options, cb) { - * startServer(options, cb); - * }], - * //... - * }, callback); - */ \ No newline at end of file diff --git a/node_modules/async/detect.js b/node_modules/async/detect.js deleted file mode 100644 index 05b2e5c..0000000 --- a/node_modules/async/detect.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * } - *); - * - * // Using Promises - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) - * .then(result => { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); - * console.log(result); - * // dir1/file1.txt - * // result now equals the file in the list that exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function detect(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(detect, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/detectLimit.js b/node_modules/async/detectLimit.js deleted file mode 100644 index db6961e..0000000 --- a/node_modules/async/detectLimit.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(detectLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/detectSeries.js b/node_modules/async/detectSeries.js deleted file mode 100644 index b9131b4..0000000 --- a/node_modules/async/detectSeries.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectSeries(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(1), coll, iteratee, callback); -} - -exports.default = (0, _awaitify2.default)(detectSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/dir.js b/node_modules/async/dir.js deleted file mode 100644 index 950d0a2..0000000 --- a/node_modules/async/dir.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _consoleFunc = require('./internal/consoleFunc.js'); - -var _consoleFunc2 = _interopRequireDefault(_consoleFunc); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Logs the result of an [`async` function]{@link AsyncFunction} to the - * `console` using `console.dir` to display the properties of the resulting object. - * Only works in Node.js or in browsers that support `console.dir` and - * `console.error` (such as FF and Chrome). - * If multiple arguments are returned from the async function, - * `console.dir` is called on each argument in order. - * - * @name dir - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, {hello: name}); - * }, 1000); - * }; - * - * // in the node repl - * node> async.dir(hello, 'world'); - * {hello: 'world'} - */ -exports.default = (0, _consoleFunc2.default)('dir'); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/dist/async.js b/node_modules/async/dist/async.js deleted file mode 100644 index 8d5e782..0000000 --- a/node_modules/async/dist/async.js +++ /dev/null @@ -1,6059 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.async = {}))); -}(this, (function (exports) { 'use strict'; - - /** - * Creates a continuation function with some arguments already applied. - * - * Useful as a shorthand when combined with other control flow functions. Any - * arguments passed to the returned function are added to the arguments - * originally passed to apply. - * - * @name apply - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {Function} fn - The function you want to eventually apply all - * arguments to. Invokes with (arguments...). - * @param {...*} arguments... - Any number of arguments to automatically apply - * when the continuation is called. - * @returns {Function} the partially-applied function - * @example - * - * // using apply - * async.parallel([ - * async.apply(fs.writeFile, 'testfile1', 'test1'), - * async.apply(fs.writeFile, 'testfile2', 'test2') - * ]); - * - * - * // the same process without using apply - * async.parallel([ - * function(callback) { - * fs.writeFile('testfile1', 'test1', callback); - * }, - * function(callback) { - * fs.writeFile('testfile2', 'test2', callback); - * } - * ]); - * - * // It's possible to pass any number of additional arguments when calling the - * // continuation: - * - * node> var fn = async.apply(sys.puts, 'one'); - * node> fn('two', 'three'); - * one - * two - * three - */ - function apply(fn, ...args) { - return (...callArgs) => fn(...args,...callArgs); - } - - function initialParams (fn) { - return function (...args/*, callback*/) { - var callback = args.pop(); - return fn.call(this, args, callback); - }; - } - - /* istanbul ignore file */ - - var hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; - var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; - var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; - - function fallback(fn) { - setTimeout(fn, 0); - } - - function wrap(defer) { - return (fn, ...args) => defer(() => fn(...args)); - } - - var _defer; - - if (hasQueueMicrotask) { - _defer = queueMicrotask; - } else if (hasSetImmediate) { - _defer = setImmediate; - } else if (hasNextTick) { - _defer = process.nextTick; - } else { - _defer = fallback; - } - - var setImmediate$1 = wrap(_defer); - - /** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ - function asyncify(func) { - if (isAsync(func)) { - return function (...args/*, callback*/) { - const callback = args.pop(); - const promise = func.apply(this, args); - return handlePromise(promise, callback) - } - } - - return initialParams(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (result && typeof result.then === 'function') { - return handlePromise(result, callback) - } else { - callback(null, result); - } - }); - } - - function handlePromise(promise, callback) { - return promise.then(value => { - invokeCallback(callback, null, value); - }, err => { - invokeCallback(callback, err && err.message ? err : new Error(err)); - }); - } - - function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (err) { - setImmediate$1(e => { throw e }, err); - } - } - - function isAsync(fn) { - return fn[Symbol.toStringTag] === 'AsyncFunction'; - } - - function isAsyncGenerator(fn) { - return fn[Symbol.toStringTag] === 'AsyncGenerator'; - } - - function isAsyncIterable(obj) { - return typeof obj[Symbol.asyncIterator] === 'function'; - } - - function wrapAsync(asyncFn) { - if (typeof asyncFn !== 'function') throw new Error('expected a function') - return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; - } - - // conditionally promisify a function. - // only return a promise if a callback is omitted - function awaitify (asyncFn, arity = asyncFn.length) { - if (!arity) throw new Error('arity is undefined') - function awaitable (...args) { - if (typeof args[arity - 1] === 'function') { - return asyncFn.apply(this, args) - } - - return new Promise((resolve, reject) => { - args[arity - 1] = (err, ...cbArgs) => { - if (err) return reject(err) - resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); - }; - asyncFn.apply(this, args); - }) - } - - return awaitable - } - - function applyEach (eachfn) { - return function applyEach(fns, ...callArgs) { - const go = awaitify(function (callback) { - var that = this; - return eachfn(fns, (fn, cb) => { - wrapAsync(fn).apply(that, callArgs.concat(cb)); - }, callback); - }); - return go; - }; - } - - function _asyncMap(eachfn, arr, iteratee, callback) { - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = wrapAsync(iteratee); - - return eachfn(arr, (value, _, iterCb) => { - var index = counter++; - _iteratee(value, (err, v) => { - results[index] = v; - iterCb(err); - }); - }, err => { - callback(err, results); - }); - } - - function isArrayLike(value) { - return value && - typeof value.length === 'number' && - value.length >= 0 && - value.length % 1 === 0; - } - - // A temporary value used to identify if the loop should be broken. - // See #1064, #1293 - const breakLoop = {}; - - function once(fn) { - function wrapper (...args) { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, args); - } - Object.assign(wrapper, fn); - return wrapper - } - - function getIterator (coll) { - return coll[Symbol.iterator] && coll[Symbol.iterator](); - } - - function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? {value: coll[i], key: i} : null; - } - } - - function createES2015Iterator(iterator) { - var i = -1; - return function next() { - var item = iterator.next(); - if (item.done) - return null; - i++; - return {value: item.value, key: i}; - } - } - - function createObjectIterator(obj) { - var okeys = obj ? Object.keys(obj) : []; - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - if (key === '__proto__') { - return next(); - } - return i < len ? {value: obj[key], key} : null; - }; - } - - function createIterator(coll) { - if (isArrayLike(coll)) { - return createArrayIterator(coll); - } - - var iterator = getIterator(coll); - return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); - } - - function onlyOnce(fn) { - return function (...args) { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, args); - }; - } - - // for async generators - function asyncEachOfLimit(generator, limit, iteratee, callback) { - let done = false; - let canceled = false; - let awaiting = false; - let running = 0; - let idx = 0; - - function replenish() { - //console.log('replenish') - if (running >= limit || awaiting || done) return - //console.log('replenish awaiting') - awaiting = true; - generator.next().then(({value, done: iterDone}) => { - //console.log('got value', value) - if (canceled || done) return - awaiting = false; - if (iterDone) { - done = true; - if (running <= 0) { - //console.log('done nextCb') - callback(null); - } - return; - } - running++; - iteratee(value, idx, iterateeCallback); - idx++; - replenish(); - }).catch(handleError); - } - - function iterateeCallback(err, result) { - //console.log('iterateeCallback') - running -= 1; - if (canceled) return - if (err) return handleError(err) - - if (err === false) { - done = true; - canceled = true; - return - } - - if (result === breakLoop || (done && running <= 0)) { - done = true; - //console.log('done iterCb') - return callback(null); - } - replenish(); - } - - function handleError(err) { - if (canceled) return - awaiting = false; - done = true; - callback(err); - } - - replenish(); - } - - var eachOfLimit = (limit) => { - return (obj, iteratee, callback) => { - callback = once(callback); - if (limit <= 0) { - throw new RangeError('concurrency limit cannot be less than 1') - } - if (!obj) { - return callback(null); - } - if (isAsyncGenerator(obj)) { - return asyncEachOfLimit(obj, limit, iteratee, callback) - } - if (isAsyncIterable(obj)) { - return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback) - } - var nextElem = createIterator(obj); - var done = false; - var canceled = false; - var running = 0; - var looping = false; - - function iterateeCallback(err, value) { - if (canceled) return - running -= 1; - if (err) { - done = true; - callback(err); - } - else if (err === false) { - done = true; - canceled = true; - } - else if (value === breakLoop || (done && running <= 0)) { - done = true; - return callback(null); - } - else if (!looping) { - replenish(); - } - } - - function replenish () { - looping = true; - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); - } - looping = false; - } - - replenish(); - }; - }; - - /** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ - function eachOfLimit$1(coll, limit, iteratee, callback) { - return eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); - } - - var eachOfLimit$2 = awaitify(eachOfLimit$1, 4); - - // eachOf implementation optimized for array-likes - function eachOfArrayLike(coll, iteratee, callback) { - callback = once(callback); - var index = 0, - completed = 0, - {length} = coll, - canceled = false; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err === false) { - canceled = true; - } - if (canceled === true) return - if (err) { - callback(err); - } else if ((++completed === length) || value === breakLoop) { - callback(null); - } - } - - for (; index < length; index++) { - iteratee(coll[index], index, onlyOnce(iteratorCallback)); - } - } - - // a generic version of eachOf which can handle array, object, and iterator cases. - function eachOfGeneric (coll, iteratee, callback) { - return eachOfLimit$2(coll, Infinity, iteratee, callback); - } - - /** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dev.json is a file containing a valid json object config for dev environment - * // dev.json is a file containing a valid json object config for test environment - * // prod.json is a file containing a valid json object config for prod environment - * // invalid.json is a file with a malformed json object - * - * let configs = {}; //global variable - * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; - * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; - * - * // asynchronous function that reads a json file and parses the contents as json object - * function parseFile(file, key, callback) { - * fs.readFile(file, "utf8", function(err, data) { - * if (err) return calback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * } - * - * // Using callbacks - * async.forEachOf(validConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * } else { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * // JSON parse error exception - * } else { - * console.log(configs); - * } - * }); - * - * // Using Promises - * async.forEachOf(validConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * }).catch( err => { - * console.error(err); - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * }).catch( err => { - * console.error(err); - * // JSON parse error exception - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.forEachOf(validConfigFileMap, parseFile); - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * catch (err) { - * console.log(err); - * } - * } - * - * //Error handing - * async () => { - * try { - * let result = await async.forEachOf(invalidConfigFileMap, parseFile); - * console.log(configs); - * } - * catch (err) { - * console.log(err); - * // JSON parse error exception - * } - * } - * - */ - function eachOf(coll, iteratee, callback) { - var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; - return eachOfImplementation(coll, wrapAsync(iteratee), callback); - } - - var eachOf$1 = awaitify(eachOf, 3); - - /** - * Produces a new collection of values by mapping each value in `coll` through - * the `iteratee` function. The `iteratee` is called with an item from `coll` - * and a callback for when it has finished processing. Each of these callbacks - * takes 2 arguments: an `error`, and the transformed item from `coll`. If - * `iteratee` passes an error to its callback, the main `callback` (for the - * `map` function) is immediately called with the error. - * - * Note, that since this function applies the `iteratee` to each item in - * parallel, there is no guarantee that the `iteratee` functions will complete - * in order. However, the results array will be in the same order as the - * original `coll`. - * - * If `map` is passed an Object, the results will be an Array. The results - * will roughly be in the order of the original Objects' keys (but this can - * vary across JavaScript engines). - * - * @name map - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an Array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.map(fileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.map(fileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.map(fileList, getFileSizeInBytes); - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.map(withMissingFileList, getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ - function map (coll, iteratee, callback) { - return _asyncMap(eachOf$1, coll, iteratee, callback) - } - var map$1 = awaitify(map, 3); - - /** - * Applies the provided arguments to each function in the array, calling - * `callback` after all functions have completed. If you only provide the first - * argument, `fns`, then it will return a function which lets you pass in the - * arguments as if it were a single function call. If more arguments are - * provided, `callback` is required while `args` is still optional. The results - * for each of the applied async functions are passed to the final callback - * as an array. - * - * @name applyEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s - * to all call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - Returns a function that takes no args other than - * an optional callback, that is the result of applying the `args` to each - * of the functions. - * @example - * - * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') - * - * appliedFn((err, results) => { - * // results[0] is the results for `enableSearch` - * // results[1] is the results for `updateSchema` - * }); - * - * // partial application example: - * async.each( - * buckets, - * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), - * callback - * ); - */ - var applyEach$1 = applyEach(map$1); - - /** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. - * - * @name eachOfSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ - function eachOfSeries(coll, iteratee, callback) { - return eachOfLimit$2(coll, 1, iteratee, callback) - } - var eachOfSeries$1 = awaitify(eachOfSeries, 3); - - /** - * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. - * - * @name mapSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ - function mapSeries (coll, iteratee, callback) { - return _asyncMap(eachOfSeries$1, coll, iteratee, callback) - } - var mapSeries$1 = awaitify(mapSeries, 3); - - /** - * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. - * - * @name applyEachSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.applyEach]{@link module:ControlFlow.applyEach} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all - * call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - A function, that when called, is the result of - * appling the `args` to the list of functions. It takes no args, other than - * a callback. - */ - var applyEachSeries = applyEach(mapSeries$1); - - const PROMISE_SYMBOL = Symbol('promiseCallback'); - - function promiseCallback () { - let resolve, reject; - function callback (err, ...args) { - if (err) return reject(err) - resolve(args.length > 1 ? args : args[0]); - } - - callback[PROMISE_SYMBOL] = new Promise((res, rej) => { - resolve = res, - reject = rej; - }); - - return callback - } - - /** - * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on - * their requirements. Each function can optionally depend on other functions - * being completed first, and each function is run as soon as its requirements - * are satisfied. - * - * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence - * will stop. Further tasks will not execute (so any other functions depending - * on it will not run), and the main `callback` is immediately called with the - * error. - * - * {@link AsyncFunction}s also receive an object containing the results of functions which - * have completed so far as the first argument, if they have dependencies. If a - * task function has no dependencies, it will only be passed a callback. - * - * @name auto - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Object} tasks - An object. Each of its properties is either a - * function or an array of requirements, with the {@link AsyncFunction} itself the last item - * in the array. The object's key of a property serves as the name of the task - * defined by that property, i.e. can be used when specifying requirements for - * other tasks. The function receives one or two arguments: - * * a `results` object, containing the results of the previously executed - * functions, only passed if the task has any dependencies, - * * a `callback(err, result)` function, which must be called when finished, - * passing an `error` (which can be `null`) and the result of the function's - * execution. - * @param {number} [concurrency=Infinity] - An optional `integer` for - * determining the maximum number of tasks that can be run in parallel. By - * default, as many as possible. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback. Results are always returned; however, if an - * error occurs, no further `tasks` will be performed, and the results object - * will only contain partial results. Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * @example - * - * //Using Callbacks - * async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }, function(err, results) { - * if (err) { - * console.log('err = ', err); - * } - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }); - * - * //Using Promises - * async.auto({ - * get_data: function(callback) { - * console.log('in get_data'); - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * console.log('in make_folder'); - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }).then(results => { - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }).catch(err => { - * console.log('err = ', err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }); - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function auto(tasks, concurrency, callback) { - if (typeof concurrency !== 'number') { - // concurrency is optional, shift the args. - callback = concurrency; - concurrency = null; - } - callback = once(callback || promiseCallback()); - var numTasks = Object.keys(tasks).length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; - } - - var results = {}; - var runningTasks = 0; - var canceled = false; - var hasError = false; - - var listeners = Object.create(null); - - var readyTasks = []; - - // for cycle detection: - var readyToCheck = []; // tasks that have been identified as reachable - // without the possibility of returning to an ancestor task - var uncheckedDependencies = {}; - - Object.keys(tasks).forEach(key => { - var task = tasks[key]; - if (!Array.isArray(task)) { - // no dependencies - enqueueTask(key, [task]); - readyToCheck.push(key); - return; - } - - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; - } - uncheckedDependencies[key] = remainingDependencies; - - dependencies.forEach(dependencyName => { - if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + - '` has a non-existent dependency `' + - dependencyName + '` in ' + - dependencies.join(', ')); - } - addListener(dependencyName, () => { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); - - checkForDeadlocks(); - processQueue(); - - function enqueueTask(key, task) { - readyTasks.push(() => runTask(key, task)); - } - - function processQueue() { - if (canceled) return - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while(readyTasks.length && runningTasks < concurrency) { - var run = readyTasks.shift(); - run(); - } - - } - - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } - - taskListeners.push(fn); - } - - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - taskListeners.forEach(fn => fn()); - processQueue(); - } - - - function runTask(key, task) { - if (hasError) return; - - var taskCallback = onlyOnce((err, ...result) => { - runningTasks--; - if (err === false) { - canceled = true; - return - } - if (result.length < 2) { - [result] = result; - } - if (err) { - var safeResults = {}; - Object.keys(results).forEach(rkey => { - safeResults[rkey] = results[rkey]; - }); - safeResults[key] = result; - hasError = true; - listeners = Object.create(null); - if (canceled) return - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); - - runningTasks++; - var taskFn = wrapAsync(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } - } - - function checkForDeadlocks() { - // Kahn's algorithm - // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm - // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - getDependents(currentTask).forEach(dependent => { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } - - if (counter !== numTasks) { - throw new Error( - 'async.auto cannot execute tasks due to a recursive dependency' - ); - } - } - - function getDependents(taskName) { - var result = []; - Object.keys(tasks).forEach(key => { - const task = tasks[key]; - if (Array.isArray(task) && task.indexOf(taskName) >= 0) { - result.push(key); - } - }); - return result; - } - - return callback[PROMISE_SYMBOL] - } - - var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; - var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; - var FN_ARG_SPLIT = /,/; - var FN_ARG = /(=.+)?(\s*)$/; - - function stripComments(string) { - let stripped = ''; - let index = 0; - let endBlockComment = string.indexOf('*/'); - while (index < string.length) { - if (string[index] === '/' && string[index+1] === '/') { - // inline comment - let endIndex = string.indexOf('\n', index); - index = (endIndex === -1) ? string.length : endIndex; - } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) { - // block comment - let endIndex = string.indexOf('*/', index); - if (endIndex !== -1) { - index = endIndex + 2; - endBlockComment = string.indexOf('*/', index); - } else { - stripped += string[index]; - index++; - } - } else { - stripped += string[index]; - index++; - } - } - return stripped; - } - - function parseParams(func) { - const src = stripComments(func.toString()); - let match = src.match(FN_ARGS); - if (!match) { - match = src.match(ARROW_FN_ARGS); - } - if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src) - let [, args] = match; - return args - .replace(/\s/g, '') - .split(FN_ARG_SPLIT) - .map((arg) => arg.replace(FN_ARG, '').trim()); - } - - /** - * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent - * tasks are specified as parameters to the function, after the usual callback - * parameter, with the parameter names matching the names of the tasks it - * depends on. This can provide even more readable task graphs which can be - * easier to maintain. - * - * If a final callback is specified, the task results are similarly injected, - * specified as named parameters after the initial error parameter. - * - * The autoInject function is purely syntactic sugar and its semantics are - * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. - * - * @name autoInject - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.auto]{@link module:ControlFlow.auto} - * @category Control Flow - * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of - * the form 'func([dependencies...], callback). The object's key of a property - * serves as the name of the task defined by that property, i.e. can be used - * when specifying requirements for other tasks. - * * The `callback` parameter is a `callback(err, result)` which must be called - * when finished, passing an `error` (which can be `null`) and the result of - * the function's execution. The remaining parameters name other tasks on - * which the task is dependent, and the results from those tasks are the - * arguments of those parameters. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback, and a `results` object with any completed - * task results, similar to `auto`. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // The example from `auto` can be rewritten as follows: - * async.autoInject({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: function(get_data, make_folder, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }, - * email_link: function(write_file, callback) { - * // once the file is written let's email a link to it... - * // write_file contains the filename returned by write_file. - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * } - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - * - * // If you are using a JS minifier that mangles parameter names, `autoInject` - * // will not work with plain functions, since the parameter names will be - * // collapsed to a single letter identifier. To work around this, you can - * // explicitly specify the names of the parameters your task function needs - * // in an array, similar to Angular.js dependency injection. - * - * // This still has an advantage over plain `auto`, since the results a task - * // depends on are still spread into arguments. - * async.autoInject({ - * //... - * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(write_file, callback) { - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * }] - * //... - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - */ - function autoInject(tasks, callback) { - var newTasks = {}; - - Object.keys(tasks).forEach(key => { - var taskFn = tasks[key]; - var params; - var fnIsAsync = isAsync(taskFn); - var hasNoDeps = - (!fnIsAsync && taskFn.length === 1) || - (fnIsAsync && taskFn.length === 0); - - if (Array.isArray(taskFn)) { - params = [...taskFn]; - taskFn = params.pop(); - - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - // no dependencies, use the function as-is - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } - - // remove callback param - if (!fnIsAsync) params.pop(); - - newTasks[key] = params.concat(newTask); - } - - function newTask(results, taskCb) { - var newArgs = params.map(name => results[name]); - newArgs.push(taskCb); - wrapAsync(taskFn)(...newArgs); - } - }); - - return auto(newTasks, callback); - } - - // Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation - // used for queues. This implementation assumes that the node provided by the user can be modified - // to adjust the next and last properties. We implement only the minimal functionality - // for queue support. - class DLL { - constructor() { - this.head = this.tail = null; - this.length = 0; - } - - removeLink(node) { - if (node.prev) node.prev.next = node.next; - else this.head = node.next; - if (node.next) node.next.prev = node.prev; - else this.tail = node.prev; - - node.prev = node.next = null; - this.length -= 1; - return node; - } - - empty () { - while(this.head) this.shift(); - return this; - } - - insertAfter(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode; - else this.tail = newNode; - node.next = newNode; - this.length += 1; - } - - insertBefore(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode; - else this.head = newNode; - node.prev = newNode; - this.length += 1; - } - - unshift(node) { - if (this.head) this.insertBefore(this.head, node); - else setInitial(this, node); - } - - push(node) { - if (this.tail) this.insertAfter(this.tail, node); - else setInitial(this, node); - } - - shift() { - return this.head && this.removeLink(this.head); - } - - pop() { - return this.tail && this.removeLink(this.tail); - } - - toArray() { - return [...this] - } - - *[Symbol.iterator] () { - var cur = this.head; - while (cur) { - yield cur.data; - cur = cur.next; - } - } - - remove (testFn) { - var curr = this.head; - while(curr) { - var {next} = curr; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; - } - return this; - } - } - - function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; - } - - function queue(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; - } - else if(concurrency === 0) { - throw new RangeError('Concurrency must not be zero'); - } - - var _worker = wrapAsync(worker); - var numRunning = 0; - var workersList = []; - const events = { - error: [], - drain: [], - saturated: [], - unsaturated: [], - empty: [] - }; - - function on (event, handler) { - events[event].push(handler); - } - - function once (event, handler) { - const handleAndRemove = (...args) => { - off(event, handleAndRemove); - handler(...args); - }; - events[event].push(handleAndRemove); - } - - function off (event, handler) { - if (!event) return Object.keys(events).forEach(ev => events[ev] = []) - if (!handler) return events[event] = [] - events[event] = events[event].filter(ev => ev !== handler); - } - - function trigger (event, ...args) { - events[event].forEach(handler => handler(...args)); - } - - var processingScheduled = false; - function _insert(data, insertAtFront, rejectOnError, callback) { - if (callback != null && typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - - var res, rej; - function promiseCallback (err, ...args) { - // we don't care about the error, let the global error handler - // deal with it - if (err) return rejectOnError ? rej(err) : res() - if (args.length <= 1) return res(args[0]) - res(args); - } - - var item = q._createTaskItem( - data, - rejectOnError ? promiseCallback : - (callback || promiseCallback) - ); - - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } - - if (!processingScheduled) { - processingScheduled = true; - setImmediate$1(() => { - processingScheduled = false; - q.process(); - }); - } - - if (rejectOnError || !callback) { - return new Promise((resolve, reject) => { - res = resolve; - rej = reject; - }) - } - } - - function _createCB(tasks) { - return function (err, ...args) { - numRunning -= 1; - - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; - - var index = workersList.indexOf(task); - if (index === 0) { - workersList.shift(); - } else if (index > 0) { - workersList.splice(index, 1); - } - - task.callback(err, ...args); - - if (err != null) { - trigger('error', err, task.data); - } - } - - if (numRunning <= (q.concurrency - q.buffer) ) { - trigger('unsaturated'); - } - - if (q.idle()) { - trigger('drain'); - } - q.process(); - }; - } - - function _maybeDrain(data) { - if (data.length === 0 && q.idle()) { - // call drain immediately if there are no tasks - setImmediate$1(() => trigger('drain')); - return true - } - return false - } - - const eventMethod = (name) => (handler) => { - if (!handler) { - return new Promise((resolve, reject) => { - once(name, (err, data) => { - if (err) return reject(err) - resolve(data); - }); - }) - } - off(name); - on(name, handler); - - }; - - var isProcessing = false; - var q = { - _tasks: new DLL(), - _createTaskItem (data, callback) { - return { - data, - callback - }; - }, - *[Symbol.iterator] () { - yield* q._tasks[Symbol.iterator](); - }, - concurrency, - payload, - buffer: concurrency / 4, - started: false, - paused: false, - push (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, false, false, callback)) - } - return _insert(data, false, false, callback); - }, - pushAsync (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, false, true, callback)) - } - return _insert(data, false, true, callback); - }, - kill () { - off(); - q._tasks.empty(); - }, - unshift (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, true, false, callback)) - } - return _insert(data, true, false, callback); - }, - unshiftAsync (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, true, true, callback)) - } - return _insert(data, true, true, callback); - }, - remove (testFn) { - q._tasks.remove(testFn); - }, - process () { - // Avoid trying to start too many processing operations. This can occur - // when callbacks resolve synchronously (#1267). - if (isProcessing) { - return; - } - isProcessing = true; - while(!q.paused && numRunning < q.concurrency && q._tasks.length){ - var tasks = [], data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - - numRunning += 1; - - if (q._tasks.length === 0) { - trigger('empty'); - } - - if (numRunning === q.concurrency) { - trigger('saturated'); - } - - var cb = onlyOnce(_createCB(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length () { - return q._tasks.length; - }, - running () { - return numRunning; - }, - workersList () { - return workersList; - }, - idle() { - return q._tasks.length + numRunning === 0; - }, - pause () { - q.paused = true; - }, - resume () { - if (q.paused === false) { return; } - q.paused = false; - setImmediate$1(q.process); - } - }; - // define these as fixed properties, so people get useful errors when updating - Object.defineProperties(q, { - saturated: { - writable: false, - value: eventMethod('saturated') - }, - unsaturated: { - writable: false, - value: eventMethod('unsaturated') - }, - empty: { - writable: false, - value: eventMethod('empty') - }, - drain: { - writable: false, - value: eventMethod('drain') - }, - error: { - writable: false, - value: eventMethod('error') - }, - }); - return q; - } - - /** - * Creates a `cargo` object with the specified payload. Tasks added to the - * cargo will be processed altogether (up to the `payload` limit). If the - * `worker` is in progress, the task is queued until it becomes available. Once - * the `worker` has completed some tasks, each callback of those tasks is - * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) - * for how `cargo` and `queue` work. - * - * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers - * at a time, cargo passes an array of tasks to a single worker, repeating - * when the worker is finished. - * - * @name cargo - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An asynchronous function for processing an array - * of queued tasks. Invoked with `(tasks, callback)`. - * @param {number} [payload=Infinity] - An optional `integer` for determining - * how many tasks should be processed per round; if omitted, the default is - * unlimited. - * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the cargo and inner queue. - * @example - * - * // create a cargo object with payload 2 - * var cargo = async.cargo(function(tasks, callback) { - * for (var i=0; i { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ - function reduce(coll, memo, iteratee, callback) { - callback = once(callback); - var _iteratee = wrapAsync(iteratee); - return eachOfSeries$1(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); - } - var reduce$1 = awaitify(reduce, 4); - - /** - * Version of the compose function that is more natural to read. Each function - * consumes the return value of the previous function. It is the equivalent of - * [compose]{@link module:ControlFlow.compose} with the arguments reversed. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name seq - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.compose]{@link module:ControlFlow.compose} - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} a function that composes the `functions` in order - * @example - * - * // Requires lodash (or underscore), express3 and dresende's orm2. - * // Part of an app, that fetches cats of the logged user. - * // This example uses `seq` function to avoid overnesting and error - * // handling clutter. - * app.get('/cats', function(request, response) { - * var User = request.models.User; - * async.seq( - * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) - * function(user, fn) { - * user.getCats(fn); // 'getCats' has signature (callback(err, data)) - * } - * )(req.session.user_id, function (err, cats) { - * if (err) { - * console.error(err); - * response.json({ status: 'error', message: err.message }); - * } else { - * response.json({ status: 'ok', message: 'Cats found', data: cats }); - * } - * }); - * }); - */ - function seq(...functions) { - var _functions = functions.map(wrapAsync); - return function (...args) { - var that = this; - - var cb = args[args.length - 1]; - if (typeof cb == 'function') { - args.pop(); - } else { - cb = promiseCallback(); - } - - reduce$1(_functions, args, (newargs, fn, iterCb) => { - fn.apply(that, newargs.concat((err, ...nextargs) => { - iterCb(err, nextargs); - })); - }, - (err, results) => cb(err, ...results)); - - return cb[PROMISE_SYMBOL] - }; - } - - /** - * Creates a function which is a composition of the passed asynchronous - * functions. Each function consumes the return value of the function that - * follows. Composing functions `f()`, `g()`, and `h()` would produce the result - * of `f(g(h()))`, only this version uses callbacks to obtain the return values. - * - * If the last argument to the composed function is not a function, a promise - * is returned when you call it. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name compose - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} an asynchronous function that is the composed - * asynchronous `functions` - * @example - * - * function add1(n, callback) { - * setTimeout(function () { - * callback(null, n + 1); - * }, 10); - * } - * - * function mul3(n, callback) { - * setTimeout(function () { - * callback(null, n * 3); - * }, 10); - * } - * - * var add1mul3 = async.compose(mul3, add1); - * add1mul3(4, function (err, result) { - * // result now equals 15 - * }); - */ - function compose(...args) { - return seq(...args.reverse()); - } - - /** - * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. - * - * @name mapLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ - function mapLimit (coll, limit, iteratee, callback) { - return _asyncMap(eachOfLimit(limit), coll, iteratee, callback) - } - var mapLimit$1 = awaitify(mapLimit, 4); - - /** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapLimit - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ - function concatLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, ...args) => { - if (err) return iterCb(err); - return iterCb(err, args); - }); - }, (err, mapResults) => { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = result.concat(...mapResults[i]); - } - } - - return callback(err, result); - }); - } - var concatLimit$1 = awaitify(concatLimit, 4); - - /** - * Applies `iteratee` to each item in `coll`, concatenating the results. Returns - * the concatenated list. The `iteratee`s are called in parallel, and the - * results are concatenated as they return. The results array will be returned in - * the original order of `coll` passed to the `iteratee` function. - * - * @name concat - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @alias flatMap - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * let directoryList = ['dir1','dir2','dir3']; - * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; - * - * // Using callbacks - * async.concat(directoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.concat(directoryList, fs.readdir) - * .then(results => { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir) - * .then(results => { - * console.log(results); - * }).catch(err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.concat(directoryList, fs.readdir); - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.concat(withMissingDirectoryList, fs.readdir); - * console.log(results); - * } catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } - * } - * - */ - function concat(coll, iteratee, callback) { - return concatLimit$1(coll, Infinity, iteratee, callback) - } - var concat$1 = awaitify(concat, 3); - - /** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapSeries - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ - function concatSeries(coll, iteratee, callback) { - return concatLimit$1(coll, 1, iteratee, callback) - } - var concatSeries$1 = awaitify(concatSeries, 3); - - /** - * Returns a function that when called, calls-back with the values provided. - * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to - * [`auto`]{@link module:ControlFlow.auto}. - * - * @name constant - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {...*} arguments... - Any number of arguments to automatically invoke - * callback with. - * @returns {AsyncFunction} Returns a function that when invoked, automatically - * invokes the callback with the previous given arguments. - * @example - * - * async.waterfall([ - * async.constant(42), - * function (value, next) { - * // value === 42 - * }, - * //... - * ], callback); - * - * async.waterfall([ - * async.constant(filename, "utf8"), - * fs.readFile, - * function (fileData, next) { - * //... - * } - * //... - * ], callback); - * - * async.auto({ - * hostname: async.constant("https://server.net/"), - * port: findFreePort, - * launchServer: ["hostname", "port", function (options, cb) { - * startServer(options, cb); - * }], - * //... - * }, callback); - */ - function constant(...args) { - return function (...ignoredArgs/*, callback*/) { - var callback = ignoredArgs.pop(); - return callback(null, ...args); - }; - } - - function _createTester(check, getResult) { - return (eachfn, arr, _iteratee, cb) => { - var testPassed = false; - var testResult; - const iteratee = wrapAsync(_iteratee); - eachfn(arr, (value, _, callback) => { - iteratee(value, (err, result) => { - if (err || err === false) return callback(err); - - if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - return callback(null, breakLoop); - } - callback(); - }); - }, err => { - if (err) return cb(err); - cb(null, testPassed ? testResult : getResult(false)); - }); - }; - } - - /** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * } - *); - * - * // Using Promises - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) - * .then(result => { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); - * console.log(result); - * // dir1/file1.txt - * // result now equals the file in the list that exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function detect(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback) - } - var detect$1 = awaitify(detect, 3); - - /** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ - function detectLimit(coll, limit, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit(limit), coll, iteratee, callback) - } - var detectLimit$1 = awaitify(detectLimit, 4); - - /** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ - function detectSeries(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback) - } - - var detectSeries$1 = awaitify(detectSeries, 3); - - function consoleFunc(name) { - return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { - /* istanbul ignore else */ - if (typeof console === 'object') { - /* istanbul ignore else */ - if (err) { - /* istanbul ignore else */ - if (console.error) { - console.error(err); - } - } else if (console[name]) { /* istanbul ignore else */ - resultArgs.forEach(x => console[name](x)); - } - } - }) - } - - /** - * Logs the result of an [`async` function]{@link AsyncFunction} to the - * `console` using `console.dir` to display the properties of the resulting object. - * Only works in Node.js or in browsers that support `console.dir` and - * `console.error` (such as FF and Chrome). - * If multiple arguments are returned from the async function, - * `console.dir` is called on each argument in order. - * - * @name dir - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, {hello: name}); - * }, 1000); - * }; - * - * // in the node repl - * node> async.dir(hello, 'world'); - * {hello: 'world'} - */ - var dir = consoleFunc('dir'); - - /** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ - function doWhilst(iteratee, test, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results; - - function next(err, ...args) { - if (err) return callback(err); - if (err === false) return; - results = args; - _test(...args, check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return check(null, true); - } - - var doWhilst$1 = awaitify(doWhilst, 3); - - /** - * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the - * argument ordering differs from `until`. - * - * @name doUntil - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee` - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ - function doUntil(iteratee, test, callback) { - const _test = wrapAsync(test); - return doWhilst$1(iteratee, (...args) => { - const cb = args.pop(); - _test(...args, (err, truth) => cb (err, !truth)); - }, callback); - } - - function _withoutIndex(iteratee) { - return (value, index, callback) => iteratee(value, callback); - } - - /** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; - * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; - * - * // asynchronous function that deletes a file - * const deleteFile = function(file, callback) { - * fs.unlink(file, callback); - * }; - * - * // Using callbacks - * async.each(fileList, deleteFile, function(err) { - * if( err ) { - * console.log(err); - * } else { - * console.log('All files have been deleted successfully'); - * } - * }); - * - * // Error Handling - * async.each(withMissingFileList, deleteFile, function(err){ - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using Promises - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using async/await - * async () => { - * try { - * await async.each(files, deleteFile); - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * await async.each(withMissingFileList, deleteFile); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * } - * } - * - */ - function eachLimit(coll, iteratee, callback) { - return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); - } - - var each = awaitify(eachLimit, 3); - - /** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ - function eachLimit$1(coll, limit, iteratee, callback) { - return eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); - } - var eachLimit$2 = awaitify(eachLimit$1, 4); - - /** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item - * in series and therefore the iteratee functions will complete in order. - - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ - function eachSeries(coll, iteratee, callback) { - return eachLimit$2(coll, 1, iteratee, callback) - } - var eachSeries$1 = awaitify(eachSeries, 3); - - /** - * Wrap an async function and ensure it calls its callback on a later tick of - * the event loop. If the function already calls its callback on a next tick, - * no extra deferral is added. This is useful for preventing stack overflows - * (`RangeError: Maximum call stack size exceeded`) and generally keeping - * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - * contained. ES2017 `async` functions are returned as-is -- they are immune - * to Zalgo's corrupting influences, as they always resolve on a later tick. - * - * @name ensureAsync - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - an async function, one that expects a node-style - * callback as its last argument. - * @returns {AsyncFunction} Returns a wrapped function with the exact same call - * signature as the function passed in. - * @example - * - * function sometimesAsync(arg, callback) { - * if (cache[arg]) { - * return callback(null, cache[arg]); // this would be synchronous!! - * } else { - * doSomeIO(arg, callback); // this IO would be asynchronous - * } - * } - * - * // this has a risk of stack overflows if many results are cached in a row - * async.mapSeries(args, sometimesAsync, done); - * - * // this will defer sometimesAsync's callback if necessary, - * // preventing stack overflows - * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); - */ - function ensureAsync(fn) { - if (isAsync(fn)) return fn; - return function (...args/*, callback*/) { - var callback = args.pop(); - var sync = true; - args.push((...innerArgs) => { - if (sync) { - setImmediate$1(() => callback(...innerArgs)); - } else { - callback(...innerArgs); - } - }); - fn.apply(this, args); - sync = false; - }; - } - - /** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.every(fileList, fileExists, function(err, result) { - * console.log(result); - * // true - * // result is true since every file exists - * }); - * - * async.every(withMissingFileList, fileExists, function(err, result) { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }); - * - * // Using Promises - * async.every(fileList, fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.every(withMissingFileList, fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.every(fileList, fileExists); - * console.log(result); - * // true - * // result is true since every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.every(withMissingFileList, fileExists); - * console.log(result); - * // false - * // result is false since NOT every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function every(coll, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback) - } - var every$1 = awaitify(every, 3); - - /** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ - function everyLimit(coll, limit, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfLimit(limit), coll, iteratee, callback) - } - var everyLimit$1 = awaitify(everyLimit, 4); - - /** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ - function everySeries(coll, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback) - } - var everySeries$1 = awaitify(everySeries, 3); - - function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, (x, index, iterCb) => { - iteratee(x, (err, v) => { - truthValues[index] = !!v; - iterCb(err); - }); - }, err => { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); - } - - function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, (x, index, iterCb) => { - iteratee(x, (err, v) => { - if (err) return iterCb(err); - if (v) { - results.push({index, value: x}); - } - iterCb(err); - }); - }, err => { - if (err) return callback(err); - callback(null, results - .sort((a, b) => a.index - b.index) - .map(v => v.value)); - }); - } - - function _filter(eachfn, coll, iteratee, callback) { - var filter = isArrayLike(coll) ? filterArray : filterGeneric; - return filter(eachfn, coll, wrapAsync(iteratee), callback); - } - - /** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.filter(files, fileExists, function(err, results) { - * if(err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * }); - * - * // Using Promises - * async.filter(files, fileExists) - * .then(results => { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.filter(files, fileExists); - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function filter (coll, iteratee, callback) { - return _filter(eachOf$1, coll, iteratee, callback) - } - var filter$1 = awaitify(filter, 3); - - /** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - */ - function filterLimit (coll, limit, iteratee, callback) { - return _filter(eachOfLimit(limit), coll, iteratee, callback) - } - var filterLimit$1 = awaitify(filterLimit, 4); - - /** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - * @returns {Promise} a promise, if no callback provided - */ - function filterSeries (coll, iteratee, callback) { - return _filter(eachOfSeries$1, coll, iteratee, callback) - } - var filterSeries$1 = awaitify(filterSeries, 3); - - /** - * Calls the asynchronous function `fn` with a callback parameter that allows it - * to call itself again, in series, indefinitely. - - * If an error is passed to the callback then `errback` is called with the - * error, and execution stops, otherwise it will never be called. - * - * @name forever - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} fn - an async function to call repeatedly. - * Invoked with (next). - * @param {Function} [errback] - when `fn` passes an error to it's callback, - * this function will be called, and execution stops. Invoked with (err). - * @returns {Promise} a promise that rejects if an error occurs and an errback - * is not passed - * @example - * - * async.forever( - * function(next) { - * // next is suitable for passing to things that need a callback(err [, whatever]); - * // it will result in this function being called again. - * }, - * function(err) { - * // if next is called with a value in its first parameter, it will appear - * // in here as 'err', and execution will stop. - * } - * ); - */ - function forever(fn, errback) { - var done = onlyOnce(errback); - var task = wrapAsync(ensureAsync(fn)); - - function next(err) { - if (err) return done(err); - if (err === false) return; - task(next); - } - return next(); - } - var forever$1 = awaitify(forever, 2); - - /** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. - * - * @name groupByLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ - function groupByLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, key) => { - if (err) return iterCb(err); - return iterCb(err, {key, val}); - }); - }, (err, mapResults) => { - var result = {}; - // from MDN, handle object having an `hasOwnProperty` prop - var {hasOwnProperty} = Object.prototype; - - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var {key} = mapResults[i]; - var {val} = mapResults[i]; - - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } - } - } - - return callback(err, result); - }); - } - - var groupByLimit$1 = awaitify(groupByLimit, 4); - - /** - * Returns a new object, where each value corresponds to an array of items, from - * `coll`, that returned the corresponding key. That is, the keys of the object - * correspond to the values passed to the `iteratee` callback. - * - * Note: Since this function applies the `iteratee` to each item in parallel, - * there is no guarantee that the `iteratee` functions will complete in order. - * However, the values for each key in the `result` will be in the same order as - * the original `coll`. For Objects, the values will roughly be in the order of - * the original Objects' keys (but this can vary across JavaScript engines). - * - * @name groupBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const files = ['dir1/file1.txt','dir2','dir4'] - * - * // asynchronous function that detects file type as none, file, or directory - * function detectFile(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(null, 'none'); - * } - * callback(null, stat.isDirectory() ? 'directory' : 'file'); - * }); - * } - * - * //Using callbacks - * async.groupBy(files, detectFile, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * }); - * - * // Using Promises - * async.groupBy(files, detectFile) - * .then( result => { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.groupBy(files, detectFile); - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function groupBy (coll, iteratee, callback) { - return groupByLimit$1(coll, Infinity, iteratee, callback) - } - - /** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. - * - * @name groupBySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whose - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ - function groupBySeries (coll, iteratee, callback) { - return groupByLimit$1(coll, 1, iteratee, callback) - } - - /** - * Logs the result of an `async` function to the `console`. Only works in - * Node.js or in browsers that support `console.log` and `console.error` (such - * as FF and Chrome). If multiple arguments are returned from the async - * function, `console.log` is called on each argument in order. - * - * @name log - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, 'hello ' + name); - * }, 1000); - * }; - * - * // in the node repl - * node> async.log(hello, 'world'); - * 'hello world' - */ - var log = consoleFunc('log'); - - /** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a - * time. - * - * @name mapValuesLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ - function mapValuesLimit(obj, limit, iteratee, callback) { - callback = once(callback); - var newObj = {}; - var _iteratee = wrapAsync(iteratee); - return eachOfLimit(limit)(obj, (val, key, next) => { - _iteratee(val, key, (err, result) => { - if (err) return next(err); - newObj[key] = result; - next(err); - }); - }, err => callback(err, newObj)); - } - - var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); - - /** - * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. - * - * Produces a new Object by mapping each value of `obj` through the `iteratee` - * function. The `iteratee` is called each `value` and `key` from `obj` and a - * callback for when it has finished processing. Each of these callbacks takes - * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` - * passes an error to its callback, the main `callback` (for the `mapValues` - * function) is immediately called with the error. - * - * Note, the order of the keys in the result is not guaranteed. The keys will - * be roughly in the order they complete, (but this is very engine-specific) - * - * @name mapValues - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file3.txt' - * }; - * - * const withMissingFileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file4.txt' - * }; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, key, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * }); - * - * // Error handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.mapValues(fileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * }).catch (err => { - * console.log(err); - * }); - * - * // Error Handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch (err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.mapValues(fileMap, getFileSizeInBytes); - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ - function mapValues(obj, iteratee, callback) { - return mapValuesLimit$1(obj, Infinity, iteratee, callback) - } - - /** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. - * - * @name mapValuesSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ - function mapValuesSeries(obj, iteratee, callback) { - return mapValuesLimit$1(obj, 1, iteratee, callback) - } - - /** - * Caches the results of an async function. When creating a hash to store - * function results against, the callback is omitted from the hash and an - * optional hash function can be used. - * - * **Note: if the async function errs, the result will not be cached and - * subsequent calls will call the wrapped function.** - * - * If no hash function is specified, the first argument is used as a hash key, - * which may work reasonably if it is a string or a data type that converts to a - * distinct string. Note that objects and arrays will not behave reasonably. - * Neither will cases where the other arguments are significant. In such cases, - * specify your own hash function. - * - * The cache of results is exposed as the `memo` property of the function - * returned by `memoize`. - * - * @name memoize - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function to proxy and cache results from. - * @param {Function} hasher - An optional function for generating a custom hash - * for storing results. It has all the arguments applied to it apart from the - * callback, and must be synchronous. - * @returns {AsyncFunction} a memoized version of `fn` - * @example - * - * var slow_fn = function(name, callback) { - * // do something - * callback(null, result); - * }; - * var fn = async.memoize(slow_fn); - * - * // fn can now be used as if it were slow_fn - * fn('some name', function() { - * // callback - * }); - */ - function memoize(fn, hasher = v => v) { - var memo = Object.create(null); - var queues = Object.create(null); - var _fn = wrapAsync(fn); - var memoized = initialParams((args, callback) => { - var key = hasher(...args); - if (key in memo) { - setImmediate$1(() => callback(null, ...memo[key])); - } else if (key in queues) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn(...args, (err, ...resultArgs) => { - // #1465 don't memoize if an error occurred - if (!err) { - memo[key] = resultArgs; - } - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i](err, ...resultArgs); - } - }); - } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; - } - - /* istanbul ignore file */ - - /** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `process.nextTick`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name nextTick - * @static - * @memberOf module:Utils - * @method - * @see [async.setImmediate]{@link module:Utils.setImmediate} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ - var _defer$1; - - if (hasNextTick) { - _defer$1 = process.nextTick; - } else if (hasSetImmediate) { - _defer$1 = setImmediate; - } else { - _defer$1 = fallback; - } - - var nextTick = wrap(_defer$1); - - var parallel = awaitify((eachfn, tasks, callback) => { - var results = isArrayLike(tasks) ? [] : {}; - - eachfn(tasks, (task, key, taskCb) => { - wrapAsync(task)((err, ...result) => { - if (result.length < 2) { - [result] = result; - } - results[key] = result; - taskCb(err); - }); - }, err => callback(err, results)); - }, 3); - - /** - * Run the `tasks` collection of functions in parallel, without waiting until - * the previous function has completed. If any of the functions pass an error to - * its callback, the main `callback` is immediately called with the value of the - * error. Once the `tasks` have completed, the results are passed to the final - * `callback` as an array. - * - * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about - * parallel execution of code. If your tasks do not use any timers or perform - * any I/O, they will actually be executed in series. Any synchronous setup - * sections for each task will happen one after the other. JavaScript remains - * single-threaded. - * - * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the - * execution of other tasks when a task fails. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.parallel}. - * - * @name parallel - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * - * //Using Callbacks - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function parallel$1(tasks, callback) { - return parallel(eachOf$1, tasks, callback); - } - - /** - * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a - * time. - * - * @name parallelLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.parallel]{@link module:ControlFlow.parallel} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - */ - function parallelLimit(tasks, limit, callback) { - return parallel(eachOfLimit(limit), tasks, callback); - } - - /** - * A queue of tasks for the worker function to complete. - * @typedef {Iterable} QueueObject - * @memberOf module:ControlFlow - * @property {Function} length - a function returning the number of items - * waiting to be processed. Invoke with `queue.length()`. - * @property {boolean} started - a boolean indicating whether or not any - * items have been pushed and processed by the queue. - * @property {Function} running - a function returning the number of items - * currently being processed. Invoke with `queue.running()`. - * @property {Function} workersList - a function returning the array of items - * currently being processed. Invoke with `queue.workersList()`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke with `queue.idle()`. - * @property {number} concurrency - an integer for determining how many `worker` - * functions should be run in parallel. This property can be changed after a - * `queue` is created to alter the concurrency on-the-fly. - * @property {number} payload - an integer that specifies how many items are - * passed to the worker function at a time. only applies if this is a - * [cargo]{@link module:ControlFlow.cargo} object - * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` - * once the `worker` has finished processing the task. Instead of a single task, - * a `tasks` array can be submitted. The respective callback is used for every - * task in the list. Invoke with `queue.push(task, [callback])`, - * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. - * Invoke with `queue.unshift(task, [callback])`. - * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns - * a promise that rejects if an error occurs. - * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns - * a promise that rejects if an error occurs. - * @property {Function} remove - remove items from the queue that match a test - * function. The test function will be passed an object with a `data` property, - * and a `priority` property, if this is a - * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. - * Invoked with `queue.remove(testFn)`, where `testFn` is of the form - * `function ({data, priority}) {}` and returns a Boolean. - * @property {Function} saturated - a function that sets a callback that is - * called when the number of running workers hits the `concurrency` limit, and - * further tasks will be queued. If the callback is omitted, `q.saturated()` - * returns a promise for the next occurrence. - * @property {Function} unsaturated - a function that sets a callback that is - * called when the number of running workers is less than the `concurrency` & - * `buffer` limits, and further tasks will not be queued. If the callback is - * omitted, `q.unsaturated()` returns a promise for the next occurrence. - * @property {number} buffer - A minimum threshold buffer in order to say that - * the `queue` is `unsaturated`. - * @property {Function} empty - a function that sets a callback that is called - * when the last item from the `queue` is given to a `worker`. If the callback - * is omitted, `q.empty()` returns a promise for the next occurrence. - * @property {Function} drain - a function that sets a callback that is called - * when the last item from the `queue` has returned from the `worker`. If the - * callback is omitted, `q.drain()` returns a promise for the next occurrence. - * @property {Function} error - a function that sets a callback that is called - * when a task errors. Has the signature `function(error, task)`. If the - * callback is omitted, `error()` returns a promise that rejects on the next - * error. - * @property {boolean} paused - a boolean for determining whether the queue is - * in a paused state. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke with `queue.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke with `queue.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. No more tasks - * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. - * - * @example - * const q = async.queue(worker, 2) - * q.push(item1) - * q.push(item2) - * q.push(item3) - * // queues are iterable, spread into an array to inspect - * const items = [...q] // [item1, item2, item3] - * // or use for of - * for (let item of q) { - * console.log(item) - * } - * - * q.drain(() => { - * console.log('all done') - * }) - * // or - * await q.drain() - */ - - /** - * Creates a `queue` object with the specified `concurrency`. Tasks added to the - * `queue` are processed in parallel (up to the `concurrency` limit). If all - * `worker`s are in progress, the task is queued until one becomes available. - * Once a `worker` completes a `task`, that `task`'s callback is called. - * - * @name queue - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. Invoked with (task, callback). - * @param {number} [concurrency=1] - An `integer` for determining how many - * `worker` functions should be run in parallel. If omitted, the concurrency - * defaults to `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be - * attached as certain properties to listen for specific events during the - * lifecycle of the queue. - * @example - * - * // create a queue object with concurrency 2 - * var q = async.queue(function(task, callback) { - * console.log('hello ' + task.name); - * callback(); - * }, 2); - * - * // assign a callback - * q.drain(function() { - * console.log('all items have been processed'); - * }); - * // or await the end - * await q.drain() - * - * // assign an error callback - * q.error(function(err, task) { - * console.error('task experienced an error'); - * }); - * - * // add some items to the queue - * q.push({name: 'foo'}, function(err) { - * console.log('finished processing foo'); - * }); - * // callback is optional - * q.push({name: 'bar'}); - * - * // add some items to the queue (batch-wise) - * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { - * console.log('finished processing item'); - * }); - * - * // add some items to the front of the queue - * q.unshift({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - */ - function queue$1 (worker, concurrency) { - var _worker = wrapAsync(worker); - return queue((items, cb) => { - _worker(items[0], cb); - }, concurrency, 1); - } - - // Binary min-heap implementation used for priority queue. - // Implementation is stable, i.e. push time is considered for equal priorities - class Heap { - constructor() { - this.heap = []; - this.pushCount = Number.MIN_SAFE_INTEGER; - } - - get length() { - return this.heap.length; - } - - empty () { - this.heap = []; - return this; - } - - percUp(index) { - let p; - - while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) { - let t = this.heap[index]; - this.heap[index] = this.heap[p]; - this.heap[p] = t; - - index = p; - } - } - - percDown(index) { - let l; - - while ((l=leftChi(index)) < this.heap.length) { - if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) { - l = l+1; - } - - if (smaller(this.heap[index], this.heap[l])) { - break; - } - - let t = this.heap[index]; - this.heap[index] = this.heap[l]; - this.heap[l] = t; - - index = l; - } - } - - push(node) { - node.pushCount = ++this.pushCount; - this.heap.push(node); - this.percUp(this.heap.length-1); - } - - unshift(node) { - return this.heap.push(node); - } - - shift() { - let [top] = this.heap; - - this.heap[0] = this.heap[this.heap.length-1]; - this.heap.pop(); - this.percDown(0); - - return top; - } - - toArray() { - return [...this]; - } - - *[Symbol.iterator] () { - for (let i = 0; i < this.heap.length; i++) { - yield this.heap[i].data; - } - } - - remove (testFn) { - let j = 0; - for (let i = 0; i < this.heap.length; i++) { - if (!testFn(this.heap[i])) { - this.heap[j] = this.heap[i]; - j++; - } - } - - this.heap.splice(j); - - for (let i = parent(this.heap.length-1); i >= 0; i--) { - this.percDown(i); - } - - return this; - } - } - - function leftChi(i) { - return (i<<1)+1; - } - - function parent(i) { - return ((i+1)>>1)-1; - } - - function smaller(x, y) { - if (x.priority !== y.priority) { - return x.priority < y.priority; - } - else { - return x.pushCount < y.pushCount; - } - } - - /** - * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and - * completed in ascending priority order. - * - * @name priorityQueue - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. - * Invoked with (task, callback). - * @param {number} concurrency - An `integer` for determining how many `worker` - * functions should be run in parallel. If omitted, the concurrency defaults to - * `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three - * differences between `queue` and `priorityQueue` objects: - * * `push(task, priority, [callback])` - `priority` should be a number. If an - * array of `tasks` is given, all tasks will be assigned the same priority. - * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, - * except this returns a promise that rejects if an error occurs. - * * The `unshift` and `unshiftAsync` methods were removed. - */ - function priorityQueue(worker, concurrency) { - // Start with a normal queue - var q = queue$1(worker, concurrency); - - var { - push, - pushAsync - } = q; - - q._tasks = new Heap(); - q._createTaskItem = ({data, priority}, callback) => { - return { - data, - priority, - callback - }; - }; - - function createDataItems(tasks, priority) { - if (!Array.isArray(tasks)) { - return {data: tasks, priority}; - } - return tasks.map(data => { return {data, priority}; }); - } - - // Override push to accept second parameter representing priority - q.push = function(data, priority = 0, callback) { - return push(createDataItems(data, priority), callback); - }; - - q.pushAsync = function(data, priority = 0, callback) { - return pushAsync(createDataItems(data, priority), callback); - }; - - // Remove unshift functions - delete q.unshift; - delete q.unshiftAsync; - - return q; - } - - /** - * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` complete or pass an - * error to its callback, the main `callback` is immediately called. It's - * equivalent to `Promise.race()`. - * - * @name race - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} - * to run. Each function can complete with an optional `result` value. - * @param {Function} callback - A callback to run once any of the functions have - * completed. This function gets an error or result from the first function that - * completed. Invoked with (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.race([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // main callback - * function(err, result) { - * // the result will be equal to 'two' as it finishes earlier - * }); - */ - function race(tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - wrapAsync(tasks[i])(callback); - } - } - - var race$1 = awaitify(race, 2); - - /** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - */ - function reduceRight (array, memo, iteratee, callback) { - var reversed = [...array].reverse(); - return reduce$1(reversed, memo, iteratee, callback); - } - - /** - * Wraps the async function in another function that always completes with a - * result object, even when it errors. - * - * The result object has either the property `error` or `value`. - * - * @name reflect - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function you want to wrap - * @returns {Function} - A function that always passes null to it's callback as - * the error. The second argument to the callback will be an `object` with - * either an `error` or a `value` property. - * @example - * - * async.parallel([ - * async.reflect(function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }), - * async.reflect(function(callback) { - * // do some more stuff but error ... - * callback('bad stuff happened'); - * }), - * async.reflect(function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * }) - * ], - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = 'bad stuff happened' - * // results[2].value = 'two' - * }); - */ - function reflect(fn) { - var _fn = wrapAsync(fn); - return initialParams(function reflectOn(args, reflectCallback) { - args.push((error, ...cbArgs) => { - let retVal = {}; - if (error) { - retVal.error = error; - } - if (cbArgs.length > 0){ - var value = cbArgs; - if (cbArgs.length <= 1) { - [value] = cbArgs; - } - retVal.value = value; - } - reflectCallback(null, retVal); - }); - - return _fn.apply(this, args); - }); - } - - /** - * A helper function that wraps an array or an object of functions with `reflect`. - * - * @name reflectAll - * @static - * @memberOf module:Utils - * @method - * @see [async.reflect]{@link module:Utils.reflect} - * @category Util - * @param {Array|Object|Iterable} tasks - The collection of - * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. - * @returns {Array} Returns an array of async functions, each wrapped in - * `async.reflect` - * @example - * - * let tasks = [ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * // do some more stuff but error ... - * callback(new Error('bad stuff happened')); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = Error('bad stuff happened') - * // results[2].value = 'two' - * }); - * - * // an example using an object instead of an array - * let tasks = { - * one: function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * two: function(callback) { - * callback('two'); - * }, - * three: function(callback) { - * setTimeout(function() { - * callback(null, 'three'); - * }, 100); - * } - * }; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results.one.value = 'one' - * // results.two.error = 'two' - * // results.three.value = 'three' - * }); - */ - function reflectAll(tasks) { - var results; - if (Array.isArray(tasks)) { - results = tasks.map(reflect); - } else { - results = {}; - Object.keys(tasks).forEach(key => { - results[key] = reflect.call(this, tasks[key]); - }); - } - return results; - } - - function reject(eachfn, arr, _iteratee, callback) { - const iteratee = wrapAsync(_iteratee); - return _filter(eachfn, arr, (value, cb) => { - iteratee(value, (err, v) => { - cb(err, !v); - }); - }, callback); - } - - /** - * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. - * - * @name reject - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.reject(fileList, fileExists, function(err, results) { - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }); - * - * // Using Promises - * async.reject(fileList, fileExists) - * .then( results => { - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.reject(fileList, fileExists); - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function reject$1 (coll, iteratee, callback) { - return reject(eachOf$1, coll, iteratee, callback) - } - var reject$2 = awaitify(reject$1, 3); - - /** - * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a - * time. - * - * @name rejectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ - function rejectLimit (coll, limit, iteratee, callback) { - return reject(eachOfLimit(limit), coll, iteratee, callback) - } - var rejectLimit$1 = awaitify(rejectLimit, 4); - - /** - * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. - * - * @name rejectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ - function rejectSeries (coll, iteratee, callback) { - return reject(eachOfSeries$1, coll, iteratee, callback) - } - var rejectSeries$1 = awaitify(rejectSeries, 3); - - function constant$1(value) { - return function () { - return value; - } - } - - /** - * Attempts to get a successful response from `task` no more than `times` times - * before returning an error. If the task is successful, the `callback` will be - * passed the result of the successful task. If all attempts fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name retry - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @see [async.retryable]{@link module:ControlFlow.retryable} - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an - * object with `times` and `interval` or a number. - * * `times` - The number of attempts to make before giving up. The default - * is `5`. - * * `interval` - The time to wait between retries, in milliseconds. The - * default is `0`. The interval may also be specified as a function of the - * retry count (see example). - * * `errorFilter` - An optional synchronous function that is invoked on - * erroneous result. If it returns `true` the retry attempts will continue; - * if the function returns `false` the retry flow is aborted with the current - * attempt's error and result being returned to the final callback. - * Invoked with (err). - * * If `opts` is a number, the number specifies the number of times to retry, - * with the default interval of `0`. - * @param {AsyncFunction} task - An async function to retry. - * Invoked with (callback). - * @param {Function} [callback] - An optional callback which is called when the - * task has succeeded, or after the final failed attempt. It receives the `err` - * and `result` arguments of the last attempt at completing the `task`. Invoked - * with (err, results). - * @returns {Promise} a promise if no callback provided - * - * @example - * - * // The `retry` function can be used as a stand-alone control flow by passing - * // a callback, as shown below: - * - * // try calling apiMethod 3 times - * async.retry(3, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 3 times, waiting 200 ms between each retry - * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 10 times with exponential backoff - * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) - * async.retry({ - * times: 10, - * interval: function(retryCount) { - * return 50 * Math.pow(2, retryCount); - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod the default 5 times no delay between each retry - * async.retry(apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod only when error condition satisfies, all other - * // errors will abort the retry control flow and return to final callback - * async.retry({ - * errorFilter: function(err) { - * return err.message === 'Temporary error'; // only retry on a specific error - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // to retry individual methods that are not as reliable within other - * // control flow functions, use the `retryable` wrapper: - * async.auto({ - * users: api.getUsers.bind(api), - * payments: async.retryable(3, api.getPayments.bind(api)) - * }, function(err, results) { - * // do something with the results - * }); - * - */ - const DEFAULT_TIMES = 5; - const DEFAULT_INTERVAL = 0; - - function retry(opts, task, callback) { - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant$1(DEFAULT_INTERVAL) - }; - - if (arguments.length < 3 && typeof opts === 'function') { - callback = task || promiseCallback(); - task = opts; - } else { - parseTimes(options, opts); - callback = callback || promiseCallback(); - } - - if (typeof task !== 'function') { - throw new Error("Invalid arguments for async.retry"); - } - - var _task = wrapAsync(task); - - var attempt = 1; - function retryAttempt() { - _task((err, ...args) => { - if (err === false) return - if (err && attempt++ < options.times && - (typeof options.errorFilter != 'function' || - options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); - } else { - callback(err, ...args); - } - }); - } - - retryAttempt(); - return callback[PROMISE_SYMBOL] - } - - function parseTimes(acc, t) { - if (typeof t === 'object') { - acc.times = +t.times || DEFAULT_TIMES; - - acc.intervalFunc = typeof t.interval === 'function' ? - t.interval : - constant$1(+t.interval || DEFAULT_INTERVAL); - - acc.errorFilter = t.errorFilter; - } else if (typeof t === 'number' || typeof t === 'string') { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } - } - - /** - * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method - * wraps a task and makes it retryable, rather than immediately calling it - * with retries. - * - * @name retryable - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.retry]{@link module:ControlFlow.retry} - * @category Control Flow - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional - * options, exactly the same as from `retry`, except for a `opts.arity` that - * is the arity of the `task` function, defaulting to `task.length` - * @param {AsyncFunction} task - the asynchronous function to wrap. - * This function will be passed any arguments passed to the returned wrapper. - * Invoked with (...args, callback). - * @returns {AsyncFunction} The wrapped function, which when invoked, will - * retry on an error, based on the parameters specified in `opts`. - * This function will accept the same parameters as `task`. - * @example - * - * async.auto({ - * dep1: async.retryable(3, getFromFlakyService), - * process: ["dep1", async.retryable(3, function (results, cb) { - * maybeProcessData(results.dep1, cb); - * })] - * }, callback); - */ - function retryable (opts, task) { - if (!task) { - task = opts; - opts = null; - } - let arity = (opts && opts.arity) || task.length; - if (isAsync(task)) { - arity += 1; - } - var _task = wrapAsync(task); - return initialParams((args, callback) => { - if (args.length < arity - 1 || callback == null) { - args.push(callback); - callback = promiseCallback(); - } - function taskFn(cb) { - _task(...args, cb); - } - - if (opts) retry(opts, taskFn, callback); - else retry(taskFn, callback); - - return callback[PROMISE_SYMBOL] - }); - } - - /** - * Run the functions in the `tasks` collection in series, each one running once - * the previous function has completed. If any functions in the series pass an - * error to its callback, no more functions are run, and `callback` is - * immediately called with the value of the error. Otherwise, `callback` - * receives an array of results when `tasks` have completed. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function, and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.series}. - * - * **Note** that while many implementations preserve the order of object - * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) - * explicitly states that - * - * > The mechanics and order of enumerating the properties is not specified. - * - * So if you rely on the order in which your series of functions are executed, - * and want this to work on all platforms, consider using an array. - * - * @name series - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing - * [async functions]{@link AsyncFunction} to run in series. - * Each function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This function gets a results array (or object) - * containing all the result arguments passed to the `task` callbacks. Invoked - * with (err, result). - * @return {Promise} a promise, if no callback is passed - * @example - * - * //Using Callbacks - * async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] - * }); - * - * // an example using objects instead of arrays - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.series([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function series(tasks, callback) { - return parallel(eachOfSeries$1, tasks, callback); - } - - /** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - *); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // false - * // result is false since none of the files exists - * } - *); - * - * // Using Promises - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since some file in the list exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since none of the files exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); - * console.log(result); - * // false - * // result is false since none of the files exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function some(coll, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback) - } - var some$1 = awaitify(some, 3); - - /** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ - function someLimit(coll, limit, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfLimit(limit), coll, iteratee, callback) - } - var someLimit$1 = awaitify(someLimit, 4); - - /** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ - function someSeries(coll, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback) - } - var someSeries$1 = awaitify(someSeries, 3); - - /** - * Sorts a list by the results of running each `coll` value through an async - * `iteratee`. - * - * @name sortBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a value to use as the sort criteria as - * its `result`. - * Invoked with (item, callback). - * @param {Function} callback - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is the items - * from the original `coll` sorted by the values returned by the `iteratee` - * calls. Invoked with (err, results). - * @returns {Promise} a promise, if no callback passed - * @example - * - * // bigfile.txt is a file that is 251100 bytes in size - * // mediumfile.txt is a file that is 11000 bytes in size - * // smallfile.txt is a file that is 121 bytes in size - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // By modifying the callback parameter the - * // sorting order can be influenced: - * - * // ascending order - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) return callback(getFileSizeErr); - * callback(null, fileSize); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // descending order - * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) { - * return callback(getFileSizeErr); - * } - * callback(null, fileSize * -1); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] - * } - * } - * ); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * } - * ); - * - * // Using Promises - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * (async () => { - * try { - * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * // Error handling - * async () => { - * try { - * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ - function sortBy (coll, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return map$1(coll, (x, iterCb) => { - _iteratee(x, (err, criteria) => { - if (err) return iterCb(err); - iterCb(err, {value: x, criteria}); - }); - }, (err, results) => { - if (err) return callback(err); - callback(null, results.sort(comparator).map(v => v.value)); - }); - - function comparator(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } - } - var sortBy$1 = awaitify(sortBy, 3); - - /** - * Sets a time limit on an asynchronous function. If the function does not call - * its callback within the specified milliseconds, it will be called with a - * timeout error. The code property for the error object will be `'ETIMEDOUT'`. - * - * @name timeout - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} asyncFn - The async function to limit in time. - * @param {number} milliseconds - The specified time limit. - * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) - * to timeout Error for more information.. - * @returns {AsyncFunction} Returns a wrapped function that can be used with any - * of the control flow functions. - * Invoke this function with the same parameters as you would `asyncFunc`. - * @example - * - * function myFunction(foo, callback) { - * doAsyncTask(foo, function(err, data) { - * // handle errors - * if (err) return callback(err); - * - * // do some stuff ... - * - * // return processed data - * return callback(null, data); - * }); - * } - * - * var wrapped = async.timeout(myFunction, 1000); - * - * // call `wrapped` as you would `myFunction` - * wrapped({ bar: 'bar' }, function(err, data) { - * // if `myFunction` takes < 1000 ms to execute, `err` - * // and `data` will have their expected values - * - * // else `err` will be an Error with the code 'ETIMEDOUT' - * }); - */ - function timeout(asyncFn, milliseconds, info) { - var fn = wrapAsync(asyncFn); - - return initialParams((args, callback) => { - var timedOut = false; - var timer; - - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; - } - timedOut = true; - callback(error); - } - - args.push((...cbArgs) => { - if (!timedOut) { - callback(...cbArgs); - clearTimeout(timer); - } - }); - - // setup timer and call original function - timer = setTimeout(timeoutCallback, milliseconds); - fn(...args); - }); - } - - function range(size) { - var result = Array(size); - while (size--) { - result[size] = size; - } - return result; - } - - /** - * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a - * time. - * - * @name timesLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} count - The number of times to run the function. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see [async.map]{@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ - function timesLimit(count, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(range(count), limit, _iteratee, callback); - } - - /** - * Calls the `iteratee` function `n` times, and accumulates results in the same - * manner you would use with [map]{@link module:Collections.map}. - * - * @name times - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.map]{@link module:Collections.map} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - * @example - * - * // Pretend this is some complicated async factory - * var createUser = function(id, callback) { - * callback(null, { - * id: 'user' + id - * }); - * }; - * - * // generate 5 users - * async.times(5, function(n, next) { - * createUser(n, function(err, user) { - * next(err, user); - * }); - * }, function(err, users) { - * // we should now have 5 users - * }); - */ - function times (n, iteratee, callback) { - return timesLimit(n, Infinity, iteratee, callback) - } - - /** - * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. - * - * @name timesSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ - function timesSeries (n, iteratee, callback) { - return timesLimit(n, 1, iteratee, callback) - } - - /** - * A relative of `reduce`. Takes an Object or Array, and iterates over each - * element in parallel, each step potentially mutating an `accumulator` value. - * The type of the accumulator defaults to the type of collection passed in. - * - * @name transform - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} [accumulator] - The initial state of the transform. If omitted, - * it will default to an empty Object or Array, depending on the type of `coll` - * @param {AsyncFunction} iteratee - A function applied to each item in the - * collection that potentially modifies the accumulator. - * Invoked with (accumulator, item, key, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the transformed accumulator. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileList, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * }); - * - * // Using Promises - * async.transform(fileList, transformFileSize) - * .then(result => { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * (async () => { - * try { - * let result = await async.transform(fileList, transformFileSize); - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileMap, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * }); - * - * // Using Promises - * async.transform(fileMap, transformFileSize) - * .then(result => { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.transform(fileMap, transformFileSize); - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ - function transform (coll, accumulator, iteratee, callback) { - if (arguments.length <= 3 && typeof accumulator === 'function') { - callback = iteratee; - iteratee = accumulator; - accumulator = Array.isArray(coll) ? [] : {}; - } - callback = once(callback || promiseCallback()); - var _iteratee = wrapAsync(iteratee); - - eachOf$1(coll, (v, k, cb) => { - _iteratee(accumulator, v, k, cb); - }, err => callback(err, accumulator)); - return callback[PROMISE_SYMBOL] - } - - /** - * It runs each task in series but stops whenever any of the functions were - * successful. If one of the tasks were successful, the `callback` will be - * passed the result of the successful task. If all tasks fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name tryEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to - * run, each function is passed a `callback(err, result)` it must call on - * completion with an error `err` (which can be `null`) and an optional `result` - * value. - * @param {Function} [callback] - An optional callback which is called when one - * of the tasks has succeeded, or all have failed. It receives the `err` and - * `result` arguments of the last attempt at completing the `task`. Invoked with - * (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * async.tryEach([ - * function getDataFromFirstWebsite(callback) { - * // Try getting the data from the first website - * callback(err, data); - * }, - * function getDataFromSecondWebsite(callback) { - * // First website failed, - * // Try getting the data from the backup website - * callback(err, data); - * } - * ], - * // optional callback - * function(err, results) { - * Now do something with the data. - * }); - * - */ - function tryEach(tasks, callback) { - var error = null; - var result; - return eachSeries$1(tasks, (task, taskCb) => { - wrapAsync(task)((err, ...args) => { - if (err === false) return taskCb(err); - - if (args.length < 2) { - [result] = args; - } else { - result = args; - } - error = err; - taskCb(err ? null : {}); - }); - }, () => callback(error, result)); - } - - var tryEach$1 = awaitify(tryEach); - - /** - * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, - * unmemoized form. Handy for testing. - * - * @name unmemoize - * @static - * @memberOf module:Utils - * @method - * @see [async.memoize]{@link module:Utils.memoize} - * @category Util - * @param {AsyncFunction} fn - the memoized function - * @returns {AsyncFunction} a function that calls the original unmemoized function - */ - function unmemoize(fn) { - return (...args) => { - return (fn.unmemoized || fn)(...args); - }; - } - - /** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - * @example - * - * var count = 0; - * async.whilst( - * function test(cb) { cb(null, count < 5); }, - * function iter(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ - function whilst(test, iteratee, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results = []; - - function next(err, ...rest) { - if (err) return callback(err); - results = rest; - if (err === false) return; - _test(check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return _test(check); - } - var whilst$1 = awaitify(whilst, 3); - - /** - * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `iteratee`'s callback. - * - * The inverse of [whilst]{@link module:ControlFlow.whilst}. - * - * @name until - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (callback). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * const results = [] - * let finished = false - * async.until(function test(cb) { - * cb(null, finished) - * }, function iter(next) { - * fetchPage(url, (err, body) => { - * if (err) return next(err) - * results = results.concat(body.objects) - * finished = !!body.next - * next(err) - * }) - * }, function done (err) { - * // all pages have been fetched - * }) - */ - function until(test, iteratee, callback) { - const _test = wrapAsync(test); - return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback); - } - - /** - * Runs the `tasks` array of functions in series, each passing their results to - * the next in the array. However, if any of the `tasks` pass an error to their - * own callback, the next function is not executed, and the main `callback` is - * immediately called with the error. - * - * @name waterfall - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} - * to run. - * Each function should complete with any number of `result` values. - * The `result` values will be passed as arguments, in order, to the next task. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This will be passed the results of the last task's - * callback. Invoked with (err, [results]). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.waterfall([ - * function(callback) { - * callback(null, 'one', 'two'); - * }, - * function(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * }, - * function(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - * ], function (err, result) { - * // result now equals 'done' - * }); - * - * // Or, with named functions: - * async.waterfall([ - * myFirstFunction, - * mySecondFunction, - * myLastFunction, - * ], function (err, result) { - * // result now equals 'done' - * }); - * function myFirstFunction(callback) { - * callback(null, 'one', 'two'); - * } - * function mySecondFunction(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * } - * function myLastFunction(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - */ - function waterfall (tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); - if (!tasks.length) return callback(); - var taskIndex = 0; - - function nextTask(args) { - var task = wrapAsync(tasks[taskIndex++]); - task(...args, onlyOnce(next)); - } - - function next(err, ...args) { - if (err === false) return - if (err || taskIndex === tasks.length) { - return callback(err, ...args); - } - nextTask(args); - } - - nextTask([]); - } - - var waterfall$1 = awaitify(waterfall); - - /** - * An "async function" in the context of Async is an asynchronous function with - * a variable number of parameters, with the final parameter being a callback. - * (`function (arg1, arg2, ..., callback) {}`) - * The final callback is of the form `callback(err, results...)`, which must be - * called once the function is completed. The callback should be called with a - * Error as its first argument to signal that an error occurred. - * Otherwise, if no error occurred, it should be called with `null` as the first - * argument, and any additional `result` arguments that may apply, to signal - * successful completion. - * The callback must be called exactly once, ideally on a later tick of the - * JavaScript event loop. - * - * This type of function is also referred to as a "Node-style async function", - * or a "continuation passing-style function" (CPS). Most of the methods of this - * library are themselves CPS/Node-style async functions, or functions that - * return CPS/Node-style async functions. - * - * Wherever we accept a Node-style async function, we also directly accept an - * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. - * In this case, the `async` function will not be passed a final callback - * argument, and any thrown error will be used as the `err` argument of the - * implicit callback, and the return value will be used as the `result` value. - * (i.e. a `rejected` of the returned Promise becomes the `err` callback - * argument, and a `resolved` value becomes the `result`.) - * - * Note, due to JavaScript limitations, we can only detect native `async` - * functions and not transpilied implementations. - * Your environment must have `async`/`await` support for this to work. - * (e.g. Node > v7.6, or a recent version of a modern browser). - * If you are using `async` functions through a transpiler (e.g. Babel), you - * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, - * because the `async function` will be compiled to an ordinary function that - * returns a promise. - * - * @typedef {Function} AsyncFunction - * @static - */ - - var index = { - apply, - applyEach: applyEach$1, - applyEachSeries, - asyncify, - auto, - autoInject, - cargo, - cargoQueue: cargo$1, - compose, - concat: concat$1, - concatLimit: concatLimit$1, - concatSeries: concatSeries$1, - constant, - detect: detect$1, - detectLimit: detectLimit$1, - detectSeries: detectSeries$1, - dir, - doUntil, - doWhilst: doWhilst$1, - each, - eachLimit: eachLimit$2, - eachOf: eachOf$1, - eachOfLimit: eachOfLimit$2, - eachOfSeries: eachOfSeries$1, - eachSeries: eachSeries$1, - ensureAsync, - every: every$1, - everyLimit: everyLimit$1, - everySeries: everySeries$1, - filter: filter$1, - filterLimit: filterLimit$1, - filterSeries: filterSeries$1, - forever: forever$1, - groupBy, - groupByLimit: groupByLimit$1, - groupBySeries, - log, - map: map$1, - mapLimit: mapLimit$1, - mapSeries: mapSeries$1, - mapValues, - mapValuesLimit: mapValuesLimit$1, - mapValuesSeries, - memoize, - nextTick, - parallel: parallel$1, - parallelLimit, - priorityQueue, - queue: queue$1, - race: race$1, - reduce: reduce$1, - reduceRight, - reflect, - reflectAll, - reject: reject$2, - rejectLimit: rejectLimit$1, - rejectSeries: rejectSeries$1, - retry, - retryable, - seq, - series, - setImmediate: setImmediate$1, - some: some$1, - someLimit: someLimit$1, - someSeries: someSeries$1, - sortBy: sortBy$1, - timeout, - times, - timesLimit, - timesSeries, - transform, - tryEach: tryEach$1, - unmemoize, - until, - waterfall: waterfall$1, - whilst: whilst$1, - - // aliases - all: every$1, - allLimit: everyLimit$1, - allSeries: everySeries$1, - any: some$1, - anyLimit: someLimit$1, - anySeries: someSeries$1, - find: detect$1, - findLimit: detectLimit$1, - findSeries: detectSeries$1, - flatMap: concat$1, - flatMapLimit: concatLimit$1, - flatMapSeries: concatSeries$1, - forEach: each, - forEachSeries: eachSeries$1, - forEachLimit: eachLimit$2, - forEachOf: eachOf$1, - forEachOfSeries: eachOfSeries$1, - forEachOfLimit: eachOfLimit$2, - inject: reduce$1, - foldl: reduce$1, - foldr: reduceRight, - select: filter$1, - selectLimit: filterLimit$1, - selectSeries: filterSeries$1, - wrapSync: asyncify, - during: whilst$1, - doDuring: doWhilst$1 - }; - - exports.default = index; - exports.apply = apply; - exports.applyEach = applyEach$1; - exports.applyEachSeries = applyEachSeries; - exports.asyncify = asyncify; - exports.auto = auto; - exports.autoInject = autoInject; - exports.cargo = cargo; - exports.cargoQueue = cargo$1; - exports.compose = compose; - exports.concat = concat$1; - exports.concatLimit = concatLimit$1; - exports.concatSeries = concatSeries$1; - exports.constant = constant; - exports.detect = detect$1; - exports.detectLimit = detectLimit$1; - exports.detectSeries = detectSeries$1; - exports.dir = dir; - exports.doUntil = doUntil; - exports.doWhilst = doWhilst$1; - exports.each = each; - exports.eachLimit = eachLimit$2; - exports.eachOf = eachOf$1; - exports.eachOfLimit = eachOfLimit$2; - exports.eachOfSeries = eachOfSeries$1; - exports.eachSeries = eachSeries$1; - exports.ensureAsync = ensureAsync; - exports.every = every$1; - exports.everyLimit = everyLimit$1; - exports.everySeries = everySeries$1; - exports.filter = filter$1; - exports.filterLimit = filterLimit$1; - exports.filterSeries = filterSeries$1; - exports.forever = forever$1; - exports.groupBy = groupBy; - exports.groupByLimit = groupByLimit$1; - exports.groupBySeries = groupBySeries; - exports.log = log; - exports.map = map$1; - exports.mapLimit = mapLimit$1; - exports.mapSeries = mapSeries$1; - exports.mapValues = mapValues; - exports.mapValuesLimit = mapValuesLimit$1; - exports.mapValuesSeries = mapValuesSeries; - exports.memoize = memoize; - exports.nextTick = nextTick; - exports.parallel = parallel$1; - exports.parallelLimit = parallelLimit; - exports.priorityQueue = priorityQueue; - exports.queue = queue$1; - exports.race = race$1; - exports.reduce = reduce$1; - exports.reduceRight = reduceRight; - exports.reflect = reflect; - exports.reflectAll = reflectAll; - exports.reject = reject$2; - exports.rejectLimit = rejectLimit$1; - exports.rejectSeries = rejectSeries$1; - exports.retry = retry; - exports.retryable = retryable; - exports.seq = seq; - exports.series = series; - exports.setImmediate = setImmediate$1; - exports.some = some$1; - exports.someLimit = someLimit$1; - exports.someSeries = someSeries$1; - exports.sortBy = sortBy$1; - exports.timeout = timeout; - exports.times = times; - exports.timesLimit = timesLimit; - exports.timesSeries = timesSeries; - exports.transform = transform; - exports.tryEach = tryEach$1; - exports.unmemoize = unmemoize; - exports.until = until; - exports.waterfall = waterfall$1; - exports.whilst = whilst$1; - exports.all = every$1; - exports.allLimit = everyLimit$1; - exports.allSeries = everySeries$1; - exports.any = some$1; - exports.anyLimit = someLimit$1; - exports.anySeries = someSeries$1; - exports.find = detect$1; - exports.findLimit = detectLimit$1; - exports.findSeries = detectSeries$1; - exports.flatMap = concat$1; - exports.flatMapLimit = concatLimit$1; - exports.flatMapSeries = concatSeries$1; - exports.forEach = each; - exports.forEachSeries = eachSeries$1; - exports.forEachLimit = eachLimit$2; - exports.forEachOf = eachOf$1; - exports.forEachOfSeries = eachOfSeries$1; - exports.forEachOfLimit = eachOfLimit$2; - exports.inject = reduce$1; - exports.foldl = reduce$1; - exports.foldr = reduceRight; - exports.select = filter$1; - exports.selectLimit = filterLimit$1; - exports.selectSeries = filterSeries$1; - exports.wrapSync = asyncify; - exports.during = whilst$1; - exports.doDuring = doWhilst$1; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); diff --git a/node_modules/async/dist/async.min.js b/node_modules/async/dist/async.min.js deleted file mode 100644 index a12963b..0000000 --- a/node_modules/async/dist/async.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.async={})})(this,function(e){'use strict';function t(e,...t){return(...n)=>e(...t,...n)}function n(e){return function(...t){var n=t.pop();return e.call(this,t,n)}}function a(e){setTimeout(e,0)}function i(e){return(t,...n)=>e(()=>t(...n))}function r(e){return u(e)?function(...t){const n=t.pop(),a=e.apply(this,t);return s(a,n)}:n(function(t,n){var a;try{a=e.apply(this,t)}catch(t){return n(t)}return a&&"function"==typeof a.then?s(a,n):void n(null,a)})}function s(e,t){return e.then(e=>{l(t,null,e)},e=>{l(t,e&&e.message?e:new Error(e))})}function l(e,t,n){try{e(t,n)}catch(e){_e(t=>{throw t},e)}}function u(e){return"AsyncFunction"===e[Symbol.toStringTag]}function d(e){return"AsyncGenerator"===e[Symbol.toStringTag]}function p(e){return"function"==typeof e[Symbol.asyncIterator]}function c(e){if("function"!=typeof e)throw new Error("expected a function");return u(e)?r(e):e}function o(e,t=e.length){if(!t)throw new Error("arity is undefined");return function(...n){return"function"==typeof n[t-1]?e.apply(this,n):new Promise((a,i)=>{n[t-1]=(e,...t)=>e?i(e):void a(1{c(e).apply(i,n.concat(t))},a)});return a}}function f(e,t,n,a){t=t||[];var i=[],r=0,s=c(n);return e(t,(e,t,n)=>{var a=r++;s(e,(e,t)=>{i[a]=t,n(e)})},e=>{a(e,i)})}function y(e){return e&&"number"==typeof e.length&&0<=e.length&&0==e.length%1}function m(e){function t(...t){if(null!==e){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}function g(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}function k(e){var t=-1,n=e.length;return function(){return++t=t||d||l||(d=!0,e.next().then(({value:e,done:t})=>{if(!(u||l))return d=!1,t?(l=!0,void(0>=p&&a(null))):void(p++,n(e,c,r),c++,i())}).catch(s))}function r(e,t){return p-=1,u?void 0:e?s(e):!1===e?(l=!0,void(u=!0)):t===be||l&&0>=p?(l=!0,a(null)):void i()}function s(e){u||(d=!1,l=!0,a(e))}let l=!1,u=!1,d=!1,p=0,c=0;i()}function O(e,t,n){function a(e,t){!1===e&&(l=!0);!0===l||(e?n(e):(++r===s||t===be)&&n(null))}n=m(n);var i=0,r=0,{length:s}=e,l=!1;for(0===s&&n(null);i{t=e,n=a}),e}function A(e,t,n){function a(e,t){g.push(()=>l(e,t))}function i(){if(!h){if(0===g.length&&0===o)return n(null,p);for(;g.length&&oe()),i()}function l(e,t){if(!f){var a=L((t,...a)=>{if(o--,!1===t)return void(h=!0);if(2>a.length&&([a]=a),t){var i={};if(Object.keys(p).forEach(e=>{i[e]=p[e]}),i[e]=a,f=!0,y=Object.create(null),h)return;n(t,i)}else p[e]=a,s(e)});o++;var i=c(t[t.length-1]);1{const i=e[a];Array.isArray(i)&&0<=i.indexOf(t)&&n.push(a)}),n}"number"!=typeof t&&(n=t,t=null),n=m(n||b());var d=Object.keys(e).length;if(!d)return n(null);t||(t=d);var p={},o=0,h=!1,f=!1,y=Object.create(null),g=[],k=[],v={};return Object.keys(e).forEach(t=>{var n=e[t];if(!Array.isArray(n))return a(t,[n]),void k.push(t);var i=n.slice(0,n.length-1),s=i.length;return 0===s?(a(t,n),void k.push(t)):void(v[t]=s,i.forEach(l=>{if(!e[l])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+l+"` in "+i.join(", "));r(l,()=>{s--,0===s&&a(t,n)})}))}),function(){for(var e,t=0;k.length;)e=k.pop(),t++,u(e).forEach(e=>{0==--v[e]&&k.push(e)});if(t!==d)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),i(),n[Ce]}function I(e){let t="",n=0,a=e.indexOf("*/");for(;ne.replace(Ne,"").trim())}function j(e,t){var n={};return Object.keys(e).forEach(t=>{function a(e,t){var n=i.map(t=>e[t]);n.push(t),c(r)(...n)}var i,r=e[t],s=u(r),l=!s&&1===r.length||s&&0===r.length;if(Array.isArray(r))i=[...r],r=i.pop(),n[t]=i.concat(0{r(e,n),t(...a)};f[e].push(n)}function r(e,t){return e?t?void(f[e]=f[e].filter(e=>e!==t)):f[e]=[]:Object.keys(f).forEach(e=>f[e]=[])}function s(e,...t){f[e].forEach(e=>e(...t))}function l(e,t,n,a){function i(e,...t){return e?n?s(e):r():1>=t.length?r(t[0]):void r(t)}if(null!=a&&"function"!=typeof a)throw new Error("task callback must be a function");k.started=!0;var r,s,l=k._createTaskItem(e,n?i:a||i);if(t?k._tasks.unshift(l):k._tasks.push(l),y||(y=!0,_e(()=>{y=!1,k.process()})),n||!a)return new Promise((e,t)=>{r=e,s=t})}function u(e){return function(t,...n){o-=1;for(var a=0,r=e.length;as("drain")),!0)}if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var p=c(e),o=0,h=[];const f={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};var y=!1;const m=e=>t=>t?void(r(e),a(e,t)):new Promise((t,n)=>{i(e,(e,a)=>e?n(e):void t(a))});var g=!1,k={_tasks:new Ve,_createTaskItem(e,t){return{data:e,callback:t}},*[Symbol.iterator](){yield*k._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){return Array.isArray(e)?d(e)?void 0:e.map(e=>l(e,!1,!1,t)):l(e,!1,!1,t)},pushAsync(e,t){return Array.isArray(e)?d(e)?void 0:e.map(e=>l(e,!1,!0,t)):l(e,!1,!0,t)},kill(){r(),k._tasks.empty()},unshift(e,t){return Array.isArray(e)?d(e)?void 0:e.map(e=>l(e,!0,!1,t)):l(e,!0,!1,t)},unshiftAsync(e,t){return Array.isArray(e)?d(e)?void 0:e.map(e=>l(e,!0,!0,t)):l(e,!0,!0,t)},remove(e){k._tasks.remove(e)},process(){var e=Math.min;if(!g){for(g=!0;!k.paused&&o{t.apply(n,e.concat((e,...t)=>{a(e,t)}))},(e,t)=>a(e,...t)),a[Ce]}}function P(...e){return C(...e.reverse())}function R(...e){return function(...t){var n=t.pop();return n(null,...e)}}function z(e,t){return(n,a,i,r)=>{var s,l=!1;const u=c(i);n(a,(n,a,i)=>{u(n,(a,r)=>a||!1===a?i(a):e(r)&&!s?(l=!0,s=t(!0,n),i(null,be)):void i())},e=>e?r(e):void r(null,l?s:t(!1)))}}function N(e){return(t,...n)=>c(t)(...n,(t,...n)=>{"object"==typeof console&&(t?console.error&&console.error(t):console[e]&&n.forEach(t=>console[e](t)))})}function V(e,t,n){const a=c(t);return Xe(e,(...e)=>{const t=e.pop();a(...e,(e,n)=>t(e,!n))},n)}function Y(e){return(t,n,a)=>e(t,a)}function q(e){return u(e)?e:function(...t){var n=t.pop(),a=!0;t.push((...e)=>{a?_e(()=>n(...e)):n(...e)}),e.apply(this,t),a=!1}}function D(e,t,n,a){var r=Array(t.length);e(t,(e,t,a)=>{n(e,(e,n)=>{r[t]=!!n,a(e)})},e=>{if(e)return a(e);for(var n=[],s=0;s{n(e,(n,r)=>n?a(n):void(r&&i.push({index:t,value:e}),a(n)))},e=>e?a(e):void a(null,i.sort((e,t)=>e.index-t.index).map(e=>e.value)))}function U(e,t,n,a){var i=y(t)?D:Q;return i(e,t,c(n),a)}function G(e,t,n){return ut(e,1/0,t,n)}function W(e,t,n){return ut(e,1,t,n)}function H(e,t,n){return pt(e,1/0,t,n)}function J(e,t,n){return pt(e,1,t,n)}function K(e,t=e=>e){var a=Object.create(null),r=Object.create(null),s=c(e),l=n((e,n)=>{var u=t(...e);u in a?_e(()=>n(null,...a[u])):u in r?r[u].push(n):(r[u]=[n],s(...e,(e,...t)=>{e||(a[u]=t);var n=r[u];delete r[u];for(var s=0,d=n.length;s{n(e[0],t)},t,1)}function ee(e){return(e<<1)+1}function te(e){return(e+1>>1)-1}function ne(e,t){return e.priority===t.priority?e.pushCount({data:e,priority:t})):{data:e,priority:t}}var a=$(e,t),{push:i,pushAsync:r}=a;return a._tasks=new ht,a._createTaskItem=({data:e,priority:t},n)=>({data:e,priority:t,callback:n}),a.push=function(e,t=0,a){return i(n(e,t),a)},a.pushAsync=function(e,t=0,a){return r(n(e,t),a)},delete a.unshift,delete a.unshiftAsync,a}function ie(e,t,n,a){var i=[...e].reverse();return qe(i,t,n,a)}function re(e){var t=c(e);return n(function(e,n){return e.push((e,...t)=>{let a={};if(e&&(a.error=e),0=t.length&&([i]=t),a.value=i}n(null,a)}),t.apply(this,e)})}function se(e){var t;return Array.isArray(e)?t=e.map(re):(t={},Object.keys(e).forEach(n=>{t[n]=re.call(this,e[n])})),t}function le(e,t,n,a){const i=c(n);return U(e,t,(e,t)=>{i(e,(e,n)=>{t(e,!n)})},a)}function ue(e){return function(){return e}}function de(e,t,n){function a(){r((e,...t)=>{!1===e||(e&&s++arguments.length&&"function"==typeof e?(n=t||b(),t=e):(pe(i,e),n=n||b()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var r=c(t),s=1;return a(),n[Ce]}function pe(e,n){if("object"==typeof n)e.times=+n.times||kt,e.intervalFunc="function"==typeof n.interval?n.interval:ue(+n.interval||vt),e.errorFilter=n.errorFilter;else if("number"==typeof n||"string"==typeof n)e.times=+n||kt;else throw new Error("Invalid arguments for async.retry")}function ce(e,t){t||(t=e,e=null);let a=e&&e.arity||t.length;u(t)&&(a+=1);var i=c(t);return n((t,n)=>{function r(e){i(...t,e)}return(t.length{var s,l=!1;n.push((...e)=>{l||(r(...e),clearTimeout(s))}),s=setTimeout(function(){var t=e.name||"anonymous",n=new Error("Callback function \""+t+"\" timed out.");n.code="ETIMEDOUT",a&&(n.info=a),l=!0,r(n)},t),i(...n)})}function fe(e){for(var t=Array(e);e--;)t[e]=e;return t}function ye(e,t,n,a){var i=c(n);return De(fe(e),t,i,a)}function me(e,t,n){return ye(e,1/0,t,n)}function ge(e,t,n){return ye(e,1,t,n)}function ke(e,t,n,a){3>=arguments.length&&"function"==typeof t&&(a=n,n=t,t=Array.isArray(e)?[]:{}),a=m(a||b());var i=c(n);return Me(e,(e,n,a)=>{i(t,e,n,a)},e=>a(e,t)),a[Ce]}function ve(e){return(...t)=>(e.unmemoized||e)(...t)}function Se(e,t,n){const a=c(e);return _t(e=>a((t,n)=>e(t,!n)),t,n)}var xe,Le="function"==typeof queueMicrotask&&queueMicrotask,Ee="function"==typeof setImmediate&&setImmediate,Oe="object"==typeof process&&"function"==typeof process.nextTick;xe=Le?queueMicrotask:Ee?setImmediate:Oe?process.nextTick:a;var _e=i(xe);const be={};var Ae=e=>(t,n,a)=>{function i(e,t){if(!u)if(c-=1,e)l=!0,a(e);else if(!1===e)l=!0,u=!0;else{if(t===be||l&&0>=c)return l=!0,a(null);o||r()}}function r(){for(o=!0;c=c&&a(null));c+=1,n(t.value,t.key,L(i))}o=!1}if(a=m(a),0>=e)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return a(null);if(d(t))return E(t,e,n,a);if(p(t))return E(t[Symbol.asyncIterator](),e,n,a);var s=x(t),l=!1,u=!1,c=0,o=!1;r()},Ie=o(function(e,t,n,a){return Ae(t)(e,c(n),a)},4),Me=o(function(e,t,n){var a=y(e)?O:_;return a(e,c(t),n)},3),je=o(function(e,t,n){return f(Me,e,t,n)},3),we=h(je),Be=o(function(e,t,n){return Ie(e,1,t,n)},3),Te=o(function(e,t,n){return f(Be,e,t,n)},3),Fe=h(Te);const Ce=Symbol("promiseCallback");var Pe=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,Re=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,ze=/,/,Ne=/(=.+)?(\s*)$/;class Ve{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):w(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):w(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}}var Ye,qe=o(function(e,t,n,a){a=m(a);var r=c(n);return Be(e,(e,n,a)=>{r(t,e,(e,n)=>{t=n,a(e)})},e=>a(e,t))},4),De=o(function(e,t,n,a){return f(Ae(t),e,n,a)},4),Qe=o(function(e,t,n,a){var i=c(n);return De(e,t,(e,t)=>{i(e,(e,...n)=>e?t(e):t(e,n))},(e,t)=>{for(var n=[],r=0;re,(e,t)=>t)(Me,e,t,n)},3),He=o(function(e,t,n,a){return z(e=>e,(e,t)=>t)(Ae(t),e,n,a)},4),Je=o(function(e,t,n){return z(e=>e,(e,t)=>t)(Ae(1),e,t,n)},3),Ke=N("dir"),Xe=o(function(e,t,n){function a(e,...t){return e?n(e):void(!1===e||(r=t,l(...t,i)))}function i(e,t){return e?n(e):!1===e?void 0:t?void s(a):n(null,...r)}n=L(n);var r,s=c(e),l=c(t);return i(null,!0)},3),Ze=o(function(e,t,n){return Me(e,Y(c(t)),n)},3),$e=o(function(e,t,n,a){return Ae(t)(e,Y(c(n)),a)},4),et=o(function(e,t,n){return $e(e,1,t,n)},3),tt=o(function(e,t,n){return z(e=>!e,e=>!e)(Me,e,t,n)},3),nt=o(function(e,t,n,a){return z(e=>!e,e=>!e)(Ae(t),e,n,a)},4),at=o(function(e,t,n){return z(e=>!e,e=>!e)(Be,e,t,n)},3),it=o(function(e,t,n){return U(Me,e,t,n)},3),rt=o(function(e,t,n,a){return U(Ae(t),e,n,a)},4),st=o(function(e,t,n){return U(Be,e,t,n)},3),lt=o(function(e,t){function n(e){return e?a(e):void(!1===e||i(n))}var a=L(t),i=c(q(e));return n()},2),ut=o(function(e,t,n,a){var i=c(n);return De(e,t,(e,t)=>{i(e,(n,a)=>n?t(n):t(n,{key:a,val:e}))},(e,t)=>{for(var n={},{hasOwnProperty:r}=Object.prototype,s=0;s{r(e,t,(e,a)=>e?n(e):void(i[t]=a,n(e)))},e=>a(e,i))},4);Ye=Oe?process.nextTick:Ee?setImmediate:a;var ct=i(Ye),ot=o((e,t,n)=>{var a=y(t)?[]:{};e(t,(e,t,n)=>{c(e)((e,...i)=>{2>i.length&&([i]=i),a[t]=i,n(e)})},e=>n(e,a))},3);class ht{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){for(let n;0e)(Me,e,t,n)},3),xt=o(function(e,t,n,a){return z(Boolean,e=>e)(Ae(t),e,n,a)},4),Lt=o(function(e,t,n){return z(Boolean,e=>e)(Be,e,t,n)},3),Et=o(function(e,t,n){function a(e,t){var n=e.criteria,a=t.criteria;return na?1:0}var i=c(t);return je(e,(e,t)=>{i(e,(n,a)=>n?t(n):void t(n,{value:e,criteria:a}))},(e,t)=>e?n(e):void n(null,t.sort(a).map(e=>e.value)))},3),Ot=o(function(e,t){var n,a=null;return et(e,(e,t)=>{c(e)((e,...i)=>!1===e?t(e):void(2>i.length?[n]=i:n=i,a=e,t(e?null:{})))},()=>t(a,n))}),_t=o(function(e,t,n){function a(e,...t){if(e)return n(e);l=t;!1===e||s(i)}function i(e,t){return e?n(e):!1===e?void 0:t?void r(a):n(null,...l)}n=L(n);var r=c(t),s=c(e),l=[];return s(i)},3),bt=o(function(e,t){function n(t){var n=c(e[i++]);n(...t,L(a))}function a(a,...r){return!1===a?void 0:a||i===e.length?t(a,...r):void n(r)}if(t=m(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var i=0;n([])});e.default={apply:t,applyEach:we,applyEachSeries:Fe,asyncify:r,auto:A,autoInject:j,cargo:T,cargoQueue:F,compose:P,concat:Ue,concatLimit:Qe,concatSeries:Ge,constant:R,detect:We,detectLimit:He,detectSeries:Je,dir:Ke,doUntil:V,doWhilst:Xe,each:Ze,eachLimit:$e,eachOf:Me,eachOfLimit:Ie,eachOfSeries:Be,eachSeries:et,ensureAsync:q,every:tt,everyLimit:nt,everySeries:at,filter:it,filterLimit:rt,filterSeries:st,forever:lt,groupBy:G,groupByLimit:ut,groupBySeries:W,log:dt,map:je,mapLimit:De,mapSeries:Te,mapValues:H,mapValuesLimit:pt,mapValuesSeries:J,memoize:K,nextTick:ct,parallel:X,parallelLimit:Z,priorityQueue:ae,queue:$,race:ft,reduce:qe,reduceRight:ie,reflect:re,reflectAll:se,reject:yt,rejectLimit:mt,rejectSeries:gt,retry:de,retryable:ce,seq:C,series:oe,setImmediate:_e,some:St,someLimit:xt,someSeries:Lt,sortBy:Et,timeout:he,times:me,timesLimit:ye,timesSeries:ge,transform:ke,tryEach:Ot,unmemoize:ve,until:Se,waterfall:bt,whilst:_t,all:tt,allLimit:nt,allSeries:at,any:St,anyLimit:xt,anySeries:Lt,find:We,findLimit:He,findSeries:Je,flatMap:Ue,flatMapLimit:Qe,flatMapSeries:Ge,forEach:Ze,forEachSeries:et,forEachLimit:$e,forEachOf:Me,forEachOfSeries:Be,forEachOfLimit:Ie,inject:qe,foldl:qe,foldr:ie,select:it,selectLimit:rt,selectSeries:st,wrapSync:r,during:_t,doDuring:Xe},e.apply=t,e.applyEach=we,e.applyEachSeries=Fe,e.asyncify=r,e.auto=A,e.autoInject=j,e.cargo=T,e.cargoQueue=F,e.compose=P,e.concat=Ue,e.concatLimit=Qe,e.concatSeries=Ge,e.constant=R,e.detect=We,e.detectLimit=He,e.detectSeries=Je,e.dir=Ke,e.doUntil=V,e.doWhilst=Xe,e.each=Ze,e.eachLimit=$e,e.eachOf=Me,e.eachOfLimit=Ie,e.eachOfSeries=Be,e.eachSeries=et,e.ensureAsync=q,e.every=tt,e.everyLimit=nt,e.everySeries=at,e.filter=it,e.filterLimit=rt,e.filterSeries=st,e.forever=lt,e.groupBy=G,e.groupByLimit=ut,e.groupBySeries=W,e.log=dt,e.map=je,e.mapLimit=De,e.mapSeries=Te,e.mapValues=H,e.mapValuesLimit=pt,e.mapValuesSeries=J,e.memoize=K,e.nextTick=ct,e.parallel=X,e.parallelLimit=Z,e.priorityQueue=ae,e.queue=$,e.race=ft,e.reduce=qe,e.reduceRight=ie,e.reflect=re,e.reflectAll=se,e.reject=yt,e.rejectLimit=mt,e.rejectSeries=gt,e.retry=de,e.retryable=ce,e.seq=C,e.series=oe,e.setImmediate=_e,e.some=St,e.someLimit=xt,e.someSeries=Lt,e.sortBy=Et,e.timeout=he,e.times=me,e.timesLimit=ye,e.timesSeries=ge,e.transform=ke,e.tryEach=Ot,e.unmemoize=ve,e.until=Se,e.waterfall=bt,e.whilst=_t,e.all=tt,e.allLimit=nt,e.allSeries=at,e.any=St,e.anyLimit=xt,e.anySeries=Lt,e.find=We,e.findLimit=He,e.findSeries=Je,e.flatMap=Ue,e.flatMapLimit=Qe,e.flatMapSeries=Ge,e.forEach=Ze,e.forEachSeries=et,e.forEachLimit=$e,e.forEachOf=Me,e.forEachOfSeries=Be,e.forEachOfLimit=Ie,e.inject=qe,e.foldl=qe,e.foldr=ie,e.select=it,e.selectLimit=rt,e.selectSeries=st,e.wrapSync=r,e.during=_t,e.doDuring=Xe,Object.defineProperty(e,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/node_modules/async/dist/async.mjs b/node_modules/async/dist/async.mjs deleted file mode 100644 index d0cd59d..0000000 --- a/node_modules/async/dist/async.mjs +++ /dev/null @@ -1,5947 +0,0 @@ -/** - * Creates a continuation function with some arguments already applied. - * - * Useful as a shorthand when combined with other control flow functions. Any - * arguments passed to the returned function are added to the arguments - * originally passed to apply. - * - * @name apply - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {Function} fn - The function you want to eventually apply all - * arguments to. Invokes with (arguments...). - * @param {...*} arguments... - Any number of arguments to automatically apply - * when the continuation is called. - * @returns {Function} the partially-applied function - * @example - * - * // using apply - * async.parallel([ - * async.apply(fs.writeFile, 'testfile1', 'test1'), - * async.apply(fs.writeFile, 'testfile2', 'test2') - * ]); - * - * - * // the same process without using apply - * async.parallel([ - * function(callback) { - * fs.writeFile('testfile1', 'test1', callback); - * }, - * function(callback) { - * fs.writeFile('testfile2', 'test2', callback); - * } - * ]); - * - * // It's possible to pass any number of additional arguments when calling the - * // continuation: - * - * node> var fn = async.apply(sys.puts, 'one'); - * node> fn('two', 'three'); - * one - * two - * three - */ -function apply(fn, ...args) { - return (...callArgs) => fn(...args,...callArgs); -} - -function initialParams (fn) { - return function (...args/*, callback*/) { - var callback = args.pop(); - return fn.call(this, args, callback); - }; -} - -/* istanbul ignore file */ - -var hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; -var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; -var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; - -function fallback(fn) { - setTimeout(fn, 0); -} - -function wrap(defer) { - return (fn, ...args) => defer(() => fn(...args)); -} - -var _defer; - -if (hasQueueMicrotask) { - _defer = queueMicrotask; -} else if (hasSetImmediate) { - _defer = setImmediate; -} else if (hasNextTick) { - _defer = process.nextTick; -} else { - _defer = fallback; -} - -var setImmediate$1 = wrap(_defer); - -/** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ -function asyncify(func) { - if (isAsync(func)) { - return function (...args/*, callback*/) { - const callback = args.pop(); - const promise = func.apply(this, args); - return handlePromise(promise, callback) - } - } - - return initialParams(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (result && typeof result.then === 'function') { - return handlePromise(result, callback) - } else { - callback(null, result); - } - }); -} - -function handlePromise(promise, callback) { - return promise.then(value => { - invokeCallback(callback, null, value); - }, err => { - invokeCallback(callback, err && err.message ? err : new Error(err)); - }); -} - -function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (err) { - setImmediate$1(e => { throw e }, err); - } -} - -function isAsync(fn) { - return fn[Symbol.toStringTag] === 'AsyncFunction'; -} - -function isAsyncGenerator(fn) { - return fn[Symbol.toStringTag] === 'AsyncGenerator'; -} - -function isAsyncIterable(obj) { - return typeof obj[Symbol.asyncIterator] === 'function'; -} - -function wrapAsync(asyncFn) { - if (typeof asyncFn !== 'function') throw new Error('expected a function') - return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; -} - -// conditionally promisify a function. -// only return a promise if a callback is omitted -function awaitify (asyncFn, arity = asyncFn.length) { - if (!arity) throw new Error('arity is undefined') - function awaitable (...args) { - if (typeof args[arity - 1] === 'function') { - return asyncFn.apply(this, args) - } - - return new Promise((resolve, reject) => { - args[arity - 1] = (err, ...cbArgs) => { - if (err) return reject(err) - resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); - }; - asyncFn.apply(this, args); - }) - } - - return awaitable -} - -function applyEach (eachfn) { - return function applyEach(fns, ...callArgs) { - const go = awaitify(function (callback) { - var that = this; - return eachfn(fns, (fn, cb) => { - wrapAsync(fn).apply(that, callArgs.concat(cb)); - }, callback); - }); - return go; - }; -} - -function _asyncMap(eachfn, arr, iteratee, callback) { - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = wrapAsync(iteratee); - - return eachfn(arr, (value, _, iterCb) => { - var index = counter++; - _iteratee(value, (err, v) => { - results[index] = v; - iterCb(err); - }); - }, err => { - callback(err, results); - }); -} - -function isArrayLike(value) { - return value && - typeof value.length === 'number' && - value.length >= 0 && - value.length % 1 === 0; -} - -// A temporary value used to identify if the loop should be broken. -// See #1064, #1293 -const breakLoop = {}; - -function once(fn) { - function wrapper (...args) { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, args); - } - Object.assign(wrapper, fn); - return wrapper -} - -function getIterator (coll) { - return coll[Symbol.iterator] && coll[Symbol.iterator](); -} - -function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? {value: coll[i], key: i} : null; - } -} - -function createES2015Iterator(iterator) { - var i = -1; - return function next() { - var item = iterator.next(); - if (item.done) - return null; - i++; - return {value: item.value, key: i}; - } -} - -function createObjectIterator(obj) { - var okeys = obj ? Object.keys(obj) : []; - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - if (key === '__proto__') { - return next(); - } - return i < len ? {value: obj[key], key} : null; - }; -} - -function createIterator(coll) { - if (isArrayLike(coll)) { - return createArrayIterator(coll); - } - - var iterator = getIterator(coll); - return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); -} - -function onlyOnce(fn) { - return function (...args) { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, args); - }; -} - -// for async generators -function asyncEachOfLimit(generator, limit, iteratee, callback) { - let done = false; - let canceled = false; - let awaiting = false; - let running = 0; - let idx = 0; - - function replenish() { - //console.log('replenish') - if (running >= limit || awaiting || done) return - //console.log('replenish awaiting') - awaiting = true; - generator.next().then(({value, done: iterDone}) => { - //console.log('got value', value) - if (canceled || done) return - awaiting = false; - if (iterDone) { - done = true; - if (running <= 0) { - //console.log('done nextCb') - callback(null); - } - return; - } - running++; - iteratee(value, idx, iterateeCallback); - idx++; - replenish(); - }).catch(handleError); - } - - function iterateeCallback(err, result) { - //console.log('iterateeCallback') - running -= 1; - if (canceled) return - if (err) return handleError(err) - - if (err === false) { - done = true; - canceled = true; - return - } - - if (result === breakLoop || (done && running <= 0)) { - done = true; - //console.log('done iterCb') - return callback(null); - } - replenish(); - } - - function handleError(err) { - if (canceled) return - awaiting = false; - done = true; - callback(err); - } - - replenish(); -} - -var eachOfLimit = (limit) => { - return (obj, iteratee, callback) => { - callback = once(callback); - if (limit <= 0) { - throw new RangeError('concurrency limit cannot be less than 1') - } - if (!obj) { - return callback(null); - } - if (isAsyncGenerator(obj)) { - return asyncEachOfLimit(obj, limit, iteratee, callback) - } - if (isAsyncIterable(obj)) { - return asyncEachOfLimit(obj[Symbol.asyncIterator](), limit, iteratee, callback) - } - var nextElem = createIterator(obj); - var done = false; - var canceled = false; - var running = 0; - var looping = false; - - function iterateeCallback(err, value) { - if (canceled) return - running -= 1; - if (err) { - done = true; - callback(err); - } - else if (err === false) { - done = true; - canceled = true; - } - else if (value === breakLoop || (done && running <= 0)) { - done = true; - return callback(null); - } - else if (!looping) { - replenish(); - } - } - - function replenish () { - looping = true; - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); - } - looping = false; - } - - replenish(); - }; -}; - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfLimit$1(coll, limit, iteratee, callback) { - return eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); -} - -var eachOfLimit$2 = awaitify(eachOfLimit$1, 4); - -// eachOf implementation optimized for array-likes -function eachOfArrayLike(coll, iteratee, callback) { - callback = once(callback); - var index = 0, - completed = 0, - {length} = coll, - canceled = false; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err === false) { - canceled = true; - } - if (canceled === true) return - if (err) { - callback(err); - } else if ((++completed === length) || value === breakLoop) { - callback(null); - } - } - - for (; index < length; index++) { - iteratee(coll[index], index, onlyOnce(iteratorCallback)); - } -} - -// a generic version of eachOf which can handle array, object, and iterator cases. -function eachOfGeneric (coll, iteratee, callback) { - return eachOfLimit$2(coll, Infinity, iteratee, callback); -} - -/** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dev.json is a file containing a valid json object config for dev environment - * // dev.json is a file containing a valid json object config for test environment - * // prod.json is a file containing a valid json object config for prod environment - * // invalid.json is a file with a malformed json object - * - * let configs = {}; //global variable - * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; - * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; - * - * // asynchronous function that reads a json file and parses the contents as json object - * function parseFile(file, key, callback) { - * fs.readFile(file, "utf8", function(err, data) { - * if (err) return calback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * } - * - * // Using callbacks - * async.forEachOf(validConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * } else { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * // JSON parse error exception - * } else { - * console.log(configs); - * } - * }); - * - * // Using Promises - * async.forEachOf(validConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * }).catch( err => { - * console.error(err); - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * }).catch( err => { - * console.error(err); - * // JSON parse error exception - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.forEachOf(validConfigFileMap, parseFile); - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * catch (err) { - * console.log(err); - * } - * } - * - * //Error handing - * async () => { - * try { - * let result = await async.forEachOf(invalidConfigFileMap, parseFile); - * console.log(configs); - * } - * catch (err) { - * console.log(err); - * // JSON parse error exception - * } - * } - * - */ -function eachOf(coll, iteratee, callback) { - var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; - return eachOfImplementation(coll, wrapAsync(iteratee), callback); -} - -var eachOf$1 = awaitify(eachOf, 3); - -/** - * Produces a new collection of values by mapping each value in `coll` through - * the `iteratee` function. The `iteratee` is called with an item from `coll` - * and a callback for when it has finished processing. Each of these callbacks - * takes 2 arguments: an `error`, and the transformed item from `coll`. If - * `iteratee` passes an error to its callback, the main `callback` (for the - * `map` function) is immediately called with the error. - * - * Note, that since this function applies the `iteratee` to each item in - * parallel, there is no guarantee that the `iteratee` functions will complete - * in order. However, the results array will be in the same order as the - * original `coll`. - * - * If `map` is passed an Object, the results will be an Array. The results - * will roughly be in the order of the original Objects' keys (but this can - * vary across JavaScript engines). - * - * @name map - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an Array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.map(fileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.map(fileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.map(fileList, getFileSizeInBytes); - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.map(withMissingFileList, getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function map (coll, iteratee, callback) { - return _asyncMap(eachOf$1, coll, iteratee, callback) -} -var map$1 = awaitify(map, 3); - -/** - * Applies the provided arguments to each function in the array, calling - * `callback` after all functions have completed. If you only provide the first - * argument, `fns`, then it will return a function which lets you pass in the - * arguments as if it were a single function call. If more arguments are - * provided, `callback` is required while `args` is still optional. The results - * for each of the applied async functions are passed to the final callback - * as an array. - * - * @name applyEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s - * to all call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - Returns a function that takes no args other than - * an optional callback, that is the result of applying the `args` to each - * of the functions. - * @example - * - * const appliedFn = async.applyEach([enableSearch, updateSchema], 'bucket') - * - * appliedFn((err, results) => { - * // results[0] is the results for `enableSearch` - * // results[1] is the results for `updateSchema` - * }); - * - * // partial application example: - * async.each( - * buckets, - * async (bucket) => async.applyEach([enableSearch, updateSchema], bucket)(), - * callback - * ); - */ -var applyEach$1 = applyEach(map$1); - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. - * - * @name eachOfSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfSeries(coll, iteratee, callback) { - return eachOfLimit$2(coll, 1, iteratee, callback) -} -var eachOfSeries$1 = awaitify(eachOfSeries, 3); - -/** - * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. - * - * @name mapSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function mapSeries (coll, iteratee, callback) { - return _asyncMap(eachOfSeries$1, coll, iteratee, callback) -} -var mapSeries$1 = awaitify(mapSeries, 3); - -/** - * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. - * - * @name applyEachSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.applyEach]{@link module:ControlFlow.applyEach} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} fns - A collection of {@link AsyncFunction}s to all - * call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {AsyncFunction} - A function, that when called, is the result of - * appling the `args` to the list of functions. It takes no args, other than - * a callback. - */ -var applyEachSeries = applyEach(mapSeries$1); - -const PROMISE_SYMBOL = Symbol('promiseCallback'); - -function promiseCallback () { - let resolve, reject; - function callback (err, ...args) { - if (err) return reject(err) - resolve(args.length > 1 ? args : args[0]); - } - - callback[PROMISE_SYMBOL] = new Promise((res, rej) => { - resolve = res, - reject = rej; - }); - - return callback -} - -/** - * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on - * their requirements. Each function can optionally depend on other functions - * being completed first, and each function is run as soon as its requirements - * are satisfied. - * - * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence - * will stop. Further tasks will not execute (so any other functions depending - * on it will not run), and the main `callback` is immediately called with the - * error. - * - * {@link AsyncFunction}s also receive an object containing the results of functions which - * have completed so far as the first argument, if they have dependencies. If a - * task function has no dependencies, it will only be passed a callback. - * - * @name auto - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Object} tasks - An object. Each of its properties is either a - * function or an array of requirements, with the {@link AsyncFunction} itself the last item - * in the array. The object's key of a property serves as the name of the task - * defined by that property, i.e. can be used when specifying requirements for - * other tasks. The function receives one or two arguments: - * * a `results` object, containing the results of the previously executed - * functions, only passed if the task has any dependencies, - * * a `callback(err, result)` function, which must be called when finished, - * passing an `error` (which can be `null`) and the result of the function's - * execution. - * @param {number} [concurrency=Infinity] - An optional `integer` for - * determining the maximum number of tasks that can be run in parallel. By - * default, as many as possible. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback. Results are always returned; however, if an - * error occurs, no further `tasks` will be performed, and the results object - * will only contain partial results. Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * @example - * - * //Using Callbacks - * async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }, function(err, results) { - * if (err) { - * console.log('err = ', err); - * } - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }); - * - * //Using Promises - * async.auto({ - * get_data: function(callback) { - * console.log('in get_data'); - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * console.log('in make_folder'); - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }).then(results => { - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * }).catch(err => { - * console.log('err = ', err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.auto({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * // once the file is written let's email a link to it... - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }); - * console.log('results = ', results); - * // results = { - * // get_data: ['data', 'converted to array'] - * // make_folder; 'folder', - * // write_file: 'filename' - * // email_link: { file: 'filename', email: 'user@example.com' } - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function auto(tasks, concurrency, callback) { - if (typeof concurrency !== 'number') { - // concurrency is optional, shift the args. - callback = concurrency; - concurrency = null; - } - callback = once(callback || promiseCallback()); - var numTasks = Object.keys(tasks).length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; - } - - var results = {}; - var runningTasks = 0; - var canceled = false; - var hasError = false; - - var listeners = Object.create(null); - - var readyTasks = []; - - // for cycle detection: - var readyToCheck = []; // tasks that have been identified as reachable - // without the possibility of returning to an ancestor task - var uncheckedDependencies = {}; - - Object.keys(tasks).forEach(key => { - var task = tasks[key]; - if (!Array.isArray(task)) { - // no dependencies - enqueueTask(key, [task]); - readyToCheck.push(key); - return; - } - - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; - } - uncheckedDependencies[key] = remainingDependencies; - - dependencies.forEach(dependencyName => { - if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + - '` has a non-existent dependency `' + - dependencyName + '` in ' + - dependencies.join(', ')); - } - addListener(dependencyName, () => { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); - - checkForDeadlocks(); - processQueue(); - - function enqueueTask(key, task) { - readyTasks.push(() => runTask(key, task)); - } - - function processQueue() { - if (canceled) return - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while(readyTasks.length && runningTasks < concurrency) { - var run = readyTasks.shift(); - run(); - } - - } - - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } - - taskListeners.push(fn); - } - - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - taskListeners.forEach(fn => fn()); - processQueue(); - } - - - function runTask(key, task) { - if (hasError) return; - - var taskCallback = onlyOnce((err, ...result) => { - runningTasks--; - if (err === false) { - canceled = true; - return - } - if (result.length < 2) { - [result] = result; - } - if (err) { - var safeResults = {}; - Object.keys(results).forEach(rkey => { - safeResults[rkey] = results[rkey]; - }); - safeResults[key] = result; - hasError = true; - listeners = Object.create(null); - if (canceled) return - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); - - runningTasks++; - var taskFn = wrapAsync(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } - } - - function checkForDeadlocks() { - // Kahn's algorithm - // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm - // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - getDependents(currentTask).forEach(dependent => { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } - - if (counter !== numTasks) { - throw new Error( - 'async.auto cannot execute tasks due to a recursive dependency' - ); - } - } - - function getDependents(taskName) { - var result = []; - Object.keys(tasks).forEach(key => { - const task = tasks[key]; - if (Array.isArray(task) && task.indexOf(taskName) >= 0) { - result.push(key); - } - }); - return result; - } - - return callback[PROMISE_SYMBOL] -} - -var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/; -var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/; -var FN_ARG_SPLIT = /,/; -var FN_ARG = /(=.+)?(\s*)$/; - -function stripComments(string) { - let stripped = ''; - let index = 0; - let endBlockComment = string.indexOf('*/'); - while (index < string.length) { - if (string[index] === '/' && string[index+1] === '/') { - // inline comment - let endIndex = string.indexOf('\n', index); - index = (endIndex === -1) ? string.length : endIndex; - } else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) { - // block comment - let endIndex = string.indexOf('*/', index); - if (endIndex !== -1) { - index = endIndex + 2; - endBlockComment = string.indexOf('*/', index); - } else { - stripped += string[index]; - index++; - } - } else { - stripped += string[index]; - index++; - } - } - return stripped; -} - -function parseParams(func) { - const src = stripComments(func.toString()); - let match = src.match(FN_ARGS); - if (!match) { - match = src.match(ARROW_FN_ARGS); - } - if (!match) throw new Error('could not parse args in autoInject\nSource:\n' + src) - let [, args] = match; - return args - .replace(/\s/g, '') - .split(FN_ARG_SPLIT) - .map((arg) => arg.replace(FN_ARG, '').trim()); -} - -/** - * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent - * tasks are specified as parameters to the function, after the usual callback - * parameter, with the parameter names matching the names of the tasks it - * depends on. This can provide even more readable task graphs which can be - * easier to maintain. - * - * If a final callback is specified, the task results are similarly injected, - * specified as named parameters after the initial error parameter. - * - * The autoInject function is purely syntactic sugar and its semantics are - * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. - * - * @name autoInject - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.auto]{@link module:ControlFlow.auto} - * @category Control Flow - * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of - * the form 'func([dependencies...], callback). The object's key of a property - * serves as the name of the task defined by that property, i.e. can be used - * when specifying requirements for other tasks. - * * The `callback` parameter is a `callback(err, result)` which must be called - * when finished, passing an `error` (which can be `null`) and the result of - * the function's execution. The remaining parameters name other tasks on - * which the task is dependent, and the results from those tasks are the - * arguments of those parameters. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback, and a `results` object with any completed - * task results, similar to `auto`. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // The example from `auto` can be rewritten as follows: - * async.autoInject({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: function(get_data, make_folder, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }, - * email_link: function(write_file, callback) { - * // once the file is written let's email a link to it... - * // write_file contains the filename returned by write_file. - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * } - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - * - * // If you are using a JS minifier that mangles parameter names, `autoInject` - * // will not work with plain functions, since the parameter names will be - * // collapsed to a single letter identifier. To work around this, you can - * // explicitly specify the names of the parameters your task function needs - * // in an array, similar to Angular.js dependency injection. - * - * // This still has an advantage over plain `auto`, since the results a task - * // depends on are still spread into arguments. - * async.autoInject({ - * //... - * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(write_file, callback) { - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * }] - * //... - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - */ -function autoInject(tasks, callback) { - var newTasks = {}; - - Object.keys(tasks).forEach(key => { - var taskFn = tasks[key]; - var params; - var fnIsAsync = isAsync(taskFn); - var hasNoDeps = - (!fnIsAsync && taskFn.length === 1) || - (fnIsAsync && taskFn.length === 0); - - if (Array.isArray(taskFn)) { - params = [...taskFn]; - taskFn = params.pop(); - - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - // no dependencies, use the function as-is - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if ((taskFn.length === 0 && !fnIsAsync) && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } - - // remove callback param - if (!fnIsAsync) params.pop(); - - newTasks[key] = params.concat(newTask); - } - - function newTask(results, taskCb) { - var newArgs = params.map(name => results[name]); - newArgs.push(taskCb); - wrapAsync(taskFn)(...newArgs); - } - }); - - return auto(newTasks, callback); -} - -// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation -// used for queues. This implementation assumes that the node provided by the user can be modified -// to adjust the next and last properties. We implement only the minimal functionality -// for queue support. -class DLL { - constructor() { - this.head = this.tail = null; - this.length = 0; - } - - removeLink(node) { - if (node.prev) node.prev.next = node.next; - else this.head = node.next; - if (node.next) node.next.prev = node.prev; - else this.tail = node.prev; - - node.prev = node.next = null; - this.length -= 1; - return node; - } - - empty () { - while(this.head) this.shift(); - return this; - } - - insertAfter(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode; - else this.tail = newNode; - node.next = newNode; - this.length += 1; - } - - insertBefore(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode; - else this.head = newNode; - node.prev = newNode; - this.length += 1; - } - - unshift(node) { - if (this.head) this.insertBefore(this.head, node); - else setInitial(this, node); - } - - push(node) { - if (this.tail) this.insertAfter(this.tail, node); - else setInitial(this, node); - } - - shift() { - return this.head && this.removeLink(this.head); - } - - pop() { - return this.tail && this.removeLink(this.tail); - } - - toArray() { - return [...this] - } - - *[Symbol.iterator] () { - var cur = this.head; - while (cur) { - yield cur.data; - cur = cur.next; - } - } - - remove (testFn) { - var curr = this.head; - while(curr) { - var {next} = curr; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; - } - return this; - } -} - -function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; -} - -function queue(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; - } - else if(concurrency === 0) { - throw new RangeError('Concurrency must not be zero'); - } - - var _worker = wrapAsync(worker); - var numRunning = 0; - var workersList = []; - const events = { - error: [], - drain: [], - saturated: [], - unsaturated: [], - empty: [] - }; - - function on (event, handler) { - events[event].push(handler); - } - - function once (event, handler) { - const handleAndRemove = (...args) => { - off(event, handleAndRemove); - handler(...args); - }; - events[event].push(handleAndRemove); - } - - function off (event, handler) { - if (!event) return Object.keys(events).forEach(ev => events[ev] = []) - if (!handler) return events[event] = [] - events[event] = events[event].filter(ev => ev !== handler); - } - - function trigger (event, ...args) { - events[event].forEach(handler => handler(...args)); - } - - var processingScheduled = false; - function _insert(data, insertAtFront, rejectOnError, callback) { - if (callback != null && typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - - var res, rej; - function promiseCallback (err, ...args) { - // we don't care about the error, let the global error handler - // deal with it - if (err) return rejectOnError ? rej(err) : res() - if (args.length <= 1) return res(args[0]) - res(args); - } - - var item = q._createTaskItem( - data, - rejectOnError ? promiseCallback : - (callback || promiseCallback) - ); - - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } - - if (!processingScheduled) { - processingScheduled = true; - setImmediate$1(() => { - processingScheduled = false; - q.process(); - }); - } - - if (rejectOnError || !callback) { - return new Promise((resolve, reject) => { - res = resolve; - rej = reject; - }) - } - } - - function _createCB(tasks) { - return function (err, ...args) { - numRunning -= 1; - - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; - - var index = workersList.indexOf(task); - if (index === 0) { - workersList.shift(); - } else if (index > 0) { - workersList.splice(index, 1); - } - - task.callback(err, ...args); - - if (err != null) { - trigger('error', err, task.data); - } - } - - if (numRunning <= (q.concurrency - q.buffer) ) { - trigger('unsaturated'); - } - - if (q.idle()) { - trigger('drain'); - } - q.process(); - }; - } - - function _maybeDrain(data) { - if (data.length === 0 && q.idle()) { - // call drain immediately if there are no tasks - setImmediate$1(() => trigger('drain')); - return true - } - return false - } - - const eventMethod = (name) => (handler) => { - if (!handler) { - return new Promise((resolve, reject) => { - once(name, (err, data) => { - if (err) return reject(err) - resolve(data); - }); - }) - } - off(name); - on(name, handler); - - }; - - var isProcessing = false; - var q = { - _tasks: new DLL(), - _createTaskItem (data, callback) { - return { - data, - callback - }; - }, - *[Symbol.iterator] () { - yield* q._tasks[Symbol.iterator](); - }, - concurrency, - payload, - buffer: concurrency / 4, - started: false, - paused: false, - push (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, false, false, callback)) - } - return _insert(data, false, false, callback); - }, - pushAsync (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, false, true, callback)) - } - return _insert(data, false, true, callback); - }, - kill () { - off(); - q._tasks.empty(); - }, - unshift (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, true, false, callback)) - } - return _insert(data, true, false, callback); - }, - unshiftAsync (data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return - return data.map(datum => _insert(datum, true, true, callback)) - } - return _insert(data, true, true, callback); - }, - remove (testFn) { - q._tasks.remove(testFn); - }, - process () { - // Avoid trying to start too many processing operations. This can occur - // when callbacks resolve synchronously (#1267). - if (isProcessing) { - return; - } - isProcessing = true; - while(!q.paused && numRunning < q.concurrency && q._tasks.length){ - var tasks = [], data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - - numRunning += 1; - - if (q._tasks.length === 0) { - trigger('empty'); - } - - if (numRunning === q.concurrency) { - trigger('saturated'); - } - - var cb = onlyOnce(_createCB(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length () { - return q._tasks.length; - }, - running () { - return numRunning; - }, - workersList () { - return workersList; - }, - idle() { - return q._tasks.length + numRunning === 0; - }, - pause () { - q.paused = true; - }, - resume () { - if (q.paused === false) { return; } - q.paused = false; - setImmediate$1(q.process); - } - }; - // define these as fixed properties, so people get useful errors when updating - Object.defineProperties(q, { - saturated: { - writable: false, - value: eventMethod('saturated') - }, - unsaturated: { - writable: false, - value: eventMethod('unsaturated') - }, - empty: { - writable: false, - value: eventMethod('empty') - }, - drain: { - writable: false, - value: eventMethod('drain') - }, - error: { - writable: false, - value: eventMethod('error') - }, - }); - return q; -} - -/** - * Creates a `cargo` object with the specified payload. Tasks added to the - * cargo will be processed altogether (up to the `payload` limit). If the - * `worker` is in progress, the task is queued until it becomes available. Once - * the `worker` has completed some tasks, each callback of those tasks is - * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) - * for how `cargo` and `queue` work. - * - * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers - * at a time, cargo passes an array of tasks to a single worker, repeating - * when the worker is finished. - * - * @name cargo - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An asynchronous function for processing an array - * of queued tasks. Invoked with `(tasks, callback)`. - * @param {number} [payload=Infinity] - An optional `integer` for determining - * how many tasks should be processed per round; if omitted, the default is - * unlimited. - * @returns {module:ControlFlow.QueueObject} A cargo object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the cargo and inner queue. - * @example - * - * // create a cargo object with payload 2 - * var cargo = async.cargo(function(tasks, callback) { - * for (var i=0; i { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function reduce(coll, memo, iteratee, callback) { - callback = once(callback); - var _iteratee = wrapAsync(iteratee); - return eachOfSeries$1(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); -} -var reduce$1 = awaitify(reduce, 4); - -/** - * Version of the compose function that is more natural to read. Each function - * consumes the return value of the previous function. It is the equivalent of - * [compose]{@link module:ControlFlow.compose} with the arguments reversed. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name seq - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.compose]{@link module:ControlFlow.compose} - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} a function that composes the `functions` in order - * @example - * - * // Requires lodash (or underscore), express3 and dresende's orm2. - * // Part of an app, that fetches cats of the logged user. - * // This example uses `seq` function to avoid overnesting and error - * // handling clutter. - * app.get('/cats', function(request, response) { - * var User = request.models.User; - * async.seq( - * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) - * function(user, fn) { - * user.getCats(fn); // 'getCats' has signature (callback(err, data)) - * } - * )(req.session.user_id, function (err, cats) { - * if (err) { - * console.error(err); - * response.json({ status: 'error', message: err.message }); - * } else { - * response.json({ status: 'ok', message: 'Cats found', data: cats }); - * } - * }); - * }); - */ -function seq(...functions) { - var _functions = functions.map(wrapAsync); - return function (...args) { - var that = this; - - var cb = args[args.length - 1]; - if (typeof cb == 'function') { - args.pop(); - } else { - cb = promiseCallback(); - } - - reduce$1(_functions, args, (newargs, fn, iterCb) => { - fn.apply(that, newargs.concat((err, ...nextargs) => { - iterCb(err, nextargs); - })); - }, - (err, results) => cb(err, ...results)); - - return cb[PROMISE_SYMBOL] - }; -} - -/** - * Creates a function which is a composition of the passed asynchronous - * functions. Each function consumes the return value of the function that - * follows. Composing functions `f()`, `g()`, and `h()` would produce the result - * of `f(g(h()))`, only this version uses callbacks to obtain the return values. - * - * If the last argument to the composed function is not a function, a promise - * is returned when you call it. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name compose - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} an asynchronous function that is the composed - * asynchronous `functions` - * @example - * - * function add1(n, callback) { - * setTimeout(function () { - * callback(null, n + 1); - * }, 10); - * } - * - * function mul3(n, callback) { - * setTimeout(function () { - * callback(null, n * 3); - * }, 10); - * } - * - * var add1mul3 = async.compose(mul3, add1); - * add1mul3(4, function (err, result) { - * // result now equals 15 - * }); - */ -function compose(...args) { - return seq(...args.reverse()); -} - -/** - * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. - * - * @name mapLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function mapLimit (coll, limit, iteratee, callback) { - return _asyncMap(eachOfLimit(limit), coll, iteratee, callback) -} -var mapLimit$1 = awaitify(mapLimit, 4); - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapLimit - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, ...args) => { - if (err) return iterCb(err); - return iterCb(err, args); - }); - }, (err, mapResults) => { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = result.concat(...mapResults[i]); - } - } - - return callback(err, result); - }); -} -var concatLimit$1 = awaitify(concatLimit, 4); - -/** - * Applies `iteratee` to each item in `coll`, concatenating the results. Returns - * the concatenated list. The `iteratee`s are called in parallel, and the - * results are concatenated as they return. The results array will be returned in - * the original order of `coll` passed to the `iteratee` function. - * - * @name concat - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @alias flatMap - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * let directoryList = ['dir1','dir2','dir3']; - * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; - * - * // Using callbacks - * async.concat(directoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.concat(directoryList, fs.readdir) - * .then(results => { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir) - * .then(results => { - * console.log(results); - * }).catch(err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.concat(directoryList, fs.readdir); - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.concat(withMissingDirectoryList, fs.readdir); - * console.log(results); - * } catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } - * } - * - */ -function concat(coll, iteratee, callback) { - return concatLimit$1(coll, Infinity, iteratee, callback) -} -var concat$1 = awaitify(concat, 3); - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapSeries - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatSeries(coll, iteratee, callback) { - return concatLimit$1(coll, 1, iteratee, callback) -} -var concatSeries$1 = awaitify(concatSeries, 3); - -/** - * Returns a function that when called, calls-back with the values provided. - * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to - * [`auto`]{@link module:ControlFlow.auto}. - * - * @name constant - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {...*} arguments... - Any number of arguments to automatically invoke - * callback with. - * @returns {AsyncFunction} Returns a function that when invoked, automatically - * invokes the callback with the previous given arguments. - * @example - * - * async.waterfall([ - * async.constant(42), - * function (value, next) { - * // value === 42 - * }, - * //... - * ], callback); - * - * async.waterfall([ - * async.constant(filename, "utf8"), - * fs.readFile, - * function (fileData, next) { - * //... - * } - * //... - * ], callback); - * - * async.auto({ - * hostname: async.constant("https://server.net/"), - * port: findFreePort, - * launchServer: ["hostname", "port", function (options, cb) { - * startServer(options, cb); - * }], - * //... - * }, callback); - */ -function constant(...args) { - return function (...ignoredArgs/*, callback*/) { - var callback = ignoredArgs.pop(); - return callback(null, ...args); - }; -} - -function _createTester(check, getResult) { - return (eachfn, arr, _iteratee, cb) => { - var testPassed = false; - var testResult; - const iteratee = wrapAsync(_iteratee); - eachfn(arr, (value, _, callback) => { - iteratee(value, (err, result) => { - if (err || err === false) return callback(err); - - if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - return callback(null, breakLoop); - } - callback(); - }); - }, err => { - if (err) return cb(err); - cb(null, testPassed ? testResult : getResult(false)); - }); - }; -} - -/** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * } - *); - * - * // Using Promises - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) - * .then(result => { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); - * console.log(result); - * // dir1/file1.txt - * // result now equals the file in the list that exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function detect(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOf$1, coll, iteratee, callback) -} -var detect$1 = awaitify(detect, 3); - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectLimit(coll, limit, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit(limit), coll, iteratee, callback) -} -var detectLimit$1 = awaitify(detectLimit, 4); - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectSeries(coll, iteratee, callback) { - return _createTester(bool => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback) -} - -var detectSeries$1 = awaitify(detectSeries, 3); - -function consoleFunc(name) { - return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => { - /* istanbul ignore else */ - if (typeof console === 'object') { - /* istanbul ignore else */ - if (err) { - /* istanbul ignore else */ - if (console.error) { - console.error(err); - } - } else if (console[name]) { /* istanbul ignore else */ - resultArgs.forEach(x => console[name](x)); - } - } - }) -} - -/** - * Logs the result of an [`async` function]{@link AsyncFunction} to the - * `console` using `console.dir` to display the properties of the resulting object. - * Only works in Node.js or in browsers that support `console.dir` and - * `console.error` (such as FF and Chrome). - * If multiple arguments are returned from the async function, - * `console.dir` is called on each argument in order. - * - * @name dir - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, {hello: name}); - * }, 1000); - * }; - * - * // in the node repl - * node> async.dir(hello, 'world'); - * {hello: 'world'} - */ -var dir = consoleFunc('dir'); - -/** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ -function doWhilst(iteratee, test, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results; - - function next(err, ...args) { - if (err) return callback(err); - if (err === false) return; - results = args; - _test(...args, check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return check(null, true); -} - -var doWhilst$1 = awaitify(doWhilst, 3); - -/** - * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the - * argument ordering differs from `until`. - * - * @name doUntil - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee` - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ -function doUntil(iteratee, test, callback) { - const _test = wrapAsync(test); - return doWhilst$1(iteratee, (...args) => { - const cb = args.pop(); - _test(...args, (err, truth) => cb (err, !truth)); - }, callback); -} - -function _withoutIndex(iteratee) { - return (value, index, callback) => iteratee(value, callback); -} - -/** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; - * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; - * - * // asynchronous function that deletes a file - * const deleteFile = function(file, callback) { - * fs.unlink(file, callback); - * }; - * - * // Using callbacks - * async.each(fileList, deleteFile, function(err) { - * if( err ) { - * console.log(err); - * } else { - * console.log('All files have been deleted successfully'); - * } - * }); - * - * // Error Handling - * async.each(withMissingFileList, deleteFile, function(err){ - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using Promises - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using async/await - * async () => { - * try { - * await async.each(files, deleteFile); - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * await async.each(withMissingFileList, deleteFile); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * } - * } - * - */ -function eachLimit(coll, iteratee, callback) { - return eachOf$1(coll, _withoutIndex(wrapAsync(iteratee)), callback); -} - -var each = awaitify(eachLimit, 3); - -/** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachLimit$1(coll, limit, iteratee, callback) { - return eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); -} -var eachLimit$2 = awaitify(eachLimit$1, 4); - -/** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item - * in series and therefore the iteratee functions will complete in order. - - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachSeries(coll, iteratee, callback) { - return eachLimit$2(coll, 1, iteratee, callback) -} -var eachSeries$1 = awaitify(eachSeries, 3); - -/** - * Wrap an async function and ensure it calls its callback on a later tick of - * the event loop. If the function already calls its callback on a next tick, - * no extra deferral is added. This is useful for preventing stack overflows - * (`RangeError: Maximum call stack size exceeded`) and generally keeping - * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - * contained. ES2017 `async` functions are returned as-is -- they are immune - * to Zalgo's corrupting influences, as they always resolve on a later tick. - * - * @name ensureAsync - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - an async function, one that expects a node-style - * callback as its last argument. - * @returns {AsyncFunction} Returns a wrapped function with the exact same call - * signature as the function passed in. - * @example - * - * function sometimesAsync(arg, callback) { - * if (cache[arg]) { - * return callback(null, cache[arg]); // this would be synchronous!! - * } else { - * doSomeIO(arg, callback); // this IO would be asynchronous - * } - * } - * - * // this has a risk of stack overflows if many results are cached in a row - * async.mapSeries(args, sometimesAsync, done); - * - * // this will defer sometimesAsync's callback if necessary, - * // preventing stack overflows - * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); - */ -function ensureAsync(fn) { - if (isAsync(fn)) return fn; - return function (...args/*, callback*/) { - var callback = args.pop(); - var sync = true; - args.push((...innerArgs) => { - if (sync) { - setImmediate$1(() => callback(...innerArgs)); - } else { - callback(...innerArgs); - } - }); - fn.apply(this, args); - sync = false; - }; -} - -/** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.every(fileList, fileExists, function(err, result) { - * console.log(result); - * // true - * // result is true since every file exists - * }); - * - * async.every(withMissingFileList, fileExists, function(err, result) { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }); - * - * // Using Promises - * async.every(fileList, fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.every(withMissingFileList, fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.every(fileList, fileExists); - * console.log(result); - * // true - * // result is true since every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.every(withMissingFileList, fileExists); - * console.log(result); - * // false - * // result is false since NOT every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function every(coll, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOf$1, coll, iteratee, callback) -} -var every$1 = awaitify(every, 3); - -/** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everyLimit(coll, limit, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfLimit(limit), coll, iteratee, callback) -} -var everyLimit$1 = awaitify(everyLimit, 4); - -/** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everySeries(coll, iteratee, callback) { - return _createTester(bool => !bool, res => !res)(eachOfSeries$1, coll, iteratee, callback) -} -var everySeries$1 = awaitify(everySeries, 3); - -function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, (x, index, iterCb) => { - iteratee(x, (err, v) => { - truthValues[index] = !!v; - iterCb(err); - }); - }, err => { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); -} - -function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, (x, index, iterCb) => { - iteratee(x, (err, v) => { - if (err) return iterCb(err); - if (v) { - results.push({index, value: x}); - } - iterCb(err); - }); - }, err => { - if (err) return callback(err); - callback(null, results - .sort((a, b) => a.index - b.index) - .map(v => v.value)); - }); -} - -function _filter(eachfn, coll, iteratee, callback) { - var filter = isArrayLike(coll) ? filterArray : filterGeneric; - return filter(eachfn, coll, wrapAsync(iteratee), callback); -} - -/** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.filter(files, fileExists, function(err, results) { - * if(err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * }); - * - * // Using Promises - * async.filter(files, fileExists) - * .then(results => { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.filter(files, fileExists); - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function filter (coll, iteratee, callback) { - return _filter(eachOf$1, coll, iteratee, callback) -} -var filter$1 = awaitify(filter, 3); - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - */ -function filterLimit (coll, limit, iteratee, callback) { - return _filter(eachOfLimit(limit), coll, iteratee, callback) -} -var filterLimit$1 = awaitify(filterLimit, 4); - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - * @returns {Promise} a promise, if no callback provided - */ -function filterSeries (coll, iteratee, callback) { - return _filter(eachOfSeries$1, coll, iteratee, callback) -} -var filterSeries$1 = awaitify(filterSeries, 3); - -/** - * Calls the asynchronous function `fn` with a callback parameter that allows it - * to call itself again, in series, indefinitely. - - * If an error is passed to the callback then `errback` is called with the - * error, and execution stops, otherwise it will never be called. - * - * @name forever - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} fn - an async function to call repeatedly. - * Invoked with (next). - * @param {Function} [errback] - when `fn` passes an error to it's callback, - * this function will be called, and execution stops. Invoked with (err). - * @returns {Promise} a promise that rejects if an error occurs and an errback - * is not passed - * @example - * - * async.forever( - * function(next) { - * // next is suitable for passing to things that need a callback(err [, whatever]); - * // it will result in this function being called again. - * }, - * function(err) { - * // if next is called with a value in its first parameter, it will appear - * // in here as 'err', and execution will stop. - * } - * ); - */ -function forever(fn, errback) { - var done = onlyOnce(errback); - var task = wrapAsync(ensureAsync(fn)); - - function next(err) { - if (err) return done(err); - if (err === false) return; - task(next); - } - return next(); -} -var forever$1 = awaitify(forever, 2); - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. - * - * @name groupByLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ -function groupByLimit(coll, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val, iterCb) => { - _iteratee(val, (err, key) => { - if (err) return iterCb(err); - return iterCb(err, {key, val}); - }); - }, (err, mapResults) => { - var result = {}; - // from MDN, handle object having an `hasOwnProperty` prop - var {hasOwnProperty} = Object.prototype; - - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var {key} = mapResults[i]; - var {val} = mapResults[i]; - - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } - } - } - - return callback(err, result); - }); -} - -var groupByLimit$1 = awaitify(groupByLimit, 4); - -/** - * Returns a new object, where each value corresponds to an array of items, from - * `coll`, that returned the corresponding key. That is, the keys of the object - * correspond to the values passed to the `iteratee` callback. - * - * Note: Since this function applies the `iteratee` to each item in parallel, - * there is no guarantee that the `iteratee` functions will complete in order. - * However, the values for each key in the `result` will be in the same order as - * the original `coll`. For Objects, the values will roughly be in the order of - * the original Objects' keys (but this can vary across JavaScript engines). - * - * @name groupBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const files = ['dir1/file1.txt','dir2','dir4'] - * - * // asynchronous function that detects file type as none, file, or directory - * function detectFile(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(null, 'none'); - * } - * callback(null, stat.isDirectory() ? 'directory' : 'file'); - * }); - * } - * - * //Using callbacks - * async.groupBy(files, detectFile, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * }); - * - * // Using Promises - * async.groupBy(files, detectFile) - * .then( result => { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.groupBy(files, detectFile); - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function groupBy (coll, iteratee, callback) { - return groupByLimit$1(coll, Infinity, iteratee, callback) -} - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. - * - * @name groupBySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whose - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ -function groupBySeries (coll, iteratee, callback) { - return groupByLimit$1(coll, 1, iteratee, callback) -} - -/** - * Logs the result of an `async` function to the `console`. Only works in - * Node.js or in browsers that support `console.log` and `console.error` (such - * as FF and Chrome). If multiple arguments are returned from the async - * function, `console.log` is called on each argument in order. - * - * @name log - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, 'hello ' + name); - * }, 1000); - * }; - * - * // in the node repl - * node> async.log(hello, 'world'); - * 'hello world' - */ -var log = consoleFunc('log'); - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a - * time. - * - * @name mapValuesLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function mapValuesLimit(obj, limit, iteratee, callback) { - callback = once(callback); - var newObj = {}; - var _iteratee = wrapAsync(iteratee); - return eachOfLimit(limit)(obj, (val, key, next) => { - _iteratee(val, key, (err, result) => { - if (err) return next(err); - newObj[key] = result; - next(err); - }); - }, err => callback(err, newObj)); -} - -var mapValuesLimit$1 = awaitify(mapValuesLimit, 4); - -/** - * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. - * - * Produces a new Object by mapping each value of `obj` through the `iteratee` - * function. The `iteratee` is called each `value` and `key` from `obj` and a - * callback for when it has finished processing. Each of these callbacks takes - * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` - * passes an error to its callback, the main `callback` (for the `mapValues` - * function) is immediately called with the error. - * - * Note, the order of the keys in the result is not guaranteed. The keys will - * be roughly in the order they complete, (but this is very engine-specific) - * - * @name mapValues - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file3.txt' - * }; - * - * const withMissingFileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file4.txt' - * }; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, key, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * }); - * - * // Error handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.mapValues(fileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * }).catch (err => { - * console.log(err); - * }); - * - * // Error Handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch (err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.mapValues(fileMap, getFileSizeInBytes); - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function mapValues(obj, iteratee, callback) { - return mapValuesLimit$1(obj, Infinity, iteratee, callback) -} - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. - * - * @name mapValuesSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function mapValuesSeries(obj, iteratee, callback) { - return mapValuesLimit$1(obj, 1, iteratee, callback) -} - -/** - * Caches the results of an async function. When creating a hash to store - * function results against, the callback is omitted from the hash and an - * optional hash function can be used. - * - * **Note: if the async function errs, the result will not be cached and - * subsequent calls will call the wrapped function.** - * - * If no hash function is specified, the first argument is used as a hash key, - * which may work reasonably if it is a string or a data type that converts to a - * distinct string. Note that objects and arrays will not behave reasonably. - * Neither will cases where the other arguments are significant. In such cases, - * specify your own hash function. - * - * The cache of results is exposed as the `memo` property of the function - * returned by `memoize`. - * - * @name memoize - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function to proxy and cache results from. - * @param {Function} hasher - An optional function for generating a custom hash - * for storing results. It has all the arguments applied to it apart from the - * callback, and must be synchronous. - * @returns {AsyncFunction} a memoized version of `fn` - * @example - * - * var slow_fn = function(name, callback) { - * // do something - * callback(null, result); - * }; - * var fn = async.memoize(slow_fn); - * - * // fn can now be used as if it were slow_fn - * fn('some name', function() { - * // callback - * }); - */ -function memoize(fn, hasher = v => v) { - var memo = Object.create(null); - var queues = Object.create(null); - var _fn = wrapAsync(fn); - var memoized = initialParams((args, callback) => { - var key = hasher(...args); - if (key in memo) { - setImmediate$1(() => callback(null, ...memo[key])); - } else if (key in queues) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn(...args, (err, ...resultArgs) => { - // #1465 don't memoize if an error occurred - if (!err) { - memo[key] = resultArgs; - } - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i](err, ...resultArgs); - } - }); - } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; -} - -/* istanbul ignore file */ - -/** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `process.nextTick`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name nextTick - * @static - * @memberOf module:Utils - * @method - * @see [async.setImmediate]{@link module:Utils.setImmediate} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ -var _defer$1; - -if (hasNextTick) { - _defer$1 = process.nextTick; -} else if (hasSetImmediate) { - _defer$1 = setImmediate; -} else { - _defer$1 = fallback; -} - -var nextTick = wrap(_defer$1); - -var parallel = awaitify((eachfn, tasks, callback) => { - var results = isArrayLike(tasks) ? [] : {}; - - eachfn(tasks, (task, key, taskCb) => { - wrapAsync(task)((err, ...result) => { - if (result.length < 2) { - [result] = result; - } - results[key] = result; - taskCb(err); - }); - }, err => callback(err, results)); -}, 3); - -/** - * Run the `tasks` collection of functions in parallel, without waiting until - * the previous function has completed. If any of the functions pass an error to - * its callback, the main `callback` is immediately called with the value of the - * error. Once the `tasks` have completed, the results are passed to the final - * `callback` as an array. - * - * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about - * parallel execution of code. If your tasks do not use any timers or perform - * any I/O, they will actually be executed in series. Any synchronous setup - * sections for each task will happen one after the other. JavaScript remains - * single-threaded. - * - * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the - * execution of other tasks when a task fails. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.parallel}. - * - * @name parallel - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * - * //Using Callbacks - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function parallel$1(tasks, callback) { - return parallel(eachOf$1, tasks, callback); -} - -/** - * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a - * time. - * - * @name parallelLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.parallel]{@link module:ControlFlow.parallel} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - */ -function parallelLimit(tasks, limit, callback) { - return parallel(eachOfLimit(limit), tasks, callback); -} - -/** - * A queue of tasks for the worker function to complete. - * @typedef {Iterable} QueueObject - * @memberOf module:ControlFlow - * @property {Function} length - a function returning the number of items - * waiting to be processed. Invoke with `queue.length()`. - * @property {boolean} started - a boolean indicating whether or not any - * items have been pushed and processed by the queue. - * @property {Function} running - a function returning the number of items - * currently being processed. Invoke with `queue.running()`. - * @property {Function} workersList - a function returning the array of items - * currently being processed. Invoke with `queue.workersList()`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke with `queue.idle()`. - * @property {number} concurrency - an integer for determining how many `worker` - * functions should be run in parallel. This property can be changed after a - * `queue` is created to alter the concurrency on-the-fly. - * @property {number} payload - an integer that specifies how many items are - * passed to the worker function at a time. only applies if this is a - * [cargo]{@link module:ControlFlow.cargo} object - * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` - * once the `worker` has finished processing the task. Instead of a single task, - * a `tasks` array can be submitted. The respective callback is used for every - * task in the list. Invoke with `queue.push(task, [callback])`, - * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. - * Invoke with `queue.unshift(task, [callback])`. - * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns - * a promise that rejects if an error occurs. - * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns - * a promise that rejects if an error occurs. - * @property {Function} remove - remove items from the queue that match a test - * function. The test function will be passed an object with a `data` property, - * and a `priority` property, if this is a - * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. - * Invoked with `queue.remove(testFn)`, where `testFn` is of the form - * `function ({data, priority}) {}` and returns a Boolean. - * @property {Function} saturated - a function that sets a callback that is - * called when the number of running workers hits the `concurrency` limit, and - * further tasks will be queued. If the callback is omitted, `q.saturated()` - * returns a promise for the next occurrence. - * @property {Function} unsaturated - a function that sets a callback that is - * called when the number of running workers is less than the `concurrency` & - * `buffer` limits, and further tasks will not be queued. If the callback is - * omitted, `q.unsaturated()` returns a promise for the next occurrence. - * @property {number} buffer - A minimum threshold buffer in order to say that - * the `queue` is `unsaturated`. - * @property {Function} empty - a function that sets a callback that is called - * when the last item from the `queue` is given to a `worker`. If the callback - * is omitted, `q.empty()` returns a promise for the next occurrence. - * @property {Function} drain - a function that sets a callback that is called - * when the last item from the `queue` has returned from the `worker`. If the - * callback is omitted, `q.drain()` returns a promise for the next occurrence. - * @property {Function} error - a function that sets a callback that is called - * when a task errors. Has the signature `function(error, task)`. If the - * callback is omitted, `error()` returns a promise that rejects on the next - * error. - * @property {boolean} paused - a boolean for determining whether the queue is - * in a paused state. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke with `queue.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke with `queue.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. No more tasks - * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. - * - * @example - * const q = async.queue(worker, 2) - * q.push(item1) - * q.push(item2) - * q.push(item3) - * // queues are iterable, spread into an array to inspect - * const items = [...q] // [item1, item2, item3] - * // or use for of - * for (let item of q) { - * console.log(item) - * } - * - * q.drain(() => { - * console.log('all done') - * }) - * // or - * await q.drain() - */ - -/** - * Creates a `queue` object with the specified `concurrency`. Tasks added to the - * `queue` are processed in parallel (up to the `concurrency` limit). If all - * `worker`s are in progress, the task is queued until one becomes available. - * Once a `worker` completes a `task`, that `task`'s callback is called. - * - * @name queue - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. Invoked with (task, callback). - * @param {number} [concurrency=1] - An `integer` for determining how many - * `worker` functions should be run in parallel. If omitted, the concurrency - * defaults to `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be - * attached as certain properties to listen for specific events during the - * lifecycle of the queue. - * @example - * - * // create a queue object with concurrency 2 - * var q = async.queue(function(task, callback) { - * console.log('hello ' + task.name); - * callback(); - * }, 2); - * - * // assign a callback - * q.drain(function() { - * console.log('all items have been processed'); - * }); - * // or await the end - * await q.drain() - * - * // assign an error callback - * q.error(function(err, task) { - * console.error('task experienced an error'); - * }); - * - * // add some items to the queue - * q.push({name: 'foo'}, function(err) { - * console.log('finished processing foo'); - * }); - * // callback is optional - * q.push({name: 'bar'}); - * - * // add some items to the queue (batch-wise) - * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { - * console.log('finished processing item'); - * }); - * - * // add some items to the front of the queue - * q.unshift({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - */ -function queue$1 (worker, concurrency) { - var _worker = wrapAsync(worker); - return queue((items, cb) => { - _worker(items[0], cb); - }, concurrency, 1); -} - -// Binary min-heap implementation used for priority queue. -// Implementation is stable, i.e. push time is considered for equal priorities -class Heap { - constructor() { - this.heap = []; - this.pushCount = Number.MIN_SAFE_INTEGER; - } - - get length() { - return this.heap.length; - } - - empty () { - this.heap = []; - return this; - } - - percUp(index) { - let p; - - while (index > 0 && smaller(this.heap[index], this.heap[p=parent(index)])) { - let t = this.heap[index]; - this.heap[index] = this.heap[p]; - this.heap[p] = t; - - index = p; - } - } - - percDown(index) { - let l; - - while ((l=leftChi(index)) < this.heap.length) { - if (l+1 < this.heap.length && smaller(this.heap[l+1], this.heap[l])) { - l = l+1; - } - - if (smaller(this.heap[index], this.heap[l])) { - break; - } - - let t = this.heap[index]; - this.heap[index] = this.heap[l]; - this.heap[l] = t; - - index = l; - } - } - - push(node) { - node.pushCount = ++this.pushCount; - this.heap.push(node); - this.percUp(this.heap.length-1); - } - - unshift(node) { - return this.heap.push(node); - } - - shift() { - let [top] = this.heap; - - this.heap[0] = this.heap[this.heap.length-1]; - this.heap.pop(); - this.percDown(0); - - return top; - } - - toArray() { - return [...this]; - } - - *[Symbol.iterator] () { - for (let i = 0; i < this.heap.length; i++) { - yield this.heap[i].data; - } - } - - remove (testFn) { - let j = 0; - for (let i = 0; i < this.heap.length; i++) { - if (!testFn(this.heap[i])) { - this.heap[j] = this.heap[i]; - j++; - } - } - - this.heap.splice(j); - - for (let i = parent(this.heap.length-1); i >= 0; i--) { - this.percDown(i); - } - - return this; - } -} - -function leftChi(i) { - return (i<<1)+1; -} - -function parent(i) { - return ((i+1)>>1)-1; -} - -function smaller(x, y) { - if (x.priority !== y.priority) { - return x.priority < y.priority; - } - else { - return x.pushCount < y.pushCount; - } -} - -/** - * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and - * completed in ascending priority order. - * - * @name priorityQueue - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. - * Invoked with (task, callback). - * @param {number} concurrency - An `integer` for determining how many `worker` - * functions should be run in parallel. If omitted, the concurrency defaults to - * `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three - * differences between `queue` and `priorityQueue` objects: - * * `push(task, priority, [callback])` - `priority` should be a number. If an - * array of `tasks` is given, all tasks will be assigned the same priority. - * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, - * except this returns a promise that rejects if an error occurs. - * * The `unshift` and `unshiftAsync` methods were removed. - */ -function priorityQueue(worker, concurrency) { - // Start with a normal queue - var q = queue$1(worker, concurrency); - - var { - push, - pushAsync - } = q; - - q._tasks = new Heap(); - q._createTaskItem = ({data, priority}, callback) => { - return { - data, - priority, - callback - }; - }; - - function createDataItems(tasks, priority) { - if (!Array.isArray(tasks)) { - return {data: tasks, priority}; - } - return tasks.map(data => { return {data, priority}; }); - } - - // Override push to accept second parameter representing priority - q.push = function(data, priority = 0, callback) { - return push(createDataItems(data, priority), callback); - }; - - q.pushAsync = function(data, priority = 0, callback) { - return pushAsync(createDataItems(data, priority), callback); - }; - - // Remove unshift functions - delete q.unshift; - delete q.unshiftAsync; - - return q; -} - -/** - * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` complete or pass an - * error to its callback, the main `callback` is immediately called. It's - * equivalent to `Promise.race()`. - * - * @name race - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} - * to run. Each function can complete with an optional `result` value. - * @param {Function} callback - A callback to run once any of the functions have - * completed. This function gets an error or result from the first function that - * completed. Invoked with (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.race([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // main callback - * function(err, result) { - * // the result will be equal to 'two' as it finishes earlier - * }); - */ -function race(tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - wrapAsync(tasks[i])(callback); - } -} - -var race$1 = awaitify(race, 2); - -/** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function reduceRight (array, memo, iteratee, callback) { - var reversed = [...array].reverse(); - return reduce$1(reversed, memo, iteratee, callback); -} - -/** - * Wraps the async function in another function that always completes with a - * result object, even when it errors. - * - * The result object has either the property `error` or `value`. - * - * @name reflect - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function you want to wrap - * @returns {Function} - A function that always passes null to it's callback as - * the error. The second argument to the callback will be an `object` with - * either an `error` or a `value` property. - * @example - * - * async.parallel([ - * async.reflect(function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }), - * async.reflect(function(callback) { - * // do some more stuff but error ... - * callback('bad stuff happened'); - * }), - * async.reflect(function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * }) - * ], - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = 'bad stuff happened' - * // results[2].value = 'two' - * }); - */ -function reflect(fn) { - var _fn = wrapAsync(fn); - return initialParams(function reflectOn(args, reflectCallback) { - args.push((error, ...cbArgs) => { - let retVal = {}; - if (error) { - retVal.error = error; - } - if (cbArgs.length > 0){ - var value = cbArgs; - if (cbArgs.length <= 1) { - [value] = cbArgs; - } - retVal.value = value; - } - reflectCallback(null, retVal); - }); - - return _fn.apply(this, args); - }); -} - -/** - * A helper function that wraps an array or an object of functions with `reflect`. - * - * @name reflectAll - * @static - * @memberOf module:Utils - * @method - * @see [async.reflect]{@link module:Utils.reflect} - * @category Util - * @param {Array|Object|Iterable} tasks - The collection of - * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. - * @returns {Array} Returns an array of async functions, each wrapped in - * `async.reflect` - * @example - * - * let tasks = [ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * // do some more stuff but error ... - * callback(new Error('bad stuff happened')); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = Error('bad stuff happened') - * // results[2].value = 'two' - * }); - * - * // an example using an object instead of an array - * let tasks = { - * one: function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * two: function(callback) { - * callback('two'); - * }, - * three: function(callback) { - * setTimeout(function() { - * callback(null, 'three'); - * }, 100); - * } - * }; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results.one.value = 'one' - * // results.two.error = 'two' - * // results.three.value = 'three' - * }); - */ -function reflectAll(tasks) { - var results; - if (Array.isArray(tasks)) { - results = tasks.map(reflect); - } else { - results = {}; - Object.keys(tasks).forEach(key => { - results[key] = reflect.call(this, tasks[key]); - }); - } - return results; -} - -function reject(eachfn, arr, _iteratee, callback) { - const iteratee = wrapAsync(_iteratee); - return _filter(eachfn, arr, (value, cb) => { - iteratee(value, (err, v) => { - cb(err, !v); - }); - }, callback); -} - -/** - * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. - * - * @name reject - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.reject(fileList, fileExists, function(err, results) { - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }); - * - * // Using Promises - * async.reject(fileList, fileExists) - * .then( results => { - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.reject(fileList, fileExists); - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function reject$1 (coll, iteratee, callback) { - return reject(eachOf$1, coll, iteratee, callback) -} -var reject$2 = awaitify(reject$1, 3); - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a - * time. - * - * @name rejectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function rejectLimit (coll, limit, iteratee, callback) { - return reject(eachOfLimit(limit), coll, iteratee, callback) -} -var rejectLimit$1 = awaitify(rejectLimit, 4); - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. - * - * @name rejectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function rejectSeries (coll, iteratee, callback) { - return reject(eachOfSeries$1, coll, iteratee, callback) -} -var rejectSeries$1 = awaitify(rejectSeries, 3); - -function constant$1(value) { - return function () { - return value; - } -} - -/** - * Attempts to get a successful response from `task` no more than `times` times - * before returning an error. If the task is successful, the `callback` will be - * passed the result of the successful task. If all attempts fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name retry - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @see [async.retryable]{@link module:ControlFlow.retryable} - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an - * object with `times` and `interval` or a number. - * * `times` - The number of attempts to make before giving up. The default - * is `5`. - * * `interval` - The time to wait between retries, in milliseconds. The - * default is `0`. The interval may also be specified as a function of the - * retry count (see example). - * * `errorFilter` - An optional synchronous function that is invoked on - * erroneous result. If it returns `true` the retry attempts will continue; - * if the function returns `false` the retry flow is aborted with the current - * attempt's error and result being returned to the final callback. - * Invoked with (err). - * * If `opts` is a number, the number specifies the number of times to retry, - * with the default interval of `0`. - * @param {AsyncFunction} task - An async function to retry. - * Invoked with (callback). - * @param {Function} [callback] - An optional callback which is called when the - * task has succeeded, or after the final failed attempt. It receives the `err` - * and `result` arguments of the last attempt at completing the `task`. Invoked - * with (err, results). - * @returns {Promise} a promise if no callback provided - * - * @example - * - * // The `retry` function can be used as a stand-alone control flow by passing - * // a callback, as shown below: - * - * // try calling apiMethod 3 times - * async.retry(3, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 3 times, waiting 200 ms between each retry - * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 10 times with exponential backoff - * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) - * async.retry({ - * times: 10, - * interval: function(retryCount) { - * return 50 * Math.pow(2, retryCount); - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod the default 5 times no delay between each retry - * async.retry(apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod only when error condition satisfies, all other - * // errors will abort the retry control flow and return to final callback - * async.retry({ - * errorFilter: function(err) { - * return err.message === 'Temporary error'; // only retry on a specific error - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // to retry individual methods that are not as reliable within other - * // control flow functions, use the `retryable` wrapper: - * async.auto({ - * users: api.getUsers.bind(api), - * payments: async.retryable(3, api.getPayments.bind(api)) - * }, function(err, results) { - * // do something with the results - * }); - * - */ -const DEFAULT_TIMES = 5; -const DEFAULT_INTERVAL = 0; - -function retry(opts, task, callback) { - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant$1(DEFAULT_INTERVAL) - }; - - if (arguments.length < 3 && typeof opts === 'function') { - callback = task || promiseCallback(); - task = opts; - } else { - parseTimes(options, opts); - callback = callback || promiseCallback(); - } - - if (typeof task !== 'function') { - throw new Error("Invalid arguments for async.retry"); - } - - var _task = wrapAsync(task); - - var attempt = 1; - function retryAttempt() { - _task((err, ...args) => { - if (err === false) return - if (err && attempt++ < options.times && - (typeof options.errorFilter != 'function' || - options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); - } else { - callback(err, ...args); - } - }); - } - - retryAttempt(); - return callback[PROMISE_SYMBOL] -} - -function parseTimes(acc, t) { - if (typeof t === 'object') { - acc.times = +t.times || DEFAULT_TIMES; - - acc.intervalFunc = typeof t.interval === 'function' ? - t.interval : - constant$1(+t.interval || DEFAULT_INTERVAL); - - acc.errorFilter = t.errorFilter; - } else if (typeof t === 'number' || typeof t === 'string') { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } -} - -/** - * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method - * wraps a task and makes it retryable, rather than immediately calling it - * with retries. - * - * @name retryable - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.retry]{@link module:ControlFlow.retry} - * @category Control Flow - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional - * options, exactly the same as from `retry`, except for a `opts.arity` that - * is the arity of the `task` function, defaulting to `task.length` - * @param {AsyncFunction} task - the asynchronous function to wrap. - * This function will be passed any arguments passed to the returned wrapper. - * Invoked with (...args, callback). - * @returns {AsyncFunction} The wrapped function, which when invoked, will - * retry on an error, based on the parameters specified in `opts`. - * This function will accept the same parameters as `task`. - * @example - * - * async.auto({ - * dep1: async.retryable(3, getFromFlakyService), - * process: ["dep1", async.retryable(3, function (results, cb) { - * maybeProcessData(results.dep1, cb); - * })] - * }, callback); - */ -function retryable (opts, task) { - if (!task) { - task = opts; - opts = null; - } - let arity = (opts && opts.arity) || task.length; - if (isAsync(task)) { - arity += 1; - } - var _task = wrapAsync(task); - return initialParams((args, callback) => { - if (args.length < arity - 1 || callback == null) { - args.push(callback); - callback = promiseCallback(); - } - function taskFn(cb) { - _task(...args, cb); - } - - if (opts) retry(opts, taskFn, callback); - else retry(taskFn, callback); - - return callback[PROMISE_SYMBOL] - }); -} - -/** - * Run the functions in the `tasks` collection in series, each one running once - * the previous function has completed. If any functions in the series pass an - * error to its callback, no more functions are run, and `callback` is - * immediately called with the value of the error. Otherwise, `callback` - * receives an array of results when `tasks` have completed. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function, and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.series}. - * - * **Note** that while many implementations preserve the order of object - * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) - * explicitly states that - * - * > The mechanics and order of enumerating the properties is not specified. - * - * So if you rely on the order in which your series of functions are executed, - * and want this to work on all platforms, consider using an array. - * - * @name series - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing - * [async functions]{@link AsyncFunction} to run in series. - * Each function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This function gets a results array (or object) - * containing all the result arguments passed to the `task` callbacks. Invoked - * with (err, result). - * @return {Promise} a promise, if no callback is passed - * @example - * - * //Using Callbacks - * async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] - * }); - * - * // an example using objects instead of arrays - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.series([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function series(tasks, callback) { - return parallel(eachOfSeries$1, tasks, callback); -} - -/** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - *); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // false - * // result is false since none of the files exists - * } - *); - * - * // Using Promises - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since some file in the list exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since none of the files exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); - * console.log(result); - * // false - * // result is false since none of the files exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function some(coll, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOf$1, coll, iteratee, callback) -} -var some$1 = awaitify(some, 3); - -/** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someLimit(coll, limit, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfLimit(limit), coll, iteratee, callback) -} -var someLimit$1 = awaitify(someLimit, 4); - -/** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someSeries(coll, iteratee, callback) { - return _createTester(Boolean, res => res)(eachOfSeries$1, coll, iteratee, callback) -} -var someSeries$1 = awaitify(someSeries, 3); - -/** - * Sorts a list by the results of running each `coll` value through an async - * `iteratee`. - * - * @name sortBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a value to use as the sort criteria as - * its `result`. - * Invoked with (item, callback). - * @param {Function} callback - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is the items - * from the original `coll` sorted by the values returned by the `iteratee` - * calls. Invoked with (err, results). - * @returns {Promise} a promise, if no callback passed - * @example - * - * // bigfile.txt is a file that is 251100 bytes in size - * // mediumfile.txt is a file that is 11000 bytes in size - * // smallfile.txt is a file that is 121 bytes in size - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // By modifying the callback parameter the - * // sorting order can be influenced: - * - * // ascending order - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) return callback(getFileSizeErr); - * callback(null, fileSize); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // descending order - * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) { - * return callback(getFileSizeErr); - * } - * callback(null, fileSize * -1); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] - * } - * } - * ); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * } - * ); - * - * // Using Promises - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * (async () => { - * try { - * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * // Error handling - * async () => { - * try { - * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function sortBy (coll, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return map$1(coll, (x, iterCb) => { - _iteratee(x, (err, criteria) => { - if (err) return iterCb(err); - iterCb(err, {value: x, criteria}); - }); - }, (err, results) => { - if (err) return callback(err); - callback(null, results.sort(comparator).map(v => v.value)); - }); - - function comparator(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } -} -var sortBy$1 = awaitify(sortBy, 3); - -/** - * Sets a time limit on an asynchronous function. If the function does not call - * its callback within the specified milliseconds, it will be called with a - * timeout error. The code property for the error object will be `'ETIMEDOUT'`. - * - * @name timeout - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} asyncFn - The async function to limit in time. - * @param {number} milliseconds - The specified time limit. - * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) - * to timeout Error for more information.. - * @returns {AsyncFunction} Returns a wrapped function that can be used with any - * of the control flow functions. - * Invoke this function with the same parameters as you would `asyncFunc`. - * @example - * - * function myFunction(foo, callback) { - * doAsyncTask(foo, function(err, data) { - * // handle errors - * if (err) return callback(err); - * - * // do some stuff ... - * - * // return processed data - * return callback(null, data); - * }); - * } - * - * var wrapped = async.timeout(myFunction, 1000); - * - * // call `wrapped` as you would `myFunction` - * wrapped({ bar: 'bar' }, function(err, data) { - * // if `myFunction` takes < 1000 ms to execute, `err` - * // and `data` will have their expected values - * - * // else `err` will be an Error with the code 'ETIMEDOUT' - * }); - */ -function timeout(asyncFn, milliseconds, info) { - var fn = wrapAsync(asyncFn); - - return initialParams((args, callback) => { - var timedOut = false; - var timer; - - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; - } - timedOut = true; - callback(error); - } - - args.push((...cbArgs) => { - if (!timedOut) { - callback(...cbArgs); - clearTimeout(timer); - } - }); - - // setup timer and call original function - timer = setTimeout(timeoutCallback, milliseconds); - fn(...args); - }); -} - -function range(size) { - var result = Array(size); - while (size--) { - result[size] = size; - } - return result; -} - -/** - * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a - * time. - * - * @name timesLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} count - The number of times to run the function. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see [async.map]{@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ -function timesLimit(count, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - return mapLimit$1(range(count), limit, _iteratee, callback); -} - -/** - * Calls the `iteratee` function `n` times, and accumulates results in the same - * manner you would use with [map]{@link module:Collections.map}. - * - * @name times - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.map]{@link module:Collections.map} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - * @example - * - * // Pretend this is some complicated async factory - * var createUser = function(id, callback) { - * callback(null, { - * id: 'user' + id - * }); - * }; - * - * // generate 5 users - * async.times(5, function(n, next) { - * createUser(n, function(err, user) { - * next(err, user); - * }); - * }, function(err, users) { - * // we should now have 5 users - * }); - */ -function times (n, iteratee, callback) { - return timesLimit(n, Infinity, iteratee, callback) -} - -/** - * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. - * - * @name timesSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ -function timesSeries (n, iteratee, callback) { - return timesLimit(n, 1, iteratee, callback) -} - -/** - * A relative of `reduce`. Takes an Object or Array, and iterates over each - * element in parallel, each step potentially mutating an `accumulator` value. - * The type of the accumulator defaults to the type of collection passed in. - * - * @name transform - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} [accumulator] - The initial state of the transform. If omitted, - * it will default to an empty Object or Array, depending on the type of `coll` - * @param {AsyncFunction} iteratee - A function applied to each item in the - * collection that potentially modifies the accumulator. - * Invoked with (accumulator, item, key, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the transformed accumulator. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileList, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * }); - * - * // Using Promises - * async.transform(fileList, transformFileSize) - * .then(result => { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * (async () => { - * try { - * let result = await async.transform(fileList, transformFileSize); - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileMap, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * }); - * - * // Using Promises - * async.transform(fileMap, transformFileSize) - * .then(result => { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.transform(fileMap, transformFileSize); - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function transform (coll, accumulator, iteratee, callback) { - if (arguments.length <= 3 && typeof accumulator === 'function') { - callback = iteratee; - iteratee = accumulator; - accumulator = Array.isArray(coll) ? [] : {}; - } - callback = once(callback || promiseCallback()); - var _iteratee = wrapAsync(iteratee); - - eachOf$1(coll, (v, k, cb) => { - _iteratee(accumulator, v, k, cb); - }, err => callback(err, accumulator)); - return callback[PROMISE_SYMBOL] -} - -/** - * It runs each task in series but stops whenever any of the functions were - * successful. If one of the tasks were successful, the `callback` will be - * passed the result of the successful task. If all tasks fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name tryEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to - * run, each function is passed a `callback(err, result)` it must call on - * completion with an error `err` (which can be `null`) and an optional `result` - * value. - * @param {Function} [callback] - An optional callback which is called when one - * of the tasks has succeeded, or all have failed. It receives the `err` and - * `result` arguments of the last attempt at completing the `task`. Invoked with - * (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * async.tryEach([ - * function getDataFromFirstWebsite(callback) { - * // Try getting the data from the first website - * callback(err, data); - * }, - * function getDataFromSecondWebsite(callback) { - * // First website failed, - * // Try getting the data from the backup website - * callback(err, data); - * } - * ], - * // optional callback - * function(err, results) { - * Now do something with the data. - * }); - * - */ -function tryEach(tasks, callback) { - var error = null; - var result; - return eachSeries$1(tasks, (task, taskCb) => { - wrapAsync(task)((err, ...args) => { - if (err === false) return taskCb(err); - - if (args.length < 2) { - [result] = args; - } else { - result = args; - } - error = err; - taskCb(err ? null : {}); - }); - }, () => callback(error, result)); -} - -var tryEach$1 = awaitify(tryEach); - -/** - * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, - * unmemoized form. Handy for testing. - * - * @name unmemoize - * @static - * @memberOf module:Utils - * @method - * @see [async.memoize]{@link module:Utils.memoize} - * @category Util - * @param {AsyncFunction} fn - the memoized function - * @returns {AsyncFunction} a function that calls the original unmemoized function - */ -function unmemoize(fn) { - return (...args) => { - return (fn.unmemoized || fn)(...args); - }; -} - -/** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - * @example - * - * var count = 0; - * async.whilst( - * function test(cb) { cb(null, count < 5); }, - * function iter(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ -function whilst(test, iteratee, callback) { - callback = onlyOnce(callback); - var _fn = wrapAsync(iteratee); - var _test = wrapAsync(test); - var results = []; - - function next(err, ...rest) { - if (err) return callback(err); - results = rest; - if (err === false) return; - _test(check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return _test(check); -} -var whilst$1 = awaitify(whilst, 3); - -/** - * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `iteratee`'s callback. - * - * The inverse of [whilst]{@link module:ControlFlow.whilst}. - * - * @name until - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (callback). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * const results = [] - * let finished = false - * async.until(function test(cb) { - * cb(null, finished) - * }, function iter(next) { - * fetchPage(url, (err, body) => { - * if (err) return next(err) - * results = results.concat(body.objects) - * finished = !!body.next - * next(err) - * }) - * }, function done (err) { - * // all pages have been fetched - * }) - */ -function until(test, iteratee, callback) { - const _test = wrapAsync(test); - return whilst$1((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback); -} - -/** - * Runs the `tasks` array of functions in series, each passing their results to - * the next in the array. However, if any of the `tasks` pass an error to their - * own callback, the next function is not executed, and the main `callback` is - * immediately called with the error. - * - * @name waterfall - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} - * to run. - * Each function should complete with any number of `result` values. - * The `result` values will be passed as arguments, in order, to the next task. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This will be passed the results of the last task's - * callback. Invoked with (err, [results]). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.waterfall([ - * function(callback) { - * callback(null, 'one', 'two'); - * }, - * function(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * }, - * function(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - * ], function (err, result) { - * // result now equals 'done' - * }); - * - * // Or, with named functions: - * async.waterfall([ - * myFirstFunction, - * mySecondFunction, - * myLastFunction, - * ], function (err, result) { - * // result now equals 'done' - * }); - * function myFirstFunction(callback) { - * callback(null, 'one', 'two'); - * } - * function mySecondFunction(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * } - * function myLastFunction(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - */ -function waterfall (tasks, callback) { - callback = once(callback); - if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); - if (!tasks.length) return callback(); - var taskIndex = 0; - - function nextTask(args) { - var task = wrapAsync(tasks[taskIndex++]); - task(...args, onlyOnce(next)); - } - - function next(err, ...args) { - if (err === false) return - if (err || taskIndex === tasks.length) { - return callback(err, ...args); - } - nextTask(args); - } - - nextTask([]); -} - -var waterfall$1 = awaitify(waterfall); - -/** - * An "async function" in the context of Async is an asynchronous function with - * a variable number of parameters, with the final parameter being a callback. - * (`function (arg1, arg2, ..., callback) {}`) - * The final callback is of the form `callback(err, results...)`, which must be - * called once the function is completed. The callback should be called with a - * Error as its first argument to signal that an error occurred. - * Otherwise, if no error occurred, it should be called with `null` as the first - * argument, and any additional `result` arguments that may apply, to signal - * successful completion. - * The callback must be called exactly once, ideally on a later tick of the - * JavaScript event loop. - * - * This type of function is also referred to as a "Node-style async function", - * or a "continuation passing-style function" (CPS). Most of the methods of this - * library are themselves CPS/Node-style async functions, or functions that - * return CPS/Node-style async functions. - * - * Wherever we accept a Node-style async function, we also directly accept an - * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. - * In this case, the `async` function will not be passed a final callback - * argument, and any thrown error will be used as the `err` argument of the - * implicit callback, and the return value will be used as the `result` value. - * (i.e. a `rejected` of the returned Promise becomes the `err` callback - * argument, and a `resolved` value becomes the `result`.) - * - * Note, due to JavaScript limitations, we can only detect native `async` - * functions and not transpilied implementations. - * Your environment must have `async`/`await` support for this to work. - * (e.g. Node > v7.6, or a recent version of a modern browser). - * If you are using `async` functions through a transpiler (e.g. Babel), you - * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, - * because the `async function` will be compiled to an ordinary function that - * returns a promise. - * - * @typedef {Function} AsyncFunction - * @static - */ - -var index = { - apply, - applyEach: applyEach$1, - applyEachSeries, - asyncify, - auto, - autoInject, - cargo, - cargoQueue: cargo$1, - compose, - concat: concat$1, - concatLimit: concatLimit$1, - concatSeries: concatSeries$1, - constant, - detect: detect$1, - detectLimit: detectLimit$1, - detectSeries: detectSeries$1, - dir, - doUntil, - doWhilst: doWhilst$1, - each, - eachLimit: eachLimit$2, - eachOf: eachOf$1, - eachOfLimit: eachOfLimit$2, - eachOfSeries: eachOfSeries$1, - eachSeries: eachSeries$1, - ensureAsync, - every: every$1, - everyLimit: everyLimit$1, - everySeries: everySeries$1, - filter: filter$1, - filterLimit: filterLimit$1, - filterSeries: filterSeries$1, - forever: forever$1, - groupBy, - groupByLimit: groupByLimit$1, - groupBySeries, - log, - map: map$1, - mapLimit: mapLimit$1, - mapSeries: mapSeries$1, - mapValues, - mapValuesLimit: mapValuesLimit$1, - mapValuesSeries, - memoize, - nextTick, - parallel: parallel$1, - parallelLimit, - priorityQueue, - queue: queue$1, - race: race$1, - reduce: reduce$1, - reduceRight, - reflect, - reflectAll, - reject: reject$2, - rejectLimit: rejectLimit$1, - rejectSeries: rejectSeries$1, - retry, - retryable, - seq, - series, - setImmediate: setImmediate$1, - some: some$1, - someLimit: someLimit$1, - someSeries: someSeries$1, - sortBy: sortBy$1, - timeout, - times, - timesLimit, - timesSeries, - transform, - tryEach: tryEach$1, - unmemoize, - until, - waterfall: waterfall$1, - whilst: whilst$1, - - // aliases - all: every$1, - allLimit: everyLimit$1, - allSeries: everySeries$1, - any: some$1, - anyLimit: someLimit$1, - anySeries: someSeries$1, - find: detect$1, - findLimit: detectLimit$1, - findSeries: detectSeries$1, - flatMap: concat$1, - flatMapLimit: concatLimit$1, - flatMapSeries: concatSeries$1, - forEach: each, - forEachSeries: eachSeries$1, - forEachLimit: eachLimit$2, - forEachOf: eachOf$1, - forEachOfSeries: eachOfSeries$1, - forEachOfLimit: eachOfLimit$2, - inject: reduce$1, - foldl: reduce$1, - foldr: reduceRight, - select: filter$1, - selectLimit: filterLimit$1, - selectSeries: filterSeries$1, - wrapSync: asyncify, - during: whilst$1, - doDuring: doWhilst$1 -}; - -export default index; -export { apply, applyEach$1 as applyEach, applyEachSeries, asyncify, auto, autoInject, cargo, cargo$1 as cargoQueue, compose, concat$1 as concat, concatLimit$1 as concatLimit, concatSeries$1 as concatSeries, constant, detect$1 as detect, detectLimit$1 as detectLimit, detectSeries$1 as detectSeries, dir, doUntil, doWhilst$1 as doWhilst, each, eachLimit$2 as eachLimit, eachOf$1 as eachOf, eachOfLimit$2 as eachOfLimit, eachOfSeries$1 as eachOfSeries, eachSeries$1 as eachSeries, ensureAsync, every$1 as every, everyLimit$1 as everyLimit, everySeries$1 as everySeries, filter$1 as filter, filterLimit$1 as filterLimit, filterSeries$1 as filterSeries, forever$1 as forever, groupBy, groupByLimit$1 as groupByLimit, groupBySeries, log, map$1 as map, mapLimit$1 as mapLimit, mapSeries$1 as mapSeries, mapValues, mapValuesLimit$1 as mapValuesLimit, mapValuesSeries, memoize, nextTick, parallel$1 as parallel, parallelLimit, priorityQueue, queue$1 as queue, race$1 as race, reduce$1 as reduce, reduceRight, reflect, reflectAll, reject$2 as reject, rejectLimit$1 as rejectLimit, rejectSeries$1 as rejectSeries, retry, retryable, seq, series, setImmediate$1 as setImmediate, some$1 as some, someLimit$1 as someLimit, someSeries$1 as someSeries, sortBy$1 as sortBy, timeout, times, timesLimit, timesSeries, transform, tryEach$1 as tryEach, unmemoize, until, waterfall$1 as waterfall, whilst$1 as whilst, every$1 as all, everyLimit$1 as allLimit, everySeries$1 as allSeries, some$1 as any, someLimit$1 as anyLimit, someSeries$1 as anySeries, detect$1 as find, detectLimit$1 as findLimit, detectSeries$1 as findSeries, concat$1 as flatMap, concatLimit$1 as flatMapLimit, concatSeries$1 as flatMapSeries, each as forEach, eachSeries$1 as forEachSeries, eachLimit$2 as forEachLimit, eachOf$1 as forEachOf, eachOfSeries$1 as forEachOfSeries, eachOfLimit$2 as forEachOfLimit, reduce$1 as inject, reduce$1 as foldl, reduceRight as foldr, filter$1 as select, filterLimit$1 as selectLimit, filterSeries$1 as selectSeries, asyncify as wrapSync, whilst$1 as during, doWhilst$1 as doDuring }; diff --git a/node_modules/async/doDuring.js b/node_modules/async/doDuring.js deleted file mode 100644 index 4c98e9e..0000000 --- a/node_modules/async/doDuring.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ -function doWhilst(iteratee, test, callback) { - callback = (0, _onlyOnce2.default)(callback); - var _fn = (0, _wrapAsync2.default)(iteratee); - var _test = (0, _wrapAsync2.default)(test); - var results; - - function next(err, ...args) { - if (err) return callback(err); - if (err === false) return; - results = args; - _test(...args, check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return check(null, true); -} - -exports.default = (0, _awaitify2.default)(doWhilst, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/doUntil.js b/node_modules/async/doUntil.js deleted file mode 100644 index 8aa0935..0000000 --- a/node_modules/async/doUntil.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = doUntil; - -var _doWhilst = require('./doWhilst.js'); - -var _doWhilst2 = _interopRequireDefault(_doWhilst); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the - * argument ordering differs from `until`. - * - * @name doUntil - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee` - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ -function doUntil(iteratee, test, callback) { - const _test = (0, _wrapAsync2.default)(test); - return (0, _doWhilst2.default)(iteratee, (...args) => { - const cb = args.pop(); - _test(...args, (err, truth) => cb(err, !truth)); - }, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/doWhilst.js b/node_modules/async/doWhilst.js deleted file mode 100644 index 4c98e9e..0000000 --- a/node_modules/async/doWhilst.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform after each - * execution of `iteratee`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - */ -function doWhilst(iteratee, test, callback) { - callback = (0, _onlyOnce2.default)(callback); - var _fn = (0, _wrapAsync2.default)(iteratee); - var _test = (0, _wrapAsync2.default)(test); - var results; - - function next(err, ...args) { - if (err) return callback(err); - if (err === false) return; - results = args; - _test(...args, check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return check(null, true); -} - -exports.default = (0, _awaitify2.default)(doWhilst, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/during.js b/node_modules/async/during.js deleted file mode 100644 index 32a4776..0000000 --- a/node_modules/async/during.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - * @example - * - * var count = 0; - * async.whilst( - * function test(cb) { cb(null, count < 5); }, - * function iter(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ -function whilst(test, iteratee, callback) { - callback = (0, _onlyOnce2.default)(callback); - var _fn = (0, _wrapAsync2.default)(iteratee); - var _test = (0, _wrapAsync2.default)(test); - var results = []; - - function next(err, ...rest) { - if (err) return callback(err); - results = rest; - if (err === false) return; - _test(check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return _test(check); -} -exports.default = (0, _awaitify2.default)(whilst, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/each.js b/node_modules/async/each.js deleted file mode 100644 index 405d495..0000000 --- a/node_modules/async/each.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _withoutIndex = require('./internal/withoutIndex.js'); - -var _withoutIndex2 = _interopRequireDefault(_withoutIndex); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; - * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; - * - * // asynchronous function that deletes a file - * const deleteFile = function(file, callback) { - * fs.unlink(file, callback); - * }; - * - * // Using callbacks - * async.each(fileList, deleteFile, function(err) { - * if( err ) { - * console.log(err); - * } else { - * console.log('All files have been deleted successfully'); - * } - * }); - * - * // Error Handling - * async.each(withMissingFileList, deleteFile, function(err){ - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using Promises - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using async/await - * async () => { - * try { - * await async.each(files, deleteFile); - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * await async.each(withMissingFileList, deleteFile); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * } - * } - * - */ -function eachLimit(coll, iteratee, callback) { - return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); -} - -exports.default = (0, _awaitify2.default)(eachLimit, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachLimit.js b/node_modules/async/eachLimit.js deleted file mode 100644 index 5f3d009..0000000 --- a/node_modules/async/eachLimit.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _withoutIndex = require('./internal/withoutIndex.js'); - -var _withoutIndex2 = _interopRequireDefault(_withoutIndex); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachLimit(coll, limit, iteratee, callback) { - return (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); -} -exports.default = (0, _awaitify2.default)(eachLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachOf.js b/node_modules/async/eachOf.js deleted file mode 100644 index c22614f..0000000 --- a/node_modules/async/eachOf.js +++ /dev/null @@ -1,185 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _isArrayLike = require('./internal/isArrayLike.js'); - -var _isArrayLike2 = _interopRequireDefault(_isArrayLike); - -var _breakLoop = require('./internal/breakLoop.js'); - -var _breakLoop2 = _interopRequireDefault(_breakLoop); - -var _eachOfLimit = require('./eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// eachOf implementation optimized for array-likes -function eachOfArrayLike(coll, iteratee, callback) { - callback = (0, _once2.default)(callback); - var index = 0, - completed = 0, - { length } = coll, - canceled = false; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err === false) { - canceled = true; - } - if (canceled === true) return; - if (err) { - callback(err); - } else if (++completed === length || value === _breakLoop2.default) { - callback(null); - } - } - - for (; index < length; index++) { - iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); - } -} - -// a generic version of eachOf which can handle array, object, and iterator cases. -function eachOfGeneric(coll, iteratee, callback) { - return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback); -} - -/** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dev.json is a file containing a valid json object config for dev environment - * // dev.json is a file containing a valid json object config for test environment - * // prod.json is a file containing a valid json object config for prod environment - * // invalid.json is a file with a malformed json object - * - * let configs = {}; //global variable - * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; - * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; - * - * // asynchronous function that reads a json file and parses the contents as json object - * function parseFile(file, key, callback) { - * fs.readFile(file, "utf8", function(err, data) { - * if (err) return calback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * } - * - * // Using callbacks - * async.forEachOf(validConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * } else { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * // JSON parse error exception - * } else { - * console.log(configs); - * } - * }); - * - * // Using Promises - * async.forEachOf(validConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * }).catch( err => { - * console.error(err); - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * }).catch( err => { - * console.error(err); - * // JSON parse error exception - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.forEachOf(validConfigFileMap, parseFile); - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * catch (err) { - * console.log(err); - * } - * } - * - * //Error handing - * async () => { - * try { - * let result = await async.forEachOf(invalidConfigFileMap, parseFile); - * console.log(configs); - * } - * catch (err) { - * console.log(err); - * // JSON parse error exception - * } - * } - * - */ -function eachOf(coll, iteratee, callback) { - var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; - return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); -} - -exports.default = (0, _awaitify2.default)(eachOf, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachOfLimit.js b/node_modules/async/eachOfLimit.js deleted file mode 100644 index e9fc4db..0000000 --- a/node_modules/async/eachOfLimit.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit2 = require('./internal/eachOfLimit.js'); - -var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfLimit(coll, limit, iteratee, callback) { - return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); -} - -exports.default = (0, _awaitify2.default)(eachOfLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachOfSeries.js b/node_modules/async/eachOfSeries.js deleted file mode 100644 index cfb0f33..0000000 --- a/node_modules/async/eachOfSeries.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit = require('./eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. - * - * @name eachOfSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfSeries(coll, iteratee, callback) { - return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(eachOfSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/eachSeries.js b/node_modules/async/eachSeries.js deleted file mode 100644 index d674d0c..0000000 --- a/node_modules/async/eachSeries.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachLimit = require('./eachLimit.js'); - -var _eachLimit2 = _interopRequireDefault(_eachLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item - * in series and therefore the iteratee functions will complete in order. - - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachSeries(coll, iteratee, callback) { - return (0, _eachLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(eachSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/ensureAsync.js b/node_modules/async/ensureAsync.js deleted file mode 100644 index ad8beb5..0000000 --- a/node_modules/async/ensureAsync.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = ensureAsync; - -var _setImmediate = require('./internal/setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Wrap an async function and ensure it calls its callback on a later tick of - * the event loop. If the function already calls its callback on a next tick, - * no extra deferral is added. This is useful for preventing stack overflows - * (`RangeError: Maximum call stack size exceeded`) and generally keeping - * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - * contained. ES2017 `async` functions are returned as-is -- they are immune - * to Zalgo's corrupting influences, as they always resolve on a later tick. - * - * @name ensureAsync - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - an async function, one that expects a node-style - * callback as its last argument. - * @returns {AsyncFunction} Returns a wrapped function with the exact same call - * signature as the function passed in. - * @example - * - * function sometimesAsync(arg, callback) { - * if (cache[arg]) { - * return callback(null, cache[arg]); // this would be synchronous!! - * } else { - * doSomeIO(arg, callback); // this IO would be asynchronous - * } - * } - * - * // this has a risk of stack overflows if many results are cached in a row - * async.mapSeries(args, sometimesAsync, done); - * - * // this will defer sometimesAsync's callback if necessary, - * // preventing stack overflows - * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); - */ -function ensureAsync(fn) { - if ((0, _wrapAsync.isAsync)(fn)) return fn; - return function (...args /*, callback*/) { - var callback = args.pop(); - var sync = true; - args.push((...innerArgs) => { - if (sync) { - (0, _setImmediate2.default)(() => callback(...innerArgs)); - } else { - callback(...innerArgs); - } - }); - fn.apply(this, args); - sync = false; - }; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/every.js b/node_modules/async/every.js deleted file mode 100644 index 148db68..0000000 --- a/node_modules/async/every.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file5.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.every(fileList, fileExists, function(err, result) { - * console.log(result); - * // true - * // result is true since every file exists - * }); - * - * async.every(withMissingFileList, fileExists, function(err, result) { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }); - * - * // Using Promises - * async.every(fileList, fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.every(withMissingFileList, fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since NOT every file exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.every(fileList, fileExists); - * console.log(result); - * // true - * // result is true since every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.every(withMissingFileList, fileExists); - * console.log(result); - * // false - * // result is false since NOT every file exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function every(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(every, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/everyLimit.js b/node_modules/async/everyLimit.js deleted file mode 100644 index 25b2c08..0000000 --- a/node_modules/async/everyLimit.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everyLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(everyLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/everySeries.js b/node_modules/async/everySeries.js deleted file mode 100644 index 147c3dc..0000000 --- a/node_modules/async/everySeries.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function everySeries(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => !bool, res => !res)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(everySeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/filter.js b/node_modules/async/filter.js deleted file mode 100644 index 303dc1f..0000000 --- a/node_modules/async/filter.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.filter(files, fileExists, function(err, results) { - * if(err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * }); - * - * // Using Promises - * async.filter(files, fileExists) - * .then(results => { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.filter(files, fileExists); - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function filter(coll, iteratee, callback) { - return (0, _filter3.default)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filter, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/filterLimit.js b/node_modules/async/filterLimit.js deleted file mode 100644 index 89e55f5..0000000 --- a/node_modules/async/filterLimit.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - */ -function filterLimit(coll, limit, iteratee, callback) { - return (0, _filter3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filterLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/filterSeries.js b/node_modules/async/filterSeries.js deleted file mode 100644 index a045e52..0000000 --- a/node_modules/async/filterSeries.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - * @returns {Promise} a promise, if no callback provided - */ -function filterSeries(coll, iteratee, callback) { - return (0, _filter3.default)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filterSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/find.js b/node_modules/async/find.js deleted file mode 100644 index 05b2e5c..0000000 --- a/node_modules/async/find.js +++ /dev/null @@ -1,96 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * } - *); - * - * // Using Promises - * async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists) - * .then(result => { - * console.log(result); - * // dir1/file1.txt - * // result now equals the first file in the list that exists - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.detect(['file3.txt','file2.txt','dir1/file1.txt'], fileExists); - * console.log(result); - * // dir1/file1.txt - * // result now equals the file in the list that exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function detect(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(detect, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/findLimit.js b/node_modules/async/findLimit.js deleted file mode 100644 index db6961e..0000000 --- a/node_modules/async/findLimit.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(detectLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/findSeries.js b/node_modules/async/findSeries.js deleted file mode 100644 index b9131b4..0000000 --- a/node_modules/async/findSeries.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @returns {Promise} a promise, if a callback is omitted - */ -function detectSeries(coll, iteratee, callback) { - return (0, _createTester2.default)(bool => bool, (res, item) => item)((0, _eachOfLimit2.default)(1), coll, iteratee, callback); -} - -exports.default = (0, _awaitify2.default)(detectSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/flatMap.js b/node_modules/async/flatMap.js deleted file mode 100644 index 8eed1ac..0000000 --- a/node_modules/async/flatMap.js +++ /dev/null @@ -1,115 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _concatLimit = require('./concatLimit.js'); - -var _concatLimit2 = _interopRequireDefault(_concatLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Applies `iteratee` to each item in `coll`, concatenating the results. Returns - * the concatenated list. The `iteratee`s are called in parallel, and the - * results are concatenated as they return. The results array will be returned in - * the original order of `coll` passed to the `iteratee` function. - * - * @name concat - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @alias flatMap - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * let directoryList = ['dir1','dir2','dir3']; - * let withMissingDirectoryList = ['dir1','dir2','dir3', 'dir4']; - * - * // Using callbacks - * async.concat(directoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.concat(directoryList, fs.readdir) - * .then(results => { - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Error Handling - * async.concat(withMissingDirectoryList, fs.readdir) - * .then(results => { - * console.log(results); - * }).catch(err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.concat(directoryList, fs.readdir); - * console.log(results); - * // [ 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt', file5.txt ] - * } catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.concat(withMissingDirectoryList, fs.readdir); - * console.log(results); - * } catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4 does not exist - * } - * } - * - */ -function concat(coll, iteratee, callback) { - return (0, _concatLimit2.default)(coll, Infinity, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(concat, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/flatMapLimit.js b/node_modules/async/flatMapLimit.js deleted file mode 100644 index 3d170f1..0000000 --- a/node_modules/async/flatMapLimit.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _mapLimit = require('./mapLimit.js'); - -var _mapLimit2 = _interopRequireDefault(_mapLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time. - * - * @name concatLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapLimit - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`, - * which should use an array as its result. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatLimit(coll, limit, iteratee, callback) { - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { - _iteratee(val, (err, ...args) => { - if (err) return iterCb(err); - return iterCb(err, args); - }); - }, (err, mapResults) => { - var result = []; - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - result = result.concat(...mapResults[i]); - } - } - - return callback(err, result); - }); -} -exports.default = (0, _awaitify2.default)(concatLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/flatMapSeries.js b/node_modules/async/flatMapSeries.js deleted file mode 100644 index 84add3b..0000000 --- a/node_modules/async/flatMapSeries.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _concatLimit = require('./concatLimit.js'); - -var _concatLimit2 = _interopRequireDefault(_concatLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time. - * - * @name concatSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.concat]{@link module:Collections.concat} - * @category Collection - * @alias flatMapSeries - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`. - * The iteratee should complete with an array an array of results. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is an array - * containing the concatenated results of the `iteratee` function. Invoked with - * (err, results). - * @returns A Promise, if no callback is passed - */ -function concatSeries(coll, iteratee, callback) { - return (0, _concatLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(concatSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/foldl.js b/node_modules/async/foldl.js deleted file mode 100644 index 56e2db8..0000000 --- a/node_modules/async/foldl.js +++ /dev/null @@ -1,153 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Reduces `coll` into a single value using an async `iteratee` to return each - * successive step. `memo` is the initial state of the reduction. This function - * only operates in series. - * - * For performance reasons, it may make sense to split a call to this function - * into a parallel map, and then use the normal `Array.prototype.reduce` on the - * results. This function is for situations where each step in the reduction - * needs to be async; if you can get the data before reducing it, then it's - * probably a good idea to do so. - * - * @name reduce - * @static - * @memberOf module:Collections - * @method - * @alias inject - * @alias foldl - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; - * - * // asynchronous function that computes the file size in bytes - * // file size is added to the memoized value, then returned - * function getFileSizeInBytes(memo, file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, memo + stat.size); - * }); - * } - * - * // Using callbacks - * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.reduce(fileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function reduce(coll, memo, iteratee, callback) { - callback = (0, _once2.default)(callback); - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); -} -exports.default = (0, _awaitify2.default)(reduce, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/foldr.js b/node_modules/async/foldr.js deleted file mode 100644 index bee5391..0000000 --- a/node_modules/async/foldr.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = reduceRight; - -var _reduce = require('./reduce.js'); - -var _reduce2 = _interopRequireDefault(_reduce); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function reduceRight(array, memo, iteratee, callback) { - var reversed = [...array].reverse(); - return (0, _reduce2.default)(reversed, memo, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEach.js b/node_modules/async/forEach.js deleted file mode 100644 index 405d495..0000000 --- a/node_modules/async/forEach.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _withoutIndex = require('./internal/withoutIndex.js'); - -var _withoutIndex2 = _interopRequireDefault(_withoutIndex); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const fileList = [ 'dir1/file2.txt', 'dir2/file3.txt', 'dir/file5.txt']; - * const withMissingFileList = ['dir1/file1.txt', 'dir4/file2.txt']; - * - * // asynchronous function that deletes a file - * const deleteFile = function(file, callback) { - * fs.unlink(file, callback); - * }; - * - * // Using callbacks - * async.each(fileList, deleteFile, function(err) { - * if( err ) { - * console.log(err); - * } else { - * console.log('All files have been deleted successfully'); - * } - * }); - * - * // Error Handling - * async.each(withMissingFileList, deleteFile, function(err){ - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using Promises - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.each(fileList, deleteFile) - * .then( () => { - * console.log('All files have been deleted successfully'); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * }); - * - * // Using async/await - * async () => { - * try { - * await async.each(files, deleteFile); - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * await async.each(withMissingFileList, deleteFile); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * // since dir4/file2.txt does not exist - * // dir1/file1.txt could have been deleted - * } - * } - * - */ -function eachLimit(coll, iteratee, callback) { - return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); -} - -exports.default = (0, _awaitify2.default)(eachLimit, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachLimit.js b/node_modules/async/forEachLimit.js deleted file mode 100644 index 5f3d009..0000000 --- a/node_modules/async/forEachLimit.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _withoutIndex = require('./internal/withoutIndex.js'); - -var _withoutIndex2 = _interopRequireDefault(_withoutIndex); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachLimit(coll, limit, iteratee, callback) { - return (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); -} -exports.default = (0, _awaitify2.default)(eachLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachOf.js b/node_modules/async/forEachOf.js deleted file mode 100644 index c22614f..0000000 --- a/node_modules/async/forEachOf.js +++ /dev/null @@ -1,185 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _isArrayLike = require('./internal/isArrayLike.js'); - -var _isArrayLike2 = _interopRequireDefault(_isArrayLike); - -var _breakLoop = require('./internal/breakLoop.js'); - -var _breakLoop2 = _interopRequireDefault(_breakLoop); - -var _eachOfLimit = require('./eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// eachOf implementation optimized for array-likes -function eachOfArrayLike(coll, iteratee, callback) { - callback = (0, _once2.default)(callback); - var index = 0, - completed = 0, - { length } = coll, - canceled = false; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err === false) { - canceled = true; - } - if (canceled === true) return; - if (err) { - callback(err); - } else if (++completed === length || value === _breakLoop2.default) { - callback(null); - } - } - - for (; index < length; index++) { - iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback)); - } -} - -// a generic version of eachOf which can handle array, object, and iterator cases. -function eachOfGeneric(coll, iteratee, callback) { - return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback); -} - -/** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * // dev.json is a file containing a valid json object config for dev environment - * // dev.json is a file containing a valid json object config for test environment - * // prod.json is a file containing a valid json object config for prod environment - * // invalid.json is a file with a malformed json object - * - * let configs = {}; //global variable - * let validConfigFileMap = {dev: 'dev.json', test: 'test.json', prod: 'prod.json'}; - * let invalidConfigFileMap = {dev: 'dev.json', test: 'test.json', invalid: 'invalid.json'}; - * - * // asynchronous function that reads a json file and parses the contents as json object - * function parseFile(file, key, callback) { - * fs.readFile(file, "utf8", function(err, data) { - * if (err) return calback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * } - * - * // Using callbacks - * async.forEachOf(validConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * } else { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile, function (err) { - * if (err) { - * console.error(err); - * // JSON parse error exception - * } else { - * console.log(configs); - * } - * }); - * - * // Using Promises - * async.forEachOf(validConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * }).catch( err => { - * console.error(err); - * }); - * - * //Error handing - * async.forEachOf(invalidConfigFileMap, parseFile) - * .then( () => { - * console.log(configs); - * }).catch( err => { - * console.error(err); - * // JSON parse error exception - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.forEachOf(validConfigFileMap, parseFile); - * console.log(configs); - * // configs is now a map of JSON data, e.g. - * // { dev: //parsed dev.json, test: //parsed test.json, prod: //parsed prod.json} - * } - * catch (err) { - * console.log(err); - * } - * } - * - * //Error handing - * async () => { - * try { - * let result = await async.forEachOf(invalidConfigFileMap, parseFile); - * console.log(configs); - * } - * catch (err) { - * console.log(err); - * // JSON parse error exception - * } - * } - * - */ -function eachOf(coll, iteratee, callback) { - var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; - return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); -} - -exports.default = (0, _awaitify2.default)(eachOf, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachOfLimit.js b/node_modules/async/forEachOfLimit.js deleted file mode 100644 index e9fc4db..0000000 --- a/node_modules/async/forEachOfLimit.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit2 = require('./internal/eachOfLimit.js'); - -var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfLimit(coll, limit, iteratee, callback) { - return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); -} - -exports.default = (0, _awaitify2.default)(eachOfLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachOfSeries.js b/node_modules/async/forEachOfSeries.js deleted file mode 100644 index cfb0f33..0000000 --- a/node_modules/async/forEachOfSeries.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit = require('./eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time. - * - * @name eachOfSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachOfSeries(coll, iteratee, callback) { - return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(eachOfSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forEachSeries.js b/node_modules/async/forEachSeries.js deleted file mode 100644 index d674d0c..0000000 --- a/node_modules/async/forEachSeries.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachLimit = require('./eachLimit.js'); - -var _eachLimit2 = _interopRequireDefault(_eachLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * Note, that unlike [`each`]{@link module:Collections.each}, this function applies iteratee to each item - * in series and therefore the iteratee functions will complete in order. - - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @returns {Promise} a promise, if a callback is omitted - */ -function eachSeries(coll, iteratee, callback) { - return (0, _eachLimit2.default)(coll, 1, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(eachSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/forever.js b/node_modules/async/forever.js deleted file mode 100644 index 2c8d5b8..0000000 --- a/node_modules/async/forever.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _ensureAsync = require('./ensureAsync.js'); - -var _ensureAsync2 = _interopRequireDefault(_ensureAsync); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Calls the asynchronous function `fn` with a callback parameter that allows it - * to call itself again, in series, indefinitely. - - * If an error is passed to the callback then `errback` is called with the - * error, and execution stops, otherwise it will never be called. - * - * @name forever - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} fn - an async function to call repeatedly. - * Invoked with (next). - * @param {Function} [errback] - when `fn` passes an error to it's callback, - * this function will be called, and execution stops. Invoked with (err). - * @returns {Promise} a promise that rejects if an error occurs and an errback - * is not passed - * @example - * - * async.forever( - * function(next) { - * // next is suitable for passing to things that need a callback(err [, whatever]); - * // it will result in this function being called again. - * }, - * function(err) { - * // if next is called with a value in its first parameter, it will appear - * // in here as 'err', and execution will stop. - * } - * ); - */ -function forever(fn, errback) { - var done = (0, _onlyOnce2.default)(errback); - var task = (0, _wrapAsync2.default)((0, _ensureAsync2.default)(fn)); - - function next(err) { - if (err) return done(err); - if (err === false) return; - task(next); - } - return next(); -} -exports.default = (0, _awaitify2.default)(forever, 2); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/groupBy.js b/node_modules/async/groupBy.js deleted file mode 100644 index 6bb52aa..0000000 --- a/node_modules/async/groupBy.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = groupBy; - -var _groupByLimit = require('./groupByLimit.js'); - -var _groupByLimit2 = _interopRequireDefault(_groupByLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns a new object, where each value corresponds to an array of items, from - * `coll`, that returned the corresponding key. That is, the keys of the object - * correspond to the values passed to the `iteratee` callback. - * - * Note: Since this function applies the `iteratee` to each item in parallel, - * there is no guarantee that the `iteratee` functions will complete in order. - * However, the values for each key in the `result` will be in the same order as - * the original `coll`. For Objects, the values will roughly be in the order of - * the original Objects' keys (but this can vary across JavaScript engines). - * - * @name groupBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * const files = ['dir1/file1.txt','dir2','dir4'] - * - * // asynchronous function that detects file type as none, file, or directory - * function detectFile(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(null, 'none'); - * } - * callback(null, stat.isDirectory() ? 'directory' : 'file'); - * }); - * } - * - * //Using callbacks - * async.groupBy(files, detectFile, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * }); - * - * // Using Promises - * async.groupBy(files, detectFile) - * .then( result => { - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.groupBy(files, detectFile); - * console.log(result); - * // { - * // file: [ 'dir1/file1.txt' ], - * // none: [ 'dir4' ], - * // directory: [ 'dir2'] - * // } - * // result is object containing the files grouped by type - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function groupBy(coll, iteratee, callback) { - return (0, _groupByLimit2.default)(coll, Infinity, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/groupByLimit.js b/node_modules/async/groupByLimit.js deleted file mode 100644 index 5766d6e..0000000 --- a/node_modules/async/groupByLimit.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _mapLimit = require('./mapLimit.js'); - -var _mapLimit2 = _interopRequireDefault(_mapLimit); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. - * - * @name groupByLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ -function groupByLimit(coll, limit, iteratee, callback) { - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => { - _iteratee(val, (err, key) => { - if (err) return iterCb(err); - return iterCb(err, { key, val }); - }); - }, (err, mapResults) => { - var result = {}; - // from MDN, handle object having an `hasOwnProperty` prop - var { hasOwnProperty } = Object.prototype; - - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var { key } = mapResults[i]; - var { val } = mapResults[i]; - - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } - } - } - - return callback(err, result); - }); -} - -exports.default = (0, _awaitify2.default)(groupByLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/groupBySeries.js b/node_modules/async/groupBySeries.js deleted file mode 100644 index 6056743..0000000 --- a/node_modules/async/groupBySeries.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = groupBySeries; - -var _groupByLimit = require('./groupByLimit.js'); - -var _groupByLimit2 = _interopRequireDefault(_groupByLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. - * - * @name groupBySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whose - * properties are arrays of values which returned the corresponding key. - * @returns {Promise} a promise, if no callback is passed - */ -function groupBySeries(coll, iteratee, callback) { - return (0, _groupByLimit2.default)(coll, 1, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/index.js b/node_modules/async/index.js deleted file mode 100644 index ce647d5..0000000 --- a/node_modules/async/index.js +++ /dev/null @@ -1,588 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.doDuring = exports.during = exports.wrapSync = undefined; -exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.flatMapSeries = exports.flatMapLimit = exports.flatMap = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.doWhilst = exports.doUntil = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargoQueue = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; - -var _apply = require('./apply'); - -var _apply2 = _interopRequireDefault(_apply); - -var _applyEach = require('./applyEach'); - -var _applyEach2 = _interopRequireDefault(_applyEach); - -var _applyEachSeries = require('./applyEachSeries'); - -var _applyEachSeries2 = _interopRequireDefault(_applyEachSeries); - -var _asyncify = require('./asyncify'); - -var _asyncify2 = _interopRequireDefault(_asyncify); - -var _auto = require('./auto'); - -var _auto2 = _interopRequireDefault(_auto); - -var _autoInject = require('./autoInject'); - -var _autoInject2 = _interopRequireDefault(_autoInject); - -var _cargo = require('./cargo'); - -var _cargo2 = _interopRequireDefault(_cargo); - -var _cargoQueue = require('./cargoQueue'); - -var _cargoQueue2 = _interopRequireDefault(_cargoQueue); - -var _compose = require('./compose'); - -var _compose2 = _interopRequireDefault(_compose); - -var _concat = require('./concat'); - -var _concat2 = _interopRequireDefault(_concat); - -var _concatLimit = require('./concatLimit'); - -var _concatLimit2 = _interopRequireDefault(_concatLimit); - -var _concatSeries = require('./concatSeries'); - -var _concatSeries2 = _interopRequireDefault(_concatSeries); - -var _constant = require('./constant'); - -var _constant2 = _interopRequireDefault(_constant); - -var _detect = require('./detect'); - -var _detect2 = _interopRequireDefault(_detect); - -var _detectLimit = require('./detectLimit'); - -var _detectLimit2 = _interopRequireDefault(_detectLimit); - -var _detectSeries = require('./detectSeries'); - -var _detectSeries2 = _interopRequireDefault(_detectSeries); - -var _dir = require('./dir'); - -var _dir2 = _interopRequireDefault(_dir); - -var _doUntil = require('./doUntil'); - -var _doUntil2 = _interopRequireDefault(_doUntil); - -var _doWhilst = require('./doWhilst'); - -var _doWhilst2 = _interopRequireDefault(_doWhilst); - -var _each = require('./each'); - -var _each2 = _interopRequireDefault(_each); - -var _eachLimit = require('./eachLimit'); - -var _eachLimit2 = _interopRequireDefault(_eachLimit); - -var _eachOf = require('./eachOf'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _eachOfLimit = require('./eachOfLimit'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _eachOfSeries = require('./eachOfSeries'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _eachSeries = require('./eachSeries'); - -var _eachSeries2 = _interopRequireDefault(_eachSeries); - -var _ensureAsync = require('./ensureAsync'); - -var _ensureAsync2 = _interopRequireDefault(_ensureAsync); - -var _every = require('./every'); - -var _every2 = _interopRequireDefault(_every); - -var _everyLimit = require('./everyLimit'); - -var _everyLimit2 = _interopRequireDefault(_everyLimit); - -var _everySeries = require('./everySeries'); - -var _everySeries2 = _interopRequireDefault(_everySeries); - -var _filter = require('./filter'); - -var _filter2 = _interopRequireDefault(_filter); - -var _filterLimit = require('./filterLimit'); - -var _filterLimit2 = _interopRequireDefault(_filterLimit); - -var _filterSeries = require('./filterSeries'); - -var _filterSeries2 = _interopRequireDefault(_filterSeries); - -var _forever = require('./forever'); - -var _forever2 = _interopRequireDefault(_forever); - -var _groupBy = require('./groupBy'); - -var _groupBy2 = _interopRequireDefault(_groupBy); - -var _groupByLimit = require('./groupByLimit'); - -var _groupByLimit2 = _interopRequireDefault(_groupByLimit); - -var _groupBySeries = require('./groupBySeries'); - -var _groupBySeries2 = _interopRequireDefault(_groupBySeries); - -var _log = require('./log'); - -var _log2 = _interopRequireDefault(_log); - -var _map = require('./map'); - -var _map2 = _interopRequireDefault(_map); - -var _mapLimit = require('./mapLimit'); - -var _mapLimit2 = _interopRequireDefault(_mapLimit); - -var _mapSeries = require('./mapSeries'); - -var _mapSeries2 = _interopRequireDefault(_mapSeries); - -var _mapValues = require('./mapValues'); - -var _mapValues2 = _interopRequireDefault(_mapValues); - -var _mapValuesLimit = require('./mapValuesLimit'); - -var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); - -var _mapValuesSeries = require('./mapValuesSeries'); - -var _mapValuesSeries2 = _interopRequireDefault(_mapValuesSeries); - -var _memoize = require('./memoize'); - -var _memoize2 = _interopRequireDefault(_memoize); - -var _nextTick = require('./nextTick'); - -var _nextTick2 = _interopRequireDefault(_nextTick); - -var _parallel = require('./parallel'); - -var _parallel2 = _interopRequireDefault(_parallel); - -var _parallelLimit = require('./parallelLimit'); - -var _parallelLimit2 = _interopRequireDefault(_parallelLimit); - -var _priorityQueue = require('./priorityQueue'); - -var _priorityQueue2 = _interopRequireDefault(_priorityQueue); - -var _queue = require('./queue'); - -var _queue2 = _interopRequireDefault(_queue); - -var _race = require('./race'); - -var _race2 = _interopRequireDefault(_race); - -var _reduce = require('./reduce'); - -var _reduce2 = _interopRequireDefault(_reduce); - -var _reduceRight = require('./reduceRight'); - -var _reduceRight2 = _interopRequireDefault(_reduceRight); - -var _reflect = require('./reflect'); - -var _reflect2 = _interopRequireDefault(_reflect); - -var _reflectAll = require('./reflectAll'); - -var _reflectAll2 = _interopRequireDefault(_reflectAll); - -var _reject = require('./reject'); - -var _reject2 = _interopRequireDefault(_reject); - -var _rejectLimit = require('./rejectLimit'); - -var _rejectLimit2 = _interopRequireDefault(_rejectLimit); - -var _rejectSeries = require('./rejectSeries'); - -var _rejectSeries2 = _interopRequireDefault(_rejectSeries); - -var _retry = require('./retry'); - -var _retry2 = _interopRequireDefault(_retry); - -var _retryable = require('./retryable'); - -var _retryable2 = _interopRequireDefault(_retryable); - -var _seq = require('./seq'); - -var _seq2 = _interopRequireDefault(_seq); - -var _series = require('./series'); - -var _series2 = _interopRequireDefault(_series); - -var _setImmediate = require('./setImmediate'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _some = require('./some'); - -var _some2 = _interopRequireDefault(_some); - -var _someLimit = require('./someLimit'); - -var _someLimit2 = _interopRequireDefault(_someLimit); - -var _someSeries = require('./someSeries'); - -var _someSeries2 = _interopRequireDefault(_someSeries); - -var _sortBy = require('./sortBy'); - -var _sortBy2 = _interopRequireDefault(_sortBy); - -var _timeout = require('./timeout'); - -var _timeout2 = _interopRequireDefault(_timeout); - -var _times = require('./times'); - -var _times2 = _interopRequireDefault(_times); - -var _timesLimit = require('./timesLimit'); - -var _timesLimit2 = _interopRequireDefault(_timesLimit); - -var _timesSeries = require('./timesSeries'); - -var _timesSeries2 = _interopRequireDefault(_timesSeries); - -var _transform = require('./transform'); - -var _transform2 = _interopRequireDefault(_transform); - -var _tryEach = require('./tryEach'); - -var _tryEach2 = _interopRequireDefault(_tryEach); - -var _unmemoize = require('./unmemoize'); - -var _unmemoize2 = _interopRequireDefault(_unmemoize); - -var _until = require('./until'); - -var _until2 = _interopRequireDefault(_until); - -var _waterfall = require('./waterfall'); - -var _waterfall2 = _interopRequireDefault(_waterfall); - -var _whilst = require('./whilst'); - -var _whilst2 = _interopRequireDefault(_whilst); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * An "async function" in the context of Async is an asynchronous function with - * a variable number of parameters, with the final parameter being a callback. - * (`function (arg1, arg2, ..., callback) {}`) - * The final callback is of the form `callback(err, results...)`, which must be - * called once the function is completed. The callback should be called with a - * Error as its first argument to signal that an error occurred. - * Otherwise, if no error occurred, it should be called with `null` as the first - * argument, and any additional `result` arguments that may apply, to signal - * successful completion. - * The callback must be called exactly once, ideally on a later tick of the - * JavaScript event loop. - * - * This type of function is also referred to as a "Node-style async function", - * or a "continuation passing-style function" (CPS). Most of the methods of this - * library are themselves CPS/Node-style async functions, or functions that - * return CPS/Node-style async functions. - * - * Wherever we accept a Node-style async function, we also directly accept an - * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. - * In this case, the `async` function will not be passed a final callback - * argument, and any thrown error will be used as the `err` argument of the - * implicit callback, and the return value will be used as the `result` value. - * (i.e. a `rejected` of the returned Promise becomes the `err` callback - * argument, and a `resolved` value becomes the `result`.) - * - * Note, due to JavaScript limitations, we can only detect native `async` - * functions and not transpilied implementations. - * Your environment must have `async`/`await` support for this to work. - * (e.g. Node > v7.6, or a recent version of a modern browser). - * If you are using `async` functions through a transpiler (e.g. Babel), you - * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, - * because the `async function` will be compiled to an ordinary function that - * returns a promise. - * - * @typedef {Function} AsyncFunction - * @static - */ - -/** - * Async is a utility module which provides straight-forward, powerful functions - * for working with asynchronous JavaScript. Although originally designed for - * use with [Node.js](http://nodejs.org) and installable via - * `npm install --save async`, it can also be used directly in the browser. - * @module async - * @see AsyncFunction - */ - -/** - * A collection of `async` functions for manipulating collections, such as - * arrays and objects. - * @module Collections - */ - -/** - * A collection of `async` functions for controlling the flow through a script. - * @module ControlFlow - */ - -/** - * A collection of `async` utility functions. - * @module Utils - */ - -exports.default = { - apply: _apply2.default, - applyEach: _applyEach2.default, - applyEachSeries: _applyEachSeries2.default, - asyncify: _asyncify2.default, - auto: _auto2.default, - autoInject: _autoInject2.default, - cargo: _cargo2.default, - cargoQueue: _cargoQueue2.default, - compose: _compose2.default, - concat: _concat2.default, - concatLimit: _concatLimit2.default, - concatSeries: _concatSeries2.default, - constant: _constant2.default, - detect: _detect2.default, - detectLimit: _detectLimit2.default, - detectSeries: _detectSeries2.default, - dir: _dir2.default, - doUntil: _doUntil2.default, - doWhilst: _doWhilst2.default, - each: _each2.default, - eachLimit: _eachLimit2.default, - eachOf: _eachOf2.default, - eachOfLimit: _eachOfLimit2.default, - eachOfSeries: _eachOfSeries2.default, - eachSeries: _eachSeries2.default, - ensureAsync: _ensureAsync2.default, - every: _every2.default, - everyLimit: _everyLimit2.default, - everySeries: _everySeries2.default, - filter: _filter2.default, - filterLimit: _filterLimit2.default, - filterSeries: _filterSeries2.default, - forever: _forever2.default, - groupBy: _groupBy2.default, - groupByLimit: _groupByLimit2.default, - groupBySeries: _groupBySeries2.default, - log: _log2.default, - map: _map2.default, - mapLimit: _mapLimit2.default, - mapSeries: _mapSeries2.default, - mapValues: _mapValues2.default, - mapValuesLimit: _mapValuesLimit2.default, - mapValuesSeries: _mapValuesSeries2.default, - memoize: _memoize2.default, - nextTick: _nextTick2.default, - parallel: _parallel2.default, - parallelLimit: _parallelLimit2.default, - priorityQueue: _priorityQueue2.default, - queue: _queue2.default, - race: _race2.default, - reduce: _reduce2.default, - reduceRight: _reduceRight2.default, - reflect: _reflect2.default, - reflectAll: _reflectAll2.default, - reject: _reject2.default, - rejectLimit: _rejectLimit2.default, - rejectSeries: _rejectSeries2.default, - retry: _retry2.default, - retryable: _retryable2.default, - seq: _seq2.default, - series: _series2.default, - setImmediate: _setImmediate2.default, - some: _some2.default, - someLimit: _someLimit2.default, - someSeries: _someSeries2.default, - sortBy: _sortBy2.default, - timeout: _timeout2.default, - times: _times2.default, - timesLimit: _timesLimit2.default, - timesSeries: _timesSeries2.default, - transform: _transform2.default, - tryEach: _tryEach2.default, - unmemoize: _unmemoize2.default, - until: _until2.default, - waterfall: _waterfall2.default, - whilst: _whilst2.default, - - // aliases - all: _every2.default, - allLimit: _everyLimit2.default, - allSeries: _everySeries2.default, - any: _some2.default, - anyLimit: _someLimit2.default, - anySeries: _someSeries2.default, - find: _detect2.default, - findLimit: _detectLimit2.default, - findSeries: _detectSeries2.default, - flatMap: _concat2.default, - flatMapLimit: _concatLimit2.default, - flatMapSeries: _concatSeries2.default, - forEach: _each2.default, - forEachSeries: _eachSeries2.default, - forEachLimit: _eachLimit2.default, - forEachOf: _eachOf2.default, - forEachOfSeries: _eachOfSeries2.default, - forEachOfLimit: _eachOfLimit2.default, - inject: _reduce2.default, - foldl: _reduce2.default, - foldr: _reduceRight2.default, - select: _filter2.default, - selectLimit: _filterLimit2.default, - selectSeries: _filterSeries2.default, - wrapSync: _asyncify2.default, - during: _whilst2.default, - doDuring: _doWhilst2.default -}; -exports.apply = _apply2.default; -exports.applyEach = _applyEach2.default; -exports.applyEachSeries = _applyEachSeries2.default; -exports.asyncify = _asyncify2.default; -exports.auto = _auto2.default; -exports.autoInject = _autoInject2.default; -exports.cargo = _cargo2.default; -exports.cargoQueue = _cargoQueue2.default; -exports.compose = _compose2.default; -exports.concat = _concat2.default; -exports.concatLimit = _concatLimit2.default; -exports.concatSeries = _concatSeries2.default; -exports.constant = _constant2.default; -exports.detect = _detect2.default; -exports.detectLimit = _detectLimit2.default; -exports.detectSeries = _detectSeries2.default; -exports.dir = _dir2.default; -exports.doUntil = _doUntil2.default; -exports.doWhilst = _doWhilst2.default; -exports.each = _each2.default; -exports.eachLimit = _eachLimit2.default; -exports.eachOf = _eachOf2.default; -exports.eachOfLimit = _eachOfLimit2.default; -exports.eachOfSeries = _eachOfSeries2.default; -exports.eachSeries = _eachSeries2.default; -exports.ensureAsync = _ensureAsync2.default; -exports.every = _every2.default; -exports.everyLimit = _everyLimit2.default; -exports.everySeries = _everySeries2.default; -exports.filter = _filter2.default; -exports.filterLimit = _filterLimit2.default; -exports.filterSeries = _filterSeries2.default; -exports.forever = _forever2.default; -exports.groupBy = _groupBy2.default; -exports.groupByLimit = _groupByLimit2.default; -exports.groupBySeries = _groupBySeries2.default; -exports.log = _log2.default; -exports.map = _map2.default; -exports.mapLimit = _mapLimit2.default; -exports.mapSeries = _mapSeries2.default; -exports.mapValues = _mapValues2.default; -exports.mapValuesLimit = _mapValuesLimit2.default; -exports.mapValuesSeries = _mapValuesSeries2.default; -exports.memoize = _memoize2.default; -exports.nextTick = _nextTick2.default; -exports.parallel = _parallel2.default; -exports.parallelLimit = _parallelLimit2.default; -exports.priorityQueue = _priorityQueue2.default; -exports.queue = _queue2.default; -exports.race = _race2.default; -exports.reduce = _reduce2.default; -exports.reduceRight = _reduceRight2.default; -exports.reflect = _reflect2.default; -exports.reflectAll = _reflectAll2.default; -exports.reject = _reject2.default; -exports.rejectLimit = _rejectLimit2.default; -exports.rejectSeries = _rejectSeries2.default; -exports.retry = _retry2.default; -exports.retryable = _retryable2.default; -exports.seq = _seq2.default; -exports.series = _series2.default; -exports.setImmediate = _setImmediate2.default; -exports.some = _some2.default; -exports.someLimit = _someLimit2.default; -exports.someSeries = _someSeries2.default; -exports.sortBy = _sortBy2.default; -exports.timeout = _timeout2.default; -exports.times = _times2.default; -exports.timesLimit = _timesLimit2.default; -exports.timesSeries = _timesSeries2.default; -exports.transform = _transform2.default; -exports.tryEach = _tryEach2.default; -exports.unmemoize = _unmemoize2.default; -exports.until = _until2.default; -exports.waterfall = _waterfall2.default; -exports.whilst = _whilst2.default; -exports.all = _every2.default; -exports.allLimit = _everyLimit2.default; -exports.allSeries = _everySeries2.default; -exports.any = _some2.default; -exports.anyLimit = _someLimit2.default; -exports.anySeries = _someSeries2.default; -exports.find = _detect2.default; -exports.findLimit = _detectLimit2.default; -exports.findSeries = _detectSeries2.default; -exports.flatMap = _concat2.default; -exports.flatMapLimit = _concatLimit2.default; -exports.flatMapSeries = _concatSeries2.default; -exports.forEach = _each2.default; -exports.forEachSeries = _eachSeries2.default; -exports.forEachLimit = _eachLimit2.default; -exports.forEachOf = _eachOf2.default; -exports.forEachOfSeries = _eachOfSeries2.default; -exports.forEachOfLimit = _eachOfLimit2.default; -exports.inject = _reduce2.default; -exports.foldl = _reduce2.default; -exports.foldr = _reduceRight2.default; -exports.select = _filter2.default; -exports.selectLimit = _filterLimit2.default; -exports.selectSeries = _filterSeries2.default; -exports.wrapSync = _asyncify2.default; -exports.during = _whilst2.default; -exports.doDuring = _doWhilst2.default; \ No newline at end of file diff --git a/node_modules/async/inject.js b/node_modules/async/inject.js deleted file mode 100644 index 56e2db8..0000000 --- a/node_modules/async/inject.js +++ /dev/null @@ -1,153 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Reduces `coll` into a single value using an async `iteratee` to return each - * successive step. `memo` is the initial state of the reduction. This function - * only operates in series. - * - * For performance reasons, it may make sense to split a call to this function - * into a parallel map, and then use the normal `Array.prototype.reduce` on the - * results. This function is for situations where each step in the reduction - * needs to be async; if you can get the data before reducing it, then it's - * probably a good idea to do so. - * - * @name reduce - * @static - * @memberOf module:Collections - * @method - * @alias inject - * @alias foldl - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; - * - * // asynchronous function that computes the file size in bytes - * // file size is added to the memoized value, then returned - * function getFileSizeInBytes(memo, file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, memo + stat.size); - * }); - * } - * - * // Using callbacks - * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.reduce(fileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function reduce(coll, memo, iteratee, callback) { - callback = (0, _once2.default)(callback); - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); -} -exports.default = (0, _awaitify2.default)(reduce, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/DoublyLinkedList.js b/node_modules/async/internal/DoublyLinkedList.js deleted file mode 100644 index cd11c3b..0000000 --- a/node_modules/async/internal/DoublyLinkedList.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation -// used for queues. This implementation assumes that the node provided by the user can be modified -// to adjust the next and last properties. We implement only the minimal functionality -// for queue support. -class DLL { - constructor() { - this.head = this.tail = null; - this.length = 0; - } - - removeLink(node) { - if (node.prev) node.prev.next = node.next;else this.head = node.next; - if (node.next) node.next.prev = node.prev;else this.tail = node.prev; - - node.prev = node.next = null; - this.length -= 1; - return node; - } - - empty() { - while (this.head) this.shift(); - return this; - } - - insertAfter(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode;else this.tail = newNode; - node.next = newNode; - this.length += 1; - } - - insertBefore(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode;else this.head = newNode; - node.prev = newNode; - this.length += 1; - } - - unshift(node) { - if (this.head) this.insertBefore(this.head, node);else setInitial(this, node); - } - - push(node) { - if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node); - } - - shift() { - return this.head && this.removeLink(this.head); - } - - pop() { - return this.tail && this.removeLink(this.tail); - } - - toArray() { - return [...this]; - } - - *[Symbol.iterator]() { - var cur = this.head; - while (cur) { - yield cur.data; - cur = cur.next; - } - } - - remove(testFn) { - var curr = this.head; - while (curr) { - var { next } = curr; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; - } - return this; - } -} - -exports.default = DLL; -function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/Heap.js b/node_modules/async/internal/Heap.js deleted file mode 100644 index 80762fe..0000000 --- a/node_modules/async/internal/Heap.js +++ /dev/null @@ -1,120 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// Binary min-heap implementation used for priority queue. -// Implementation is stable, i.e. push time is considered for equal priorities -class Heap { - constructor() { - this.heap = []; - this.pushCount = Number.MIN_SAFE_INTEGER; - } - - get length() { - return this.heap.length; - } - - empty() { - this.heap = []; - return this; - } - - percUp(index) { - let p; - - while (index > 0 && smaller(this.heap[index], this.heap[p = parent(index)])) { - let t = this.heap[index]; - this.heap[index] = this.heap[p]; - this.heap[p] = t; - - index = p; - } - } - - percDown(index) { - let l; - - while ((l = leftChi(index)) < this.heap.length) { - if (l + 1 < this.heap.length && smaller(this.heap[l + 1], this.heap[l])) { - l = l + 1; - } - - if (smaller(this.heap[index], this.heap[l])) { - break; - } - - let t = this.heap[index]; - this.heap[index] = this.heap[l]; - this.heap[l] = t; - - index = l; - } - } - - push(node) { - node.pushCount = ++this.pushCount; - this.heap.push(node); - this.percUp(this.heap.length - 1); - } - - unshift(node) { - return this.heap.push(node); - } - - shift() { - let [top] = this.heap; - - this.heap[0] = this.heap[this.heap.length - 1]; - this.heap.pop(); - this.percDown(0); - - return top; - } - - toArray() { - return [...this]; - } - - *[Symbol.iterator]() { - for (let i = 0; i < this.heap.length; i++) { - yield this.heap[i].data; - } - } - - remove(testFn) { - let j = 0; - for (let i = 0; i < this.heap.length; i++) { - if (!testFn(this.heap[i])) { - this.heap[j] = this.heap[i]; - j++; - } - } - - this.heap.splice(j); - - for (let i = parent(this.heap.length - 1); i >= 0; i--) { - this.percDown(i); - } - - return this; - } -} - -exports.default = Heap; -function leftChi(i) { - return (i << 1) + 1; -} - -function parent(i) { - return (i + 1 >> 1) - 1; -} - -function smaller(x, y) { - if (x.priority !== y.priority) { - return x.priority < y.priority; - } else { - return x.pushCount < y.pushCount; - } -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/applyEach.js b/node_modules/async/internal/applyEach.js deleted file mode 100644 index a3f4ef1..0000000 --- a/node_modules/async/internal/applyEach.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (eachfn) { - return function applyEach(fns, ...callArgs) { - const go = (0, _awaitify2.default)(function (callback) { - var that = this; - return eachfn(fns, (fn, cb) => { - (0, _wrapAsync2.default)(fn).apply(that, callArgs.concat(cb)); - }, callback); - }); - return go; - }; -}; - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/asyncEachOfLimit.js b/node_modules/async/internal/asyncEachOfLimit.js deleted file mode 100644 index bba74c7..0000000 --- a/node_modules/async/internal/asyncEachOfLimit.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = asyncEachOfLimit; - -var _breakLoop = require('./breakLoop.js'); - -var _breakLoop2 = _interopRequireDefault(_breakLoop); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// for async generators -function asyncEachOfLimit(generator, limit, iteratee, callback) { - let done = false; - let canceled = false; - let awaiting = false; - let running = 0; - let idx = 0; - - function replenish() { - //console.log('replenish') - if (running >= limit || awaiting || done) return; - //console.log('replenish awaiting') - awaiting = true; - generator.next().then(({ value, done: iterDone }) => { - //console.log('got value', value) - if (canceled || done) return; - awaiting = false; - if (iterDone) { - done = true; - if (running <= 0) { - //console.log('done nextCb') - callback(null); - } - return; - } - running++; - iteratee(value, idx, iterateeCallback); - idx++; - replenish(); - }).catch(handleError); - } - - function iterateeCallback(err, result) { - //console.log('iterateeCallback') - running -= 1; - if (canceled) return; - if (err) return handleError(err); - - if (err === false) { - done = true; - canceled = true; - return; - } - - if (result === _breakLoop2.default || done && running <= 0) { - done = true; - //console.log('done iterCb') - return callback(null); - } - replenish(); - } - - function handleError(err) { - if (canceled) return; - awaiting = false; - done = true; - callback(err); - } - - replenish(); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/awaitify.js b/node_modules/async/internal/awaitify.js deleted file mode 100644 index 7b36f1a..0000000 --- a/node_modules/async/internal/awaitify.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = awaitify; -// conditionally promisify a function. -// only return a promise if a callback is omitted -function awaitify(asyncFn, arity = asyncFn.length) { - if (!arity) throw new Error('arity is undefined'); - function awaitable(...args) { - if (typeof args[arity - 1] === 'function') { - return asyncFn.apply(this, args); - } - - return new Promise((resolve, reject) => { - args[arity - 1] = (err, ...cbArgs) => { - if (err) return reject(err); - resolve(cbArgs.length > 1 ? cbArgs : cbArgs[0]); - }; - asyncFn.apply(this, args); - }); - } - - return awaitable; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/breakLoop.js b/node_modules/async/internal/breakLoop.js deleted file mode 100644 index 8245e55..0000000 --- a/node_modules/async/internal/breakLoop.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -// A temporary value used to identify if the loop should be broken. -// See #1064, #1293 -const breakLoop = {}; -exports.default = breakLoop; -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/consoleFunc.js b/node_modules/async/internal/consoleFunc.js deleted file mode 100644 index 70347a5..0000000 --- a/node_modules/async/internal/consoleFunc.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = consoleFunc; - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function consoleFunc(name) { - return (fn, ...args) => (0, _wrapAsync2.default)(fn)(...args, (err, ...resultArgs) => { - /* istanbul ignore else */ - if (typeof console === 'object') { - /* istanbul ignore else */ - if (err) { - /* istanbul ignore else */ - if (console.error) { - console.error(err); - } - } else if (console[name]) { - /* istanbul ignore else */ - resultArgs.forEach(x => console[name](x)); - } - } - }); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/createTester.js b/node_modules/async/internal/createTester.js deleted file mode 100644 index 7b2d734..0000000 --- a/node_modules/async/internal/createTester.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _createTester; - -var _breakLoop = require('./breakLoop.js'); - -var _breakLoop2 = _interopRequireDefault(_breakLoop); - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _createTester(check, getResult) { - return (eachfn, arr, _iteratee, cb) => { - var testPassed = false; - var testResult; - const iteratee = (0, _wrapAsync2.default)(_iteratee); - eachfn(arr, (value, _, callback) => { - iteratee(value, (err, result) => { - if (err || err === false) return callback(err); - - if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - return callback(null, _breakLoop2.default); - } - callback(); - }); - }, err => { - if (err) return cb(err); - cb(null, testPassed ? testResult : getResult(false)); - }); - }; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/eachOfLimit.js b/node_modules/async/internal/eachOfLimit.js deleted file mode 100644 index fc26b20..0000000 --- a/node_modules/async/internal/eachOfLimit.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _once = require('./once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _iterator = require('./iterator.js'); - -var _iterator2 = _interopRequireDefault(_iterator); - -var _onlyOnce = require('./onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./wrapAsync.js'); - -var _asyncEachOfLimit = require('./asyncEachOfLimit.js'); - -var _asyncEachOfLimit2 = _interopRequireDefault(_asyncEachOfLimit); - -var _breakLoop = require('./breakLoop.js'); - -var _breakLoop2 = _interopRequireDefault(_breakLoop); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = limit => { - return (obj, iteratee, callback) => { - callback = (0, _once2.default)(callback); - if (limit <= 0) { - throw new RangeError('concurrency limit cannot be less than 1'); - } - if (!obj) { - return callback(null); - } - if ((0, _wrapAsync.isAsyncGenerator)(obj)) { - return (0, _asyncEachOfLimit2.default)(obj, limit, iteratee, callback); - } - if ((0, _wrapAsync.isAsyncIterable)(obj)) { - return (0, _asyncEachOfLimit2.default)(obj[Symbol.asyncIterator](), limit, iteratee, callback); - } - var nextElem = (0, _iterator2.default)(obj); - var done = false; - var canceled = false; - var running = 0; - var looping = false; - - function iterateeCallback(err, value) { - if (canceled) return; - running -= 1; - if (err) { - done = true; - callback(err); - } else if (err === false) { - done = true; - canceled = true; - } else if (value === _breakLoop2.default || done && running <= 0) { - done = true; - return callback(null); - } else if (!looping) { - replenish(); - } - } - - function replenish() { - looping = true; - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback)); - } - looping = false; - } - - replenish(); - }; -}; - -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/filter.js b/node_modules/async/internal/filter.js deleted file mode 100644 index aef2b9d..0000000 --- a/node_modules/async/internal/filter.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _filter; - -var _isArrayLike = require('./isArrayLike.js'); - -var _isArrayLike2 = _interopRequireDefault(_isArrayLike); - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, (x, index, iterCb) => { - iteratee(x, (err, v) => { - truthValues[index] = !!v; - iterCb(err); - }); - }, err => { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); -} - -function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, (x, index, iterCb) => { - iteratee(x, (err, v) => { - if (err) return iterCb(err); - if (v) { - results.push({ index, value: x }); - } - iterCb(err); - }); - }, err => { - if (err) return callback(err); - callback(null, results.sort((a, b) => a.index - b.index).map(v => v.value)); - }); -} - -function _filter(eachfn, coll, iteratee, callback) { - var filter = (0, _isArrayLike2.default)(coll) ? filterArray : filterGeneric; - return filter(eachfn, coll, (0, _wrapAsync2.default)(iteratee), callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/getIterator.js b/node_modules/async/internal/getIterator.js deleted file mode 100644 index 830a545..0000000 --- a/node_modules/async/internal/getIterator.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (coll) { - return coll[Symbol.iterator] && coll[Symbol.iterator](); -}; - -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/initialParams.js b/node_modules/async/internal/initialParams.js deleted file mode 100644 index 245378c..0000000 --- a/node_modules/async/internal/initialParams.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (fn) { - return function (...args /*, callback*/) { - var callback = args.pop(); - return fn.call(this, args, callback); - }; -}; - -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/isArrayLike.js b/node_modules/async/internal/isArrayLike.js deleted file mode 100644 index ce07670..0000000 --- a/node_modules/async/internal/isArrayLike.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isArrayLike; -function isArrayLike(value) { - return value && typeof value.length === 'number' && value.length >= 0 && value.length % 1 === 0; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/iterator.js b/node_modules/async/internal/iterator.js deleted file mode 100644 index 90b0223..0000000 --- a/node_modules/async/internal/iterator.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = createIterator; - -var _isArrayLike = require('./isArrayLike.js'); - -var _isArrayLike2 = _interopRequireDefault(_isArrayLike); - -var _getIterator = require('./getIterator.js'); - -var _getIterator2 = _interopRequireDefault(_getIterator); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? { value: coll[i], key: i } : null; - }; -} - -function createES2015Iterator(iterator) { - var i = -1; - return function next() { - var item = iterator.next(); - if (item.done) return null; - i++; - return { value: item.value, key: i }; - }; -} - -function createObjectIterator(obj) { - var okeys = obj ? Object.keys(obj) : []; - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - if (key === '__proto__') { - return next(); - } - return i < len ? { value: obj[key], key } : null; - }; -} - -function createIterator(coll) { - if ((0, _isArrayLike2.default)(coll)) { - return createArrayIterator(coll); - } - - var iterator = (0, _getIterator2.default)(coll); - return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/map.js b/node_modules/async/internal/map.js deleted file mode 100644 index af3fd09..0000000 --- a/node_modules/async/internal/map.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _asyncMap; - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _asyncMap(eachfn, arr, iteratee, callback) { - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = (0, _wrapAsync2.default)(iteratee); - - return eachfn(arr, (value, _, iterCb) => { - var index = counter++; - _iteratee(value, (err, v) => { - results[index] = v; - iterCb(err); - }); - }, err => { - callback(err, results); - }); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/once.js b/node_modules/async/internal/once.js deleted file mode 100644 index 49f3727..0000000 --- a/node_modules/async/internal/once.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = once; -function once(fn) { - function wrapper(...args) { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, args); - } - Object.assign(wrapper, fn); - return wrapper; -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/onlyOnce.js b/node_modules/async/internal/onlyOnce.js deleted file mode 100644 index 6ad721b..0000000 --- a/node_modules/async/internal/onlyOnce.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = onlyOnce; -function onlyOnce(fn) { - return function (...args) { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, args); - }; -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/parallel.js b/node_modules/async/internal/parallel.js deleted file mode 100644 index 75741bb..0000000 --- a/node_modules/async/internal/parallel.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _isArrayLike = require('./isArrayLike.js'); - -var _isArrayLike2 = _interopRequireDefault(_isArrayLike); - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = (0, _awaitify2.default)((eachfn, tasks, callback) => { - var results = (0, _isArrayLike2.default)(tasks) ? [] : {}; - - eachfn(tasks, (task, key, taskCb) => { - (0, _wrapAsync2.default)(task)((err, ...result) => { - if (result.length < 2) { - [result] = result; - } - results[key] = result; - taskCb(err); - }); - }, err => callback(err, results)); -}, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/promiseCallback.js b/node_modules/async/internal/promiseCallback.js deleted file mode 100644 index 17a8301..0000000 --- a/node_modules/async/internal/promiseCallback.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -const PROMISE_SYMBOL = Symbol('promiseCallback'); - -function promiseCallback() { - let resolve, reject; - function callback(err, ...args) { - if (err) return reject(err); - resolve(args.length > 1 ? args : args[0]); - } - - callback[PROMISE_SYMBOL] = new Promise((res, rej) => { - resolve = res, reject = rej; - }); - - return callback; -} - -exports.promiseCallback = promiseCallback; -exports.PROMISE_SYMBOL = PROMISE_SYMBOL; \ No newline at end of file diff --git a/node_modules/async/internal/queue.js b/node_modules/async/internal/queue.js deleted file mode 100644 index cbc590d..0000000 --- a/node_modules/async/internal/queue.js +++ /dev/null @@ -1,294 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = queue; - -var _onlyOnce = require('./onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _setImmediate = require('./setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _DoublyLinkedList = require('./DoublyLinkedList.js'); - -var _DoublyLinkedList2 = _interopRequireDefault(_DoublyLinkedList); - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function queue(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; - } else if (concurrency === 0) { - throw new RangeError('Concurrency must not be zero'); - } - - var _worker = (0, _wrapAsync2.default)(worker); - var numRunning = 0; - var workersList = []; - const events = { - error: [], - drain: [], - saturated: [], - unsaturated: [], - empty: [] - }; - - function on(event, handler) { - events[event].push(handler); - } - - function once(event, handler) { - const handleAndRemove = (...args) => { - off(event, handleAndRemove); - handler(...args); - }; - events[event].push(handleAndRemove); - } - - function off(event, handler) { - if (!event) return Object.keys(events).forEach(ev => events[ev] = []); - if (!handler) return events[event] = []; - events[event] = events[event].filter(ev => ev !== handler); - } - - function trigger(event, ...args) { - events[event].forEach(handler => handler(...args)); - } - - var processingScheduled = false; - function _insert(data, insertAtFront, rejectOnError, callback) { - if (callback != null && typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - - var res, rej; - function promiseCallback(err, ...args) { - // we don't care about the error, let the global error handler - // deal with it - if (err) return rejectOnError ? rej(err) : res(); - if (args.length <= 1) return res(args[0]); - res(args); - } - - var item = q._createTaskItem(data, rejectOnError ? promiseCallback : callback || promiseCallback); - - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } - - if (!processingScheduled) { - processingScheduled = true; - (0, _setImmediate2.default)(() => { - processingScheduled = false; - q.process(); - }); - } - - if (rejectOnError || !callback) { - return new Promise((resolve, reject) => { - res = resolve; - rej = reject; - }); - } - } - - function _createCB(tasks) { - return function (err, ...args) { - numRunning -= 1; - - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; - - var index = workersList.indexOf(task); - if (index === 0) { - workersList.shift(); - } else if (index > 0) { - workersList.splice(index, 1); - } - - task.callback(err, ...args); - - if (err != null) { - trigger('error', err, task.data); - } - } - - if (numRunning <= q.concurrency - q.buffer) { - trigger('unsaturated'); - } - - if (q.idle()) { - trigger('drain'); - } - q.process(); - }; - } - - function _maybeDrain(data) { - if (data.length === 0 && q.idle()) { - // call drain immediately if there are no tasks - (0, _setImmediate2.default)(() => trigger('drain')); - return true; - } - return false; - } - - const eventMethod = name => handler => { - if (!handler) { - return new Promise((resolve, reject) => { - once(name, (err, data) => { - if (err) return reject(err); - resolve(data); - }); - }); - } - off(name); - on(name, handler); - }; - - var isProcessing = false; - var q = { - _tasks: new _DoublyLinkedList2.default(), - _createTaskItem(data, callback) { - return { - data, - callback - }; - }, - *[Symbol.iterator]() { - yield* q._tasks[Symbol.iterator](); - }, - concurrency, - payload, - buffer: concurrency / 4, - started: false, - paused: false, - push(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map(datum => _insert(datum, false, false, callback)); - } - return _insert(data, false, false, callback); - }, - pushAsync(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map(datum => _insert(datum, false, true, callback)); - } - return _insert(data, false, true, callback); - }, - kill() { - off(); - q._tasks.empty(); - }, - unshift(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map(datum => _insert(datum, true, false, callback)); - } - return _insert(data, true, false, callback); - }, - unshiftAsync(data, callback) { - if (Array.isArray(data)) { - if (_maybeDrain(data)) return; - return data.map(datum => _insert(datum, true, true, callback)); - } - return _insert(data, true, true, callback); - }, - remove(testFn) { - q._tasks.remove(testFn); - }, - process() { - // Avoid trying to start too many processing operations. This can occur - // when callbacks resolve synchronously (#1267). - if (isProcessing) { - return; - } - isProcessing = true; - while (!q.paused && numRunning < q.concurrency && q._tasks.length) { - var tasks = [], - data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - - numRunning += 1; - - if (q._tasks.length === 0) { - trigger('empty'); - } - - if (numRunning === q.concurrency) { - trigger('saturated'); - } - - var cb = (0, _onlyOnce2.default)(_createCB(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length() { - return q._tasks.length; - }, - running() { - return numRunning; - }, - workersList() { - return workersList; - }, - idle() { - return q._tasks.length + numRunning === 0; - }, - pause() { - q.paused = true; - }, - resume() { - if (q.paused === false) { - return; - } - q.paused = false; - (0, _setImmediate2.default)(q.process); - } - }; - // define these as fixed properties, so people get useful errors when updating - Object.defineProperties(q, { - saturated: { - writable: false, - value: eventMethod('saturated') - }, - unsaturated: { - writable: false, - value: eventMethod('unsaturated') - }, - empty: { - writable: false, - value: eventMethod('empty') - }, - drain: { - writable: false, - value: eventMethod('drain') - }, - error: { - writable: false, - value: eventMethod('error') - } - }); - return q; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/range.js b/node_modules/async/internal/range.js deleted file mode 100644 index 6680e64..0000000 --- a/node_modules/async/internal/range.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = range; -function range(size) { - var result = Array(size); - while (size--) { - result[size] = size; - } - return result; -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/reject.js b/node_modules/async/internal/reject.js deleted file mode 100644 index 7388ef4..0000000 --- a/node_modules/async/internal/reject.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = reject; - -var _filter = require('./filter.js'); - -var _filter2 = _interopRequireDefault(_filter); - -var _wrapAsync = require('./wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function reject(eachfn, arr, _iteratee, callback) { - const iteratee = (0, _wrapAsync2.default)(_iteratee); - return (0, _filter2.default)(eachfn, arr, (value, cb) => { - iteratee(value, (err, v) => { - cb(err, !v); - }); - }, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/internal/setImmediate.js b/node_modules/async/internal/setImmediate.js deleted file mode 100644 index 513efd1..0000000 --- a/node_modules/async/internal/setImmediate.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.fallback = fallback; -exports.wrap = wrap; -/* istanbul ignore file */ - -var hasQueueMicrotask = exports.hasQueueMicrotask = typeof queueMicrotask === 'function' && queueMicrotask; -var hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === 'function' && setImmediate; -var hasNextTick = exports.hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; - -function fallback(fn) { - setTimeout(fn, 0); -} - -function wrap(defer) { - return (fn, ...args) => defer(() => fn(...args)); -} - -var _defer; - -if (hasQueueMicrotask) { - _defer = queueMicrotask; -} else if (hasSetImmediate) { - _defer = setImmediate; -} else if (hasNextTick) { - _defer = process.nextTick; -} else { - _defer = fallback; -} - -exports.default = wrap(_defer); \ No newline at end of file diff --git a/node_modules/async/internal/withoutIndex.js b/node_modules/async/internal/withoutIndex.js deleted file mode 100644 index ec45fa3..0000000 --- a/node_modules/async/internal/withoutIndex.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _withoutIndex; -function _withoutIndex(iteratee) { - return (value, index, callback) => iteratee(value, callback); -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/internal/wrapAsync.js b/node_modules/async/internal/wrapAsync.js deleted file mode 100644 index ad4d619..0000000 --- a/node_modules/async/internal/wrapAsync.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isAsyncIterable = exports.isAsyncGenerator = exports.isAsync = undefined; - -var _asyncify = require('../asyncify.js'); - -var _asyncify2 = _interopRequireDefault(_asyncify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function isAsync(fn) { - return fn[Symbol.toStringTag] === 'AsyncFunction'; -} - -function isAsyncGenerator(fn) { - return fn[Symbol.toStringTag] === 'AsyncGenerator'; -} - -function isAsyncIterable(obj) { - return typeof obj[Symbol.asyncIterator] === 'function'; -} - -function wrapAsync(asyncFn) { - if (typeof asyncFn !== 'function') throw new Error('expected a function'); - return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn; -} - -exports.default = wrapAsync; -exports.isAsync = isAsync; -exports.isAsyncGenerator = isAsyncGenerator; -exports.isAsyncIterable = isAsyncIterable; \ No newline at end of file diff --git a/node_modules/async/log.js b/node_modules/async/log.js deleted file mode 100644 index 8fc1ed5..0000000 --- a/node_modules/async/log.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _consoleFunc = require('./internal/consoleFunc.js'); - -var _consoleFunc2 = _interopRequireDefault(_consoleFunc); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Logs the result of an `async` function to the `console`. Only works in - * Node.js or in browsers that support `console.log` and `console.error` (such - * as FF and Chrome). If multiple arguments are returned from the async - * function, `console.log` is called on each argument in order. - * - * @name log - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, 'hello ' + name); - * }, 1000); - * }; - * - * // in the node repl - * node> async.log(hello, 'world'); - * 'hello world' - */ -exports.default = (0, _consoleFunc2.default)('log'); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/map.js b/node_modules/async/map.js deleted file mode 100644 index ec4135d..0000000 --- a/node_modules/async/map.js +++ /dev/null @@ -1,142 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _map2 = require('./internal/map.js'); - -var _map3 = _interopRequireDefault(_map2); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Produces a new collection of values by mapping each value in `coll` through - * the `iteratee` function. The `iteratee` is called with an item from `coll` - * and a callback for when it has finished processing. Each of these callbacks - * takes 2 arguments: an `error`, and the transformed item from `coll`. If - * `iteratee` passes an error to its callback, the main `callback` (for the - * `map` function) is immediately called with the error. - * - * Note, that since this function applies the `iteratee` to each item in - * parallel, there is no guarantee that the `iteratee` functions will complete - * in order. However, the results array will be in the same order as the - * original `coll`. - * - * If `map` is passed an Object, the results will be an Array. The results - * will roughly be in the order of the original Objects' keys (but this can - * vary across JavaScript engines). - * - * @name map - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an Array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file4.txt']; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.map(fileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes, function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * }); - * - * // Using Promises - * async.map(fileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.map(withMissingFileList, getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.map(fileList, getFileSizeInBytes); - * console.log(results); - * // results is now an array of the file size in bytes for each file, e.g. - * // [ 1000, 2000, 3000] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let results = await async.map(withMissingFileList, getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function map(coll, iteratee, callback) { - return (0, _map3.default)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(map, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapLimit.js b/node_modules/async/mapLimit.js deleted file mode 100644 index b5e461c..0000000 --- a/node_modules/async/mapLimit.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _map2 = require('./internal/map.js'); - -var _map3 = _interopRequireDefault(_map2); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. - * - * @name mapLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function mapLimit(coll, limit, iteratee, callback) { - return (0, _map3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(mapLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapSeries.js b/node_modules/async/mapSeries.js deleted file mode 100644 index 91f36bf..0000000 --- a/node_modules/async/mapSeries.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _map2 = require('./internal/map.js'); - -var _map3 = _interopRequireDefault(_map2); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. - * - * @name mapSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function mapSeries(coll, iteratee, callback) { - return (0, _map3.default)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(mapSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapValues.js b/node_modules/async/mapValues.js deleted file mode 100644 index 00da926..0000000 --- a/node_modules/async/mapValues.js +++ /dev/null @@ -1,152 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = mapValues; - -var _mapValuesLimit = require('./mapValuesLimit.js'); - -var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. - * - * Produces a new Object by mapping each value of `obj` through the `iteratee` - * function. The `iteratee` is called each `value` and `key` from `obj` and a - * callback for when it has finished processing. Each of these callbacks takes - * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` - * passes an error to its callback, the main `callback` (for the `mapValues` - * function) is immediately called with the error. - * - * Note, the order of the keys in the result is not guaranteed. The keys will - * be roughly in the order they complete, (but this is very engine-specific) - * - * @name mapValues - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file3.txt' - * }; - * - * const withMissingFileMap = { - * f1: 'file1.txt', - * f2: 'file2.txt', - * f3: 'file4.txt' - * }; - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, key, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.mapValues(fileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * }); - * - * // Error handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.mapValues(fileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * }).catch (err => { - * console.log(err); - * }); - * - * // Error Handling - * async.mapValues(withMissingFileMap, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch (err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.mapValues(fileMap, getFileSizeInBytes); - * console.log(result); - * // result is now a map of file size in bytes for each file, e.g. - * // { - * // f1: 1000, - * // f2: 2000, - * // f3: 3000 - * // } - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.mapValues(withMissingFileMap, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function mapValues(obj, iteratee, callback) { - return (0, _mapValuesLimit2.default)(obj, Infinity, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapValuesLimit.js b/node_modules/async/mapValuesLimit.js deleted file mode 100644 index 93066ee..0000000 --- a/node_modules/async/mapValuesLimit.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a - * time. - * - * @name mapValuesLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function mapValuesLimit(obj, limit, iteratee, callback) { - callback = (0, _once2.default)(callback); - var newObj = {}; - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _eachOfLimit2.default)(limit)(obj, (val, key, next) => { - _iteratee(val, key, (err, result) => { - if (err) return next(err); - newObj[key] = result; - next(err); - }); - }, err => callback(err, newObj)); -} - -exports.default = (0, _awaitify2.default)(mapValuesLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/mapValuesSeries.js b/node_modules/async/mapValuesSeries.js deleted file mode 100644 index 560058a..0000000 --- a/node_modules/async/mapValuesSeries.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = mapValuesSeries; - -var _mapValuesLimit = require('./mapValuesLimit.js'); - -var _mapValuesLimit2 = _interopRequireDefault(_mapValuesLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. - * - * @name mapValuesSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function mapValuesSeries(obj, iteratee, callback) { - return (0, _mapValuesLimit2.default)(obj, 1, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/memoize.js b/node_modules/async/memoize.js deleted file mode 100644 index 6003e41..0000000 --- a/node_modules/async/memoize.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = memoize; - -var _setImmediate = require('./internal/setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Caches the results of an async function. When creating a hash to store - * function results against, the callback is omitted from the hash and an - * optional hash function can be used. - * - * **Note: if the async function errs, the result will not be cached and - * subsequent calls will call the wrapped function.** - * - * If no hash function is specified, the first argument is used as a hash key, - * which may work reasonably if it is a string or a data type that converts to a - * distinct string. Note that objects and arrays will not behave reasonably. - * Neither will cases where the other arguments are significant. In such cases, - * specify your own hash function. - * - * The cache of results is exposed as the `memo` property of the function - * returned by `memoize`. - * - * @name memoize - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function to proxy and cache results from. - * @param {Function} hasher - An optional function for generating a custom hash - * for storing results. It has all the arguments applied to it apart from the - * callback, and must be synchronous. - * @returns {AsyncFunction} a memoized version of `fn` - * @example - * - * var slow_fn = function(name, callback) { - * // do something - * callback(null, result); - * }; - * var fn = async.memoize(slow_fn); - * - * // fn can now be used as if it were slow_fn - * fn('some name', function() { - * // callback - * }); - */ -function memoize(fn, hasher = v => v) { - var memo = Object.create(null); - var queues = Object.create(null); - var _fn = (0, _wrapAsync2.default)(fn); - var memoized = (0, _initialParams2.default)((args, callback) => { - var key = hasher(...args); - if (key in memo) { - (0, _setImmediate2.default)(() => callback(null, ...memo[key])); - } else if (key in queues) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn(...args, (err, ...resultArgs) => { - // #1465 don't memoize if an error occurred - if (!err) { - memo[key] = resultArgs; - } - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i](err, ...resultArgs); - } - }); - } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/nextTick.js b/node_modules/async/nextTick.js deleted file mode 100644 index e6d321b..0000000 --- a/node_modules/async/nextTick.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _setImmediate = require('./internal/setImmediate.js'); - -/** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `process.nextTick`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name nextTick - * @static - * @memberOf module:Utils - * @method - * @see [async.setImmediate]{@link module:Utils.setImmediate} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ -var _defer; /* istanbul ignore file */ - - -if (_setImmediate.hasNextTick) { - _defer = process.nextTick; -} else if (_setImmediate.hasSetImmediate) { - _defer = setImmediate; -} else { - _defer = _setImmediate.fallback; -} - -exports.default = (0, _setImmediate.wrap)(_defer); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/package.json b/node_modules/async/package.json deleted file mode 100644 index 9c464bc..0000000 --- a/node_modules/async/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "version": "3.2.4", - "main": "dist/async.js", - "author": "Caolan McMahon", - "homepage": "https://caolan.github.io/async/", - "repository": { - "type": "git", - "url": "https://github.com/caolan/async.git" - }, - "bugs": { - "url": "https://github.com/caolan/async/issues" - }, - "keywords": [ - "async", - "callback", - "module", - "utility" - ], - "devDependencies": { - "@babel/eslint-parser": "^7.16.5", - "babel-core": "^6.26.3", - "babel-minify": "^0.5.0", - "babel-plugin-add-module-exports": "^1.0.4", - "babel-plugin-istanbul": "^6.1.1", - "babel-plugin-syntax-async-generators": "^6.13.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", - "babel-preset-es2015": "^6.3.13", - "babel-preset-es2017": "^6.22.0", - "babel-register": "^6.26.0", - "babelify": "^10.0.0", - "benchmark": "^2.1.1", - "bluebird": "^3.4.6", - "browserify": "^17.0.0", - "chai": "^4.2.0", - "cheerio": "^0.22.0", - "es6-promise": "^4.2.8", - "eslint": "^8.6.0", - "eslint-plugin-prefer-arrow": "^1.2.3", - "fs-extra": "^10.0.0", - "jsdoc": "^3.6.2", - "karma": "^6.3.12", - "karma-browserify": "^8.1.0", - "karma-firefox-launcher": "^2.1.2", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.0", - "karma-safari-launcher": "^1.0.0", - "mocha": "^6.1.4", - "native-promise-only": "^0.8.0-a", - "nyc": "^15.1.0", - "rollup": "^2.66.1", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-npm": "^2.0.0", - "rsvp": "^4.8.5", - "semver": "^7.3.5", - "yargs": "^17.3.1" - }, - "scripts": { - "coverage": "nyc npm run mocha-node-test -- --grep @nycinvalid --invert", - "jsdoc": "jsdoc -c ./support/jsdoc/jsdoc.json && node support/jsdoc/jsdoc-fix-html.js", - "lint": "eslint --fix .", - "mocha-browser-test": "karma start", - "mocha-node-test": "mocha", - "mocha-test": "npm run mocha-node-test && npm run mocha-browser-test", - "test": "npm run lint && npm run mocha-node-test" - }, - "license": "MIT", - "nyc": { - "exclude": [ - "test" - ] - }, - "module": "dist/async.mjs" -} \ No newline at end of file diff --git a/node_modules/async/parallel.js b/node_modules/async/parallel.js deleted file mode 100644 index 76bc624..0000000 --- a/node_modules/async/parallel.js +++ /dev/null @@ -1,180 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = parallel; - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _parallel2 = require('./internal/parallel.js'); - -var _parallel3 = _interopRequireDefault(_parallel2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Run the `tasks` collection of functions in parallel, without waiting until - * the previous function has completed. If any of the functions pass an error to - * its callback, the main `callback` is immediately called with the value of the - * error. Once the `tasks` have completed, the results are passed to the final - * `callback` as an array. - * - * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about - * parallel execution of code. If your tasks do not use any timers or perform - * any I/O, they will actually be executed in series. Any synchronous setup - * sections for each task will happen one after the other. JavaScript remains - * single-threaded. - * - * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the - * execution of other tasks when a task fails. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.parallel}. - * - * @name parallel - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * - * //Using Callbacks - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] even though - * // the second function had a shorter timeout. - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function parallel(tasks, callback) { - return (0, _parallel3.default)(_eachOf2.default, tasks, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/parallelLimit.js b/node_modules/async/parallelLimit.js deleted file mode 100644 index dbe0bb8..0000000 --- a/node_modules/async/parallelLimit.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = parallelLimit; - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _parallel = require('./internal/parallel.js'); - -var _parallel2 = _interopRequireDefault(_parallel); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a - * time. - * - * @name parallelLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.parallel]{@link module:ControlFlow.parallel} - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * @returns {Promise} a promise, if a callback is not passed - */ -function parallelLimit(tasks, limit, callback) { - return (0, _parallel2.default)((0, _eachOfLimit2.default)(limit), tasks, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/priorityQueue.js b/node_modules/async/priorityQueue.js deleted file mode 100644 index 6006f66..0000000 --- a/node_modules/async/priorityQueue.js +++ /dev/null @@ -1,86 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (worker, concurrency) { - // Start with a normal queue - var q = (0, _queue2.default)(worker, concurrency); - - var { - push, - pushAsync - } = q; - - q._tasks = new _Heap2.default(); - q._createTaskItem = ({ data, priority }, callback) => { - return { - data, - priority, - callback - }; - }; - - function createDataItems(tasks, priority) { - if (!Array.isArray(tasks)) { - return { data: tasks, priority }; - } - return tasks.map(data => { - return { data, priority }; - }); - } - - // Override push to accept second parameter representing priority - q.push = function (data, priority = 0, callback) { - return push(createDataItems(data, priority), callback); - }; - - q.pushAsync = function (data, priority = 0, callback) { - return pushAsync(createDataItems(data, priority), callback); - }; - - // Remove unshift functions - delete q.unshift; - delete q.unshiftAsync; - - return q; -}; - -var _queue = require('./queue.js'); - -var _queue2 = _interopRequireDefault(_queue); - -var _Heap = require('./internal/Heap.js'); - -var _Heap2 = _interopRequireDefault(_Heap); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -module.exports = exports['default']; - -/** - * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and - * completed in ascending priority order. - * - * @name priorityQueue - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. - * Invoked with (task, callback). - * @param {number} concurrency - An `integer` for determining how many `worker` - * functions should be run in parallel. If omitted, the concurrency defaults to - * `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are three - * differences between `queue` and `priorityQueue` objects: - * * `push(task, priority, [callback])` - `priority` should be a number. If an - * array of `tasks` is given, all tasks will be assigned the same priority. - * * `pushAsync(task, priority, [callback])` - the same as `priorityQueue.push`, - * except this returns a promise that rejects if an error occurs. - * * The `unshift` and `unshiftAsync` methods were removed. - */ \ No newline at end of file diff --git a/node_modules/async/queue.js b/node_modules/async/queue.js deleted file mode 100644 index c69becb..0000000 --- a/node_modules/async/queue.js +++ /dev/null @@ -1,167 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (worker, concurrency) { - var _worker = (0, _wrapAsync2.default)(worker); - return (0, _queue2.default)((items, cb) => { - _worker(items[0], cb); - }, concurrency, 1); -}; - -var _queue = require('./internal/queue.js'); - -var _queue2 = _interopRequireDefault(_queue); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -module.exports = exports['default']; - -/** - * A queue of tasks for the worker function to complete. - * @typedef {Iterable} QueueObject - * @memberOf module:ControlFlow - * @property {Function} length - a function returning the number of items - * waiting to be processed. Invoke with `queue.length()`. - * @property {boolean} started - a boolean indicating whether or not any - * items have been pushed and processed by the queue. - * @property {Function} running - a function returning the number of items - * currently being processed. Invoke with `queue.running()`. - * @property {Function} workersList - a function returning the array of items - * currently being processed. Invoke with `queue.workersList()`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke with `queue.idle()`. - * @property {number} concurrency - an integer for determining how many `worker` - * functions should be run in parallel. This property can be changed after a - * `queue` is created to alter the concurrency on-the-fly. - * @property {number} payload - an integer that specifies how many items are - * passed to the worker function at a time. only applies if this is a - * [cargo]{@link module:ControlFlow.cargo} object - * @property {AsyncFunction} push - add a new task to the `queue`. Calls `callback` - * once the `worker` has finished processing the task. Instead of a single task, - * a `tasks` array can be submitted. The respective callback is used for every - * task in the list. Invoke with `queue.push(task, [callback])`, - * @property {AsyncFunction} unshift - add a new task to the front of the `queue`. - * Invoke with `queue.unshift(task, [callback])`. - * @property {AsyncFunction} pushAsync - the same as `q.push`, except this returns - * a promise that rejects if an error occurs. - * @property {AsyncFunction} unshiftAsync - the same as `q.unshift`, except this returns - * a promise that rejects if an error occurs. - * @property {Function} remove - remove items from the queue that match a test - * function. The test function will be passed an object with a `data` property, - * and a `priority` property, if this is a - * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. - * Invoked with `queue.remove(testFn)`, where `testFn` is of the form - * `function ({data, priority}) {}` and returns a Boolean. - * @property {Function} saturated - a function that sets a callback that is - * called when the number of running workers hits the `concurrency` limit, and - * further tasks will be queued. If the callback is omitted, `q.saturated()` - * returns a promise for the next occurrence. - * @property {Function} unsaturated - a function that sets a callback that is - * called when the number of running workers is less than the `concurrency` & - * `buffer` limits, and further tasks will not be queued. If the callback is - * omitted, `q.unsaturated()` returns a promise for the next occurrence. - * @property {number} buffer - A minimum threshold buffer in order to say that - * the `queue` is `unsaturated`. - * @property {Function} empty - a function that sets a callback that is called - * when the last item from the `queue` is given to a `worker`. If the callback - * is omitted, `q.empty()` returns a promise for the next occurrence. - * @property {Function} drain - a function that sets a callback that is called - * when the last item from the `queue` has returned from the `worker`. If the - * callback is omitted, `q.drain()` returns a promise for the next occurrence. - * @property {Function} error - a function that sets a callback that is called - * when a task errors. Has the signature `function(error, task)`. If the - * callback is omitted, `error()` returns a promise that rejects on the next - * error. - * @property {boolean} paused - a boolean for determining whether the queue is - * in a paused state. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke with `queue.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke with `queue.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. No more tasks - * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. - * - * @example - * const q = async.queue(worker, 2) - * q.push(item1) - * q.push(item2) - * q.push(item3) - * // queues are iterable, spread into an array to inspect - * const items = [...q] // [item1, item2, item3] - * // or use for of - * for (let item of q) { - * console.log(item) - * } - * - * q.drain(() => { - * console.log('all done') - * }) - * // or - * await q.drain() - */ - -/** - * Creates a `queue` object with the specified `concurrency`. Tasks added to the - * `queue` are processed in parallel (up to the `concurrency` limit). If all - * `worker`s are in progress, the task is queued until one becomes available. - * Once a `worker` completes a `task`, that `task`'s callback is called. - * - * @name queue - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. Invoked with (task, callback). - * @param {number} [concurrency=1] - An `integer` for determining how many - * `worker` functions should be run in parallel. If omitted, the concurrency - * defaults to `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can be - * attached as certain properties to listen for specific events during the - * lifecycle of the queue. - * @example - * - * // create a queue object with concurrency 2 - * var q = async.queue(function(task, callback) { - * console.log('hello ' + task.name); - * callback(); - * }, 2); - * - * // assign a callback - * q.drain(function() { - * console.log('all items have been processed'); - * }); - * // or await the end - * await q.drain() - * - * // assign an error callback - * q.error(function(err, task) { - * console.error('task experienced an error'); - * }); - * - * // add some items to the queue - * q.push({name: 'foo'}, function(err) { - * console.log('finished processing foo'); - * }); - * // callback is optional - * q.push({name: 'bar'}); - * - * // add some items to the queue (batch-wise) - * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { - * console.log('finished processing item'); - * }); - * - * // add some items to the front of the queue - * q.unshift({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - */ \ No newline at end of file diff --git a/node_modules/async/race.js b/node_modules/async/race.js deleted file mode 100644 index 9595d88..0000000 --- a/node_modules/async/race.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` complete or pass an - * error to its callback, the main `callback` is immediately called. It's - * equivalent to `Promise.race()`. - * - * @name race - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} - * to run. Each function can complete with an optional `result` value. - * @param {Function} callback - A callback to run once any of the functions have - * completed. This function gets an error or result from the first function that - * completed. Invoked with (err, result). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.race([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // main callback - * function(err, result) { - * // the result will be equal to 'two' as it finishes earlier - * }); - */ -function race(tasks, callback) { - callback = (0, _once2.default)(callback); - if (!Array.isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - (0, _wrapAsync2.default)(tasks[i])(callback); - } -} - -exports.default = (0, _awaitify2.default)(race, 2); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reduce.js b/node_modules/async/reduce.js deleted file mode 100644 index 56e2db8..0000000 --- a/node_modules/async/reduce.js +++ /dev/null @@ -1,153 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Reduces `coll` into a single value using an async `iteratee` to return each - * successive step. `memo` is the initial state of the reduction. This function - * only operates in series. - * - * For performance reasons, it may make sense to split a call to this function - * into a parallel map, and then use the normal `Array.prototype.reduce` on the - * results. This function is for situations where each step in the reduction - * needs to be async; if you can get the data before reducing it, then it's - * probably a good idea to do so. - * - * @name reduce - * @static - * @memberOf module:Collections - * @method - * @alias inject - * @alias foldl - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * // file4.txt does not exist - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * const withMissingFileList = ['file1.txt','file2.txt','file3.txt', 'file4.txt']; - * - * // asynchronous function that computes the file size in bytes - * // file size is added to the memoized value, then returned - * function getFileSizeInBytes(memo, file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, memo + stat.size); - * }); - * } - * - * // Using callbacks - * async.reduce(fileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes, function(err, result) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(result); - * } - * }); - * - * // Using Promises - * async.reduce(fileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * }).catch( err => { - * console.log(err); - * }); - * - * // Error Handling - * async.reduce(withMissingFileList, 0, getFileSizeInBytes) - * .then( result => { - * console.log(result); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.reduce(fileList, 0, getFileSizeInBytes); - * console.log(result); - * // 6000 - * // which is the sum of the file sizes of the three files - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // Error Handling - * async () => { - * try { - * let result = await async.reduce(withMissingFileList, 0, getFileSizeInBytes); - * console.log(result); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function reduce(coll, memo, iteratee, callback) { - callback = (0, _once2.default)(callback); - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _eachOfSeries2.default)(coll, (x, i, iterCb) => { - _iteratee(memo, x, (err, v) => { - memo = v; - iterCb(err); - }); - }, err => callback(err, memo)); -} -exports.default = (0, _awaitify2.default)(reduce, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reduceRight.js b/node_modules/async/reduceRight.js deleted file mode 100644 index bee5391..0000000 --- a/node_modules/async/reduceRight.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = reduceRight; - -var _reduce = require('./reduce.js'); - -var _reduce2 = _interopRequireDefault(_reduce); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee completes with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - * @returns {Promise} a promise, if no callback is passed - */ -function reduceRight(array, memo, iteratee, callback) { - var reversed = [...array].reverse(); - return (0, _reduce2.default)(reversed, memo, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reflect.js b/node_modules/async/reflect.js deleted file mode 100644 index 297ed79..0000000 --- a/node_modules/async/reflect.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = reflect; - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Wraps the async function in another function that always completes with a - * result object, even when it errors. - * - * The result object has either the property `error` or `value`. - * - * @name reflect - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function you want to wrap - * @returns {Function} - A function that always passes null to it's callback as - * the error. The second argument to the callback will be an `object` with - * either an `error` or a `value` property. - * @example - * - * async.parallel([ - * async.reflect(function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }), - * async.reflect(function(callback) { - * // do some more stuff but error ... - * callback('bad stuff happened'); - * }), - * async.reflect(function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * }) - * ], - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = 'bad stuff happened' - * // results[2].value = 'two' - * }); - */ -function reflect(fn) { - var _fn = (0, _wrapAsync2.default)(fn); - return (0, _initialParams2.default)(function reflectOn(args, reflectCallback) { - args.push((error, ...cbArgs) => { - let retVal = {}; - if (error) { - retVal.error = error; - } - if (cbArgs.length > 0) { - var value = cbArgs; - if (cbArgs.length <= 1) { - [value] = cbArgs; - } - retVal.value = value; - } - reflectCallback(null, retVal); - }); - - return _fn.apply(this, args); - }); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reflectAll.js b/node_modules/async/reflectAll.js deleted file mode 100644 index a862ff0..0000000 --- a/node_modules/async/reflectAll.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = reflectAll; - -var _reflect = require('./reflect.js'); - -var _reflect2 = _interopRequireDefault(_reflect); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * A helper function that wraps an array or an object of functions with `reflect`. - * - * @name reflectAll - * @static - * @memberOf module:Utils - * @method - * @see [async.reflect]{@link module:Utils.reflect} - * @category Util - * @param {Array|Object|Iterable} tasks - The collection of - * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. - * @returns {Array} Returns an array of async functions, each wrapped in - * `async.reflect` - * @example - * - * let tasks = [ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * // do some more stuff but error ... - * callback(new Error('bad stuff happened')); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = Error('bad stuff happened') - * // results[2].value = 'two' - * }); - * - * // an example using an object instead of an array - * let tasks = { - * one: function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * two: function(callback) { - * callback('two'); - * }, - * three: function(callback) { - * setTimeout(function() { - * callback(null, 'three'); - * }, 100); - * } - * }; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results.one.value = 'one' - * // results.two.error = 'two' - * // results.three.value = 'three' - * }); - */ -function reflectAll(tasks) { - var results; - if (Array.isArray(tasks)) { - results = tasks.map(_reflect2.default); - } else { - results = {}; - Object.keys(tasks).forEach(key => { - results[key] = _reflect2.default.call(this, tasks[key]); - }); - } - return results; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/reject.js b/node_modules/async/reject.js deleted file mode 100644 index cabd96e..0000000 --- a/node_modules/async/reject.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _reject2 = require('./internal/reject.js'); - -var _reject3 = _interopRequireDefault(_reject2); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. - * - * @name reject - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const fileList = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.reject(fileList, fileExists, function(err, results) { - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }); - * - * // Using Promises - * async.reject(fileList, fileExists) - * .then( results => { - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.reject(fileList, fileExists); - * console.log(results); - * // [ 'dir3/file6.txt' ] - * // results now equals an array of the non-existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function reject(coll, iteratee, callback) { - return (0, _reject3.default)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(reject, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/rejectLimit.js b/node_modules/async/rejectLimit.js deleted file mode 100644 index 1a89925..0000000 --- a/node_modules/async/rejectLimit.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _reject2 = require('./internal/reject.js'); - -var _reject3 = _interopRequireDefault(_reject2); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a - * time. - * - * @name rejectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function rejectLimit(coll, limit, iteratee, callback) { - return (0, _reject3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(rejectLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/rejectSeries.js b/node_modules/async/rejectSeries.js deleted file mode 100644 index 6e1a1c5..0000000 --- a/node_modules/async/rejectSeries.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _reject2 = require('./internal/reject.js'); - -var _reject3 = _interopRequireDefault(_reject2); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. - * - * @name rejectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback is passed - */ -function rejectSeries(coll, iteratee, callback) { - return (0, _reject3.default)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(rejectSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/retry.js b/node_modules/async/retry.js deleted file mode 100644 index dba3030..0000000 --- a/node_modules/async/retry.js +++ /dev/null @@ -1,159 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = retry; - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _promiseCallback = require('./internal/promiseCallback.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function constant(value) { - return function () { - return value; - }; -} - -/** - * Attempts to get a successful response from `task` no more than `times` times - * before returning an error. If the task is successful, the `callback` will be - * passed the result of the successful task. If all attempts fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name retry - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @see [async.retryable]{@link module:ControlFlow.retryable} - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an - * object with `times` and `interval` or a number. - * * `times` - The number of attempts to make before giving up. The default - * is `5`. - * * `interval` - The time to wait between retries, in milliseconds. The - * default is `0`. The interval may also be specified as a function of the - * retry count (see example). - * * `errorFilter` - An optional synchronous function that is invoked on - * erroneous result. If it returns `true` the retry attempts will continue; - * if the function returns `false` the retry flow is aborted with the current - * attempt's error and result being returned to the final callback. - * Invoked with (err). - * * If `opts` is a number, the number specifies the number of times to retry, - * with the default interval of `0`. - * @param {AsyncFunction} task - An async function to retry. - * Invoked with (callback). - * @param {Function} [callback] - An optional callback which is called when the - * task has succeeded, or after the final failed attempt. It receives the `err` - * and `result` arguments of the last attempt at completing the `task`. Invoked - * with (err, results). - * @returns {Promise} a promise if no callback provided - * - * @example - * - * // The `retry` function can be used as a stand-alone control flow by passing - * // a callback, as shown below: - * - * // try calling apiMethod 3 times - * async.retry(3, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 3 times, waiting 200 ms between each retry - * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 10 times with exponential backoff - * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) - * async.retry({ - * times: 10, - * interval: function(retryCount) { - * return 50 * Math.pow(2, retryCount); - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod the default 5 times no delay between each retry - * async.retry(apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod only when error condition satisfies, all other - * // errors will abort the retry control flow and return to final callback - * async.retry({ - * errorFilter: function(err) { - * return err.message === 'Temporary error'; // only retry on a specific error - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // to retry individual methods that are not as reliable within other - * // control flow functions, use the `retryable` wrapper: - * async.auto({ - * users: api.getUsers.bind(api), - * payments: async.retryable(3, api.getPayments.bind(api)) - * }, function(err, results) { - * // do something with the results - * }); - * - */ -const DEFAULT_TIMES = 5; -const DEFAULT_INTERVAL = 0; - -function retry(opts, task, callback) { - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant(DEFAULT_INTERVAL) - }; - - if (arguments.length < 3 && typeof opts === 'function') { - callback = task || (0, _promiseCallback.promiseCallback)(); - task = opts; - } else { - parseTimes(options, opts); - callback = callback || (0, _promiseCallback.promiseCallback)(); - } - - if (typeof task !== 'function') { - throw new Error("Invalid arguments for async.retry"); - } - - var _task = (0, _wrapAsync2.default)(task); - - var attempt = 1; - function retryAttempt() { - _task((err, ...args) => { - if (err === false) return; - if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt - 1)); - } else { - callback(err, ...args); - } - }); - } - - retryAttempt(); - return callback[_promiseCallback.PROMISE_SYMBOL]; -} - -function parseTimes(acc, t) { - if (typeof t === 'object') { - acc.times = +t.times || DEFAULT_TIMES; - - acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant(+t.interval || DEFAULT_INTERVAL); - - acc.errorFilter = t.errorFilter; - } else if (typeof t === 'number' || typeof t === 'string') { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/retryable.js b/node_modules/async/retryable.js deleted file mode 100644 index 1b1147c..0000000 --- a/node_modules/async/retryable.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = retryable; - -var _retry = require('./retry.js'); - -var _retry2 = _interopRequireDefault(_retry); - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _promiseCallback = require('./internal/promiseCallback.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method - * wraps a task and makes it retryable, rather than immediately calling it - * with retries. - * - * @name retryable - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.retry]{@link module:ControlFlow.retry} - * @category Control Flow - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional - * options, exactly the same as from `retry`, except for a `opts.arity` that - * is the arity of the `task` function, defaulting to `task.length` - * @param {AsyncFunction} task - the asynchronous function to wrap. - * This function will be passed any arguments passed to the returned wrapper. - * Invoked with (...args, callback). - * @returns {AsyncFunction} The wrapped function, which when invoked, will - * retry on an error, based on the parameters specified in `opts`. - * This function will accept the same parameters as `task`. - * @example - * - * async.auto({ - * dep1: async.retryable(3, getFromFlakyService), - * process: ["dep1", async.retryable(3, function (results, cb) { - * maybeProcessData(results.dep1, cb); - * })] - * }, callback); - */ -function retryable(opts, task) { - if (!task) { - task = opts; - opts = null; - } - let arity = opts && opts.arity || task.length; - if ((0, _wrapAsync.isAsync)(task)) { - arity += 1; - } - var _task = (0, _wrapAsync2.default)(task); - return (0, _initialParams2.default)((args, callback) => { - if (args.length < arity - 1 || callback == null) { - args.push(callback); - callback = (0, _promiseCallback.promiseCallback)(); - } - function taskFn(cb) { - _task(...args, cb); - } - - if (opts) (0, _retry2.default)(opts, taskFn, callback);else (0, _retry2.default)(taskFn, callback); - - return callback[_promiseCallback.PROMISE_SYMBOL]; - }); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/select.js b/node_modules/async/select.js deleted file mode 100644 index 303dc1f..0000000 --- a/node_modules/async/select.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * - * const files = ['dir1/file1.txt','dir2/file3.txt','dir3/file6.txt']; - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.filter(files, fileExists, function(err, results) { - * if(err) { - * console.log(err); - * } else { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * }); - * - * // Using Promises - * async.filter(files, fileExists) - * .then(results => { - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let results = await async.filter(files, fileExists); - * console.log(results); - * // [ 'dir1/file1.txt', 'dir2/file3.txt' ] - * // results is now an array of the existing files - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function filter(coll, iteratee, callback) { - return (0, _filter3.default)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filter, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/selectLimit.js b/node_modules/async/selectLimit.js deleted file mode 100644 index 89e55f5..0000000 --- a/node_modules/async/selectLimit.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @returns {Promise} a promise, if no callback provided - */ -function filterLimit(coll, limit, iteratee, callback) { - return (0, _filter3.default)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filterLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/selectSeries.js b/node_modules/async/selectSeries.js deleted file mode 100644 index a045e52..0000000 --- a/node_modules/async/selectSeries.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _filter2 = require('./internal/filter.js'); - -var _filter3 = _interopRequireDefault(_filter2); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - * @returns {Promise} a promise, if no callback provided - */ -function filterSeries(coll, iteratee, callback) { - return (0, _filter3.default)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(filterSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/seq.js b/node_modules/async/seq.js deleted file mode 100644 index 28c825f..0000000 --- a/node_modules/async/seq.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = seq; - -var _reduce = require('./reduce.js'); - -var _reduce2 = _interopRequireDefault(_reduce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _promiseCallback = require('./internal/promiseCallback.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Version of the compose function that is more natural to read. Each function - * consumes the return value of the previous function. It is the equivalent of - * [compose]{@link module:ControlFlow.compose} with the arguments reversed. - * - * Each function is executed with the `this` binding of the composed function. - * - * @name seq - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.compose]{@link module:ControlFlow.compose} - * @category Control Flow - * @param {...AsyncFunction} functions - the asynchronous functions to compose - * @returns {Function} a function that composes the `functions` in order - * @example - * - * // Requires lodash (or underscore), express3 and dresende's orm2. - * // Part of an app, that fetches cats of the logged user. - * // This example uses `seq` function to avoid overnesting and error - * // handling clutter. - * app.get('/cats', function(request, response) { - * var User = request.models.User; - * async.seq( - * User.get.bind(User), // 'User.get' has signature (id, callback(err, data)) - * function(user, fn) { - * user.getCats(fn); // 'getCats' has signature (callback(err, data)) - * } - * )(req.session.user_id, function (err, cats) { - * if (err) { - * console.error(err); - * response.json({ status: 'error', message: err.message }); - * } else { - * response.json({ status: 'ok', message: 'Cats found', data: cats }); - * } - * }); - * }); - */ -function seq(...functions) { - var _functions = functions.map(_wrapAsync2.default); - return function (...args) { - var that = this; - - var cb = args[args.length - 1]; - if (typeof cb == 'function') { - args.pop(); - } else { - cb = (0, _promiseCallback.promiseCallback)(); - } - - (0, _reduce2.default)(_functions, args, (newargs, fn, iterCb) => { - fn.apply(that, newargs.concat((err, ...nextargs) => { - iterCb(err, nextargs); - })); - }, (err, results) => cb(err, ...results)); - - return cb[_promiseCallback.PROMISE_SYMBOL]; - }; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/series.js b/node_modules/async/series.js deleted file mode 100644 index 56e78f9..0000000 --- a/node_modules/async/series.js +++ /dev/null @@ -1,186 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = series; - -var _parallel2 = require('./internal/parallel.js'); - -var _parallel3 = _interopRequireDefault(_parallel2); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Run the functions in the `tasks` collection in series, each one running once - * the previous function has completed. If any functions in the series pass an - * error to its callback, no more functions are run, and `callback` is - * immediately called with the value of the error. Otherwise, `callback` - * receives an array of results when `tasks` have completed. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function, and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.series}. - * - * **Note** that while many implementations preserve the order of object - * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) - * explicitly states that - * - * > The mechanics and order of enumerating the properties is not specified. - * - * So if you rely on the order in which your series of functions are executed, - * and want this to work on all platforms, consider using an array. - * - * @name series - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing - * [async functions]{@link AsyncFunction} to run in series. - * Each function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This function gets a results array (or object) - * containing all the result arguments passed to the `task` callbacks. Invoked - * with (err, result). - * @return {Promise} a promise, if no callback is passed - * @example - * - * //Using Callbacks - * async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ], function(err, results) { - * console.log(results); - * // results is equal to ['one','two'] - * }); - * - * // an example using objects instead of arrays - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }); - * - * //Using Promises - * async.series([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]).then(results => { - * console.log(results); - * // results is equal to ['one','two'] - * }).catch(err => { - * console.log(err); - * }); - * - * // an example using an object instead of an array - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }).then(results => { - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * }).catch(err => { - * console.log(err); - * }); - * - * //Using async/await - * async () => { - * try { - * let results = await async.series([ - * function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 'two'); - * }, 100); - * } - * ]); - * console.log(results); - * // results is equal to ['one','two'] - * } - * catch (err) { - * console.log(err); - * } - * } - * - * // an example using an object instead of an array - * async () => { - * try { - * let results = await async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * // do some async task - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * // then do another async task - * callback(null, 2); - * }, 100); - * } - * }); - * console.log(results); - * // results is equal to: { one: 1, two: 2 } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function series(tasks, callback) { - return (0, _parallel3.default)(_eachOfSeries2.default, tasks, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/setImmediate.js b/node_modules/async/setImmediate.js deleted file mode 100644 index c712ec3..0000000 --- a/node_modules/async/setImmediate.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _setImmediate = require('./internal/setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `setImmediate`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name setImmediate - * @static - * @memberOf module:Utils - * @method - * @see [async.nextTick]{@link module:Utils.nextTick} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ -exports.default = _setImmediate2.default; -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/some.js b/node_modules/async/some.js deleted file mode 100644 index 2046cf6..0000000 --- a/node_modules/async/some.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // dir1 is a directory that contains file1.txt, file2.txt - * // dir2 is a directory that contains file3.txt, file4.txt - * // dir3 is a directory that contains file5.txt - * // dir4 does not exist - * - * // asynchronous function that checks if a file exists - * function fileExists(file, callback) { - * fs.access(file, fs.constants.F_OK, (err) => { - * callback(null, !err); - * }); - * } - * - * // Using callbacks - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - *); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists, - * function(err, result) { - * console.log(result); - * // false - * // result is false since none of the files exists - * } - *); - * - * // Using Promises - * async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists) - * .then( result => { - * console.log(result); - * // true - * // result is true since some file in the list exists - * }).catch( err => { - * console.log(err); - * }); - * - * async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists) - * .then( result => { - * console.log(result); - * // false - * // result is false since none of the files exists - * }).catch( err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir3/file5.txt'], fileExists); - * console.log(result); - * // true - * // result is true since some file in the list exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - * async () => { - * try { - * let result = await async.some(['dir1/missing.txt','dir2/missing.txt','dir4/missing.txt'], fileExists); - * console.log(result); - * // false - * // result is false since none of the files exists - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function some(coll, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)(_eachOf2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(some, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/someLimit.js b/node_modules/async/someLimit.js deleted file mode 100644 index c8a295a..0000000 --- a/node_modules/async/someLimit.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfLimit = require('./internal/eachOfLimit.js'); - -var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someLimit(coll, limit, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)((0, _eachOfLimit2.default)(limit), coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(someLimit, 4); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/someSeries.js b/node_modules/async/someSeries.js deleted file mode 100644 index ee0654b..0000000 --- a/node_modules/async/someSeries.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createTester = require('./internal/createTester.js'); - -var _createTester2 = _interopRequireDefault(_createTester); - -var _eachOfSeries = require('./eachOfSeries.js'); - -var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - */ -function someSeries(coll, iteratee, callback) { - return (0, _createTester2.default)(Boolean, res => res)(_eachOfSeries2.default, coll, iteratee, callback); -} -exports.default = (0, _awaitify2.default)(someSeries, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/sortBy.js b/node_modules/async/sortBy.js deleted file mode 100644 index d17fb6a..0000000 --- a/node_modules/async/sortBy.js +++ /dev/null @@ -1,190 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _map = require('./map.js'); - -var _map2 = _interopRequireDefault(_map); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Sorts a list by the results of running each `coll` value through an async - * `iteratee`. - * - * @name sortBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a value to use as the sort criteria as - * its `result`. - * Invoked with (item, callback). - * @param {Function} callback - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is the items - * from the original `coll` sorted by the values returned by the `iteratee` - * calls. Invoked with (err, results). - * @returns {Promise} a promise, if no callback passed - * @example - * - * // bigfile.txt is a file that is 251100 bytes in size - * // mediumfile.txt is a file that is 11000 bytes in size - * // smallfile.txt is a file that is 121 bytes in size - * - * // asynchronous function that returns the file size in bytes - * function getFileSizeInBytes(file, callback) { - * fs.stat(file, function(err, stat) { - * if (err) { - * return callback(err); - * } - * callback(null, stat.size); - * }); - * } - * - * // Using callbacks - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // By modifying the callback parameter the - * // sorting order can be influenced: - * - * // ascending order - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) return callback(getFileSizeErr); - * callback(null, fileSize); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * } - * ); - * - * // descending order - * async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], function(file, callback) { - * getFileSizeInBytes(file, function(getFileSizeErr, fileSize) { - * if (getFileSizeErr) { - * return callback(getFileSizeErr); - * } - * callback(null, fileSize * -1); - * }); - * }, function(err, results) { - * if (err) { - * console.log(err); - * } else { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'bigfile.txt', 'mediumfile.txt', 'smallfile.txt'] - * } - * } - * ); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes, - * function(err, results) { - * if (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } else { - * console.log(results); - * } - * } - * ); - * - * // Using Promises - * async.sortBy(['mediumfile.txt','smallfile.txt','bigfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * }).catch( err => { - * console.log(err); - * }); - * - * // Error handling - * async.sortBy(['mediumfile.txt','smallfile.txt','missingfile.txt'], getFileSizeInBytes) - * .then( results => { - * console.log(results); - * }).catch( err => { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * }); - * - * // Using async/await - * (async () => { - * try { - * let results = await async.sortBy(['bigfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * // results is now the original array of files sorted by - * // file size (ascending by default), e.g. - * // [ 'smallfile.txt', 'mediumfile.txt', 'bigfile.txt'] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * // Error handling - * async () => { - * try { - * let results = await async.sortBy(['missingfile.txt','mediumfile.txt','smallfile.txt'], getFileSizeInBytes); - * console.log(results); - * } - * catch (err) { - * console.log(err); - * // [ Error: ENOENT: no such file or directory ] - * } - * } - * - */ -function sortBy(coll, iteratee, callback) { - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _map2.default)(coll, (x, iterCb) => { - _iteratee(x, (err, criteria) => { - if (err) return iterCb(err); - iterCb(err, { value: x, criteria }); - }); - }, (err, results) => { - if (err) return callback(err); - callback(null, results.sort(comparator).map(v => v.value)); - }); - - function comparator(left, right) { - var a = left.criteria, - b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } -} -exports.default = (0, _awaitify2.default)(sortBy, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/timeout.js b/node_modules/async/timeout.js deleted file mode 100644 index dd58eb3..0000000 --- a/node_modules/async/timeout.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = timeout; - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Sets a time limit on an asynchronous function. If the function does not call - * its callback within the specified milliseconds, it will be called with a - * timeout error. The code property for the error object will be `'ETIMEDOUT'`. - * - * @name timeout - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} asyncFn - The async function to limit in time. - * @param {number} milliseconds - The specified time limit. - * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) - * to timeout Error for more information.. - * @returns {AsyncFunction} Returns a wrapped function that can be used with any - * of the control flow functions. - * Invoke this function with the same parameters as you would `asyncFunc`. - * @example - * - * function myFunction(foo, callback) { - * doAsyncTask(foo, function(err, data) { - * // handle errors - * if (err) return callback(err); - * - * // do some stuff ... - * - * // return processed data - * return callback(null, data); - * }); - * } - * - * var wrapped = async.timeout(myFunction, 1000); - * - * // call `wrapped` as you would `myFunction` - * wrapped({ bar: 'bar' }, function(err, data) { - * // if `myFunction` takes < 1000 ms to execute, `err` - * // and `data` will have their expected values - * - * // else `err` will be an Error with the code 'ETIMEDOUT' - * }); - */ -function timeout(asyncFn, milliseconds, info) { - var fn = (0, _wrapAsync2.default)(asyncFn); - - return (0, _initialParams2.default)((args, callback) => { - var timedOut = false; - var timer; - - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; - } - timedOut = true; - callback(error); - } - - args.push((...cbArgs) => { - if (!timedOut) { - callback(...cbArgs); - clearTimeout(timer); - } - }); - - // setup timer and call original function - timer = setTimeout(timeoutCallback, milliseconds); - fn(...args); - }); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/times.js b/node_modules/async/times.js deleted file mode 100644 index 4484c73..0000000 --- a/node_modules/async/times.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = times; - -var _timesLimit = require('./timesLimit.js'); - -var _timesLimit2 = _interopRequireDefault(_timesLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Calls the `iteratee` function `n` times, and accumulates results in the same - * manner you would use with [map]{@link module:Collections.map}. - * - * @name times - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.map]{@link module:Collections.map} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - * @example - * - * // Pretend this is some complicated async factory - * var createUser = function(id, callback) { - * callback(null, { - * id: 'user' + id - * }); - * }; - * - * // generate 5 users - * async.times(5, function(n, next) { - * createUser(n, function(err, user) { - * next(err, user); - * }); - * }, function(err, users) { - * // we should now have 5 users - * }); - */ -function times(n, iteratee, callback) { - return (0, _timesLimit2.default)(n, Infinity, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/timesLimit.js b/node_modules/async/timesLimit.js deleted file mode 100644 index 9fb0ba3..0000000 --- a/node_modules/async/timesLimit.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = timesLimit; - -var _mapLimit = require('./mapLimit.js'); - -var _mapLimit2 = _interopRequireDefault(_mapLimit); - -var _range = require('./internal/range.js'); - -var _range2 = _interopRequireDefault(_range); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a - * time. - * - * @name timesLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} count - The number of times to run the function. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see [async.map]{@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ -function timesLimit(count, limit, iteratee, callback) { - var _iteratee = (0, _wrapAsync2.default)(iteratee); - return (0, _mapLimit2.default)((0, _range2.default)(count), limit, _iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/timesSeries.js b/node_modules/async/timesSeries.js deleted file mode 100644 index a10f0cb..0000000 --- a/node_modules/async/timesSeries.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = timesSeries; - -var _timesLimit = require('./timesLimit.js'); - -var _timesLimit2 = _interopRequireDefault(_timesLimit); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. - * - * @name timesSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @returns {Promise} a promise, if no callback is provided - */ -function timesSeries(n, iteratee, callback) { - return (0, _timesLimit2.default)(n, 1, iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/transform.js b/node_modules/async/transform.js deleted file mode 100644 index 75b754e..0000000 --- a/node_modules/async/transform.js +++ /dev/null @@ -1,173 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = transform; - -var _eachOf = require('./eachOf.js'); - -var _eachOf2 = _interopRequireDefault(_eachOf); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _promiseCallback = require('./internal/promiseCallback.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * A relative of `reduce`. Takes an Object or Array, and iterates over each - * element in parallel, each step potentially mutating an `accumulator` value. - * The type of the accumulator defaults to the type of collection passed in. - * - * @name transform - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over. - * @param {*} [accumulator] - The initial state of the transform. If omitted, - * it will default to an empty Object or Array, depending on the type of `coll` - * @param {AsyncFunction} iteratee - A function applied to each item in the - * collection that potentially modifies the accumulator. - * Invoked with (accumulator, item, key, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the transformed accumulator. - * Invoked with (err, result). - * @returns {Promise} a promise, if no callback provided - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileList = ['file1.txt','file2.txt','file3.txt']; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileList, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * }); - * - * // Using Promises - * async.transform(fileList, transformFileSize) - * .then(result => { - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * (async () => { - * try { - * let result = await async.transform(fileList, transformFileSize); - * console.log(result); - * // [ '1000 Bytes', '1.95 KB', '2.93 KB' ] - * } - * catch (err) { - * console.log(err); - * } - * })(); - * - * @example - * - * // file1.txt is a file that is 1000 bytes in size - * // file2.txt is a file that is 2000 bytes in size - * // file3.txt is a file that is 3000 bytes in size - * - * // helper function that returns human-readable size format from bytes - * function formatBytes(bytes, decimals = 2) { - * // implementation not included for brevity - * return humanReadbleFilesize; - * } - * - * const fileMap = { f1: 'file1.txt', f2: 'file2.txt', f3: 'file3.txt' }; - * - * // asynchronous function that returns the file size, transformed to human-readable format - * // e.g. 1024 bytes = 1KB, 1234 bytes = 1.21 KB, 1048576 bytes = 1MB, etc. - * function transformFileSize(acc, value, key, callback) { - * fs.stat(value, function(err, stat) { - * if (err) { - * return callback(err); - * } - * acc[key] = formatBytes(stat.size); - * callback(null); - * }); - * } - * - * // Using callbacks - * async.transform(fileMap, transformFileSize, function(err, result) { - * if(err) { - * console.log(err); - * } else { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * }); - * - * // Using Promises - * async.transform(fileMap, transformFileSize) - * .then(result => { - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * }).catch(err => { - * console.log(err); - * }); - * - * // Using async/await - * async () => { - * try { - * let result = await async.transform(fileMap, transformFileSize); - * console.log(result); - * // { f1: '1000 Bytes', f2: '1.95 KB', f3: '2.93 KB' } - * } - * catch (err) { - * console.log(err); - * } - * } - * - */ -function transform(coll, accumulator, iteratee, callback) { - if (arguments.length <= 3 && typeof accumulator === 'function') { - callback = iteratee; - iteratee = accumulator; - accumulator = Array.isArray(coll) ? [] : {}; - } - callback = (0, _once2.default)(callback || (0, _promiseCallback.promiseCallback)()); - var _iteratee = (0, _wrapAsync2.default)(iteratee); - - (0, _eachOf2.default)(coll, (v, k, cb) => { - _iteratee(accumulator, v, k, cb); - }, err => callback(err, accumulator)); - return callback[_promiseCallback.PROMISE_SYMBOL]; -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/tryEach.js b/node_modules/async/tryEach.js deleted file mode 100644 index 82fe8ec..0000000 --- a/node_modules/async/tryEach.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _eachSeries = require('./eachSeries.js'); - -var _eachSeries2 = _interopRequireDefault(_eachSeries); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * It runs each task in series but stops whenever any of the functions were - * successful. If one of the tasks were successful, the `callback` will be - * passed the result of the successful task. If all tasks fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name tryEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|AsyncIterable|Object} tasks - A collection containing functions to - * run, each function is passed a `callback(err, result)` it must call on - * completion with an error `err` (which can be `null`) and an optional `result` - * value. - * @param {Function} [callback] - An optional callback which is called when one - * of the tasks has succeeded, or all have failed. It receives the `err` and - * `result` arguments of the last attempt at completing the `task`. Invoked with - * (err, results). - * @returns {Promise} a promise, if no callback is passed - * @example - * async.tryEach([ - * function getDataFromFirstWebsite(callback) { - * // Try getting the data from the first website - * callback(err, data); - * }, - * function getDataFromSecondWebsite(callback) { - * // First website failed, - * // Try getting the data from the backup website - * callback(err, data); - * } - * ], - * // optional callback - * function(err, results) { - * Now do something with the data. - * }); - * - */ -function tryEach(tasks, callback) { - var error = null; - var result; - return (0, _eachSeries2.default)(tasks, (task, taskCb) => { - (0, _wrapAsync2.default)(task)((err, ...args) => { - if (err === false) return taskCb(err); - - if (args.length < 2) { - [result] = args; - } else { - result = args; - } - error = err; - taskCb(err ? null : {}); - }); - }, () => callback(error, result)); -} - -exports.default = (0, _awaitify2.default)(tryEach); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/unmemoize.js b/node_modules/async/unmemoize.js deleted file mode 100644 index 47a92b4..0000000 --- a/node_modules/async/unmemoize.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = unmemoize; -/** - * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, - * unmemoized form. Handy for testing. - * - * @name unmemoize - * @static - * @memberOf module:Utils - * @method - * @see [async.memoize]{@link module:Utils.memoize} - * @category Util - * @param {AsyncFunction} fn - the memoized function - * @returns {AsyncFunction} a function that calls the original unmemoized function - */ -function unmemoize(fn) { - return (...args) => { - return (fn.unmemoized || fn)(...args); - }; -} -module.exports = exports["default"]; \ No newline at end of file diff --git a/node_modules/async/until.js b/node_modules/async/until.js deleted file mode 100644 index 3c71e51..0000000 --- a/node_modules/async/until.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = until; - -var _whilst = require('./whilst.js'); - -var _whilst2 = _interopRequireDefault(_whilst); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `iteratee`'s callback. - * - * The inverse of [whilst]{@link module:ControlFlow.whilst}. - * - * @name until - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (callback). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if a callback is not passed - * - * @example - * const results = [] - * let finished = false - * async.until(function test(cb) { - * cb(null, finished) - * }, function iter(next) { - * fetchPage(url, (err, body) => { - * if (err) return next(err) - * results = results.concat(body.objects) - * finished = !!body.next - * next(err) - * }) - * }, function done (err) { - * // all pages have been fetched - * }) - */ -function until(test, iteratee, callback) { - const _test = (0, _wrapAsync2.default)(test); - return (0, _whilst2.default)(cb => _test((err, truth) => cb(err, !truth)), iteratee, callback); -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/waterfall.js b/node_modules/async/waterfall.js deleted file mode 100644 index fcd0dc1..0000000 --- a/node_modules/async/waterfall.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _once = require('./internal/once.js'); - -var _once2 = _interopRequireDefault(_once); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Runs the `tasks` array of functions in series, each passing their results to - * the next in the array. However, if any of the `tasks` pass an error to their - * own callback, the next function is not executed, and the main `callback` is - * immediately called with the error. - * - * @name waterfall - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} - * to run. - * Each function should complete with any number of `result` values. - * The `result` values will be passed as arguments, in order, to the next task. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This will be passed the results of the last task's - * callback. Invoked with (err, [results]). - * @returns {Promise} a promise, if a callback is omitted - * @example - * - * async.waterfall([ - * function(callback) { - * callback(null, 'one', 'two'); - * }, - * function(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * }, - * function(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - * ], function (err, result) { - * // result now equals 'done' - * }); - * - * // Or, with named functions: - * async.waterfall([ - * myFirstFunction, - * mySecondFunction, - * myLastFunction, - * ], function (err, result) { - * // result now equals 'done' - * }); - * function myFirstFunction(callback) { - * callback(null, 'one', 'two'); - * } - * function mySecondFunction(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * } - * function myLastFunction(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - */ -function waterfall(tasks, callback) { - callback = (0, _once2.default)(callback); - if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); - if (!tasks.length) return callback(); - var taskIndex = 0; - - function nextTask(args) { - var task = (0, _wrapAsync2.default)(tasks[taskIndex++]); - task(...args, (0, _onlyOnce2.default)(next)); - } - - function next(err, ...args) { - if (err === false) return; - if (err || taskIndex === tasks.length) { - return callback(err, ...args); - } - nextTask(args); - } - - nextTask([]); -} - -exports.default = (0, _awaitify2.default)(waterfall); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/whilst.js b/node_modules/async/whilst.js deleted file mode 100644 index 32a4776..0000000 --- a/node_modules/async/whilst.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _onlyOnce = require('./internal/onlyOnce.js'); - -var _onlyOnce2 = _interopRequireDefault(_onlyOnce); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -var _wrapAsync2 = _interopRequireDefault(_wrapAsync); - -var _awaitify = require('./internal/awaitify.js'); - -var _awaitify2 = _interopRequireDefault(_awaitify); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns {Promise} a promise, if no callback is passed - * @example - * - * var count = 0; - * async.whilst( - * function test(cb) { cb(null, count < 5); }, - * function iter(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ -function whilst(test, iteratee, callback) { - callback = (0, _onlyOnce2.default)(callback); - var _fn = (0, _wrapAsync2.default)(iteratee); - var _test = (0, _wrapAsync2.default)(test); - var results = []; - - function next(err, ...rest) { - if (err) return callback(err); - results = rest; - if (err === false) return; - _test(check); - } - - function check(err, truth) { - if (err) return callback(err); - if (err === false) return; - if (!truth) return callback(null, ...results); - _fn(next); - } - - return _test(check); -} -exports.default = (0, _awaitify2.default)(whilst, 3); -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/async/wrapSync.js b/node_modules/async/wrapSync.js deleted file mode 100644 index 3c3bf88..0000000 --- a/node_modules/async/wrapSync.js +++ /dev/null @@ -1,118 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = asyncify; - -var _initialParams = require('./internal/initialParams.js'); - -var _initialParams2 = _interopRequireDefault(_initialParams); - -var _setImmediate = require('./internal/setImmediate.js'); - -var _setImmediate2 = _interopRequireDefault(_setImmediate); - -var _wrapAsync = require('./internal/wrapAsync.js'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ -function asyncify(func) { - if ((0, _wrapAsync.isAsync)(func)) { - return function (...args /*, callback*/) { - const callback = args.pop(); - const promise = func.apply(this, args); - return handlePromise(promise, callback); - }; - } - - return (0, _initialParams2.default)(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (result && typeof result.then === 'function') { - return handlePromise(result, callback); - } else { - callback(null, result); - } - }); -} - -function handlePromise(promise, callback) { - return promise.then(value => { - invokeCallback(callback, null, value); - }, err => { - invokeCallback(callback, err && err.message ? err : new Error(err)); - }); -} - -function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (err) { - (0, _setImmediate2.default)(e => { - throw e; - }, err); - } -} -module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/balanced-match/.github/FUNDING.yml b/node_modules/balanced-match/.github/FUNDING.yml deleted file mode 100644 index cea8b16..0000000 --- a/node_modules/balanced-match/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -tidelift: "npm/balanced-match" -patreon: juliangruber diff --git a/node_modules/balanced-match/LICENSE.md b/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e4..0000000 --- a/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/balanced-match/README.md b/node_modules/balanced-match/README.md deleted file mode 100644 index d2a48b6..0000000 --- a/node_modules/balanced-match/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## Security contact information - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/balanced-match/index.js b/node_modules/balanced-match/index.js deleted file mode 100644 index c67a646..0000000 --- a/node_modules/balanced-match/index.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - if(a===b) { - return [ai, bi]; - } - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/node_modules/balanced-match/package.json b/node_modules/balanced-match/package.json deleted file mode 100644 index ce6073e..0000000 --- a/node_modules/balanced-match/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "1.0.2", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "tape test/test.js", - "bench": "matcha test/bench.js" - }, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/node_modules/bignumber.js/CHANGELOG.md b/node_modules/bignumber.js/CHANGELOG.md deleted file mode 100644 index e3ec980..0000000 --- a/node_modules/bignumber.js/CHANGELOG.md +++ /dev/null @@ -1,266 +0,0 @@ -#### 9.0.0 -* 27/05/2019 -* For compatibility with legacy browsers, remove `Symbol` references. - -#### 8.1.1 -* 24/02/2019 -* [BUGFIX] #222 Restore missing `var` to `export BigNumber`. -* Allow any key in BigNumber.Instance in *bignumber.d.ts*. - -#### 8.1.0 -* 23/02/2019 -* [NEW FEATURE] #220 Create a BigNumber using `{s, e, c}`. -* [NEW FEATURE] `isBigNumber`: if `BigNumber.DEBUG` is `true`, also check that the BigNumber instance is well-formed. -* Remove `instanceof` checks; just use `_isBigNumber` to identify a BigNumber instance. -* Add `_isBigNumber` to prototype in *bignumber.mjs*. -* Add tests for BigNumber creation from object. -* Update *API.html*. - -#### 8.0.2 -* 13/01/2019 -* #209 `toPrecision` without argument should follow `toString`. -* Improve *Use* section of *README*. -* Optimise `toString(10)`. -* Add verson number to API doc. - -#### 8.0.1 -* 01/11/2018 -* Rest parameter must be array type in *bignumber.d.ts*. - -#### 8.0.0 -* 01/11/2018 -* [NEW FEATURE] Add `BigNumber.sum` method. -* [NEW FEATURE]`toFormat`: add `prefix` and `suffix` options. -* [NEW FEATURE] #178 Pass custom formatting to `toFormat`. -* [BREAKING CHANGE] #184 `toFraction`: return array of BigNumbers not strings. -* [NEW FEATURE] #185 Enable overwrite of `valueOf` to prevent accidental addition to string. -* #183 Add Node.js `crypto` requirement to documentation. -* [BREAKING CHANGE] #198 Disallow signs and whitespace in custom alphabet. -* [NEW FEATURE] #188 Implement `util.inspect.custom` for Node.js REPL. -* #170 Make `isBigNumber` a type guard in *bignumber.d.ts*. -* [BREAKING CHANGE] `BigNumber.min` and `BigNumber.max`: don't accept an array. -* Update *.travis.yml*. -* Remove *bower.json*. - -#### 7.2.1 -* 24/05/2018 -* Add `browser` field to *package.json*. - -#### 7.2.0 -* 22/05/2018 -* #166 Correct *.mjs* file. Remove extension from `main` field in *package.json*. - -#### 7.1.0 -* 18/05/2018 -* Add `module` field to *package.json* for *bignumber.mjs*. - -#### 7.0.2 -* 17/05/2018 -* #165 Bugfix: upper-case letters for bases 11-36 in a custom alphabet. -* Add note to *README* regarding creating BigNumbers from Number values. - -#### 7.0.1 -* 26/04/2018 -* #158 Fix global object variable name typo. - -#### 7.0.0 -* 26/04/2018 -* #143 Remove global BigNumber from typings. -* #144 Enable compatibility with `Object.freeze(Object.prototype)`. -* #148 #123 #11 Only throw on a number primitive with more than 15 significant digits if `BigNumber.DEBUG` is `true`. -* Only throw on an invalid BigNumber value if `BigNumber.DEBUG` is `true`. Return BigNumber `NaN` instead. -* #154 `exponentiatedBy`: allow BigNumber exponent. -* #156 Prevent Content Security Policy *unsafe-eval* issue. -* `toFraction`: allow `Infinity` maximum denominator. -* Comment-out some excess tests to reduce test time. -* Amend indentation and other spacing. - -#### 6.0.0 -* 26/01/2018 -* #137 Implement `APLHABET` configuration option. -* Remove `ERRORS` configuration option. -* Remove `toDigits` method; extend `precision` method accordingly. -* Remove s`round` method; extend `decimalPlaces` method accordingly. -* Remove methods: `ceil`, `floor`, and `truncated`. -* Remove method aliases: `add`, `cmp`, `isInt`, `isNeg`, `trunc`, `mul`, `neg` and `sub`. -* Rename methods: `shift` to `shiftedBy`, `another` to `clone`, `toPower` to `exponentiatedBy`, and `equals` to `isEqualTo`. -* Rename methods: add `is` prefix to `greaterThan`, `greaterThanOrEqualTo`, `lessThan` and `lessThanOrEqualTo`. -* Add methods: `multipliedBy`, `isBigNumber`, `isPositive`, `integerValue`, `maximum` and `minimum`. -* Refactor test suite. -* Add *CHANGELOG.md*. -* Rewrite *bignumber.d.ts*. -* Redo API image. - -#### 5.0.0 -* 27/11/2017 -* #81 Don't throw on constructor call without `new`. - -#### 4.1.0 -* 26/09/2017 -* Remove node 0.6 from *.travis.yml*. -* Add *bignumber.mjs*. - -#### 4.0.4 -* 03/09/2017 -* Add missing aliases to *bignumber.d.ts*. - -#### 4.0.3 -* 30/08/2017 -* Add types: *bignumber.d.ts*. - -#### 4.0.2 -* 03/05/2017 -* #120 Workaround Safari/Webkit bug. - -#### 4.0.1 -* 05/04/2017 -* #121 BigNumber.default to BigNumber['default']. - -#### 4.0.0 -* 09/01/2017 -* Replace BigNumber.isBigNumber method with isBigNumber prototype property. - -#### 3.1.2 -* 08/01/2017 -* Minor documentation edit. - -#### 3.1.1 -* 08/01/2017 -* Uncomment `isBigNumber` tests. -* Ignore dot files. - -#### 3.1.0 -* 08/01/2017 -* Add `isBigNumber` method. - -#### 3.0.2 -* 08/01/2017 -* Bugfix: Possible incorrect value of `ERRORS` after a `BigNumber.another` call (due to `parseNumeric` declaration in outer scope). - -#### 3.0.1 -* 23/11/2016 -* Apply fix for old ipads with `%` issue, see #57 and #102. -* Correct error message. - -#### 3.0.0 -* 09/11/2016 -* Remove `require('crypto')` - leave it to the user. -* Add `BigNumber.set` as `BigNumber.config` alias. -* Default `POW_PRECISION` to `0`. - -#### 2.4.0 -* 14/07/2016 -* #97 Add exports to support ES6 imports. - -#### 2.3.0 -* 07/03/2016 -* #86 Add modulus parameter to `toPower`. - -#### 2.2.0 -* 03/03/2016 -* #91 Permit larger JS integers. - -#### 2.1.4 -* 15/12/2015 -* Correct UMD. - -#### 2.1.3 -* 13/12/2015 -* Refactor re global object and crypto availability when bundling. - -#### 2.1.2 -* 10/12/2015 -* Bugfix: `window.crypto` not assigned to `crypto`. - -#### 2.1.1 -* 09/12/2015 -* Prevent code bundler from adding `crypto` shim. - -#### 2.1.0 -* 26/10/2015 -* For `valueOf` and `toJSON`, include the minus sign with negative zero. - -#### 2.0.8 -* 2/10/2015 -* Internal round function bugfix. - -#### 2.0.6 -* 31/03/2015 -* Add bower.json. Tweak division after in-depth review. - -#### 2.0.5 -* 25/03/2015 -* Amend README. Remove bitcoin address. - -#### 2.0.4 -* 25/03/2015 -* Critical bugfix #58: division. - -#### 2.0.3 -* 18/02/2015 -* Amend README. Add source map. - -#### 2.0.2 -* 18/02/2015 -* Correct links. - -#### 2.0.1 -* 18/02/2015 -* Add `max`, `min`, `precision`, `random`, `shiftedBy`, `toDigits` and `truncated` methods. -* Add the short-forms: `add`, `mul`, `sd`, `sub` and `trunc`. -* Add an `another` method to enable multiple independent constructors to be created. -* Add support for the base 2, 8 and 16 prefixes `0b`, `0o` and `0x`. -* Enable a rounding mode to be specified as a second parameter to `toExponential`, `toFixed`, `toFormat` and `toPrecision`. -* Add a `CRYPTO` configuration property so cryptographically-secure pseudo-random number generation can be specified. -* Add a `MODULO_MODE` configuration property to enable the rounding mode used by the `modulo` operation to be specified. -* Add a `POW_PRECISION` configuration property to enable the number of significant digits calculated by the power operation to be limited. -* Improve code quality. -* Improve documentation. - -#### 2.0.0 -* 29/12/2014 -* Add `dividedToIntegerBy`, `isInteger` and `toFormat` methods. -* Remove the following short-forms: `isF`, `isZ`, `toE`, `toF`, `toFr`, `toN`, `toP`, `toS`. -* Store a BigNumber's coefficient in base 1e14, rather than base 10. -* Add fast path for integers to BigNumber constructor. -* Incorporate the library into the online documentation. - -#### 1.5.0 -* 13/11/2014 -* Add `toJSON` and `decimalPlaces` methods. - -#### 1.4.1 -* 08/06/2014 -* Amend README. - -#### 1.4.0 -* 08/05/2014 -* Add `toNumber`. - -#### 1.3.0 -* 08/11/2013 -* Ensure correct rounding of `sqrt` in all, rather than almost all, cases. -* Maximum radix to 64. - -#### 1.2.1 -* 17/10/2013 -* Sign of zero when x < 0 and x + (-x) = 0. - -#### 1.2.0 -* 19/9/2013 -* Throw Error objects for stack. - -#### 1.1.1 -* 22/8/2013 -* Show original value in constructor error message. - -#### 1.1.0 -* 1/8/2013 -* Allow numbers with trailing radix point. - -#### 1.0.1 -* Bugfix: error messages with incorrect method name - -#### 1.0.0 -* 8/11/2012 -* Initial release diff --git a/node_modules/bignumber.js/LICENCE b/node_modules/bignumber.js/LICENCE deleted file mode 100644 index 3c39f85..0000000 --- a/node_modules/bignumber.js/LICENCE +++ /dev/null @@ -1,23 +0,0 @@ -The MIT Licence. - -Copyright (c) 2019 Michael Mclaughlin - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/node_modules/bignumber.js/README.md b/node_modules/bignumber.js/README.md deleted file mode 100644 index a4a3e10..0000000 --- a/node_modules/bignumber.js/README.md +++ /dev/null @@ -1,268 +0,0 @@ -![bignumber.js](https://raw.githubusercontent.com/MikeMcl/bignumber.js/gh-pages/bignumberjs.png) - -A JavaScript library for arbitrary-precision decimal and non-decimal arithmetic. - -[![Build Status](https://travis-ci.org/MikeMcl/bignumber.js.svg)](https://travis-ci.org/MikeMcl/bignumber.js) - -
    - -## Features - - - Integers and decimals - - Simple API but full-featured - - Faster, smaller, and perhaps easier to use than JavaScript versions of Java's BigDecimal - - 8 KB minified and gzipped - - Replicates the `toExponential`, `toFixed`, `toPrecision` and `toString` methods of JavaScript's Number type - - Includes a `toFraction` and a correctly-rounded `squareRoot` method - - Supports cryptographically-secure pseudo-random number generation - - No dependencies - - Wide platform compatibility: uses JavaScript 1.5 (ECMAScript 3) features only - - Comprehensive [documentation](http://mikemcl.github.io/bignumber.js/) and test set - -![API](https://raw.githubusercontent.com/MikeMcl/bignumber.js/gh-pages/API.png) - -If a smaller and simpler library is required see [big.js](https://github.com/MikeMcl/big.js/). -It's less than half the size but only works with decimal numbers and only has half the methods. -It also does not allow `NaN` or `Infinity`, or have the configuration options of this library. - -See also [decimal.js](https://github.com/MikeMcl/decimal.js/), which among other things adds support for non-integer powers, and performs all operations to a specified number of significant digits. - -## Load - -The library is the single JavaScript file *bignumber.js* (or minified, *bignumber.min.js*). - -Browser: - -```html - -``` - -[Node.js](http://nodejs.org): - -```bash -$ npm install bignumber.js -``` - -```javascript -const BigNumber = require('bignumber.js'); -``` - -ES6 module: - -```javascript -import BigNumber from "./bignumber.mjs" -``` - -AMD loader libraries such as [requireJS](http://requirejs.org/): - -```javascript -require(['bignumber'], function(BigNumber) { - // Use BigNumber here in local scope. No global BigNumber. -}); -``` - -## Use - -The library exports a single constructor function, [`BigNumber`](http://mikemcl.github.io/bignumber.js/#bignumber), which accepts a value of type Number, String or BigNumber, - -```javascript -let x = new BigNumber(123.4567); -let y = BigNumber('123456.7e-3'); -let z = new BigNumber(x); -x.isEqualTo(y) && y.isEqualTo(z) && x.isEqualTo(z); // true -``` - -To get the string value of a BigNumber use [`toString()`](http://mikemcl.github.io/bignumber.js/#toS) or [`toFixed()`](http://mikemcl.github.io/bignumber.js/#toFix). Using `toFixed()` prevents exponential notation being returned, no matter how large or small the value. - -```javascript -let x = new BigNumber('1111222233334444555566'); -x.toString(); // "1.111222233334444555566e+21" -x.toFixed(); // "1111222233334444555566" -``` - -If the limited precision of Number values is not well understood, it is recommended to create BigNumbers from String values rather than Number values to avoid a potential loss of precision. - -*In all further examples below, `let`, semicolons and `toString` calls are not shown. If a commented-out value is in quotes it means `toString` has been called on the preceding expression.* - -```javascript -// Precision loss from using numeric literals with more than 15 significant digits. -new BigNumber(1.0000000000000001) // '1' -new BigNumber(88259496234518.57) // '88259496234518.56' -new BigNumber(99999999999999999999) // '100000000000000000000' - -// Precision loss from using numeric literals outside the range of Number values. -new BigNumber(2e+308) // 'Infinity' -new BigNumber(1e-324) // '0' - -// Precision loss from the unexpected result of arithmetic with Number values. -new BigNumber(0.7 + 0.1) // '0.7999999999999999' -``` - -When creating a BigNumber from a Number, note that a BigNumber is created from a Number's decimal `toString()` value not from its underlying binary value. If the latter is required, then pass the Number's `toString(2)` value and specify base 2. - -```javascript -new BigNumber(Number.MAX_VALUE.toString(2), 2) -``` - -BigNumbers can be created from values in bases from 2 to 36. See [`ALPHABET`](http://mikemcl.github.io/bignumber.js/#alphabet) to extend this range. - -```javascript -a = new BigNumber(1011, 2) // "11" -b = new BigNumber('zz.9', 36) // "1295.25" -c = a.plus(b) // "1306.25" -``` - -Performance is better if base 10 is NOT specified for decimal values. Only specify base 10 when it is desired that the number of decimal places of the input value be limited to the current [`DECIMAL_PLACES`](http://mikemcl.github.io/bignumber.js/#decimal-places) setting. - -A BigNumber is immutable in the sense that it is not changed by its methods. - -```javascript -0.3 - 0.1 // 0.19999999999999998 -x = new BigNumber(0.3) -x.minus(0.1) // "0.2" -x // "0.3" -``` - -The methods that return a BigNumber can be chained. - -```javascript -x.dividedBy(y).plus(z).times(9) -x.times('1.23456780123456789e+9').plus(9876.5432321).dividedBy('4444562598.111772').integerValue() -``` - -Some of the longer method names have a shorter alias. - -```javascript -x.squareRoot().dividedBy(y).exponentiatedBy(3).isEqualTo(x.sqrt().div(y).pow(3)) // true -x.modulo(y).multipliedBy(z).eq(x.mod(y).times(z)) // true -``` - -As with JavaScript's Number type, there are [`toExponential`](http://mikemcl.github.io/bignumber.js/#toE), [`toFixed`](http://mikemcl.github.io/bignumber.js/#toFix) and [`toPrecision`](http://mikemcl.github.io/bignumber.js/#toP) methods. - -```javascript -x = new BigNumber(255.5) -x.toExponential(5) // "2.55500e+2" -x.toFixed(5) // "255.50000" -x.toPrecision(5) // "255.50" -x.toNumber() // 255.5 -``` - - A base can be specified for [`toString`](http://mikemcl.github.io/bignumber.js/#toS). Performance is better if base 10 is NOT specified, i.e. use `toString()` not `toString(10)`. Only specify base 10 when it is desired that the number of decimal places be limited to the current [`DECIMAL_PLACES`](http://mikemcl.github.io/bignumber.js/#decimal-places) setting. - - ```javascript - x.toString(16) // "ff.8" - ``` - -There is a [`toFormat`](http://mikemcl.github.io/bignumber.js/#toFor) method which may be useful for internationalisation. - -```javascript -y = new BigNumber('1234567.898765') -y.toFormat(2) // "1,234,567.90" -``` - -The maximum number of decimal places of the result of an operation involving division (i.e. a division, square root, base conversion or negative power operation) is set using the `set` or `config` method of the `BigNumber` constructor. - -The other arithmetic operations always give the exact result. - -```javascript -BigNumber.set({ DECIMAL_PLACES: 10, ROUNDING_MODE: 4 }) - -x = new BigNumber(2) -y = new BigNumber(3) -z = x.dividedBy(y) // "0.6666666667" -z.squareRoot() // "0.8164965809" -z.exponentiatedBy(-3) // "3.3749999995" -z.toString(2) // "0.1010101011" -z.multipliedBy(z) // "0.44444444448888888889" -z.multipliedBy(z).decimalPlaces(10) // "0.4444444445" -``` - -There is a [`toFraction`](http://mikemcl.github.io/bignumber.js/#toFr) method with an optional *maximum denominator* argument - -```javascript -y = new BigNumber(355) -pi = y.dividedBy(113) // "3.1415929204" -pi.toFraction() // [ "7853982301", "2500000000" ] -pi.toFraction(1000) // [ "355", "113" ] -``` - -and [`isNaN`](http://mikemcl.github.io/bignumber.js/#isNaN) and [`isFinite`](http://mikemcl.github.io/bignumber.js/#isF) methods, as `NaN` and `Infinity` are valid `BigNumber` values. - -```javascript -x = new BigNumber(NaN) // "NaN" -y = new BigNumber(Infinity) // "Infinity" -x.isNaN() && !y.isNaN() && !x.isFinite() && !y.isFinite() // true -``` - -The value of a BigNumber is stored in a decimal floating point format in terms of a coefficient, exponent and sign. - -```javascript -x = new BigNumber(-123.456); -x.c // [ 123, 45600000000000 ] coefficient (i.e. significand) -x.e // 2 exponent -x.s // -1 sign -``` - -For advanced usage, multiple BigNumber constructors can be created, each with their own independent configuration. - -```javascript -// Set DECIMAL_PLACES for the original BigNumber constructor -BigNumber.set({ DECIMAL_PLACES: 10 }) - -// Create another BigNumber constructor, optionally passing in a configuration object -BN = BigNumber.clone({ DECIMAL_PLACES: 5 }) - -x = new BigNumber(1) -y = new BN(1) - -x.div(3) // '0.3333333333' -y.div(3) // '0.33333' -``` - -For further information see the [API](http://mikemcl.github.io/bignumber.js/) reference in the *doc* directory. - -## Test - -The *test/modules* directory contains the test scripts for each method. - -The tests can be run with Node.js or a browser. For Node.js use - - $ npm test - -or - - $ node test/test - -To test a single method, use, for example - - $ node test/methods/toFraction - -For the browser, open *test/test.html*. - -## Build - -For Node, if [uglify-js](https://github.com/mishoo/UglifyJS2) is installed - - npm install uglify-js -g - -then - - npm run build - -will create *bignumber.min.js*. - -A source map will also be created in the root directory. - -## Feedback - -Open an issue, or email - -Michael - -
    M8ch88l@gmail.com - -## Licence - -The MIT Licence. - -See [LICENCE](https://github.com/MikeMcl/bignumber.js/blob/master/LICENCE). diff --git a/node_modules/bignumber.js/bignumber.d.ts b/node_modules/bignumber.js/bignumber.d.ts deleted file mode 100644 index dc9b0b1..0000000 --- a/node_modules/bignumber.js/bignumber.d.ts +++ /dev/null @@ -1,1829 +0,0 @@ -// Type definitions for bignumber.js >=8.1.0 -// Project: https://github.com/MikeMcl/bignumber.js -// Definitions by: Michael Mclaughlin -// Definitions: https://github.com/MikeMcl/bignumber.js - -// Documentation: http://mikemcl.github.io/bignumber.js/ -// -// Exports: -// -// class BigNumber (default export) -// type BigNumber.Constructor -// type BigNumber.ModuloMode -// type BigNumber.RoundingMOde -// type BigNumber.Value -// interface BigNumber.Config -// interface BigNumber.Format -// interface BigNumber.Instance -// -// Example: -// -// import {BigNumber} from "bignumber.js" -// //import BigNumber from "bignumber.js" -// -// let rm: BigNumber.RoundingMode = BigNumber.ROUND_UP; -// let f: BigNumber.Format = { decimalSeparator: ',' }; -// let c: BigNumber.Config = { DECIMAL_PLACES: 4, ROUNDING_MODE: rm, FORMAT: f }; -// BigNumber.config(c); -// -// let v: BigNumber.Value = '12345.6789'; -// let b: BigNumber = new BigNumber(v); -// -// The use of compiler option `--strictNullChecks` is recommended. - -export default BigNumber; - -export namespace BigNumber { - - /** See `BigNumber.config` (alias `BigNumber.set`) and `BigNumber.clone`. */ - interface Config { - - /** - * An integer, 0 to 1e+9. Default value: 20. - * - * The maximum number of decimal places of the result of operations involving division, i.e. - * division, square root and base conversion operations, and exponentiation when the exponent is - * negative. - * - * ```ts - * BigNumber.config({ DECIMAL_PLACES: 5 }) - * BigNumber.set({ DECIMAL_PLACES: 5 }) - * ``` - */ - DECIMAL_PLACES?: number; - - /** - * An integer, 0 to 8. Default value: `BigNumber.ROUND_HALF_UP` (4). - * - * The rounding mode used in operations that involve division (see `DECIMAL_PLACES`) and the - * default rounding mode of the `decimalPlaces`, `precision`, `toExponential`, `toFixed`, - * `toFormat` and `toPrecision` methods. - * - * The modes are available as enumerated properties of the BigNumber constructor. - * - * ```ts - * BigNumber.config({ ROUNDING_MODE: 0 }) - * BigNumber.set({ ROUNDING_MODE: BigNumber.ROUND_UP }) - * ``` - */ - ROUNDING_MODE?: BigNumber.RoundingMode; - - /** - * An integer, 0 to 1e+9, or an array, [-1e+9 to 0, 0 to 1e+9]. - * Default value: `[-7, 20]`. - * - * The exponent value(s) at which `toString` returns exponential notation. - * - * If a single number is assigned, the value is the exponent magnitude. - * - * If an array of two numbers is assigned then the first number is the negative exponent value at - * and beneath which exponential notation is used, and the second number is the positive exponent - * value at and above which exponential notation is used. - * - * For example, to emulate JavaScript numbers in terms of the exponent values at which they begin - * to use exponential notation, use `[-7, 20]`. - * - * ```ts - * BigNumber.config({ EXPONENTIAL_AT: 2 }) - * new BigNumber(12.3) // '12.3' e is only 1 - * new BigNumber(123) // '1.23e+2' - * new BigNumber(0.123) // '0.123' e is only -1 - * new BigNumber(0.0123) // '1.23e-2' - * - * BigNumber.config({ EXPONENTIAL_AT: [-7, 20] }) - * new BigNumber(123456789) // '123456789' e is only 8 - * new BigNumber(0.000000123) // '1.23e-7' - * - * // Almost never return exponential notation: - * BigNumber.config({ EXPONENTIAL_AT: 1e+9 }) - * - * // Always return exponential notation: - * BigNumber.config({ EXPONENTIAL_AT: 0 }) - * ``` - * - * Regardless of the value of `EXPONENTIAL_AT`, the `toFixed` method will always return a value in - * normal notation and the `toExponential` method will always return a value in exponential form. - * Calling `toString` with a base argument, e.g. `toString(10)`, will also always return normal - * notation. - */ - EXPONENTIAL_AT?: number | [number, number]; - - /** - * An integer, magnitude 1 to 1e+9, or an array, [-1e+9 to -1, 1 to 1e+9]. - * Default value: `[-1e+9, 1e+9]`. - * - * The exponent value(s) beyond which overflow to Infinity and underflow to zero occurs. - * - * If a single number is assigned, it is the maximum exponent magnitude: values wth a positive - * exponent of greater magnitude become Infinity and those with a negative exponent of greater - * magnitude become zero. - * - * If an array of two numbers is assigned then the first number is the negative exponent limit and - * the second number is the positive exponent limit. - * - * For example, to emulate JavaScript numbers in terms of the exponent values at which they - * become zero and Infinity, use [-324, 308]. - * - * ```ts - * BigNumber.config({ RANGE: 500 }) - * BigNumber.config().RANGE // [ -500, 500 ] - * new BigNumber('9.999e499') // '9.999e+499' - * new BigNumber('1e500') // 'Infinity' - * new BigNumber('1e-499') // '1e-499' - * new BigNumber('1e-500') // '0' - * - * BigNumber.config({ RANGE: [-3, 4] }) - * new BigNumber(99999) // '99999' e is only 4 - * new BigNumber(100000) // 'Infinity' e is 5 - * new BigNumber(0.001) // '0.01' e is only -3 - * new BigNumber(0.0001) // '0' e is -4 - * ``` - * The largest possible magnitude of a finite BigNumber is 9.999...e+1000000000. - * The smallest possible magnitude of a non-zero BigNumber is 1e-1000000000. - */ - RANGE?: number | [number, number]; - - /** - * A boolean: `true` or `false`. Default value: `false`. - * - * The value that determines whether cryptographically-secure pseudo-random number generation is - * used. If `CRYPTO` is set to true then the random method will generate random digits using - * `crypto.getRandomValues` in browsers that support it, or `crypto.randomBytes` if using a - * version of Node.js that supports it. - * - * If neither function is supported by the host environment then attempting to set `CRYPTO` to - * `true` will fail and an exception will be thrown. - * - * If `CRYPTO` is `false` then the source of randomness used will be `Math.random` (which is - * assumed to generate at least 30 bits of randomness). - * - * See `BigNumber.random`. - * - * ```ts - * // Node.js - * global.crypto = require('crypto') - * - * BigNumber.config({ CRYPTO: true }) - * BigNumber.config().CRYPTO // true - * BigNumber.random() // 0.54340758610486147524 - * ``` - */ - CRYPTO?: boolean; - - /** - * An integer, 0, 1, 3, 6 or 9. Default value: `BigNumber.ROUND_DOWN` (1). - * - * The modulo mode used when calculating the modulus: `a mod n`. - * The quotient, `q = a / n`, is calculated according to the `ROUNDING_MODE` that corresponds to - * the chosen `MODULO_MODE`. - * The remainder, `r`, is calculated as: `r = a - n * q`. - * - * The modes that are most commonly used for the modulus/remainder operation are shown in the - * following table. Although the other rounding modes can be used, they may not give useful - * results. - * - * Property | Value | Description - * :------------------|:------|:------------------------------------------------------------------ - * `ROUND_UP` | 0 | The remainder is positive if the dividend is negative. - * `ROUND_DOWN` | 1 | The remainder has the same sign as the dividend. - * | | Uses 'truncating division' and matches JavaScript's `%` operator . - * `ROUND_FLOOR` | 3 | The remainder has the same sign as the divisor. - * | | This matches Python's `%` operator. - * `ROUND_HALF_EVEN` | 6 | The IEEE 754 remainder function. - * `EUCLID` | 9 | The remainder is always positive. - * | | Euclidian division: `q = sign(n) * floor(a / abs(n))` - * - * The rounding/modulo modes are available as enumerated properties of the BigNumber constructor. - * - * See `modulo`. - * - * ```ts - * BigNumber.config({ MODULO_MODE: BigNumber.EUCLID }) - * BigNumber.set({ MODULO_MODE: 9 }) // equivalent - * ``` - */ - MODULO_MODE?: BigNumber.ModuloMode; - - /** - * An integer, 0 to 1e+9. Default value: 0. - * - * The maximum precision, i.e. number of significant digits, of the result of the power operation - * - unless a modulus is specified. - * - * If set to 0, the number of significant digits will not be limited. - * - * See `exponentiatedBy`. - * - * ```ts - * BigNumber.config({ POW_PRECISION: 100 }) - * ``` - */ - POW_PRECISION?: number; - - /** - * An object including any number of the properties shown below. - * - * The object configures the format of the string returned by the `toFormat` method. - * The example below shows the properties of the object that are recognised, and - * their default values. - * - * Unlike the other configuration properties, the values of the properties of the `FORMAT` object - * will not be checked for validity - the existing object will simply be replaced by the object - * that is passed in. - * - * See `toFormat`. - * - * ```ts - * BigNumber.config({ - * FORMAT: { - * // string to prepend - * prefix: '', - * // the decimal separator - * decimalSeparator: '.', - * // the grouping separator of the integer part - * groupSeparator: ',', - * // the primary grouping size of the integer part - * groupSize: 3, - * // the secondary grouping size of the integer part - * secondaryGroupSize: 0, - * // the grouping separator of the fraction part - * fractionGroupSeparator: ' ', - * // the grouping size of the fraction part - * fractionGroupSize: 0, - * // string to append - * suffix: '' - * } - * }) - * ``` - */ - FORMAT?: BigNumber.Format; - - /** - * The alphabet used for base conversion. The length of the alphabet corresponds to the maximum - * value of the base argument that can be passed to the BigNumber constructor or `toString`. - * - * Default value: `'0123456789abcdefghijklmnopqrstuvwxyz'`. - * - * There is no maximum length for the alphabet, but it must be at least 2 characters long, - * and it must not contain whitespace or a repeated character, or the sign indicators '+' and - * '-', or the decimal separator '.'. - * - * ```ts - * // duodecimal (base 12) - * BigNumber.config({ ALPHABET: '0123456789TE' }) - * x = new BigNumber('T', 12) - * x.toString() // '10' - * x.toString(12) // 'T' - * ``` - */ - ALPHABET?: string; - } - - /** See `FORMAT` and `toFormat`. */ - interface Format { - - /** The string to prepend. */ - prefix?: string; - - /** The decimal separator. */ - decimalSeparator?: string; - - /** The grouping separator of the integer part. */ - groupSeparator?: string; - - /** The primary grouping size of the integer part. */ - groupSize?: number; - - /** The secondary grouping size of the integer part. */ - secondaryGroupSize?: number; - - /** The grouping separator of the fraction part. */ - fractionGroupSeparator?: string; - - /** The grouping size of the fraction part. */ - fractionGroupSize?: number; - - /** The string to append. */ - suffix?: string; - } - - interface Instance { - - /** The coefficient of the value of this BigNumber, an array of base 1e14 integer numbers, or null. */ - readonly c: number[] | null; - - /** The exponent of the value of this BigNumber, an integer number, -1000000000 to 1000000000, or null. */ - readonly e: number | null; - - /** The sign of the value of this BigNumber, -1, 1, or null. */ - readonly s: number | null; - - [key: string]: any; - } - - type Constructor = typeof BigNumber; - type ModuloMode = 0 | 1 | 3 | 6 | 9; - type RoundingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - type Value = string | number | Instance; -} - -export declare class BigNumber implements BigNumber.Instance { - - /** Used internally to identify a BigNumber instance. */ - private readonly _isBigNumber: true; - - /** The coefficient of the value of this BigNumber, an array of base 1e14 integer numbers, or null. */ - readonly c: number[] | null; - - /** The exponent of the value of this BigNumber, an integer number, -1000000000 to 1000000000, or null. */ - readonly e: number | null; - - /** The sign of the value of this BigNumber, -1, 1, or null. */ - readonly s: number | null; - - /** - * Returns a new instance of a BigNumber object with value `n`, where `n` is a numeric value in - * the specified `base`, or base 10 if `base` is omitted or is `null` or `undefined`. - * - * ```ts - * x = new BigNumber(123.4567) // '123.4567' - * // 'new' is optional - * y = BigNumber(x) // '123.4567' - * ``` - * - * If `n` is a base 10 value it can be in normal (fixed-point) or exponential notation. - * Values in other bases must be in normal notation. Values in any base can have fraction digits, - * i.e. digits after the decimal point. - * - * ```ts - * new BigNumber(43210) // '43210' - * new BigNumber('4.321e+4') // '43210' - * new BigNumber('-735.0918e-430') // '-7.350918e-428' - * new BigNumber('123412421.234324', 5) // '607236.557696' - * ``` - * - * Signed `0`, signed `Infinity` and `NaN` are supported. - * - * ```ts - * new BigNumber('-Infinity') // '-Infinity' - * new BigNumber(NaN) // 'NaN' - * new BigNumber(-0) // '0' - * new BigNumber('.5') // '0.5' - * new BigNumber('+2') // '2' - * ``` - * - * String values in hexadecimal literal form, e.g. `'0xff'`, are valid, as are string values with - * the octal and binary prefixs `'0o'` and `'0b'`. String values in octal literal form without the - * prefix will be interpreted as decimals, e.g. `'011'` is interpreted as 11, not 9. - * - * ```ts - * new BigNumber(-10110100.1, 2) // '-180.5' - * new BigNumber('-0b10110100.1') // '-180.5' - * new BigNumber('ff.8', 16) // '255.5' - * new BigNumber('0xff.8') // '255.5' - * ``` - * - * If a base is specified, `n` is rounded according to the current `DECIMAL_PLACES` and - * `ROUNDING_MODE` settings. This includes base 10, so don't include a `base` parameter for decimal - * values unless this behaviour is desired. - * - * ```ts - * BigNumber.config({ DECIMAL_PLACES: 5 }) - * new BigNumber(1.23456789) // '1.23456789' - * new BigNumber(1.23456789, 10) // '1.23457' - * ``` - * - * An error is thrown if `base` is invalid. - * - * There is no limit to the number of digits of a value of type string (other than that of - * JavaScript's maximum array size). See `RANGE` to set the maximum and minimum possible exponent - * value of a BigNumber. - * - * ```ts - * new BigNumber('5032485723458348569331745.33434346346912144534543') - * new BigNumber('4.321e10000000') - * ``` - * - * BigNumber `NaN` is returned if `n` is invalid (unless `BigNumber.DEBUG` is `true`, see below). - * - * ```ts - * new BigNumber('.1*') // 'NaN' - * new BigNumber('blurgh') // 'NaN' - * new BigNumber(9, 2) // 'NaN' - * ``` - * - * To aid in debugging, if `BigNumber.DEBUG` is `true` then an error will be thrown on an - * invalid `n`. An error will also be thrown if `n` is of type number with more than 15 - * significant digits, as calling `toString` or `valueOf` on these numbers may not result in the - * intended value. - * - * ```ts - * console.log(823456789123456.3) // 823456789123456.2 - * new BigNumber(823456789123456.3) // '823456789123456.2' - * BigNumber.DEBUG = true - * // 'Error: Number has more than 15 significant digits' - * new BigNumber(823456789123456.3) - * // 'Error: Not a base 2 number' - * new BigNumber(9, 2) - * ``` - * - * A BigNumber can also be created from an object literal. - * Use `isBigNumber` to check that it is well-formed. - * - * ```ts - * new BigNumber({ s: 1, e: 2, c: [ 777, 12300000000000 ], _isBigNumber: true }) // '777.123' - * ``` - * - * @param n A numeric value. - * @param base The base of `n`, integer, 2 to 36 (or `ALPHABET.length`, see `ALPHABET`). - */ - constructor(n: BigNumber.Value, base?: number); - - /** - * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this - * BigNumber. - * - * The return value is always exact and unrounded. - * - * ```ts - * x = new BigNumber(-0.8) - * x.absoluteValue() // '0.8' - * ``` - */ - absoluteValue(): BigNumber; - - /** - * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this - * BigNumber. - * - * The return value is always exact and unrounded. - * - * ```ts - * x = new BigNumber(-0.8) - * x.abs() // '0.8' - * ``` - */ - abs(): BigNumber; - - /** - * Returns | | - * :-------:|:--------------------------------------------------------------| - * 1 | If the value of this BigNumber is greater than the value of `n` - * -1 | If the value of this BigNumber is less than the value of `n` - * 0 | If this BigNumber and `n` have the same value - * `null` | If the value of either this BigNumber or `n` is `NaN` - * - * ```ts - * - * x = new BigNumber(Infinity) - * y = new BigNumber(5) - * x.comparedTo(y) // 1 - * x.comparedTo(x.minus(1)) // 0 - * y.comparedTo(NaN) // null - * y.comparedTo('110', 2) // -1 - * ``` - * @param n A numeric value. - * @param [base] The base of n. - */ - comparedTo(n: BigNumber.Value, base?: number): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode - * `roundingMode` to a maximum of `decimalPlaces` decimal places. - * - * If `decimalPlaces` is omitted, or is `null` or `undefined`, the return value is the number of - * decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is - * ±`Infinity` or `NaN`. - * - * If `roundingMode` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. - * - * Throws if `decimalPlaces` or `roundingMode` is invalid. - * - * ```ts - * x = new BigNumber(1234.56) - * x.decimalPlaces() // 2 - * x.decimalPlaces(1) // '1234.6' - * x.decimalPlaces(2) // '1234.56' - * x.decimalPlaces(10) // '1234.56' - * x.decimalPlaces(0, 1) // '1234' - * x.decimalPlaces(0, 6) // '1235' - * x.decimalPlaces(1, 1) // '1234.5' - * x.decimalPlaces(1, BigNumber.ROUND_HALF_EVEN) // '1234.6' - * x // '1234.56' - * y = new BigNumber('9.9e-101') - * y.decimalPlaces() // 102 - * ``` - * - * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. - * @param [roundingMode] Rounding mode, integer, 0 to 8. - */ - decimalPlaces(): number; - decimalPlaces(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode - * `roundingMode` to a maximum of `decimalPlaces` decimal places. - * - * If `decimalPlaces` is omitted, or is `null` or `undefined`, the return value is the number of - * decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is - * ±`Infinity` or `NaN`. - * - * If `roundingMode` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. - * - * Throws if `decimalPlaces` or `roundingMode` is invalid. - * - * ```ts - * x = new BigNumber(1234.56) - * x.dp() // 2 - * x.dp(1) // '1234.6' - * x.dp(2) // '1234.56' - * x.dp(10) // '1234.56' - * x.dp(0, 1) // '1234' - * x.dp(0, 6) // '1235' - * x.dp(1, 1) // '1234.5' - * x.dp(1, BigNumber.ROUND_HALF_EVEN) // '1234.6' - * x // '1234.56' - * y = new BigNumber('9.9e-101') - * y.dp() // 102 - * ``` - * - * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. - * @param [roundingMode] Rounding mode, integer, 0 to 8. - */ - dp(): number; - dp(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded - * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. - * - * ```ts - * x = new BigNumber(355) - * y = new BigNumber(113) - * x.dividedBy(y) // '3.14159292035398230088' - * x.dividedBy(5) // '71' - * x.dividedBy(47, 16) // '5' - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - dividedBy(n: BigNumber.Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded - * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. - * - * ```ts - * x = new BigNumber(355) - * y = new BigNumber(113) - * x.div(y) // '3.14159292035398230088' - * x.div(5) // '71' - * x.div(47, 16) // '5' - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - div(n: BigNumber.Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by - * `n`. - * - * ```ts - * x = new BigNumber(5) - * y = new BigNumber(3) - * x.dividedToIntegerBy(y) // '1' - * x.dividedToIntegerBy(0.7) // '7' - * x.dividedToIntegerBy('0.f', 16) // '5' - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - dividedToIntegerBy(n: BigNumber.Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by - * `n`. - * - * ```ts - * x = new BigNumber(5) - * y = new BigNumber(3) - * x.idiv(y) // '1' - * x.idiv(0.7) // '7' - * x.idiv('0.f', 16) // '5' - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - idiv(n: BigNumber.Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber exponentiated by `n`, i.e. - * raised to the power `n`, and optionally modulo a modulus `m`. - * - * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and - * `ROUNDING_MODE` settings. - * - * As the number of digits of the result of the power operation can grow so large so quickly, - * e.g. 123.456**10000 has over 50000 digits, the number of significant digits calculated is - * limited to the value of the `POW_PRECISION` setting (unless a modulus `m` is specified). - * - * By default `POW_PRECISION` is set to 0. This means that an unlimited number of significant - * digits will be calculated, and that the method's performance will decrease dramatically for - * larger exponents. - * - * If `m` is specified and the value of `m`, `n` and this BigNumber are integers and `n` is - * positive, then a fast modular exponentiation algorithm is used, otherwise the operation will - * be performed as `x.exponentiatedBy(n).modulo(m)` with a `POW_PRECISION` of 0. - * - * Throws if `n` is not an integer. - * - * ```ts - * Math.pow(0.7, 2) // 0.48999999999999994 - * x = new BigNumber(0.7) - * x.exponentiatedBy(2) // '0.49' - * BigNumber(3).exponentiatedBy(-2) // '0.11111111111111111111' - * ``` - * - * @param n The exponent, an integer. - * @param [m] The modulus. - */ - exponentiatedBy(n: BigNumber.Value, m?: BigNumber.Value): BigNumber; - exponentiatedBy(n: number, m?: BigNumber.Value): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber exponentiated by `n`, i.e. - * raised to the power `n`, and optionally modulo a modulus `m`. - * - * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and - * `ROUNDING_MODE` settings. - * - * As the number of digits of the result of the power operation can grow so large so quickly, - * e.g. 123.456**10000 has over 50000 digits, the number of significant digits calculated is - * limited to the value of the `POW_PRECISION` setting (unless a modulus `m` is specified). - * - * By default `POW_PRECISION` is set to 0. This means that an unlimited number of significant - * digits will be calculated, and that the method's performance will decrease dramatically for - * larger exponents. - * - * If `m` is specified and the value of `m`, `n` and this BigNumber are integers and `n` is - * positive, then a fast modular exponentiation algorithm is used, otherwise the operation will - * be performed as `x.pow(n).modulo(m)` with a `POW_PRECISION` of 0. - * - * Throws if `n` is not an integer. - * - * ```ts - * Math.pow(0.7, 2) // 0.48999999999999994 - * x = new BigNumber(0.7) - * x.pow(2) // '0.49' - * BigNumber(3).pow(-2) // '0.11111111111111111111' - * ``` - * - * @param n The exponent, an integer. - * @param [m] The modulus. - */ - pow(n: BigNumber.Value, m?: BigNumber.Value): BigNumber; - pow(n: number, m?: BigNumber.Value): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to an integer using - * rounding mode `rm`. - * - * If `rm` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. - * - * Throws if `rm` is invalid. - * - * ```ts - * x = new BigNumber(123.456) - * x.integerValue() // '123' - * x.integerValue(BigNumber.ROUND_CEIL) // '124' - * y = new BigNumber(-12.7) - * y.integerValue() // '-13' - * x.integerValue(BigNumber.ROUND_DOWN) // '-12' - * ``` - * - * @param {BigNumber.RoundingMode} [rm] The roundng mode, an integer, 0 to 8. - */ - integerValue(rm?: BigNumber.RoundingMode): BigNumber; - - /** - * Returns `true` if the value of this BigNumber is equal to the value of `n`, otherwise returns - * `false`. - * - * As with JavaScript, `NaN` does not equal `NaN`. - * - * ```ts - * 0 === 1e-324 // true - * x = new BigNumber(0) - * x.isEqualTo('1e-324') // false - * BigNumber(-0).isEqualTo(x) // true ( -0 === 0 ) - * BigNumber(255).isEqualTo('ff', 16) // true - * - * y = new BigNumber(NaN) - * y.isEqualTo(NaN) // false - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - isEqualTo(n: BigNumber.Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is equal to the value of `n`, otherwise returns - * `false`. - * - * As with JavaScript, `NaN` does not equal `NaN`. - * - * ```ts - * 0 === 1e-324 // true - * x = new BigNumber(0) - * x.eq('1e-324') // false - * BigNumber(-0).eq(x) // true ( -0 === 0 ) - * BigNumber(255).eq('ff', 16) // true - * - * y = new BigNumber(NaN) - * y.eq(NaN) // false - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - eq(n: BigNumber.Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is a finite number, otherwise returns `false`. - * - * The only possible non-finite values of a BigNumber are `NaN`, `Infinity` and `-Infinity`. - * - * ```ts - * x = new BigNumber(1) - * x.isFinite() // true - * y = new BigNumber(Infinity) - * y.isFinite() // false - * ``` - */ - isFinite(): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise - * returns `false`. - * - * ```ts - * 0.1 > (0.3 - 0.2) // true - * x = new BigNumber(0.1) - * x.isGreaterThan(BigNumber(0.3).minus(0.2)) // false - * BigNumber(0).isGreaterThan(x) // false - * BigNumber(11, 3).isGreaterThan(11.1, 2) // true - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - isGreaterThan(n: BigNumber.Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise - * returns `false`. - * - * ```ts - * 0.1 > (0.3 - 0 // true - * x = new BigNumber(0.1) - * x.gt(BigNumber(0.3).minus(0.2)) // false - * BigNumber(0).gt(x) // false - * BigNumber(11, 3).gt(11.1, 2) // true - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - gt(n: BigNumber.Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, - * otherwise returns `false`. - * - * ```ts - * (0.3 - 0.2) >= 0.1 // false - * x = new BigNumber(0.3).minus(0.2) - * x.isGreaterThanOrEqualTo(0.1) // true - * BigNumber(1).isGreaterThanOrEqualTo(x) // true - * BigNumber(10, 18).isGreaterThanOrEqualTo('i', 36) // true - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - isGreaterThanOrEqualTo(n: BigNumber.Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, - * otherwise returns `false`. - * - * ```ts - * (0.3 - 0.2) >= 0.1 // false - * x = new BigNumber(0.3).minus(0.2) - * x.gte(0.1) // true - * BigNumber(1).gte(x) // true - * BigNumber(10, 18).gte('i', 36) // true - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - gte(n: BigNumber.Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is an integer, otherwise returns `false`. - * - * ```ts - * x = new BigNumber(1) - * x.isInteger() // true - * y = new BigNumber(123.456) - * y.isInteger() // false - * ``` - */ - isInteger(): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns - * `false`. - * - * ```ts - * (0.3 - 0.2) < 0.1 // true - * x = new BigNumber(0.3).minus(0.2) - * x.isLessThan(0.1) // false - * BigNumber(0).isLessThan(x) // true - * BigNumber(11.1, 2).isLessThan(11, 3) // true - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - isLessThan(n: BigNumber.Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns - * `false`. - * - * ```ts - * (0.3 - 0.2) < 0.1 // true - * x = new BigNumber(0.3).minus(0.2) - * x.lt(0.1) // false - * BigNumber(0).lt(x) // true - * BigNumber(11.1, 2).lt(11, 3) // true - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - lt(n: BigNumber.Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, - * otherwise returns `false`. - * - * ```ts - * 0.1 <= (0.3 - 0.2) // false - * x = new BigNumber(0.1) - * x.isLessThanOrEqualTo(BigNumber(0.3).minus(0.2)) // true - * BigNumber(-1).isLessThanOrEqualTo(x) // true - * BigNumber(10, 18).isLessThanOrEqualTo('i', 36) // true - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - isLessThanOrEqualTo(n: BigNumber.Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, - * otherwise returns `false`. - * - * ```ts - * 0.1 <= (0.3 - 0.2) // false - * x = new BigNumber(0.1) - * x.lte(BigNumber(0.3).minus(0.2)) // true - * BigNumber(-1).lte(x) // true - * BigNumber(10, 18).lte('i', 36) // true - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - lte(n: BigNumber.Value, base?: number): boolean; - - /** - * Returns `true` if the value of this BigNumber is `NaN`, otherwise returns `false`. - * - * ```ts - * x = new BigNumber(NaN) - * x.isNaN() // true - * y = new BigNumber('Infinity') - * y.isNaN() // false - * ``` - */ - isNaN(): boolean; - - /** - * Returns `true` if the value of this BigNumber is negative, otherwise returns `false`. - * - * ```ts - * x = new BigNumber(-0) - * x.isNegative() // true - * y = new BigNumber(2) - * y.isNegative() // false - * ``` - */ - isNegative(): boolean; - - /** - * Returns `true` if the value of this BigNumber is positive, otherwise returns `false`. - * - * ```ts - * x = new BigNumber(-0) - * x.isPositive() // false - * y = new BigNumber(2) - * y.isPositive() // true - * ``` - */ - isPositive(): boolean; - - /** - * Returns `true` if the value of this BigNumber is zero or minus zero, otherwise returns `false`. - * - * ```ts - * x = new BigNumber(-0) - * x.isZero() // true - * ``` - */ - isZero(): boolean; - - /** - * Returns a BigNumber whose value is the value of this BigNumber minus `n`. - * - * The return value is always exact and unrounded. - * - * ```ts - * 0.3 - 0.1 // 0.19999999999999998 - * x = new BigNumber(0.3) - * x.minus(0.1) // '0.2' - * x.minus(0.6, 20) // '0' - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - minus(n: BigNumber.Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer - * remainder of dividing this BigNumber by `n`. - * - * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` - * setting of this BigNumber constructor. If it is 1 (default value), the result will have the - * same sign as this BigNumber, and it will match that of Javascript's `%` operator (within the - * limits of double precision) and BigDecimal's `remainder` method. - * - * The return value is always exact and unrounded. - * - * See `MODULO_MODE` for a description of the other modulo modes. - * - * ```ts - * 1 % 0.9 // 0.09999999999999998 - * x = new BigNumber(1) - * x.modulo(0.9) // '0.1' - * y = new BigNumber(33) - * y.modulo('a', 33) // '3' - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - modulo(n: BigNumber.Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer - * remainder of dividing this BigNumber by `n`. - * - * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` - * setting of this BigNumber constructor. If it is 1 (default value), the result will have the - * same sign as this BigNumber, and it will match that of Javascript's `%` operator (within the - * limits of double precision) and BigDecimal's `remainder` method. - * - * The return value is always exact and unrounded. - * - * See `MODULO_MODE` for a description of the other modulo modes. - * - * ```ts - * 1 % 0.9 // 0.09999999999999998 - * x = new BigNumber(1) - * x.mod(0.9) // '0.1' - * y = new BigNumber(33) - * y.mod('a', 33) // '3' - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - mod(n: BigNumber.Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber multiplied by `n`. - * - * The return value is always exact and unrounded. - * - * ```ts - * 0.6 * 3 // 1.7999999999999998 - * x = new BigNumber(0.6) - * y = x.multipliedBy(3) // '1.8' - * BigNumber('7e+500').multipliedBy(y) // '1.26e+501' - * x.multipliedBy('-a', 16) // '-6' - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - multipliedBy(n: BigNumber.Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber multiplied by `n`. - * - * The return value is always exact and unrounded. - * - * ```ts - * 0.6 * 3 // 1.7999999999999998 - * x = new BigNumber(0.6) - * y = x.times(3) // '1.8' - * BigNumber('7e+500').times(y) // '1.26e+501' - * x.times('-a', 16) // '-6' - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - times(n: BigNumber.Value, base?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by -1. - * - * ```ts - * x = new BigNumber(1.8) - * x.negated() // '-1.8' - * y = new BigNumber(-1.3) - * y.negated() // '1.3' - * ``` - */ - negated(): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber plus `n`. - * - * The return value is always exact and unrounded. - * - * ```ts - * 0.1 + 0.2 // 0.30000000000000004 - * x = new BigNumber(0.1) - * y = x.plus(0.2) // '0.3' - * BigNumber(0.7).plus(x).plus(y) // '1' - * x.plus('0.1', 8) // '0.225' - * ``` - * - * @param n A numeric value. - * @param [base] The base of n. - */ - plus(n: BigNumber.Value, base?: number): BigNumber; - - /** - * Returns the number of significant digits of the value of this BigNumber, or `null` if the value - * of this BigNumber is ±`Infinity` or `NaN`. - * - * If `includeZeros` is true then any trailing zeros of the integer part of the value of this - * BigNumber are counted as significant digits, otherwise they are not. - * - * Throws if `includeZeros` is invalid. - * - * ```ts - * x = new BigNumber(9876.54321) - * x.precision() // 9 - * y = new BigNumber(987000) - * y.precision(false) // 3 - * y.precision(true) // 6 - * ``` - * - * @param [includeZeros] Whether to include integer trailing zeros in the significant digit count. - */ - precision(includeZeros?: boolean): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to a precision of - * `significantDigits` significant digits using rounding mode `roundingMode`. - * - * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` will be used. - * - * Throws if `significantDigits` or `roundingMode` is invalid. - * - * ```ts - * x = new BigNumber(9876.54321) - * x.precision(6) // '9876.54' - * x.precision(6, BigNumber.ROUND_UP) // '9876.55' - * x.precision(2) // '9900' - * x.precision(2, 1) // '9800' - * x // '9876.54321' - * ``` - * - * @param significantDigits Significant digits, integer, 1 to 1e+9. - * @param [roundingMode] Rounding mode, integer, 0 to 8. - */ - precision(significantDigits: number, roundingMode?: BigNumber.RoundingMode): BigNumber; - - /** - * Returns the number of significant digits of the value of this BigNumber, - * or `null` if the value of this BigNumber is ±`Infinity` or `NaN`. - * - * If `includeZeros` is true then any trailing zeros of the integer part of - * the value of this BigNumber are counted as significant digits, otherwise - * they are not. - * - * Throws if `includeZeros` is invalid. - * - * ```ts - * x = new BigNumber(9876.54321) - * x.sd() // 9 - * y = new BigNumber(987000) - * y.sd(false) // 3 - * y.sd(true) // 6 - * ``` - * - * @param [includeZeros] Whether to include integer trailing zeros in the significant digit count. - */ - sd(includeZeros?: boolean): number; - - /** - * Returns a BigNumber whose value is the value of this BigNumber rounded to a precision of - * `significantDigits` significant digits using rounding mode `roundingMode`. - * - * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` will be used. - * - * Throws if `significantDigits` or `roundingMode` is invalid. - * - * ```ts - * x = new BigNumber(9876.54321) - * x.sd(6) // '9876.54' - * x.sd(6, BigNumber.ROUND_UP) // '9876.55' - * x.sd(2) // '9900' - * x.sd(2, 1) // '9800' - * x // '9876.54321' - * ``` - * - * @param significantDigits Significant digits, integer, 1 to 1e+9. - * @param [roundingMode] Rounding mode, integer, 0 to 8. - */ - sd(significantDigits: number, roundingMode?: BigNumber.RoundingMode): BigNumber; - - /** - * Returns a BigNumber whose value is the value of this BigNumber shifted by `n` places. - * - * The shift is of the decimal point, i.e. of powers of ten, and is to the left if `n` is negative - * or to the right if `n` is positive. - * - * The return value is always exact and unrounded. - * - * Throws if `n` is invalid. - * - * ```ts - * x = new BigNumber(1.23) - * x.shiftedBy(3) // '1230' - * x.shiftedBy(-3) // '0.00123' - * ``` - * - * @param n The shift value, integer, -9007199254740991 to 9007199254740991. - */ - shiftedBy(n: number): BigNumber; - - /** - * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded - * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. - * - * The return value will be correctly rounded, i.e. rounded as if the result was first calculated - * to an infinite number of correct digits before rounding. - * - * ```ts - * x = new BigNumber(16) - * x.squareRoot() // '4' - * y = new BigNumber(3) - * y.squareRoot() // '1.73205080756887729353' - * ``` - */ - squareRoot(): BigNumber; - - /** - * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded - * according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` settings. - * - * The return value will be correctly rounded, i.e. rounded as if the result was first calculated - * to an infinite number of correct digits before rounding. - * - * ```ts - * x = new BigNumber(16) - * x.sqrt() // '4' - * y = new BigNumber(3) - * y.sqrt() // '1.73205080756887729353' - * ``` - */ - sqrt(): BigNumber; - - /** - * Returns a string representing the value of this BigNumber in exponential notation rounded using - * rounding mode `roundingMode` to `decimalPlaces` decimal places, i.e with one digit before the - * decimal point and `decimalPlaces` digits after it. - * - * If the value of this BigNumber in exponential notation has fewer than `decimalPlaces` fraction - * digits, the return value will be appended with zeros accordingly. - * - * If `decimalPlaces` is omitted, or is `null` or `undefined`, the number of digits after the - * decimal point defaults to the minimum number of digits necessary to represent the value - * exactly. - * - * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - * - * Throws if `decimalPlaces` or `roundingMode` is invalid. - * - * ```ts - * x = 45.6 - * y = new BigNumber(x) - * x.toExponential() // '4.56e+1' - * y.toExponential() // '4.56e+1' - * x.toExponential(0) // '5e+1' - * y.toExponential(0) // '5e+1' - * x.toExponential(1) // '4.6e+1' - * y.toExponential(1) // '4.6e+1' - * y.toExponential(1, 1) // '4.5e+1' (ROUND_DOWN) - * x.toExponential(3) // '4.560e+1' - * y.toExponential(3) // '4.560e+1' - * ``` - * - * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. - * @param [roundingMode] Rounding mode, integer, 0 to 8. - */ - toExponential(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): string; - toExponential(): string; - - /** - * Returns a string representing the value of this BigNumber in normal (fixed-point) notation - * rounded to `decimalPlaces` decimal places using rounding mode `roundingMode`. - * - * If the value of this BigNumber in normal notation has fewer than `decimalPlaces` fraction - * digits, the return value will be appended with zeros accordingly. - * - * Unlike `Number.prototype.toFixed`, which returns exponential notation if a number is greater or - * equal to 10**21, this method will always return normal notation. - * - * If `decimalPlaces` is omitted or is `null` or `undefined`, the return value will be unrounded - * and in normal notation. This is also unlike `Number.prototype.toFixed`, which returns the value - * to zero decimal places. It is useful when normal notation is required and the current - * `EXPONENTIAL_AT` setting causes `toString` to return exponential notation. - * - * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - * - * Throws if `decimalPlaces` or `roundingMode` is invalid. - * - * ```ts - * x = 3.456 - * y = new BigNumber(x) - * x.toFixed() // '3' - * y.toFixed() // '3.456' - * y.toFixed(0) // '3' - * x.toFixed(2) // '3.46' - * y.toFixed(2) // '3.46' - * y.toFixed(2, 1) // '3.45' (ROUND_DOWN) - * x.toFixed(5) // '3.45600' - * y.toFixed(5) // '3.45600' - * ``` - * - * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. - * @param [roundingMode] Rounding mode, integer, 0 to 8. - */ - toFixed(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): string; - toFixed(): string; - - /** - * Returns a string representing the value of this BigNumber in normal (fixed-point) notation - * rounded to `decimalPlaces` decimal places using rounding mode `roundingMode`, and formatted - * according to the properties of the `format` or `FORMAT` object. - * - * The formatting object may contain some or all of the properties shown in the examples below. - * - * If `decimalPlaces` is omitted or is `null` or `undefined`, then the return value is not - * rounded to a fixed number of decimal places. - * - * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - * - * If `format` is omitted or is `null` or `undefined`, `FORMAT` is used. - * - * Throws if `decimalPlaces`, `roundingMode`, or `format` is invalid. - * - * ```ts - * fmt = { - * decimalSeparator: '.', - * groupSeparator: ',', - * groupSize: 3, - * secondaryGroupSize: 0, - * fractionGroupSeparator: ' ', - * fractionGroupSize: 0 - * } - * - * x = new BigNumber('123456789.123456789') - * - * // Set the global formatting options - * BigNumber.config({ FORMAT: fmt }) - * - * x.toFormat() // '123,456,789.123456789' - * x.toFormat(3) // '123,456,789.123' - * - * // If a reference to the object assigned to FORMAT has been retained, - * // the format properties can be changed directly - * fmt.groupSeparator = ' ' - * fmt.fractionGroupSize = 5 - * x.toFormat() // '123 456 789.12345 6789' - * - * // Alternatively, pass the formatting options as an argument - * fmt = { - * decimalSeparator: ',', - * groupSeparator: '.', - * groupSize: 3, - * secondaryGroupSize: 2 - * } - * - * x.toFormat() // '123 456 789.12345 6789' - * x.toFormat(fmt) // '12.34.56.789,123456789' - * x.toFormat(2, fmt) // '12.34.56.789,12' - * x.toFormat(3, BigNumber.ROUND_UP, fmt) // '12.34.56.789,124' - * ``` - * - * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. - * @param [roundingMode] Rounding mode, integer, 0 to 8. - * @param [format] Formatting options object. See `BigNumber.Format`. - */ - toFormat(decimalPlaces: number, roundingMode: BigNumber.RoundingMode, format?: BigNumber.Format): string; - toFormat(decimalPlaces: number, roundingMode?: BigNumber.RoundingMode): string; - toFormat(decimalPlaces?: number): string; - toFormat(decimalPlaces: number, format: BigNumber.Format): string; - toFormat(format: BigNumber.Format): string; - - /** - * Returns an array of two BigNumbers representing the value of this BigNumber as a simple - * fraction with an integer numerator and an integer denominator. - * The denominator will be a positive non-zero value less than or equal to `max_denominator`. - * If a maximum denominator, `max_denominator`, is not specified, or is `null` or `undefined`, the - * denominator will be the lowest value necessary to represent the number exactly. - * - * Throws if `max_denominator` is invalid. - * - * ```ts - * x = new BigNumber(1.75) - * x.toFraction() // '7, 4' - * - * pi = new BigNumber('3.14159265358') - * pi.toFraction() // '157079632679,50000000000' - * pi.toFraction(100000) // '312689, 99532' - * pi.toFraction(10000) // '355, 113' - * pi.toFraction(100) // '311, 99' - * pi.toFraction(10) // '22, 7' - * pi.toFraction(1) // '3, 1' - * ``` - * - * @param [max_denominator] The maximum denominator, integer > 0, or Infinity. - */ - toFraction(max_denominator?: BigNumber.Value): [BigNumber, BigNumber]; - - /** As `valueOf`. */ - toJSON(): string; - - /** - * Returns the value of this BigNumber as a JavaScript primitive number. - * - * Using the unary plus operator gives the same result. - * - * ```ts - * x = new BigNumber(456.789) - * x.toNumber() // 456.789 - * +x // 456.789 - * - * y = new BigNumber('45987349857634085409857349856430985') - * y.toNumber() // 4.598734985763409e+34 - * - * z = new BigNumber(-0) - * 1 / z.toNumber() // -Infinity - * 1 / +z // -Infinity - * ``` - */ - toNumber(): number; - - /** - * Returns a string representing the value of this BigNumber rounded to `significantDigits` - * significant digits using rounding mode `roundingMode`. - * - * If `significantDigits` is less than the number of digits necessary to represent the integer - * part of the value in normal (fixed-point) notation, then exponential notation is used. - * - * If `significantDigits` is omitted, or is `null` or `undefined`, then the return value is the - * same as `n.toString()`. - * - * If `roundingMode` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. - * - * Throws if `significantDigits` or `roundingMode` is invalid. - * - * ```ts - * x = 45.6 - * y = new BigNumber(x) - * x.toPrecision() // '45.6' - * y.toPrecision() // '45.6' - * x.toPrecision(1) // '5e+1' - * y.toPrecision(1) // '5e+1' - * y.toPrecision(2, 0) // '4.6e+1' (ROUND_UP) - * y.toPrecision(2, 1) // '4.5e+1' (ROUND_DOWN) - * x.toPrecision(5) // '45.600' - * y.toPrecision(5) // '45.600' - * ``` - * - * @param [significantDigits] Significant digits, integer, 1 to 1e+9. - * @param [roundingMode] Rounding mode, integer 0 to 8. - */ - toPrecision(significantDigits: number, roundingMode?: BigNumber.RoundingMode): string; - toPrecision(): string; - - /** - * Returns a string representing the value of this BigNumber in base `base`, or base 10 if `base` - * is omitted or is `null` or `undefined`. - * - * For bases above 10, and using the default base conversion alphabet (see `ALPHABET`), values - * from 10 to 35 are represented by a-z (the same as `Number.prototype.toString`). - * - * If a base is specified the value is rounded according to the current `DECIMAL_PLACES` and - * `ROUNDING_MODE` settings, otherwise it is not. - * - * If a base is not specified, and this BigNumber has a positive exponent that is equal to or - * greater than the positive component of the current `EXPONENTIAL_AT` setting, or a negative - * exponent equal to or less than the negative component of the setting, then exponential notation - * is returned. - * - * If `base` is `null` or `undefined` it is ignored. - * - * Throws if `base` is invalid. - * - * ```ts - * x = new BigNumber(750000) - * x.toString() // '750000' - * BigNumber.config({ EXPONENTIAL_AT: 5 }) - * x.toString() // '7.5e+5' - * - * y = new BigNumber(362.875) - * y.toString(2) // '101101010.111' - * y.toString(9) // '442.77777777777777777778' - * y.toString(32) // 'ba.s' - * - * BigNumber.config({ DECIMAL_PLACES: 4 }); - * z = new BigNumber('1.23456789') - * z.toString() // '1.23456789' - * z.toString(10) // '1.2346' - * ``` - * - * @param [base] The base, integer, 2 to 36 (or `ALPHABET.length`, see `ALPHABET`). - */ - toString(base?: number): string; - - /** - * As `toString`, but does not accept a base argument and includes the minus sign for negative - * zero. - * - * ``ts - * x = new BigNumber('-0') - * x.toString() // '0' - * x.valueOf() // '-0' - * y = new BigNumber('1.777e+457') - * y.valueOf() // '1.777e+457' - * ``` - */ - valueOf(): string; - - /** Helps ES6 import. */ - private static readonly default?: BigNumber.Constructor; - - /** Helps ES6 import. */ - private static readonly BigNumber?: BigNumber.Constructor; - - /** Rounds away from zero. */ - static readonly ROUND_UP: 0; - - /** Rounds towards zero. */ - static readonly ROUND_DOWN: 1; - - /** Rounds towards Infinity. */ - static readonly ROUND_CEIL: 2; - - /** Rounds towards -Infinity. */ - static readonly ROUND_FLOOR: 3; - - /** Rounds towards nearest neighbour. If equidistant, rounds away from zero . */ - static readonly ROUND_HALF_UP: 4; - - /** Rounds towards nearest neighbour. If equidistant, rounds towards zero. */ - static readonly ROUND_HALF_DOWN: 5; - - /** Rounds towards nearest neighbour. If equidistant, rounds towards even neighbour. */ - static readonly ROUND_HALF_EVEN: 6; - - /** Rounds towards nearest neighbour. If equidistant, rounds towards Infinity. */ - static readonly ROUND_HALF_CEIL: 7; - - /** Rounds towards nearest neighbour. If equidistant, rounds towards -Infinity. */ - static readonly ROUND_HALF_FLOOR: 8; - - /** See `MODULO_MODE`. */ - static readonly EUCLID: 9; - - /** - * To aid in debugging, if a `BigNumber.DEBUG` property is `true` then an error will be thrown - * if the BigNumber constructor receives an invalid `BigNumber.Value`, or if `BigNumber.isBigNumber` - * receives a BigNumber instance that is malformed. - * - * ```ts - * // No error, and BigNumber NaN is returned. - * new BigNumber('blurgh') // 'NaN' - * new BigNumber(9, 2) // 'NaN' - * BigNumber.DEBUG = true - * new BigNumber('blurgh') // '[BigNumber Error] Not a number' - * new BigNumber(9, 2) // '[BigNumber Error] Not a base 2 number' - * ``` - * - * An error will also be thrown if a `BigNumber.Value` is of type number with more than 15 - * significant digits, as calling `toString` or `valueOf` on such numbers may not result - * in the intended value. - * - * ```ts - * console.log(823456789123456.3) // 823456789123456.2 - * // No error, and the returned BigNumber does not have the same value as the number literal. - * new BigNumber(823456789123456.3) // '823456789123456.2' - * BigNumber.DEBUG = true - * new BigNumber(823456789123456.3) - * // '[BigNumber Error] Number primitive has more than 15 significant digits' - * ``` - * - * Check that a BigNumber instance is well-formed: - * - * ```ts - * x = new BigNumber(10) - * - * BigNumber.DEBUG = false - * // Change x.c to an illegitimate value. - * x.c = NaN - * // No error, as BigNumber.DEBUG is false. - * BigNumber.isBigNumber(x) // true - * - * BigNumber.DEBUG = true - * BigNumber.isBigNumber(x) // '[BigNumber Error] Invalid BigNumber' - * ``` - */ - static DEBUG?: boolean; - - /** - * Returns a new independent BigNumber constructor with configuration as described by `object`, or - * with the default configuration if object is `null` or `undefined`. - * - * Throws if `object` is not an object. - * - * ```ts - * BigNumber.config({ DECIMAL_PLACES: 5 }) - * BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) - * - * x = new BigNumber(1) - * y = new BN(1) - * - * x.div(3) // 0.33333 - * y.div(3) // 0.333333333 - * - * // BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) is equivalent to: - * BN = BigNumber.clone() - * BN.config({ DECIMAL_PLACES: 9 }) - * ``` - * - * @param [object] The configuration object. - */ - static clone(object?: BigNumber.Config): BigNumber.Constructor; - - /** - * Configures the settings that apply to this BigNumber constructor. - * - * The configuration object, `object`, contains any number of the properties shown in the example - * below. - * - * Returns an object with the above properties and their current values. - * - * Throws if `object` is not an object, or if an invalid value is assigned to one or more of the - * properties. - * - * ```ts - * BigNumber.config({ - * DECIMAL_PLACES: 40, - * ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL, - * EXPONENTIAL_AT: [-10, 20], - * RANGE: [-500, 500], - * CRYPTO: true, - * MODULO_MODE: BigNumber.ROUND_FLOOR, - * POW_PRECISION: 80, - * FORMAT: { - * groupSize: 3, - * groupSeparator: ' ', - * decimalSeparator: ',' - * }, - * ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' - * }); - * - * BigNumber.config().DECIMAL_PLACES // 40 - * ``` - * - * @param object The configuration object. - */ - static config(object: BigNumber.Config): BigNumber.Config; - - /** - * Returns `true` if `value` is a BigNumber instance, otherwise returns `false`. - * - * If `BigNumber.DEBUG` is `true`, throws if a BigNumber instance is not well-formed. - * - * ```ts - * x = 42 - * y = new BigNumber(x) - * - * BigNumber.isBigNumber(x) // false - * y instanceof BigNumber // true - * BigNumber.isBigNumber(y) // true - * - * BN = BigNumber.clone(); - * z = new BN(x) - * z instanceof BigNumber // false - * BigNumber.isBigNumber(z) // true - * ``` - * - * @param value The value to test. - */ - static isBigNumber(value: any): value is BigNumber; - - /** - * Returns a BigNumber whose value is the maximum of the arguments. - * - * The return value is always exact and unrounded. - * - * ```ts - * x = new BigNumber('3257869345.0378653') - * BigNumber.maximum(4e9, x, '123456789.9') // '4000000000' - * - * arr = [12, '13', new BigNumber(14)] - * BigNumber.maximum.apply(null, arr) // '14' - * ``` - * - * @param n A numeric value. - */ - static maximum(...n: BigNumber.Value[]): BigNumber; - - /** - * Returns a BigNumber whose value is the maximum of the arguments. - * - * The return value is always exact and unrounded. - * - * ```ts - * x = new BigNumber('3257869345.0378653') - * BigNumber.max(4e9, x, '123456789.9') // '4000000000' - * - * arr = [12, '13', new BigNumber(14)] - * BigNumber.max.apply(null, arr) // '14' - * ``` - * - * @param n A numeric value. - */ - static max(...n: BigNumber.Value[]): BigNumber; - - /** - * Returns a BigNumber whose value is the minimum of the arguments. - * - * The return value is always exact and unrounded. - * - * ```ts - * x = new BigNumber('3257869345.0378653') - * BigNumber.minimum(4e9, x, '123456789.9') // '123456789.9' - * - * arr = [2, new BigNumber(-14), '-15.9999', -12] - * BigNumber.minimum.apply(null, arr) // '-15.9999' - * ``` - * - * @param n A numeric value. - */ - static minimum(...n: BigNumber.Value[]): BigNumber; - - /** - * Returns a BigNumber whose value is the minimum of the arguments. - * - * The return value is always exact and unrounded. - * - * ```ts - * x = new BigNumber('3257869345.0378653') - * BigNumber.min(4e9, x, '123456789.9') // '123456789.9' - * - * arr = [2, new BigNumber(-14), '-15.9999', -12] - * BigNumber.min.apply(null, arr) // '-15.9999' - * ``` - * - * @param n A numeric value. - */ - static min(...n: BigNumber.Value[]): BigNumber; - - /** - * Returns a new BigNumber with a pseudo-random value equal to or greater than 0 and less than 1. - * - * The return value will have `decimalPlaces` decimal places, or less if trailing zeros are - * produced. If `decimalPlaces` is omitted, the current `DECIMAL_PLACES` setting will be used. - * - * Depending on the value of this BigNumber constructor's `CRYPTO` setting and the support for the - * `crypto` object in the host environment, the random digits of the return value are generated by - * either `Math.random` (fastest), `crypto.getRandomValues` (Web Cryptography API in recent - * browsers) or `crypto.randomBytes` (Node.js). - * - * To be able to set `CRYPTO` to true when using Node.js, the `crypto` object must be available - * globally: - * - * ```ts - * global.crypto = require('crypto') - * ``` - * - * If `CRYPTO` is true, i.e. one of the `crypto` methods is to be used, the value of a returned - * BigNumber should be cryptographically secure and statistically indistinguishable from a random - * value. - * - * Throws if `decimalPlaces` is invalid. - * - * ```ts - * BigNumber.config({ DECIMAL_PLACES: 10 }) - * BigNumber.random() // '0.4117936847' - * BigNumber.random(20) // '0.78193327636914089009' - * ``` - * - * @param [decimalPlaces] Decimal places, integer, 0 to 1e+9. - */ - static random(decimalPlaces?: number): BigNumber; - - /** - * Returns a BigNumber whose value is the sum of the arguments. - * - * The return value is always exact and unrounded. - * - * ```ts - * x = new BigNumber('3257869345.0378653') - * BigNumber.sum(4e9, x, '123456789.9') // '7381326134.9378653' - * - * arr = [2, new BigNumber(14), '15.9999', 12] - * BigNumber.sum.apply(null, arr) // '43.9999' - * ``` - * - * @param n A numeric value. - */ - static sum(...n: BigNumber.Value[]): BigNumber; - - /** - * Configures the settings that apply to this BigNumber constructor. - * - * The configuration object, `object`, contains any number of the properties shown in the example - * below. - * - * Returns an object with the above properties and their current values. - * - * Throws if `object` is not an object, or if an invalid value is assigned to one or more of the - * properties. - * - * ```ts - * BigNumber.set({ - * DECIMAL_PLACES: 40, - * ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL, - * EXPONENTIAL_AT: [-10, 20], - * RANGE: [-500, 500], - * CRYPTO: true, - * MODULO_MODE: BigNumber.ROUND_FLOOR, - * POW_PRECISION: 80, - * FORMAT: { - * groupSize: 3, - * groupSeparator: ' ', - * decimalSeparator: ',' - * }, - * ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' - * }); - * - * BigNumber.set().DECIMAL_PLACES // 40 - * ``` - * - * @param object The configuration object. - */ - static set(object: BigNumber.Config): BigNumber.Config; -} diff --git a/node_modules/bignumber.js/bignumber.js b/node_modules/bignumber.js/bignumber.js deleted file mode 100644 index 1ffc9f9..0000000 --- a/node_modules/bignumber.js/bignumber.js +++ /dev/null @@ -1,2902 +0,0 @@ -;(function (globalObject) { - 'use strict'; - -/* - * bignumber.js v9.0.0 - * A JavaScript library for arbitrary-precision arithmetic. - * https://github.com/MikeMcl/bignumber.js - * Copyright (c) 2019 Michael Mclaughlin - * MIT Licensed. - * - * BigNumber.prototype methods | BigNumber methods - * | - * absoluteValue abs | clone - * comparedTo | config set - * decimalPlaces dp | DECIMAL_PLACES - * dividedBy div | ROUNDING_MODE - * dividedToIntegerBy idiv | EXPONENTIAL_AT - * exponentiatedBy pow | RANGE - * integerValue | CRYPTO - * isEqualTo eq | MODULO_MODE - * isFinite | POW_PRECISION - * isGreaterThan gt | FORMAT - * isGreaterThanOrEqualTo gte | ALPHABET - * isInteger | isBigNumber - * isLessThan lt | maximum max - * isLessThanOrEqualTo lte | minimum min - * isNaN | random - * isNegative | sum - * isPositive | - * isZero | - * minus | - * modulo mod | - * multipliedBy times | - * negated | - * plus | - * precision sd | - * shiftedBy | - * squareRoot sqrt | - * toExponential | - * toFixed | - * toFormat | - * toFraction | - * toJSON | - * toNumber | - * toPrecision | - * toString | - * valueOf | - * - */ - - - var BigNumber, - isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, - mathceil = Math.ceil, - mathfloor = Math.floor, - - bignumberError = '[BigNumber Error] ', - tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', - - BASE = 1e14, - LOG_BASE = 14, - MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 - // MAX_INT32 = 0x7fffffff, // 2^31 - 1 - POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], - SQRT_BASE = 1e7, - - // EDITABLE - // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and - // the arguments to toExponential, toFixed, toFormat, and toPrecision. - MAX = 1E9; // 0 to MAX_INT32 - - - /* - * Create and return a BigNumber constructor. - */ - function clone(configObject) { - var div, convertBase, parseNumeric, - P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, - ONE = new BigNumber(1), - - - //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- - - - // The default values below must be integers within the inclusive ranges stated. - // The values can also be changed at run-time using BigNumber.set. - - // The maximum number of decimal places for operations involving division. - DECIMAL_PLACES = 20, // 0 to MAX - - // The rounding mode used when rounding to the above decimal places, and when using - // toExponential, toFixed, toFormat and toPrecision, and round (default value). - // UP 0 Away from zero. - // DOWN 1 Towards zero. - // CEIL 2 Towards +Infinity. - // FLOOR 3 Towards -Infinity. - // HALF_UP 4 Towards nearest neighbour. If equidistant, up. - // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. - // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. - // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. - // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. - ROUNDING_MODE = 4, // 0 to 8 - - // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] - - // The exponent value at and beneath which toString returns exponential notation. - // Number type: -7 - TO_EXP_NEG = -7, // 0 to -MAX - - // The exponent value at and above which toString returns exponential notation. - // Number type: 21 - TO_EXP_POS = 21, // 0 to MAX - - // RANGE : [MIN_EXP, MAX_EXP] - - // The minimum exponent value, beneath which underflow to zero occurs. - // Number type: -324 (5e-324) - MIN_EXP = -1e7, // -1 to -MAX - - // The maximum exponent value, above which overflow to Infinity occurs. - // Number type: 308 (1.7976931348623157e+308) - // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. - MAX_EXP = 1e7, // 1 to MAX - - // Whether to use cryptographically-secure random number generation, if available. - CRYPTO = false, // true or false - - // The modulo mode used when calculating the modulus: a mod n. - // The quotient (q = a / n) is calculated according to the corresponding rounding mode. - // The remainder (r) is calculated as: r = a - n * q. - // - // UP 0 The remainder is positive if the dividend is negative, else is negative. - // DOWN 1 The remainder has the same sign as the dividend. - // This modulo mode is commonly known as 'truncated division' and is - // equivalent to (a % n) in JavaScript. - // FLOOR 3 The remainder has the same sign as the divisor (Python %). - // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. - // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). - // The remainder is always positive. - // - // The truncated division, floored division, Euclidian division and IEEE 754 remainder - // modes are commonly used for the modulus operation. - // Although the other rounding modes can also be used, they may not give useful results. - MODULO_MODE = 1, // 0 to 9 - - // The maximum number of significant digits of the result of the exponentiatedBy operation. - // If POW_PRECISION is 0, there will be unlimited significant digits. - POW_PRECISION = 0, // 0 to MAX - - // The format specification used by the BigNumber.prototype.toFormat method. - FORMAT = { - prefix: '', - groupSize: 3, - secondaryGroupSize: 0, - groupSeparator: ',', - decimalSeparator: '.', - fractionGroupSize: 0, - fractionGroupSeparator: '\xA0', // non-breaking space - suffix: '' - }, - - // The alphabet used for base conversion. It must be at least 2 characters long, with no '+', - // '-', '.', whitespace, or repeated character. - // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' - ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz'; - - - //------------------------------------------------------------------------------------------ - - - // CONSTRUCTOR - - - /* - * The BigNumber constructor and exported function. - * Create and return a new instance of a BigNumber object. - * - * v {number|string|BigNumber} A numeric value. - * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive. - */ - function BigNumber(v, b) { - var alphabet, c, caseChanged, e, i, isNum, len, str, - x = this; - - // Enable constructor call without `new`. - if (!(x instanceof BigNumber)) return new BigNumber(v, b); - - if (b == null) { - - if (v && v._isBigNumber === true) { - x.s = v.s; - - if (!v.c || v.e > MAX_EXP) { - x.c = x.e = null; - } else if (v.e < MIN_EXP) { - x.c = [x.e = 0]; - } else { - x.e = v.e; - x.c = v.c.slice(); - } - - return; - } - - if ((isNum = typeof v == 'number') && v * 0 == 0) { - - // Use `1 / n` to handle minus zero also. - x.s = 1 / v < 0 ? (v = -v, -1) : 1; - - // Fast path for integers, where n < 2147483648 (2**31). - if (v === ~~v) { - for (e = 0, i = v; i >= 10; i /= 10, e++); - - if (e > MAX_EXP) { - x.c = x.e = null; - } else { - x.e = e; - x.c = [v]; - } - - return; - } - - str = String(v); - } else { - - if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum); - - x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; - } - - // Decimal point? - if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); - - // Exponential form? - if ((i = str.search(/e/i)) > 0) { - - // Determine exponent. - if (e < 0) e = i; - e += +str.slice(i + 1); - str = str.substring(0, i); - } else if (e < 0) { - - // Integer. - e = str.length; - } - - } else { - - // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' - intCheck(b, 2, ALPHABET.length, 'Base'); - - // Allow exponential notation to be used with base 10 argument, while - // also rounding to DECIMAL_PLACES as with other bases. - if (b == 10) { - x = new BigNumber(v); - return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); - } - - str = String(v); - - if (isNum = typeof v == 'number') { - - // Avoid potential interpretation of Infinity and NaN as base 44+ values. - if (v * 0 != 0) return parseNumeric(x, str, isNum, b); - - x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1; - - // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' - if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { - throw Error - (tooManyDigits + v); - } - } else { - x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; - } - - alphabet = ALPHABET.slice(0, b); - e = i = 0; - - // Check that str is a valid base b number. - // Don't use RegExp, so alphabet can contain special characters. - for (len = str.length; i < len; i++) { - if (alphabet.indexOf(c = str.charAt(i)) < 0) { - if (c == '.') { - - // If '.' is not the first character and it has not be found before. - if (i > e) { - e = len; - continue; - } - } else if (!caseChanged) { - - // Allow e.g. hexadecimal 'FF' as well as 'ff'. - if (str == str.toUpperCase() && (str = str.toLowerCase()) || - str == str.toLowerCase() && (str = str.toUpperCase())) { - caseChanged = true; - i = -1; - e = 0; - continue; - } - } - - return parseNumeric(x, String(v), isNum, b); - } - } - - // Prevent later check for length on converted number. - isNum = false; - str = convertBase(str, b, 10, x.s); - - // Decimal point? - if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); - else e = str.length; - } - - // Determine leading zeros. - for (i = 0; str.charCodeAt(i) === 48; i++); - - // Determine trailing zeros. - for (len = str.length; str.charCodeAt(--len) === 48;); - - if (str = str.slice(i, ++len)) { - len -= i; - - // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' - if (isNum && BigNumber.DEBUG && - len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) { - throw Error - (tooManyDigits + (x.s * v)); - } - - // Overflow? - if ((e = e - i - 1) > MAX_EXP) { - - // Infinity. - x.c = x.e = null; - - // Underflow? - } else if (e < MIN_EXP) { - - // Zero. - x.c = [x.e = 0]; - } else { - x.e = e; - x.c = []; - - // Transform base - - // e is the base 10 exponent. - // i is where to slice str to get the first element of the coefficient array. - i = (e + 1) % LOG_BASE; - if (e < 0) i += LOG_BASE; // i < 1 - - if (i < len) { - if (i) x.c.push(+str.slice(0, i)); - - for (len -= LOG_BASE; i < len;) { - x.c.push(+str.slice(i, i += LOG_BASE)); - } - - i = LOG_BASE - (str = str.slice(i)).length; - } else { - i -= len; - } - - for (; i--; str += '0'); - x.c.push(+str); - } - } else { - - // Zero. - x.c = [x.e = 0]; - } - } - - - // CONSTRUCTOR PROPERTIES - - - BigNumber.clone = clone; - - BigNumber.ROUND_UP = 0; - BigNumber.ROUND_DOWN = 1; - BigNumber.ROUND_CEIL = 2; - BigNumber.ROUND_FLOOR = 3; - BigNumber.ROUND_HALF_UP = 4; - BigNumber.ROUND_HALF_DOWN = 5; - BigNumber.ROUND_HALF_EVEN = 6; - BigNumber.ROUND_HALF_CEIL = 7; - BigNumber.ROUND_HALF_FLOOR = 8; - BigNumber.EUCLID = 9; - - - /* - * Configure infrequently-changing library-wide settings. - * - * Accept an object with the following optional properties (if the value of a property is - * a number, it must be an integer within the inclusive range stated): - * - * DECIMAL_PLACES {number} 0 to MAX - * ROUNDING_MODE {number} 0 to 8 - * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] - * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] - * CRYPTO {boolean} true or false - * MODULO_MODE {number} 0 to 9 - * POW_PRECISION {number} 0 to MAX - * ALPHABET {string} A string of two or more unique characters which does - * not contain '.'. - * FORMAT {object} An object with some of the following properties: - * prefix {string} - * groupSize {number} - * secondaryGroupSize {number} - * groupSeparator {string} - * decimalSeparator {string} - * fractionGroupSize {number} - * fractionGroupSeparator {string} - * suffix {string} - * - * (The values assigned to the above FORMAT object properties are not checked for validity.) - * - * E.g. - * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) - * - * Ignore properties/parameters set to null or undefined, except for ALPHABET. - * - * Return an object with the properties current values. - */ - BigNumber.config = BigNumber.set = function (obj) { - var p, v; - - if (obj != null) { - - if (typeof obj == 'object') { - - // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. - // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' - if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { - v = obj[p]; - intCheck(v, 0, MAX, p); - DECIMAL_PLACES = v; - } - - // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. - // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' - if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { - v = obj[p]; - intCheck(v, 0, 8, p); - ROUNDING_MODE = v; - } - - // EXPONENTIAL_AT {number|number[]} - // Integer, -MAX to MAX inclusive or - // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. - // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' - if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { - v = obj[p]; - if (v && v.pop) { - intCheck(v[0], -MAX, 0, p); - intCheck(v[1], 0, MAX, p); - TO_EXP_NEG = v[0]; - TO_EXP_POS = v[1]; - } else { - intCheck(v, -MAX, MAX, p); - TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); - } - } - - // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or - // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. - // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' - if (obj.hasOwnProperty(p = 'RANGE')) { - v = obj[p]; - if (v && v.pop) { - intCheck(v[0], -MAX, -1, p); - intCheck(v[1], 1, MAX, p); - MIN_EXP = v[0]; - MAX_EXP = v[1]; - } else { - intCheck(v, -MAX, MAX, p); - if (v) { - MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); - } else { - throw Error - (bignumberError + p + ' cannot be zero: ' + v); - } - } - } - - // CRYPTO {boolean} true or false. - // '[BigNumber Error] CRYPTO not true or false: {v}' - // '[BigNumber Error] crypto unavailable' - if (obj.hasOwnProperty(p = 'CRYPTO')) { - v = obj[p]; - if (v === !!v) { - if (v) { - if (typeof crypto != 'undefined' && crypto && - (crypto.getRandomValues || crypto.randomBytes)) { - CRYPTO = v; - } else { - CRYPTO = !v; - throw Error - (bignumberError + 'crypto unavailable'); - } - } else { - CRYPTO = v; - } - } else { - throw Error - (bignumberError + p + ' not true or false: ' + v); - } - } - - // MODULO_MODE {number} Integer, 0 to 9 inclusive. - // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' - if (obj.hasOwnProperty(p = 'MODULO_MODE')) { - v = obj[p]; - intCheck(v, 0, 9, p); - MODULO_MODE = v; - } - - // POW_PRECISION {number} Integer, 0 to MAX inclusive. - // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' - if (obj.hasOwnProperty(p = 'POW_PRECISION')) { - v = obj[p]; - intCheck(v, 0, MAX, p); - POW_PRECISION = v; - } - - // FORMAT {object} - // '[BigNumber Error] FORMAT not an object: {v}' - if (obj.hasOwnProperty(p = 'FORMAT')) { - v = obj[p]; - if (typeof v == 'object') FORMAT = v; - else throw Error - (bignumberError + p + ' not an object: ' + v); - } - - // ALPHABET {string} - // '[BigNumber Error] ALPHABET invalid: {v}' - if (obj.hasOwnProperty(p = 'ALPHABET')) { - v = obj[p]; - - // Disallow if only one character, - // or if it contains '+', '-', '.', whitespace, or a repeated character. - if (typeof v == 'string' && !/^.$|[+-.\s]|(.).*\1/.test(v)) { - ALPHABET = v; - } else { - throw Error - (bignumberError + p + ' invalid: ' + v); - } - } - - } else { - - // '[BigNumber Error] Object expected: {v}' - throw Error - (bignumberError + 'Object expected: ' + obj); - } - } - - return { - DECIMAL_PLACES: DECIMAL_PLACES, - ROUNDING_MODE: ROUNDING_MODE, - EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], - RANGE: [MIN_EXP, MAX_EXP], - CRYPTO: CRYPTO, - MODULO_MODE: MODULO_MODE, - POW_PRECISION: POW_PRECISION, - FORMAT: FORMAT, - ALPHABET: ALPHABET - }; - }; - - - /* - * Return true if v is a BigNumber instance, otherwise return false. - * - * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed. - * - * v {any} - * - * '[BigNumber Error] Invalid BigNumber: {v}' - */ - BigNumber.isBigNumber = function (v) { - if (!v || v._isBigNumber !== true) return false; - if (!BigNumber.DEBUG) return true; - - var i, n, - c = v.c, - e = v.e, - s = v.s; - - out: if ({}.toString.call(c) == '[object Array]') { - - if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) { - - // If the first element is zero, the BigNumber value must be zero. - if (c[0] === 0) { - if (e === 0 && c.length === 1) return true; - break out; - } - - // Calculate number of digits that c[0] should have, based on the exponent. - i = (e + 1) % LOG_BASE; - if (i < 1) i += LOG_BASE; - - // Calculate number of digits of c[0]. - //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) { - if (String(c[0]).length == i) { - - for (i = 0; i < c.length; i++) { - n = c[i]; - if (n < 0 || n >= BASE || n !== mathfloor(n)) break out; - } - - // Last element cannot be zero, unless it is the only element. - if (n !== 0) return true; - } - } - - // Infinity/NaN - } else if (c === null && e === null && (s === null || s === 1 || s === -1)) { - return true; - } - - throw Error - (bignumberError + 'Invalid BigNumber: ' + v); - }; - - - /* - * Return a new BigNumber whose value is the maximum of the arguments. - * - * arguments {number|string|BigNumber} - */ - BigNumber.maximum = BigNumber.max = function () { - return maxOrMin(arguments, P.lt); - }; - - - /* - * Return a new BigNumber whose value is the minimum of the arguments. - * - * arguments {number|string|BigNumber} - */ - BigNumber.minimum = BigNumber.min = function () { - return maxOrMin(arguments, P.gt); - }; - - - /* - * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, - * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing - * zeros are produced). - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' - * '[BigNumber Error] crypto unavailable' - */ - BigNumber.random = (function () { - var pow2_53 = 0x20000000000000; - - // Return a 53 bit integer n, where 0 <= n < 9007199254740992. - // Check if Math.random() produces more than 32 bits of randomness. - // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. - // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. - var random53bitInt = (Math.random() * pow2_53) & 0x1fffff - ? function () { return mathfloor(Math.random() * pow2_53); } - : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + - (Math.random() * 0x800000 | 0); }; - - return function (dp) { - var a, b, e, k, v, - i = 0, - c = [], - rand = new BigNumber(ONE); - - if (dp == null) dp = DECIMAL_PLACES; - else intCheck(dp, 0, MAX); - - k = mathceil(dp / LOG_BASE); - - if (CRYPTO) { - - // Browsers supporting crypto.getRandomValues. - if (crypto.getRandomValues) { - - a = crypto.getRandomValues(new Uint32Array(k *= 2)); - - for (; i < k;) { - - // 53 bits: - // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) - // 11111 11111111 11111111 11111111 11100000 00000000 00000000 - // ((Math.pow(2, 32) - 1) >>> 11).toString(2) - // 11111 11111111 11111111 - // 0x20000 is 2^21. - v = a[i] * 0x20000 + (a[i + 1] >>> 11); - - // Rejection sampling: - // 0 <= v < 9007199254740992 - // Probability that v >= 9e15, is - // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 - if (v >= 9e15) { - b = crypto.getRandomValues(new Uint32Array(2)); - a[i] = b[0]; - a[i + 1] = b[1]; - } else { - - // 0 <= v <= 8999999999999999 - // 0 <= (v % 1e14) <= 99999999999999 - c.push(v % 1e14); - i += 2; - } - } - i = k / 2; - - // Node.js supporting crypto.randomBytes. - } else if (crypto.randomBytes) { - - // buffer - a = crypto.randomBytes(k *= 7); - - for (; i < k;) { - - // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 - // 0x100000000 is 2^32, 0x1000000 is 2^24 - // 11111 11111111 11111111 11111111 11111111 11111111 11111111 - // 0 <= v < 9007199254740992 - v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + - (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + - (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; - - if (v >= 9e15) { - crypto.randomBytes(7).copy(a, i); - } else { - - // 0 <= (v % 1e14) <= 99999999999999 - c.push(v % 1e14); - i += 7; - } - } - i = k / 7; - } else { - CRYPTO = false; - throw Error - (bignumberError + 'crypto unavailable'); - } - } - - // Use Math.random. - if (!CRYPTO) { - - for (; i < k;) { - v = random53bitInt(); - if (v < 9e15) c[i++] = v % 1e14; - } - } - - k = c[--i]; - dp %= LOG_BASE; - - // Convert trailing digits to zeros according to dp. - if (k && dp) { - v = POWS_TEN[LOG_BASE - dp]; - c[i] = mathfloor(k / v) * v; - } - - // Remove trailing elements which are zero. - for (; c[i] === 0; c.pop(), i--); - - // Zero? - if (i < 0) { - c = [e = 0]; - } else { - - // Remove leading elements which are zero and adjust exponent accordingly. - for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); - - // Count the digits of the first element of c to determine leading zeros, and... - for (i = 1, v = c[0]; v >= 10; v /= 10, i++); - - // adjust the exponent accordingly. - if (i < LOG_BASE) e -= LOG_BASE - i; - } - - rand.e = e; - rand.c = c; - return rand; - }; - })(); - - - /* - * Return a BigNumber whose value is the sum of the arguments. - * - * arguments {number|string|BigNumber} - */ - BigNumber.sum = function () { - var i = 1, - args = arguments, - sum = new BigNumber(args[0]); - for (; i < args.length;) sum = sum.plus(args[i++]); - return sum; - }; - - - // PRIVATE FUNCTIONS - - - // Called by BigNumber and BigNumber.prototype.toString. - convertBase = (function () { - var decimal = '0123456789'; - - /* - * Convert string of baseIn to an array of numbers of baseOut. - * Eg. toBaseOut('255', 10, 16) returns [15, 15]. - * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. - */ - function toBaseOut(str, baseIn, baseOut, alphabet) { - var j, - arr = [0], - arrL, - i = 0, - len = str.length; - - for (; i < len;) { - for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); - - arr[0] += alphabet.indexOf(str.charAt(i++)); - - for (j = 0; j < arr.length; j++) { - - if (arr[j] > baseOut - 1) { - if (arr[j + 1] == null) arr[j + 1] = 0; - arr[j + 1] += arr[j] / baseOut | 0; - arr[j] %= baseOut; - } - } - } - - return arr.reverse(); - } - - // Convert a numeric string of baseIn to a numeric string of baseOut. - // If the caller is toString, we are converting from base 10 to baseOut. - // If the caller is BigNumber, we are converting from baseIn to base 10. - return function (str, baseIn, baseOut, sign, callerIsToString) { - var alphabet, d, e, k, r, x, xc, y, - i = str.indexOf('.'), - dp = DECIMAL_PLACES, - rm = ROUNDING_MODE; - - // Non-integer. - if (i >= 0) { - k = POW_PRECISION; - - // Unlimited precision. - POW_PRECISION = 0; - str = str.replace('.', ''); - y = new BigNumber(baseIn); - x = y.pow(str.length - i); - POW_PRECISION = k; - - // Convert str as if an integer, then restore the fraction part by dividing the - // result by its base raised to a power. - - y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), - 10, baseOut, decimal); - y.e = y.c.length; - } - - // Convert the number as integer. - - xc = toBaseOut(str, baseIn, baseOut, callerIsToString - ? (alphabet = ALPHABET, decimal) - : (alphabet = decimal, ALPHABET)); - - // xc now represents str as an integer and converted to baseOut. e is the exponent. - e = k = xc.length; - - // Remove trailing zeros. - for (; xc[--k] == 0; xc.pop()); - - // Zero? - if (!xc[0]) return alphabet.charAt(0); - - // Does str represent an integer? If so, no need for the division. - if (i < 0) { - --e; - } else { - x.c = xc; - x.e = e; - - // The sign is needed for correct rounding. - x.s = sign; - x = div(x, y, dp, rm, baseOut); - xc = x.c; - r = x.r; - e = x.e; - } - - // xc now represents str converted to baseOut. - - // THe index of the rounding digit. - d = e + dp + 1; - - // The rounding digit: the digit to the right of the digit that may be rounded up. - i = xc[d]; - - // Look at the rounding digits and mode to determine whether to round up. - - k = baseOut / 2; - r = r || d < 0 || xc[d + 1] != null; - - r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) - : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || - rm == (x.s < 0 ? 8 : 7)); - - // If the index of the rounding digit is not greater than zero, or xc represents - // zero, then the result of the base conversion is zero or, if rounding up, a value - // such as 0.00001. - if (d < 1 || !xc[0]) { - - // 1^-dp or 0 - str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0); - } else { - - // Truncate xc to the required number of decimal places. - xc.length = d; - - // Round up? - if (r) { - - // Rounding up may mean the previous digit has to be rounded up and so on. - for (--baseOut; ++xc[--d] > baseOut;) { - xc[d] = 0; - - if (!d) { - ++e; - xc = [1].concat(xc); - } - } - } - - // Determine trailing zeros. - for (k = xc.length; !xc[--k];); - - // E.g. [4, 11, 15] becomes 4bf. - for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); - - // Add leading zeros, decimal point and trailing zeros as required. - str = toFixedPoint(str, e, alphabet.charAt(0)); - } - - // The caller will add the sign. - return str; - }; - })(); - - - // Perform division in the specified base. Called by div and convertBase. - div = (function () { - - // Assume non-zero x and k. - function multiply(x, k, base) { - var m, temp, xlo, xhi, - carry = 0, - i = x.length, - klo = k % SQRT_BASE, - khi = k / SQRT_BASE | 0; - - for (x = x.slice(); i--;) { - xlo = x[i] % SQRT_BASE; - xhi = x[i] / SQRT_BASE | 0; - m = khi * xlo + xhi * klo; - temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; - carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; - x[i] = temp % base; - } - - if (carry) x = [carry].concat(x); - - return x; - } - - function compare(a, b, aL, bL) { - var i, cmp; - - if (aL != bL) { - cmp = aL > bL ? 1 : -1; - } else { - - for (i = cmp = 0; i < aL; i++) { - - if (a[i] != b[i]) { - cmp = a[i] > b[i] ? 1 : -1; - break; - } - } - } - - return cmp; - } - - function subtract(a, b, aL, base) { - var i = 0; - - // Subtract b from a. - for (; aL--;) { - a[aL] -= i; - i = a[aL] < b[aL] ? 1 : 0; - a[aL] = i * base + a[aL] - b[aL]; - } - - // Remove leading zeros. - for (; !a[0] && a.length > 1; a.splice(0, 1)); - } - - // x: dividend, y: divisor. - return function (x, y, dp, rm, base) { - var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, - yL, yz, - s = x.s == y.s ? 1 : -1, - xc = x.c, - yc = y.c; - - // Either NaN, Infinity or 0? - if (!xc || !xc[0] || !yc || !yc[0]) { - - return new BigNumber( - - // Return NaN if either NaN, or both Infinity or 0. - !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : - - // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. - xc && xc[0] == 0 || !yc ? s * 0 : s / 0 - ); - } - - q = new BigNumber(s); - qc = q.c = []; - e = x.e - y.e; - s = dp + e + 1; - - if (!base) { - base = BASE; - e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); - s = s / LOG_BASE | 0; - } - - // Result exponent may be one less then the current value of e. - // The coefficients of the BigNumbers from convertBase may have trailing zeros. - for (i = 0; yc[i] == (xc[i] || 0); i++); - - if (yc[i] > (xc[i] || 0)) e--; - - if (s < 0) { - qc.push(1); - more = true; - } else { - xL = xc.length; - yL = yc.length; - i = 0; - s += 2; - - // Normalise xc and yc so highest order digit of yc is >= base / 2. - - n = mathfloor(base / (yc[0] + 1)); - - // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. - // if (n > 1 || n++ == 1 && yc[0] < base / 2) { - if (n > 1) { - yc = multiply(yc, n, base); - xc = multiply(xc, n, base); - yL = yc.length; - xL = xc.length; - } - - xi = yL; - rem = xc.slice(0, yL); - remL = rem.length; - - // Add zeros to make remainder as long as divisor. - for (; remL < yL; rem[remL++] = 0); - yz = yc.slice(); - yz = [0].concat(yz); - yc0 = yc[0]; - if (yc[1] >= base / 2) yc0++; - // Not necessary, but to prevent trial digit n > base, when using base 3. - // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; - - do { - n = 0; - - // Compare divisor and remainder. - cmp = compare(yc, rem, yL, remL); - - // If divisor < remainder. - if (cmp < 0) { - - // Calculate trial digit, n. - - rem0 = rem[0]; - if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); - - // n is how many times the divisor goes into the current remainder. - n = mathfloor(rem0 / yc0); - - // Algorithm: - // product = divisor multiplied by trial digit (n). - // Compare product and remainder. - // If product is greater than remainder: - // Subtract divisor from product, decrement trial digit. - // Subtract product from remainder. - // If product was less than remainder at the last compare: - // Compare new remainder and divisor. - // If remainder is greater than divisor: - // Subtract divisor from remainder, increment trial digit. - - if (n > 1) { - - // n may be > base only when base is 3. - if (n >= base) n = base - 1; - - // product = divisor * trial digit. - prod = multiply(yc, n, base); - prodL = prod.length; - remL = rem.length; - - // Compare product and remainder. - // If product > remainder then trial digit n too high. - // n is 1 too high about 5% of the time, and is not known to have - // ever been more than 1 too high. - while (compare(prod, rem, prodL, remL) == 1) { - n--; - - // Subtract divisor from product. - subtract(prod, yL < prodL ? yz : yc, prodL, base); - prodL = prod.length; - cmp = 1; - } - } else { - - // n is 0 or 1, cmp is -1. - // If n is 0, there is no need to compare yc and rem again below, - // so change cmp to 1 to avoid it. - // If n is 1, leave cmp as -1, so yc and rem are compared again. - if (n == 0) { - - // divisor < remainder, so n must be at least 1. - cmp = n = 1; - } - - // product = divisor - prod = yc.slice(); - prodL = prod.length; - } - - if (prodL < remL) prod = [0].concat(prod); - - // Subtract product from remainder. - subtract(rem, prod, remL, base); - remL = rem.length; - - // If product was < remainder. - if (cmp == -1) { - - // Compare divisor and new remainder. - // If divisor < new remainder, subtract divisor from remainder. - // Trial digit n too low. - // n is 1 too low about 5% of the time, and very rarely 2 too low. - while (compare(yc, rem, yL, remL) < 1) { - n++; - - // Subtract divisor from remainder. - subtract(rem, yL < remL ? yz : yc, remL, base); - remL = rem.length; - } - } - } else if (cmp === 0) { - n++; - rem = [0]; - } // else cmp === 1 and n will be 0 - - // Add the next digit, n, to the result array. - qc[i++] = n; - - // Update the remainder. - if (rem[0]) { - rem[remL++] = xc[xi] || 0; - } else { - rem = [xc[xi]]; - remL = 1; - } - } while ((xi++ < xL || rem[0] != null) && s--); - - more = rem[0] != null; - - // Leading zero? - if (!qc[0]) qc.splice(0, 1); - } - - if (base == BASE) { - - // To calculate q.e, first get the number of digits of qc[0]. - for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); - - round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); - - // Caller is convertBase. - } else { - q.e = e; - q.r = +more; - } - - return q; - }; - })(); - - - /* - * Return a string representing the value of BigNumber n in fixed-point or exponential - * notation rounded to the specified decimal places or significant digits. - * - * n: a BigNumber. - * i: the index of the last digit required (i.e. the digit that may be rounded up). - * rm: the rounding mode. - * id: 1 (toExponential) or 2 (toPrecision). - */ - function format(n, i, rm, id) { - var c0, e, ne, len, str; - - if (rm == null) rm = ROUNDING_MODE; - else intCheck(rm, 0, 8); - - if (!n.c) return n.toString(); - - c0 = n.c[0]; - ne = n.e; - - if (i == null) { - str = coeffToString(n.c); - str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) - ? toExponential(str, ne) - : toFixedPoint(str, ne, '0'); - } else { - n = round(new BigNumber(n), i, rm); - - // n.e may have changed if the value was rounded up. - e = n.e; - - str = coeffToString(n.c); - len = str.length; - - // toPrecision returns exponential notation if the number of significant digits - // specified is less than the number of digits necessary to represent the integer - // part of the value in fixed-point notation. - - // Exponential notation. - if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { - - // Append zeros? - for (; len < i; str += '0', len++); - str = toExponential(str, e); - - // Fixed-point notation. - } else { - i -= ne; - str = toFixedPoint(str, e, '0'); - - // Append zeros? - if (e + 1 > len) { - if (--i > 0) for (str += '.'; i--; str += '0'); - } else { - i += e - len; - if (i > 0) { - if (e + 1 == len) str += '.'; - for (; i--; str += '0'); - } - } - } - } - - return n.s < 0 && c0 ? '-' + str : str; - } - - - // Handle BigNumber.max and BigNumber.min. - function maxOrMin(args, method) { - var n, - i = 1, - m = new BigNumber(args[0]); - - for (; i < args.length; i++) { - n = new BigNumber(args[i]); - - // If any number is NaN, return NaN. - if (!n.s) { - m = n; - break; - } else if (method.call(m, n)) { - m = n; - } - } - - return m; - } - - - /* - * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. - * Called by minus, plus and times. - */ - function normalise(n, c, e) { - var i = 1, - j = c.length; - - // Remove trailing zeros. - for (; !c[--j]; c.pop()); - - // Calculate the base 10 exponent. First get the number of digits of c[0]. - for (j = c[0]; j >= 10; j /= 10, i++); - - // Overflow? - if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { - - // Infinity. - n.c = n.e = null; - - // Underflow? - } else if (e < MIN_EXP) { - - // Zero. - n.c = [n.e = 0]; - } else { - n.e = e; - n.c = c; - } - - return n; - } - - - // Handle values that fail the validity test in BigNumber. - parseNumeric = (function () { - var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, - dotAfter = /^([^.]+)\.$/, - dotBefore = /^\.([^.]+)$/, - isInfinityOrNaN = /^-?(Infinity|NaN)$/, - whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; - - return function (x, str, isNum, b) { - var base, - s = isNum ? str : str.replace(whitespaceOrPlus, ''); - - // No exception on ±Infinity or NaN. - if (isInfinityOrNaN.test(s)) { - x.s = isNaN(s) ? null : s < 0 ? -1 : 1; - } else { - if (!isNum) { - - // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i - s = s.replace(basePrefix, function (m, p1, p2) { - base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; - return !b || b == base ? p1 : m; - }); - - if (b) { - base = b; - - // E.g. '1.' to '1', '.1' to '0.1' - s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); - } - - if (str != s) return new BigNumber(s, base); - } - - // '[BigNumber Error] Not a number: {n}' - // '[BigNumber Error] Not a base {b} number: {n}' - if (BigNumber.DEBUG) { - throw Error - (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); - } - - // NaN - x.s = null; - } - - x.c = x.e = null; - } - })(); - - - /* - * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. - * If r is truthy, it is known that there are more digits after the rounding digit. - */ - function round(x, sd, rm, r) { - var d, i, j, k, n, ni, rd, - xc = x.c, - pows10 = POWS_TEN; - - // if x is not Infinity or NaN... - if (xc) { - - // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. - // n is a base 1e14 number, the value of the element of array x.c containing rd. - // ni is the index of n within x.c. - // d is the number of digits of n. - // i is the index of rd within n including leading zeros. - // j is the actual index of rd within n (if < 0, rd is a leading zero). - out: { - - // Get the number of digits of the first element of xc. - for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); - i = sd - d; - - // If the rounding digit is in the first element of xc... - if (i < 0) { - i += LOG_BASE; - j = sd; - n = xc[ni = 0]; - - // Get the rounding digit at index j of n. - rd = n / pows10[d - j - 1] % 10 | 0; - } else { - ni = mathceil((i + 1) / LOG_BASE); - - if (ni >= xc.length) { - - if (r) { - - // Needed by sqrt. - for (; xc.length <= ni; xc.push(0)); - n = rd = 0; - d = 1; - i %= LOG_BASE; - j = i - LOG_BASE + 1; - } else { - break out; - } - } else { - n = k = xc[ni]; - - // Get the number of digits of n. - for (d = 1; k >= 10; k /= 10, d++); - - // Get the index of rd within n. - i %= LOG_BASE; - - // Get the index of rd within n, adjusted for leading zeros. - // The number of leading zeros of n is given by LOG_BASE - d. - j = i - LOG_BASE + d; - - // Get the rounding digit at index j of n. - rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; - } - } - - r = r || sd < 0 || - - // Are there any non-zero digits after the rounding digit? - // The expression n % pows10[d - j - 1] returns all digits of n to the right - // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. - xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); - - r = rm < 4 - ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) - : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && - - // Check whether the digit to the left of the rounding digit is odd. - ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || - rm == (x.s < 0 ? 8 : 7)); - - if (sd < 1 || !xc[0]) { - xc.length = 0; - - if (r) { - - // Convert sd to decimal places. - sd -= x.e + 1; - - // 1, 0.1, 0.01, 0.001, 0.0001 etc. - xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; - x.e = -sd || 0; - } else { - - // Zero. - xc[0] = x.e = 0; - } - - return x; - } - - // Remove excess digits. - if (i == 0) { - xc.length = ni; - k = 1; - ni--; - } else { - xc.length = ni + 1; - k = pows10[LOG_BASE - i]; - - // E.g. 56700 becomes 56000 if 7 is the rounding digit. - // j > 0 means i > number of leading zeros of n. - xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; - } - - // Round up? - if (r) { - - for (; ;) { - - // If the digit to be rounded up is in the first element of xc... - if (ni == 0) { - - // i will be the length of xc[0] before k is added. - for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); - j = xc[0] += k; - for (k = 1; j >= 10; j /= 10, k++); - - // if i != k the length has increased. - if (i != k) { - x.e++; - if (xc[0] == BASE) xc[0] = 1; - } - - break; - } else { - xc[ni] += k; - if (xc[ni] != BASE) break; - xc[ni--] = 0; - k = 1; - } - } - } - - // Remove trailing zeros. - for (i = xc.length; xc[--i] === 0; xc.pop()); - } - - // Overflow? Infinity. - if (x.e > MAX_EXP) { - x.c = x.e = null; - - // Underflow? Zero. - } else if (x.e < MIN_EXP) { - x.c = [x.e = 0]; - } - } - - return x; - } - - - function valueOf(n) { - var str, - e = n.e; - - if (e === null) return n.toString(); - - str = coeffToString(n.c); - - str = e <= TO_EXP_NEG || e >= TO_EXP_POS - ? toExponential(str, e) - : toFixedPoint(str, e, '0'); - - return n.s < 0 ? '-' + str : str; - } - - - // PROTOTYPE/INSTANCE METHODS - - - /* - * Return a new BigNumber whose value is the absolute value of this BigNumber. - */ - P.absoluteValue = P.abs = function () { - var x = new BigNumber(this); - if (x.s < 0) x.s = 1; - return x; - }; - - - /* - * Return - * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), - * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), - * 0 if they have the same value, - * or null if the value of either is NaN. - */ - P.comparedTo = function (y, b) { - return compare(this, new BigNumber(y, b)); - }; - - - /* - * If dp is undefined or null or true or false, return the number of decimal places of the - * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. - * - * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this - * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or - * ROUNDING_MODE if rm is omitted. - * - * [dp] {number} Decimal places: integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' - */ - P.decimalPlaces = P.dp = function (dp, rm) { - var c, n, v, - x = this; - - if (dp != null) { - intCheck(dp, 0, MAX); - if (rm == null) rm = ROUNDING_MODE; - else intCheck(rm, 0, 8); - - return round(new BigNumber(x), dp + x.e + 1, rm); - } - - if (!(c = x.c)) return null; - n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; - - // Subtract the number of trailing zeros of the last number. - if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); - if (n < 0) n = 0; - - return n; - }; - - - /* - * n / 0 = I - * n / N = N - * n / I = 0 - * 0 / n = 0 - * 0 / 0 = N - * 0 / N = N - * 0 / I = 0 - * N / n = N - * N / 0 = N - * N / N = N - * N / I = N - * I / n = I - * I / 0 = I - * I / N = N - * I / I = N - * - * Return a new BigNumber whose value is the value of this BigNumber divided by the value of - * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. - */ - P.dividedBy = P.div = function (y, b) { - return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); - }; - - - /* - * Return a new BigNumber whose value is the integer part of dividing the value of this - * BigNumber by the value of BigNumber(y, b). - */ - P.dividedToIntegerBy = P.idiv = function (y, b) { - return div(this, new BigNumber(y, b), 0, 1); - }; - - - /* - * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. - * - * If m is present, return the result modulo m. - * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. - * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. - * - * The modular power operation works efficiently when x, n, and m are integers, otherwise it - * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. - * - * n {number|string|BigNumber} The exponent. An integer. - * [m] {number|string|BigNumber} The modulus. - * - * '[BigNumber Error] Exponent not an integer: {n}' - */ - P.exponentiatedBy = P.pow = function (n, m) { - var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, - x = this; - - n = new BigNumber(n); - - // Allow NaN and ±Infinity, but not other non-integers. - if (n.c && !n.isInteger()) { - throw Error - (bignumberError + 'Exponent not an integer: ' + valueOf(n)); - } - - if (m != null) m = new BigNumber(m); - - // Exponent of MAX_SAFE_INTEGER is 15. - nIsBig = n.e > 14; - - // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. - if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { - - // The sign of the result of pow when x is negative depends on the evenness of n. - // If +n overflows to ±Infinity, the evenness of n would be not be known. - y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n))); - return m ? y.mod(m) : y; - } - - nIsNeg = n.s < 0; - - if (m) { - - // x % m returns NaN if abs(m) is zero, or m is NaN. - if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); - - isModExp = !nIsNeg && x.isInteger() && m.isInteger(); - - if (isModExp) x = x.mod(m); - - // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. - // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. - } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 - // [1, 240000000] - ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 - // [80000000000000] [99999750000000] - : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { - - // If x is negative and n is odd, k = -0, else k = 0. - k = x.s < 0 && isOdd(n) ? -0 : 0; - - // If x >= 1, k = ±Infinity. - if (x.e > -1) k = 1 / k; - - // If n is negative return ±0, else return ±Infinity. - return new BigNumber(nIsNeg ? 1 / k : k); - - } else if (POW_PRECISION) { - - // Truncating each coefficient array to a length of k after each multiplication - // equates to truncating significant digits to POW_PRECISION + [28, 41], - // i.e. there will be a minimum of 28 guard digits retained. - k = mathceil(POW_PRECISION / LOG_BASE + 2); - } - - if (nIsBig) { - half = new BigNumber(0.5); - if (nIsNeg) n.s = 1; - nIsOdd = isOdd(n); - } else { - i = Math.abs(+valueOf(n)); - nIsOdd = i % 2; - } - - y = new BigNumber(ONE); - - // Performs 54 loop iterations for n of 9007199254740991. - for (; ;) { - - if (nIsOdd) { - y = y.times(x); - if (!y.c) break; - - if (k) { - if (y.c.length > k) y.c.length = k; - } else if (isModExp) { - y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); - } - } - - if (i) { - i = mathfloor(i / 2); - if (i === 0) break; - nIsOdd = i % 2; - } else { - n = n.times(half); - round(n, n.e + 1, 1); - - if (n.e > 14) { - nIsOdd = isOdd(n); - } else { - i = +valueOf(n); - if (i === 0) break; - nIsOdd = i % 2; - } - } - - x = x.times(x); - - if (k) { - if (x.c && x.c.length > k) x.c.length = k; - } else if (isModExp) { - x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); - } - } - - if (isModExp) return y; - if (nIsNeg) y = ONE.div(y); - - return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer - * using rounding mode rm, or ROUNDING_MODE if rm is omitted. - * - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' - */ - P.integerValue = function (rm) { - var n = new BigNumber(this); - if (rm == null) rm = ROUNDING_MODE; - else intCheck(rm, 0, 8); - return round(n, n.e + 1, rm); - }; - - - /* - * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), - * otherwise return false. - */ - P.isEqualTo = P.eq = function (y, b) { - return compare(this, new BigNumber(y, b)) === 0; - }; - - - /* - * Return true if the value of this BigNumber is a finite number, otherwise return false. - */ - P.isFinite = function () { - return !!this.c; - }; - - - /* - * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), - * otherwise return false. - */ - P.isGreaterThan = P.gt = function (y, b) { - return compare(this, new BigNumber(y, b)) > 0; - }; - - - /* - * Return true if the value of this BigNumber is greater than or equal to the value of - * BigNumber(y, b), otherwise return false. - */ - P.isGreaterThanOrEqualTo = P.gte = function (y, b) { - return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; - - }; - - - /* - * Return true if the value of this BigNumber is an integer, otherwise return false. - */ - P.isInteger = function () { - return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; - }; - - - /* - * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), - * otherwise return false. - */ - P.isLessThan = P.lt = function (y, b) { - return compare(this, new BigNumber(y, b)) < 0; - }; - - - /* - * Return true if the value of this BigNumber is less than or equal to the value of - * BigNumber(y, b), otherwise return false. - */ - P.isLessThanOrEqualTo = P.lte = function (y, b) { - return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; - }; - - - /* - * Return true if the value of this BigNumber is NaN, otherwise return false. - */ - P.isNaN = function () { - return !this.s; - }; - - - /* - * Return true if the value of this BigNumber is negative, otherwise return false. - */ - P.isNegative = function () { - return this.s < 0; - }; - - - /* - * Return true if the value of this BigNumber is positive, otherwise return false. - */ - P.isPositive = function () { - return this.s > 0; - }; - - - /* - * Return true if the value of this BigNumber is 0 or -0, otherwise return false. - */ - P.isZero = function () { - return !!this.c && this.c[0] == 0; - }; - - - /* - * n - 0 = n - * n - N = N - * n - I = -I - * 0 - n = -n - * 0 - 0 = 0 - * 0 - N = N - * 0 - I = -I - * N - n = N - * N - 0 = N - * N - N = N - * N - I = N - * I - n = I - * I - 0 = I - * I - N = N - * I - I = N - * - * Return a new BigNumber whose value is the value of this BigNumber minus the value of - * BigNumber(y, b). - */ - P.minus = function (y, b) { - var i, j, t, xLTy, - x = this, - a = x.s; - - y = new BigNumber(y, b); - b = y.s; - - // Either NaN? - if (!a || !b) return new BigNumber(NaN); - - // Signs differ? - if (a != b) { - y.s = -b; - return x.plus(y); - } - - var xe = x.e / LOG_BASE, - ye = y.e / LOG_BASE, - xc = x.c, - yc = y.c; - - if (!xe || !ye) { - - // Either Infinity? - if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); - - // Either zero? - if (!xc[0] || !yc[0]) { - - // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. - return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : - - // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity - ROUNDING_MODE == 3 ? -0 : 0); - } - } - - xe = bitFloor(xe); - ye = bitFloor(ye); - xc = xc.slice(); - - // Determine which is the bigger number. - if (a = xe - ye) { - - if (xLTy = a < 0) { - a = -a; - t = xc; - } else { - ye = xe; - t = yc; - } - - t.reverse(); - - // Prepend zeros to equalise exponents. - for (b = a; b--; t.push(0)); - t.reverse(); - } else { - - // Exponents equal. Check digit by digit. - j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; - - for (a = b = 0; b < j; b++) { - - if (xc[b] != yc[b]) { - xLTy = xc[b] < yc[b]; - break; - } - } - } - - // x < y? Point xc to the array of the bigger number. - if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; - - b = (j = yc.length) - (i = xc.length); - - // Append zeros to xc if shorter. - // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. - if (b > 0) for (; b--; xc[i++] = 0); - b = BASE - 1; - - // Subtract yc from xc. - for (; j > a;) { - - if (xc[--j] < yc[j]) { - for (i = j; i && !xc[--i]; xc[i] = b); - --xc[i]; - xc[j] += BASE; - } - - xc[j] -= yc[j]; - } - - // Remove leading zeros and adjust exponent accordingly. - for (; xc[0] == 0; xc.splice(0, 1), --ye); - - // Zero? - if (!xc[0]) { - - // Following IEEE 754 (2008) 6.3, - // n - n = +0 but n - n = -0 when rounding towards -Infinity. - y.s = ROUNDING_MODE == 3 ? -1 : 1; - y.c = [y.e = 0]; - return y; - } - - // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity - // for finite x and y. - return normalise(y, xc, ye); - }; - - - /* - * n % 0 = N - * n % N = N - * n % I = n - * 0 % n = 0 - * -0 % n = -0 - * 0 % 0 = N - * 0 % N = N - * 0 % I = 0 - * N % n = N - * N % 0 = N - * N % N = N - * N % I = N - * I % n = N - * I % 0 = N - * I % N = N - * I % I = N - * - * Return a new BigNumber whose value is the value of this BigNumber modulo the value of - * BigNumber(y, b). The result depends on the value of MODULO_MODE. - */ - P.modulo = P.mod = function (y, b) { - var q, s, - x = this; - - y = new BigNumber(y, b); - - // Return NaN if x is Infinity or NaN, or y is NaN or zero. - if (!x.c || !y.s || y.c && !y.c[0]) { - return new BigNumber(NaN); - - // Return x if y is Infinity or x is zero. - } else if (!y.c || x.c && !x.c[0]) { - return new BigNumber(x); - } - - if (MODULO_MODE == 9) { - - // Euclidian division: q = sign(y) * floor(x / abs(y)) - // r = x - qy where 0 <= r < abs(y) - s = y.s; - y.s = 1; - q = div(x, y, 0, 3); - y.s = s; - q.s *= s; - } else { - q = div(x, y, 0, MODULO_MODE); - } - - y = x.minus(q.times(y)); - - // To match JavaScript %, ensure sign of zero is sign of dividend. - if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; - - return y; - }; - - - /* - * n * 0 = 0 - * n * N = N - * n * I = I - * 0 * n = 0 - * 0 * 0 = 0 - * 0 * N = N - * 0 * I = N - * N * n = N - * N * 0 = N - * N * N = N - * N * I = N - * I * n = I - * I * 0 = N - * I * N = N - * I * I = I - * - * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value - * of BigNumber(y, b). - */ - P.multipliedBy = P.times = function (y, b) { - var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, - base, sqrtBase, - x = this, - xc = x.c, - yc = (y = new BigNumber(y, b)).c; - - // Either NaN, ±Infinity or ±0? - if (!xc || !yc || !xc[0] || !yc[0]) { - - // Return NaN if either is NaN, or one is 0 and the other is Infinity. - if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { - y.c = y.e = y.s = null; - } else { - y.s *= x.s; - - // Return ±Infinity if either is ±Infinity. - if (!xc || !yc) { - y.c = y.e = null; - - // Return ±0 if either is ±0. - } else { - y.c = [0]; - y.e = 0; - } - } - - return y; - } - - e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); - y.s *= x.s; - xcL = xc.length; - ycL = yc.length; - - // Ensure xc points to longer array and xcL to its length. - if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; - - // Initialise the result array with zeros. - for (i = xcL + ycL, zc = []; i--; zc.push(0)); - - base = BASE; - sqrtBase = SQRT_BASE; - - for (i = ycL; --i >= 0;) { - c = 0; - ylo = yc[i] % sqrtBase; - yhi = yc[i] / sqrtBase | 0; - - for (k = xcL, j = i + k; j > i;) { - xlo = xc[--k] % sqrtBase; - xhi = xc[k] / sqrtBase | 0; - m = yhi * xlo + xhi * ylo; - xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; - c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; - zc[j--] = xlo % base; - } - - zc[j] = c; - } - - if (c) { - ++e; - } else { - zc.splice(0, 1); - } - - return normalise(y, zc, e); - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber negated, - * i.e. multiplied by -1. - */ - P.negated = function () { - var x = new BigNumber(this); - x.s = -x.s || null; - return x; - }; - - - /* - * n + 0 = n - * n + N = N - * n + I = I - * 0 + n = n - * 0 + 0 = 0 - * 0 + N = N - * 0 + I = I - * N + n = N - * N + 0 = N - * N + N = N - * N + I = N - * I + n = I - * I + 0 = I - * I + N = N - * I + I = I - * - * Return a new BigNumber whose value is the value of this BigNumber plus the value of - * BigNumber(y, b). - */ - P.plus = function (y, b) { - var t, - x = this, - a = x.s; - - y = new BigNumber(y, b); - b = y.s; - - // Either NaN? - if (!a || !b) return new BigNumber(NaN); - - // Signs differ? - if (a != b) { - y.s = -b; - return x.minus(y); - } - - var xe = x.e / LOG_BASE, - ye = y.e / LOG_BASE, - xc = x.c, - yc = y.c; - - if (!xe || !ye) { - - // Return ±Infinity if either ±Infinity. - if (!xc || !yc) return new BigNumber(a / 0); - - // Either zero? - // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. - if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); - } - - xe = bitFloor(xe); - ye = bitFloor(ye); - xc = xc.slice(); - - // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. - if (a = xe - ye) { - if (a > 0) { - ye = xe; - t = yc; - } else { - a = -a; - t = xc; - } - - t.reverse(); - for (; a--; t.push(0)); - t.reverse(); - } - - a = xc.length; - b = yc.length; - - // Point xc to the longer array, and b to the shorter length. - if (a - b < 0) t = yc, yc = xc, xc = t, b = a; - - // Only start adding at yc.length - 1 as the further digits of xc can be ignored. - for (a = 0; b;) { - a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; - xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; - } - - if (a) { - xc = [a].concat(xc); - ++ye; - } - - // No need to check for zero, as +x + +y != 0 && -x + -y != 0 - // ye = MAX_EXP + 1 possible - return normalise(y, xc, ye); - }; - - - /* - * If sd is undefined or null or true or false, return the number of significant digits of - * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. - * If sd is true include integer-part trailing zeros in the count. - * - * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this - * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or - * ROUNDING_MODE if rm is omitted. - * - * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. - * boolean: whether to count integer-part trailing zeros: true or false. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' - */ - P.precision = P.sd = function (sd, rm) { - var c, n, v, - x = this; - - if (sd != null && sd !== !!sd) { - intCheck(sd, 1, MAX); - if (rm == null) rm = ROUNDING_MODE; - else intCheck(rm, 0, 8); - - return round(new BigNumber(x), sd, rm); - } - - if (!(c = x.c)) return null; - v = c.length - 1; - n = v * LOG_BASE + 1; - - if (v = c[v]) { - - // Subtract the number of trailing zeros of the last element. - for (; v % 10 == 0; v /= 10, n--); - - // Add the number of digits of the first element. - for (v = c[0]; v >= 10; v /= 10, n++); - } - - if (sd && x.e + 1 > n) n = x.e + 1; - - return n; - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber shifted by k places - * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. - * - * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' - */ - P.shiftedBy = function (k) { - intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); - return this.times('1e' + k); - }; - - - /* - * sqrt(-n) = N - * sqrt(N) = N - * sqrt(-I) = N - * sqrt(I) = I - * sqrt(0) = 0 - * sqrt(-0) = -0 - * - * Return a new BigNumber whose value is the square root of the value of this BigNumber, - * rounded according to DECIMAL_PLACES and ROUNDING_MODE. - */ - P.squareRoot = P.sqrt = function () { - var m, n, r, rep, t, - x = this, - c = x.c, - s = x.s, - e = x.e, - dp = DECIMAL_PLACES + 4, - half = new BigNumber('0.5'); - - // Negative/NaN/Infinity/zero? - if (s !== 1 || !c || !c[0]) { - return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); - } - - // Initial estimate. - s = Math.sqrt(+valueOf(x)); - - // Math.sqrt underflow/overflow? - // Pass x to Math.sqrt as integer, then adjust the exponent of the result. - if (s == 0 || s == 1 / 0) { - n = coeffToString(c); - if ((n.length + e) % 2 == 0) n += '0'; - s = Math.sqrt(+n); - e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); - - if (s == 1 / 0) { - n = '1e' + e; - } else { - n = s.toExponential(); - n = n.slice(0, n.indexOf('e') + 1) + e; - } - - r = new BigNumber(n); - } else { - r = new BigNumber(s + ''); - } - - // Check for zero. - // r could be zero if MIN_EXP is changed after the this value was created. - // This would cause a division by zero (x/t) and hence Infinity below, which would cause - // coeffToString to throw. - if (r.c[0]) { - e = r.e; - s = e + dp; - if (s < 3) s = 0; - - // Newton-Raphson iteration. - for (; ;) { - t = r; - r = half.times(t.plus(div(x, t, dp, 1))); - - if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) { - - // The exponent of r may here be one less than the final result exponent, - // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits - // are indexed correctly. - if (r.e < e) --s; - n = n.slice(s - 3, s + 1); - - // The 4th rounding digit may be in error by -1 so if the 4 rounding digits - // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the - // iteration. - if (n == '9999' || !rep && n == '4999') { - - // On the first iteration only, check to see if rounding up gives the - // exact result as the nines may infinitely repeat. - if (!rep) { - round(t, t.e + DECIMAL_PLACES + 2, 0); - - if (t.times(t).eq(x)) { - r = t; - break; - } - } - - dp += 4; - s += 4; - rep = 1; - } else { - - // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact - // result. If not, then there are further digits and m will be truthy. - if (!+n || !+n.slice(1) && n.charAt(0) == '5') { - - // Truncate to the first rounding digit. - round(r, r.e + DECIMAL_PLACES + 2, 1); - m = !r.times(r).eq(x); - } - - break; - } - } - } - } - - return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); - }; - - - /* - * Return a string representing the value of this BigNumber in exponential notation and - * rounded using ROUNDING_MODE to dp fixed decimal places. - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' - */ - P.toExponential = function (dp, rm) { - if (dp != null) { - intCheck(dp, 0, MAX); - dp++; - } - return format(this, dp, rm, 1); - }; - - - /* - * Return a string representing the value of this BigNumber in fixed-point notation rounding - * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. - * - * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', - * but e.g. (-0.00001).toFixed(0) is '-0'. - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' - */ - P.toFixed = function (dp, rm) { - if (dp != null) { - intCheck(dp, 0, MAX); - dp = dp + this.e + 1; - } - return format(this, dp, rm); - }; - - - /* - * Return a string representing the value of this BigNumber in fixed-point notation rounded - * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties - * of the format or FORMAT object (see BigNumber.set). - * - * The formatting object may contain some or all of the properties shown below. - * - * FORMAT = { - * prefix: '', - * groupSize: 3, - * secondaryGroupSize: 0, - * groupSeparator: ',', - * decimalSeparator: '.', - * fractionGroupSize: 0, - * fractionGroupSeparator: '\xA0', // non-breaking space - * suffix: '' - * }; - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * [format] {object} Formatting options. See FORMAT pbject above. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' - * '[BigNumber Error] Argument not an object: {format}' - */ - P.toFormat = function (dp, rm, format) { - var str, - x = this; - - if (format == null) { - if (dp != null && rm && typeof rm == 'object') { - format = rm; - rm = null; - } else if (dp && typeof dp == 'object') { - format = dp; - dp = rm = null; - } else { - format = FORMAT; - } - } else if (typeof format != 'object') { - throw Error - (bignumberError + 'Argument not an object: ' + format); - } - - str = x.toFixed(dp, rm); - - if (x.c) { - var i, - arr = str.split('.'), - g1 = +format.groupSize, - g2 = +format.secondaryGroupSize, - groupSeparator = format.groupSeparator || '', - intPart = arr[0], - fractionPart = arr[1], - isNeg = x.s < 0, - intDigits = isNeg ? intPart.slice(1) : intPart, - len = intDigits.length; - - if (g2) i = g1, g1 = g2, g2 = i, len -= i; - - if (g1 > 0 && len > 0) { - i = len % g1 || g1; - intPart = intDigits.substr(0, i); - for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1); - if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); - if (isNeg) intPart = '-' + intPart; - } - - str = fractionPart - ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize) - ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), - '$&' + (format.fractionGroupSeparator || '')) - : fractionPart) - : intPart; - } - - return (format.prefix || '') + str + (format.suffix || ''); - }; - - - /* - * Return an array of two BigNumbers representing the value of this BigNumber as a simple - * fraction with an integer numerator and an integer denominator. - * The denominator will be a positive non-zero value less than or equal to the specified - * maximum denominator. If a maximum denominator is not specified, the denominator will be - * the lowest value necessary to represent the number exactly. - * - * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. - * - * '[BigNumber Error] Argument {not an integer|out of range} : {md}' - */ - P.toFraction = function (md) { - var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, - x = this, - xc = x.c; - - if (md != null) { - n = new BigNumber(md); - - // Throw if md is less than one or is not an integer, unless it is Infinity. - if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { - throw Error - (bignumberError + 'Argument ' + - (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n)); - } - } - - if (!xc) return new BigNumber(x); - - d = new BigNumber(ONE); - n1 = d0 = new BigNumber(ONE); - d1 = n0 = new BigNumber(ONE); - s = coeffToString(xc); - - // Determine initial denominator. - // d is a power of 10 and the minimum max denominator that specifies the value exactly. - e = d.e = s.length - x.e - 1; - d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; - md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; - - exp = MAX_EXP; - MAX_EXP = 1 / 0; - n = new BigNumber(s); - - // n0 = d1 = 0 - n0.c[0] = 0; - - for (; ;) { - q = div(n, d, 0, 1); - d2 = d0.plus(q.times(d1)); - if (d2.comparedTo(md) == 1) break; - d0 = d1; - d1 = d2; - n1 = n0.plus(q.times(d2 = n1)); - n0 = d2; - d = n.minus(q.times(d2 = d)); - n = d2; - } - - d2 = div(md.minus(d0), d1, 0, 1); - n0 = n0.plus(d2.times(n1)); - d0 = d0.plus(d2.times(d1)); - n0.s = n1.s = x.s; - e = e * 2; - - // Determine which fraction is closer to x, n0/d0 or n1/d1 - r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( - div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0]; - - MAX_EXP = exp; - - return r; - }; - - - /* - * Return the value of this BigNumber converted to a number primitive. - */ - P.toNumber = function () { - return +valueOf(this); - }; - - - /* - * Return a string representing the value of this BigNumber rounded to sd significant digits - * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits - * necessary to represent the integer part of the value in fixed-point notation, then use - * exponential notation. - * - * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' - */ - P.toPrecision = function (sd, rm) { - if (sd != null) intCheck(sd, 1, MAX); - return format(this, sd, rm, 2); - }; - - - /* - * Return a string representing the value of this BigNumber in base b, or base 10 if b is - * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and - * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent - * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than - * TO_EXP_NEG, return exponential notation. - * - * [b] {number} Integer, 2 to ALPHABET.length inclusive. - * - * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' - */ - P.toString = function (b) { - var str, - n = this, - s = n.s, - e = n.e; - - // Infinity or NaN? - if (e === null) { - if (s) { - str = 'Infinity'; - if (s < 0) str = '-' + str; - } else { - str = 'NaN'; - } - } else { - if (b == null) { - str = e <= TO_EXP_NEG || e >= TO_EXP_POS - ? toExponential(coeffToString(n.c), e) - : toFixedPoint(coeffToString(n.c), e, '0'); - } else if (b === 10) { - n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE); - str = toFixedPoint(coeffToString(n.c), n.e, '0'); - } else { - intCheck(b, 2, ALPHABET.length, 'Base'); - str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true); - } - - if (s < 0 && n.c[0]) str = '-' + str; - } - - return str; - }; - - - /* - * Return as toString, but do not accept a base argument, and include the minus sign for - * negative zero. - */ - P.valueOf = P.toJSON = function () { - return valueOf(this); - }; - - - P._isBigNumber = true; - - if (configObject != null) BigNumber.set(configObject); - - return BigNumber; - } - - - // PRIVATE HELPER FUNCTIONS - - // These functions don't need access to variables, - // e.g. DECIMAL_PLACES, in the scope of the `clone` function above. - - - function bitFloor(n) { - var i = n | 0; - return n > 0 || n === i ? i : i - 1; - } - - - // Return a coefficient array as a string of base 10 digits. - function coeffToString(a) { - var s, z, - i = 1, - j = a.length, - r = a[0] + ''; - - for (; i < j;) { - s = a[i++] + ''; - z = LOG_BASE - s.length; - for (; z--; s = '0' + s); - r += s; - } - - // Determine trailing zeros. - for (j = r.length; r.charCodeAt(--j) === 48;); - - return r.slice(0, j + 1 || 1); - } - - - // Compare the value of BigNumbers x and y. - function compare(x, y) { - var a, b, - xc = x.c, - yc = y.c, - i = x.s, - j = y.s, - k = x.e, - l = y.e; - - // Either NaN? - if (!i || !j) return null; - - a = xc && !xc[0]; - b = yc && !yc[0]; - - // Either zero? - if (a || b) return a ? b ? 0 : -j : i; - - // Signs differ? - if (i != j) return i; - - a = i < 0; - b = k == l; - - // Either Infinity? - if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; - - // Compare exponents. - if (!b) return k > l ^ a ? 1 : -1; - - j = (k = xc.length) < (l = yc.length) ? k : l; - - // Compare digit by digit. - for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; - - // Compare lengths. - return k == l ? 0 : k > l ^ a ? 1 : -1; - } - - - /* - * Check that n is a primitive number, an integer, and in range, otherwise throw. - */ - function intCheck(n, min, max, name) { - if (n < min || n > max || n !== mathfloor(n)) { - throw Error - (bignumberError + (name || 'Argument') + (typeof n == 'number' - ? n < min || n > max ? ' out of range: ' : ' not an integer: ' - : ' not a primitive number: ') + String(n)); - } - } - - - // Assumes finite n. - function isOdd(n) { - var k = n.c.length - 1; - return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; - } - - - function toExponential(str, e) { - return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + - (e < 0 ? 'e' : 'e+') + e; - } - - - function toFixedPoint(str, e, z) { - var len, zs; - - // Negative exponent? - if (e < 0) { - - // Prepend zeros. - for (zs = z + '.'; ++e; zs += z); - str = zs + str; - - // Positive exponent - } else { - len = str.length; - - // Append zeros. - if (++e > len) { - for (zs = z, e -= len; --e; zs += z); - str += zs; - } else if (e < len) { - str = str.slice(0, e) + '.' + str.slice(e); - } - } - - return str; - } - - - // EXPORT - - - BigNumber = clone(); - BigNumber['default'] = BigNumber.BigNumber = BigNumber; - - // AMD. - if (typeof define == 'function' && define.amd) { - define(function () { return BigNumber; }); - - // Node.js and other environments that support module.exports. - } else if (typeof module != 'undefined' && module.exports) { - module.exports = BigNumber; - - // Browser. - } else { - if (!globalObject) { - globalObject = typeof self != 'undefined' && self ? self : window; - } - - globalObject.BigNumber = BigNumber; - } -})(this); diff --git a/node_modules/bignumber.js/bignumber.min.js b/node_modules/bignumber.js/bignumber.min.js deleted file mode 100644 index 2610072..0000000 --- a/node_modules/bignumber.js/bignumber.min.js +++ /dev/null @@ -1 +0,0 @@ -/* bignumber.js v9.0.0 https://github.com/MikeMcl/bignumber.js/LICENCE */!function(e){"use strict";var r,x=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,L=Math.ceil,U=Math.floor,I="[BigNumber Error] ",T=I+"Number primitive has more than 15 significant digits: ",C=1e14,M=14,G=9007199254740991,k=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],F=1e7,q=1e9;function j(e){var r=0|e;return 0o[s]^n?1:-1;return u==l?0:l(t=e.length)){for(i=n,r-=t;--r;i+=n);e+=i}else ry?c.c=c.e=null:e.ey)c.c=c.e=null;else if(oy?e.c=e.e=null:e.c=n=a.length){if(!t)break e;for(;a.length<=l;a.push(0));u=c=0,s=(o%=M)-M+(i=1)}else{for(u=f=a[l],i=1;10<=f;f/=10,i++);c=(s=(o%=M)-M+i)<0?0:u/h[i-s-1]%10|0}if(t=t||r<0||null!=a[l+1]||(s<0?u:u%h[i-s-1]),t=n<4?(c||t)&&(0==n||n==(e.s<0?3:2)):5y?e.c=e.e=null:e.e>>11))?(n=crypto.getRandomValues(new Uint32Array(2)),r[s]=n[0],r[s+1]=n[1]):(f.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw b=!1,Error(I+"crypto unavailable");for(r=crypto.randomBytes(i*=7);sn-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}return function(e,r,n,t,i){var o,s,f,u,l,c,a,h,g=e.indexOf("."),p=N,w=O;for(0<=g&&(u=E,E=0,e=e.replace(".",""),c=(h=new B(r)).pow(e.length-g),E=u,h.c=m(X($(c.c),c.e,"0"),10,n,d),h.e=h.c.length),f=u=(a=m(e,r,n,i?(o=S,d):(o=d,S))).length;0==a[--u];a.pop());if(!a[0])return o.charAt(0);if(g<0?--f:(c.c=a,c.e=f,c.s=t,a=(c=v(c,h,p,w,n)).c,l=c.r,f=c.e),g=a[s=f+p+1],u=n/2,l=l||s<0||null!=a[s+1],l=w<4?(null!=g||l)&&(0==w||w==(c.s<0?3:2)):un;)a[s]=0,s||(++f,a=[1].concat(a));for(u=a.length;!a[--u];);for(g=0,e="";g<=u;e+=o.charAt(a[g++]));e=X(e,f,o.charAt(0))}return e}}(),v=function(){function S(e,r,n){var t,i,o,s,f=0,u=e.length,l=r%F,c=r/F|0;for(e=e.slice();u--;)f=((i=l*(o=e[u]%F)+(t=c*o+(s=e[u]/F|0)*l)%F*F+f)/n|0)+(t/F|0)+c*s,e[u]=i%n;return f&&(e=[f].concat(e)),e}function R(e,r,n,t){var i,o;if(n!=t)o=tr[i]?1:-1;break}return o}function _(e,r,n,t){for(var i=0;n--;)e[n]-=i,i=e[n](E[f]||0)&&s--,b<0)g.push(1),u=!0;else{for(v=E.length,O=A.length,b+=2,1<(l=U(i/(A[f=0]+1)))&&(A=S(A,l,i),E=S(E,l,i),O=A.length,v=E.length),m=O,w=(p=E.slice(0,O)).length;w=i/2&&N++;do{if(l=0,(o=R(A,p,O,w))<0){if(d=p[0],O!=w&&(d=d*i+(p[1]||0)),1<(l=U(d/N)))for(i<=l&&(l=i-1),a=(c=S(A,l,i)).length,w=p.length;1==R(c,p,a,w);)l--,_(c,Oo&&(l.c.length=o):t&&(l=l.mod(r))}if(i){if(0===(i=U(i/2)))break;u=i%2}else if(D(e=e.times(n),e.e+1,1),14o&&(c.c.length=o):t&&(c=c.mod(r))}return t?l:(f&&(l=w.div(l)),r?l.mod(r):o?D(l,E,O,void 0):l)},t.integerValue=function(e){var r=new B(this);return null==e?e=O:H(e,0,8),D(r,r.e+1,e)},t.isEqualTo=t.eq=function(e,r){return 0===z(this,new B(e,r))},t.isFinite=function(){return!!this.c},t.isGreaterThan=t.gt=function(e,r){return 0this.c.length-2},t.isLessThan=t.lt=function(e,r){return z(this,new B(e,r))<0},t.isLessThanOrEqualTo=t.lte=function(e,r){return-1===(r=z(this,new B(e,r)))||0===r},t.isNaN=function(){return!this.s},t.isNegative=function(){return this.s<0},t.isPositive=function(){return 0t&&(t=this.e+1),t},t.shiftedBy=function(e){return H(e,-G,G),this.times("1e"+e)},t.squareRoot=t.sqrt=function(){var e,r,n,t,i,o=this,s=o.c,f=o.s,u=o.e,l=N+4,c=new B("0.5");if(1!==f||!s||!s[0])return new B(!f||f<0&&(!s||s[0])?NaN:s?o:1/0);if((n=0==(f=Math.sqrt(+P(o)))||f==1/0?(((r=$(s)).length+u)%2==0&&(r+="0"),f=Math.sqrt(+r),u=j((u+1)/2)-(u<0||u%2),new B(r=f==1/0?"1e"+u:(r=f.toExponential()).slice(0,r.indexOf("e")+1)+u)):new B(f+"")).c[0])for((f=(u=n.e)+l)<3&&(f=0);;)if(i=n,n=c.times(i.plus(v(o,i,l,1))),$(i.c).slice(0,f)===(r=$(n.c)).slice(0,f)){if(n.e - * MIT Licensed. - * - * BigNumber.prototype methods | BigNumber methods - * | - * absoluteValue abs | clone - * comparedTo | config set - * decimalPlaces dp | DECIMAL_PLACES - * dividedBy div | ROUNDING_MODE - * dividedToIntegerBy idiv | EXPONENTIAL_AT - * exponentiatedBy pow | RANGE - * integerValue | CRYPTO - * isEqualTo eq | MODULO_MODE - * isFinite | POW_PRECISION - * isGreaterThan gt | FORMAT - * isGreaterThanOrEqualTo gte | ALPHABET - * isInteger | isBigNumber - * isLessThan lt | maximum max - * isLessThanOrEqualTo lte | minimum min - * isNaN | random - * isNegative | sum - * isPositive | - * isZero | - * minus | - * modulo mod | - * multipliedBy times | - * negated | - * plus | - * precision sd | - * shiftedBy | - * squareRoot sqrt | - * toExponential | - * toFixed | - * toFormat | - * toFraction | - * toJSON | - * toNumber | - * toPrecision | - * toString | - * valueOf | - * - */ - - -var - isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, - - mathceil = Math.ceil, - mathfloor = Math.floor, - - bignumberError = '[BigNumber Error] ', - tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ', - - BASE = 1e14, - LOG_BASE = 14, - MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1 - // MAX_INT32 = 0x7fffffff, // 2^31 - 1 - POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], - SQRT_BASE = 1e7, - - // EDITABLE - // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and - // the arguments to toExponential, toFixed, toFormat, and toPrecision. - MAX = 1E9; // 0 to MAX_INT32 - - -/* - * Create and return a BigNumber constructor. - */ -function clone(configObject) { - var div, convertBase, parseNumeric, - P = BigNumber.prototype = { constructor: BigNumber, toString: null, valueOf: null }, - ONE = new BigNumber(1), - - - //----------------------------- EDITABLE CONFIG DEFAULTS ------------------------------- - - - // The default values below must be integers within the inclusive ranges stated. - // The values can also be changed at run-time using BigNumber.set. - - // The maximum number of decimal places for operations involving division. - DECIMAL_PLACES = 20, // 0 to MAX - - // The rounding mode used when rounding to the above decimal places, and when using - // toExponential, toFixed, toFormat and toPrecision, and round (default value). - // UP 0 Away from zero. - // DOWN 1 Towards zero. - // CEIL 2 Towards +Infinity. - // FLOOR 3 Towards -Infinity. - // HALF_UP 4 Towards nearest neighbour. If equidistant, up. - // HALF_DOWN 5 Towards nearest neighbour. If equidistant, down. - // HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour. - // HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity. - // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity. - ROUNDING_MODE = 4, // 0 to 8 - - // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS] - - // The exponent value at and beneath which toString returns exponential notation. - // Number type: -7 - TO_EXP_NEG = -7, // 0 to -MAX - - // The exponent value at and above which toString returns exponential notation. - // Number type: 21 - TO_EXP_POS = 21, // 0 to MAX - - // RANGE : [MIN_EXP, MAX_EXP] - - // The minimum exponent value, beneath which underflow to zero occurs. - // Number type: -324 (5e-324) - MIN_EXP = -1e7, // -1 to -MAX - - // The maximum exponent value, above which overflow to Infinity occurs. - // Number type: 308 (1.7976931348623157e+308) - // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow. - MAX_EXP = 1e7, // 1 to MAX - - // Whether to use cryptographically-secure random number generation, if available. - CRYPTO = false, // true or false - - // The modulo mode used when calculating the modulus: a mod n. - // The quotient (q = a / n) is calculated according to the corresponding rounding mode. - // The remainder (r) is calculated as: r = a - n * q. - // - // UP 0 The remainder is positive if the dividend is negative, else is negative. - // DOWN 1 The remainder has the same sign as the dividend. - // This modulo mode is commonly known as 'truncated division' and is - // equivalent to (a % n) in JavaScript. - // FLOOR 3 The remainder has the same sign as the divisor (Python %). - // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function. - // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). - // The remainder is always positive. - // - // The truncated division, floored division, Euclidian division and IEEE 754 remainder - // modes are commonly used for the modulus operation. - // Although the other rounding modes can also be used, they may not give useful results. - MODULO_MODE = 1, // 0 to 9 - - // The maximum number of significant digits of the result of the exponentiatedBy operation. - // If POW_PRECISION is 0, there will be unlimited significant digits. - POW_PRECISION = 0, // 0 to MAX - - // The format specification used by the BigNumber.prototype.toFormat method. - FORMAT = { - prefix: '', - groupSize: 3, - secondaryGroupSize: 0, - groupSeparator: ',', - decimalSeparator: '.', - fractionGroupSize: 0, - fractionGroupSeparator: '\xA0', // non-breaking space - suffix: '' - }, - - // The alphabet used for base conversion. It must be at least 2 characters long, with no '+', - // '-', '.', whitespace, or repeated character. - // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' - ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz'; - - - //------------------------------------------------------------------------------------------ - - - // CONSTRUCTOR - - - /* - * The BigNumber constructor and exported function. - * Create and return a new instance of a BigNumber object. - * - * v {number|string|BigNumber} A numeric value. - * [b] {number} The base of v. Integer, 2 to ALPHABET.length inclusive. - */ - function BigNumber(v, b) { - var alphabet, c, caseChanged, e, i, isNum, len, str, - x = this; - - // Enable constructor call without `new`. - if (!(x instanceof BigNumber)) return new BigNumber(v, b); - - if (b == null) { - - if (v && v._isBigNumber === true) { - x.s = v.s; - - if (!v.c || v.e > MAX_EXP) { - x.c = x.e = null; - } else if (v.e < MIN_EXP) { - x.c = [x.e = 0]; - } else { - x.e = v.e; - x.c = v.c.slice(); - } - - return; - } - - if ((isNum = typeof v == 'number') && v * 0 == 0) { - - // Use `1 / n` to handle minus zero also. - x.s = 1 / v < 0 ? (v = -v, -1) : 1; - - // Fast path for integers, where n < 2147483648 (2**31). - if (v === ~~v) { - for (e = 0, i = v; i >= 10; i /= 10, e++); - - if (e > MAX_EXP) { - x.c = x.e = null; - } else { - x.e = e; - x.c = [v]; - } - - return; - } - - str = String(v); - } else { - - if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum); - - x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1; - } - - // Decimal point? - if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); - - // Exponential form? - if ((i = str.search(/e/i)) > 0) { - - // Determine exponent. - if (e < 0) e = i; - e += +str.slice(i + 1); - str = str.substring(0, i); - } else if (e < 0) { - - // Integer. - e = str.length; - } - - } else { - - // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' - intCheck(b, 2, ALPHABET.length, 'Base'); - - // Allow exponential notation to be used with base 10 argument, while - // also rounding to DECIMAL_PLACES as with other bases. - if (b == 10) { - x = new BigNumber(v); - return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE); - } - - str = String(v); - - if (isNum = typeof v == 'number') { - - // Avoid potential interpretation of Infinity and NaN as base 44+ values. - if (v * 0 != 0) return parseNumeric(x, str, isNum, b); - - x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1; - - // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' - if (BigNumber.DEBUG && str.replace(/^0\.0*|\./, '').length > 15) { - throw Error - (tooManyDigits + v); - } - } else { - x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1; - } - - alphabet = ALPHABET.slice(0, b); - e = i = 0; - - // Check that str is a valid base b number. - // Don't use RegExp, so alphabet can contain special characters. - for (len = str.length; i < len; i++) { - if (alphabet.indexOf(c = str.charAt(i)) < 0) { - if (c == '.') { - - // If '.' is not the first character and it has not be found before. - if (i > e) { - e = len; - continue; - } - } else if (!caseChanged) { - - // Allow e.g. hexadecimal 'FF' as well as 'ff'. - if (str == str.toUpperCase() && (str = str.toLowerCase()) || - str == str.toLowerCase() && (str = str.toUpperCase())) { - caseChanged = true; - i = -1; - e = 0; - continue; - } - } - - return parseNumeric(x, String(v), isNum, b); - } - } - - // Prevent later check for length on converted number. - isNum = false; - str = convertBase(str, b, 10, x.s); - - // Decimal point? - if ((e = str.indexOf('.')) > -1) str = str.replace('.', ''); - else e = str.length; - } - - // Determine leading zeros. - for (i = 0; str.charCodeAt(i) === 48; i++); - - // Determine trailing zeros. - for (len = str.length; str.charCodeAt(--len) === 48;); - - if (str = str.slice(i, ++len)) { - len -= i; - - // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}' - if (isNum && BigNumber.DEBUG && - len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) { - throw Error - (tooManyDigits + (x.s * v)); - } - - // Overflow? - if ((e = e - i - 1) > MAX_EXP) { - - // Infinity. - x.c = x.e = null; - - // Underflow? - } else if (e < MIN_EXP) { - - // Zero. - x.c = [x.e = 0]; - } else { - x.e = e; - x.c = []; - - // Transform base - - // e is the base 10 exponent. - // i is where to slice str to get the first element of the coefficient array. - i = (e + 1) % LOG_BASE; - if (e < 0) i += LOG_BASE; // i < 1 - - if (i < len) { - if (i) x.c.push(+str.slice(0, i)); - - for (len -= LOG_BASE; i < len;) { - x.c.push(+str.slice(i, i += LOG_BASE)); - } - - i = LOG_BASE - (str = str.slice(i)).length; - } else { - i -= len; - } - - for (; i--; str += '0'); - x.c.push(+str); - } - } else { - - // Zero. - x.c = [x.e = 0]; - } - } - - - // CONSTRUCTOR PROPERTIES - - - BigNumber.clone = clone; - - BigNumber.ROUND_UP = 0; - BigNumber.ROUND_DOWN = 1; - BigNumber.ROUND_CEIL = 2; - BigNumber.ROUND_FLOOR = 3; - BigNumber.ROUND_HALF_UP = 4; - BigNumber.ROUND_HALF_DOWN = 5; - BigNumber.ROUND_HALF_EVEN = 6; - BigNumber.ROUND_HALF_CEIL = 7; - BigNumber.ROUND_HALF_FLOOR = 8; - BigNumber.EUCLID = 9; - - - /* - * Configure infrequently-changing library-wide settings. - * - * Accept an object with the following optional properties (if the value of a property is - * a number, it must be an integer within the inclusive range stated): - * - * DECIMAL_PLACES {number} 0 to MAX - * ROUNDING_MODE {number} 0 to 8 - * EXPONENTIAL_AT {number|number[]} -MAX to MAX or [-MAX to 0, 0 to MAX] - * RANGE {number|number[]} -MAX to MAX (not zero) or [-MAX to -1, 1 to MAX] - * CRYPTO {boolean} true or false - * MODULO_MODE {number} 0 to 9 - * POW_PRECISION {number} 0 to MAX - * ALPHABET {string} A string of two or more unique characters which does - * not contain '.'. - * FORMAT {object} An object with some of the following properties: - * prefix {string} - * groupSize {number} - * secondaryGroupSize {number} - * groupSeparator {string} - * decimalSeparator {string} - * fractionGroupSize {number} - * fractionGroupSeparator {string} - * suffix {string} - * - * (The values assigned to the above FORMAT object properties are not checked for validity.) - * - * E.g. - * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 }) - * - * Ignore properties/parameters set to null or undefined, except for ALPHABET. - * - * Return an object with the properties current values. - */ - BigNumber.config = BigNumber.set = function (obj) { - var p, v; - - if (obj != null) { - - if (typeof obj == 'object') { - - // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive. - // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}' - if (obj.hasOwnProperty(p = 'DECIMAL_PLACES')) { - v = obj[p]; - intCheck(v, 0, MAX, p); - DECIMAL_PLACES = v; - } - - // ROUNDING_MODE {number} Integer, 0 to 8 inclusive. - // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}' - if (obj.hasOwnProperty(p = 'ROUNDING_MODE')) { - v = obj[p]; - intCheck(v, 0, 8, p); - ROUNDING_MODE = v; - } - - // EXPONENTIAL_AT {number|number[]} - // Integer, -MAX to MAX inclusive or - // [integer -MAX to 0 inclusive, 0 to MAX inclusive]. - // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}' - if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) { - v = obj[p]; - if (v && v.pop) { - intCheck(v[0], -MAX, 0, p); - intCheck(v[1], 0, MAX, p); - TO_EXP_NEG = v[0]; - TO_EXP_POS = v[1]; - } else { - intCheck(v, -MAX, MAX, p); - TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v); - } - } - - // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or - // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive]. - // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}' - if (obj.hasOwnProperty(p = 'RANGE')) { - v = obj[p]; - if (v && v.pop) { - intCheck(v[0], -MAX, -1, p); - intCheck(v[1], 1, MAX, p); - MIN_EXP = v[0]; - MAX_EXP = v[1]; - } else { - intCheck(v, -MAX, MAX, p); - if (v) { - MIN_EXP = -(MAX_EXP = v < 0 ? -v : v); - } else { - throw Error - (bignumberError + p + ' cannot be zero: ' + v); - } - } - } - - // CRYPTO {boolean} true or false. - // '[BigNumber Error] CRYPTO not true or false: {v}' - // '[BigNumber Error] crypto unavailable' - if (obj.hasOwnProperty(p = 'CRYPTO')) { - v = obj[p]; - if (v === !!v) { - if (v) { - if (typeof crypto != 'undefined' && crypto && - (crypto.getRandomValues || crypto.randomBytes)) { - CRYPTO = v; - } else { - CRYPTO = !v; - throw Error - (bignumberError + 'crypto unavailable'); - } - } else { - CRYPTO = v; - } - } else { - throw Error - (bignumberError + p + ' not true or false: ' + v); - } - } - - // MODULO_MODE {number} Integer, 0 to 9 inclusive. - // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}' - if (obj.hasOwnProperty(p = 'MODULO_MODE')) { - v = obj[p]; - intCheck(v, 0, 9, p); - MODULO_MODE = v; - } - - // POW_PRECISION {number} Integer, 0 to MAX inclusive. - // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}' - if (obj.hasOwnProperty(p = 'POW_PRECISION')) { - v = obj[p]; - intCheck(v, 0, MAX, p); - POW_PRECISION = v; - } - - // FORMAT {object} - // '[BigNumber Error] FORMAT not an object: {v}' - if (obj.hasOwnProperty(p = 'FORMAT')) { - v = obj[p]; - if (typeof v == 'object') FORMAT = v; - else throw Error - (bignumberError + p + ' not an object: ' + v); - } - - // ALPHABET {string} - // '[BigNumber Error] ALPHABET invalid: {v}' - if (obj.hasOwnProperty(p = 'ALPHABET')) { - v = obj[p]; - - // Disallow if only one character, - // or if it contains '+', '-', '.', whitespace, or a repeated character. - if (typeof v == 'string' && !/^.$|[+-.\s]|(.).*\1/.test(v)) { - ALPHABET = v; - } else { - throw Error - (bignumberError + p + ' invalid: ' + v); - } - } - - } else { - - // '[BigNumber Error] Object expected: {v}' - throw Error - (bignumberError + 'Object expected: ' + obj); - } - } - - return { - DECIMAL_PLACES: DECIMAL_PLACES, - ROUNDING_MODE: ROUNDING_MODE, - EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS], - RANGE: [MIN_EXP, MAX_EXP], - CRYPTO: CRYPTO, - MODULO_MODE: MODULO_MODE, - POW_PRECISION: POW_PRECISION, - FORMAT: FORMAT, - ALPHABET: ALPHABET - }; - }; - - - /* - * Return true if v is a BigNumber instance, otherwise return false. - * - * If BigNumber.DEBUG is true, throw if a BigNumber instance is not well-formed. - * - * v {any} - * - * '[BigNumber Error] Invalid BigNumber: {v}' - */ - BigNumber.isBigNumber = function (v) { - if (!v || v._isBigNumber !== true) return false; - if (!BigNumber.DEBUG) return true; - - var i, n, - c = v.c, - e = v.e, - s = v.s; - - out: if ({}.toString.call(c) == '[object Array]') { - - if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) { - - // If the first element is zero, the BigNumber value must be zero. - if (c[0] === 0) { - if (e === 0 && c.length === 1) return true; - break out; - } - - // Calculate number of digits that c[0] should have, based on the exponent. - i = (e + 1) % LOG_BASE; - if (i < 1) i += LOG_BASE; - - // Calculate number of digits of c[0]. - //if (Math.ceil(Math.log(c[0] + 1) / Math.LN10) == i) { - if (String(c[0]).length == i) { - - for (i = 0; i < c.length; i++) { - n = c[i]; - if (n < 0 || n >= BASE || n !== mathfloor(n)) break out; - } - - // Last element cannot be zero, unless it is the only element. - if (n !== 0) return true; - } - } - - // Infinity/NaN - } else if (c === null && e === null && (s === null || s === 1 || s === -1)) { - return true; - } - - throw Error - (bignumberError + 'Invalid BigNumber: ' + v); - }; - - - /* - * Return a new BigNumber whose value is the maximum of the arguments. - * - * arguments {number|string|BigNumber} - */ - BigNumber.maximum = BigNumber.max = function () { - return maxOrMin(arguments, P.lt); - }; - - - /* - * Return a new BigNumber whose value is the minimum of the arguments. - * - * arguments {number|string|BigNumber} - */ - BigNumber.minimum = BigNumber.min = function () { - return maxOrMin(arguments, P.gt); - }; - - - /* - * Return a new BigNumber with a random value equal to or greater than 0 and less than 1, - * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing - * zeros are produced). - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}' - * '[BigNumber Error] crypto unavailable' - */ - BigNumber.random = (function () { - var pow2_53 = 0x20000000000000; - - // Return a 53 bit integer n, where 0 <= n < 9007199254740992. - // Check if Math.random() produces more than 32 bits of randomness. - // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits. - // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1. - var random53bitInt = (Math.random() * pow2_53) & 0x1fffff - ? function () { return mathfloor(Math.random() * pow2_53); } - : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) + - (Math.random() * 0x800000 | 0); }; - - return function (dp) { - var a, b, e, k, v, - i = 0, - c = [], - rand = new BigNumber(ONE); - - if (dp == null) dp = DECIMAL_PLACES; - else intCheck(dp, 0, MAX); - - k = mathceil(dp / LOG_BASE); - - if (CRYPTO) { - - // Browsers supporting crypto.getRandomValues. - if (crypto.getRandomValues) { - - a = crypto.getRandomValues(new Uint32Array(k *= 2)); - - for (; i < k;) { - - // 53 bits: - // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2) - // 11111 11111111 11111111 11111111 11100000 00000000 00000000 - // ((Math.pow(2, 32) - 1) >>> 11).toString(2) - // 11111 11111111 11111111 - // 0x20000 is 2^21. - v = a[i] * 0x20000 + (a[i + 1] >>> 11); - - // Rejection sampling: - // 0 <= v < 9007199254740992 - // Probability that v >= 9e15, is - // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251 - if (v >= 9e15) { - b = crypto.getRandomValues(new Uint32Array(2)); - a[i] = b[0]; - a[i + 1] = b[1]; - } else { - - // 0 <= v <= 8999999999999999 - // 0 <= (v % 1e14) <= 99999999999999 - c.push(v % 1e14); - i += 2; - } - } - i = k / 2; - - // Node.js supporting crypto.randomBytes. - } else if (crypto.randomBytes) { - - // buffer - a = crypto.randomBytes(k *= 7); - - for (; i < k;) { - - // 0x1000000000000 is 2^48, 0x10000000000 is 2^40 - // 0x100000000 is 2^32, 0x1000000 is 2^24 - // 11111 11111111 11111111 11111111 11111111 11111111 11111111 - // 0 <= v < 9007199254740992 - v = ((a[i] & 31) * 0x1000000000000) + (a[i + 1] * 0x10000000000) + - (a[i + 2] * 0x100000000) + (a[i + 3] * 0x1000000) + - (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6]; - - if (v >= 9e15) { - crypto.randomBytes(7).copy(a, i); - } else { - - // 0 <= (v % 1e14) <= 99999999999999 - c.push(v % 1e14); - i += 7; - } - } - i = k / 7; - } else { - CRYPTO = false; - throw Error - (bignumberError + 'crypto unavailable'); - } - } - - // Use Math.random. - if (!CRYPTO) { - - for (; i < k;) { - v = random53bitInt(); - if (v < 9e15) c[i++] = v % 1e14; - } - } - - k = c[--i]; - dp %= LOG_BASE; - - // Convert trailing digits to zeros according to dp. - if (k && dp) { - v = POWS_TEN[LOG_BASE - dp]; - c[i] = mathfloor(k / v) * v; - } - - // Remove trailing elements which are zero. - for (; c[i] === 0; c.pop(), i--); - - // Zero? - if (i < 0) { - c = [e = 0]; - } else { - - // Remove leading elements which are zero and adjust exponent accordingly. - for (e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE); - - // Count the digits of the first element of c to determine leading zeros, and... - for (i = 1, v = c[0]; v >= 10; v /= 10, i++); - - // adjust the exponent accordingly. - if (i < LOG_BASE) e -= LOG_BASE - i; - } - - rand.e = e; - rand.c = c; - return rand; - }; - })(); - - - /* - * Return a BigNumber whose value is the sum of the arguments. - * - * arguments {number|string|BigNumber} - */ - BigNumber.sum = function () { - var i = 1, - args = arguments, - sum = new BigNumber(args[0]); - for (; i < args.length;) sum = sum.plus(args[i++]); - return sum; - }; - - - // PRIVATE FUNCTIONS - - - // Called by BigNumber and BigNumber.prototype.toString. - convertBase = (function () { - var decimal = '0123456789'; - - /* - * Convert string of baseIn to an array of numbers of baseOut. - * Eg. toBaseOut('255', 10, 16) returns [15, 15]. - * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5]. - */ - function toBaseOut(str, baseIn, baseOut, alphabet) { - var j, - arr = [0], - arrL, - i = 0, - len = str.length; - - for (; i < len;) { - for (arrL = arr.length; arrL--; arr[arrL] *= baseIn); - - arr[0] += alphabet.indexOf(str.charAt(i++)); - - for (j = 0; j < arr.length; j++) { - - if (arr[j] > baseOut - 1) { - if (arr[j + 1] == null) arr[j + 1] = 0; - arr[j + 1] += arr[j] / baseOut | 0; - arr[j] %= baseOut; - } - } - } - - return arr.reverse(); - } - - // Convert a numeric string of baseIn to a numeric string of baseOut. - // If the caller is toString, we are converting from base 10 to baseOut. - // If the caller is BigNumber, we are converting from baseIn to base 10. - return function (str, baseIn, baseOut, sign, callerIsToString) { - var alphabet, d, e, k, r, x, xc, y, - i = str.indexOf('.'), - dp = DECIMAL_PLACES, - rm = ROUNDING_MODE; - - // Non-integer. - if (i >= 0) { - k = POW_PRECISION; - - // Unlimited precision. - POW_PRECISION = 0; - str = str.replace('.', ''); - y = new BigNumber(baseIn); - x = y.pow(str.length - i); - POW_PRECISION = k; - - // Convert str as if an integer, then restore the fraction part by dividing the - // result by its base raised to a power. - - y.c = toBaseOut(toFixedPoint(coeffToString(x.c), x.e, '0'), - 10, baseOut, decimal); - y.e = y.c.length; - } - - // Convert the number as integer. - - xc = toBaseOut(str, baseIn, baseOut, callerIsToString - ? (alphabet = ALPHABET, decimal) - : (alphabet = decimal, ALPHABET)); - - // xc now represents str as an integer and converted to baseOut. e is the exponent. - e = k = xc.length; - - // Remove trailing zeros. - for (; xc[--k] == 0; xc.pop()); - - // Zero? - if (!xc[0]) return alphabet.charAt(0); - - // Does str represent an integer? If so, no need for the division. - if (i < 0) { - --e; - } else { - x.c = xc; - x.e = e; - - // The sign is needed for correct rounding. - x.s = sign; - x = div(x, y, dp, rm, baseOut); - xc = x.c; - r = x.r; - e = x.e; - } - - // xc now represents str converted to baseOut. - - // THe index of the rounding digit. - d = e + dp + 1; - - // The rounding digit: the digit to the right of the digit that may be rounded up. - i = xc[d]; - - // Look at the rounding digits and mode to determine whether to round up. - - k = baseOut / 2; - r = r || d < 0 || xc[d + 1] != null; - - r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) - : i > k || i == k &&(rm == 4 || r || rm == 6 && xc[d - 1] & 1 || - rm == (x.s < 0 ? 8 : 7)); - - // If the index of the rounding digit is not greater than zero, or xc represents - // zero, then the result of the base conversion is zero or, if rounding up, a value - // such as 0.00001. - if (d < 1 || !xc[0]) { - - // 1^-dp or 0 - str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0); - } else { - - // Truncate xc to the required number of decimal places. - xc.length = d; - - // Round up? - if (r) { - - // Rounding up may mean the previous digit has to be rounded up and so on. - for (--baseOut; ++xc[--d] > baseOut;) { - xc[d] = 0; - - if (!d) { - ++e; - xc = [1].concat(xc); - } - } - } - - // Determine trailing zeros. - for (k = xc.length; !xc[--k];); - - // E.g. [4, 11, 15] becomes 4bf. - for (i = 0, str = ''; i <= k; str += alphabet.charAt(xc[i++])); - - // Add leading zeros, decimal point and trailing zeros as required. - str = toFixedPoint(str, e, alphabet.charAt(0)); - } - - // The caller will add the sign. - return str; - }; - })(); - - - // Perform division in the specified base. Called by div and convertBase. - div = (function () { - - // Assume non-zero x and k. - function multiply(x, k, base) { - var m, temp, xlo, xhi, - carry = 0, - i = x.length, - klo = k % SQRT_BASE, - khi = k / SQRT_BASE | 0; - - for (x = x.slice(); i--;) { - xlo = x[i] % SQRT_BASE; - xhi = x[i] / SQRT_BASE | 0; - m = khi * xlo + xhi * klo; - temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry; - carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi; - x[i] = temp % base; - } - - if (carry) x = [carry].concat(x); - - return x; - } - - function compare(a, b, aL, bL) { - var i, cmp; - - if (aL != bL) { - cmp = aL > bL ? 1 : -1; - } else { - - for (i = cmp = 0; i < aL; i++) { - - if (a[i] != b[i]) { - cmp = a[i] > b[i] ? 1 : -1; - break; - } - } - } - - return cmp; - } - - function subtract(a, b, aL, base) { - var i = 0; - - // Subtract b from a. - for (; aL--;) { - a[aL] -= i; - i = a[aL] < b[aL] ? 1 : 0; - a[aL] = i * base + a[aL] - b[aL]; - } - - // Remove leading zeros. - for (; !a[0] && a.length > 1; a.splice(0, 1)); - } - - // x: dividend, y: divisor. - return function (x, y, dp, rm, base) { - var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, - yL, yz, - s = x.s == y.s ? 1 : -1, - xc = x.c, - yc = y.c; - - // Either NaN, Infinity or 0? - if (!xc || !xc[0] || !yc || !yc[0]) { - - return new BigNumber( - - // Return NaN if either NaN, or both Infinity or 0. - !x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : - - // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0. - xc && xc[0] == 0 || !yc ? s * 0 : s / 0 - ); - } - - q = new BigNumber(s); - qc = q.c = []; - e = x.e - y.e; - s = dp + e + 1; - - if (!base) { - base = BASE; - e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE); - s = s / LOG_BASE | 0; - } - - // Result exponent may be one less then the current value of e. - // The coefficients of the BigNumbers from convertBase may have trailing zeros. - for (i = 0; yc[i] == (xc[i] || 0); i++); - - if (yc[i] > (xc[i] || 0)) e--; - - if (s < 0) { - qc.push(1); - more = true; - } else { - xL = xc.length; - yL = yc.length; - i = 0; - s += 2; - - // Normalise xc and yc so highest order digit of yc is >= base / 2. - - n = mathfloor(base / (yc[0] + 1)); - - // Not necessary, but to handle odd bases where yc[0] == (base / 2) - 1. - // if (n > 1 || n++ == 1 && yc[0] < base / 2) { - if (n > 1) { - yc = multiply(yc, n, base); - xc = multiply(xc, n, base); - yL = yc.length; - xL = xc.length; - } - - xi = yL; - rem = xc.slice(0, yL); - remL = rem.length; - - // Add zeros to make remainder as long as divisor. - for (; remL < yL; rem[remL++] = 0); - yz = yc.slice(); - yz = [0].concat(yz); - yc0 = yc[0]; - if (yc[1] >= base / 2) yc0++; - // Not necessary, but to prevent trial digit n > base, when using base 3. - // else if (base == 3 && yc0 == 1) yc0 = 1 + 1e-15; - - do { - n = 0; - - // Compare divisor and remainder. - cmp = compare(yc, rem, yL, remL); - - // If divisor < remainder. - if (cmp < 0) { - - // Calculate trial digit, n. - - rem0 = rem[0]; - if (yL != remL) rem0 = rem0 * base + (rem[1] || 0); - - // n is how many times the divisor goes into the current remainder. - n = mathfloor(rem0 / yc0); - - // Algorithm: - // product = divisor multiplied by trial digit (n). - // Compare product and remainder. - // If product is greater than remainder: - // Subtract divisor from product, decrement trial digit. - // Subtract product from remainder. - // If product was less than remainder at the last compare: - // Compare new remainder and divisor. - // If remainder is greater than divisor: - // Subtract divisor from remainder, increment trial digit. - - if (n > 1) { - - // n may be > base only when base is 3. - if (n >= base) n = base - 1; - - // product = divisor * trial digit. - prod = multiply(yc, n, base); - prodL = prod.length; - remL = rem.length; - - // Compare product and remainder. - // If product > remainder then trial digit n too high. - // n is 1 too high about 5% of the time, and is not known to have - // ever been more than 1 too high. - while (compare(prod, rem, prodL, remL) == 1) { - n--; - - // Subtract divisor from product. - subtract(prod, yL < prodL ? yz : yc, prodL, base); - prodL = prod.length; - cmp = 1; - } - } else { - - // n is 0 or 1, cmp is -1. - // If n is 0, there is no need to compare yc and rem again below, - // so change cmp to 1 to avoid it. - // If n is 1, leave cmp as -1, so yc and rem are compared again. - if (n == 0) { - - // divisor < remainder, so n must be at least 1. - cmp = n = 1; - } - - // product = divisor - prod = yc.slice(); - prodL = prod.length; - } - - if (prodL < remL) prod = [0].concat(prod); - - // Subtract product from remainder. - subtract(rem, prod, remL, base); - remL = rem.length; - - // If product was < remainder. - if (cmp == -1) { - - // Compare divisor and new remainder. - // If divisor < new remainder, subtract divisor from remainder. - // Trial digit n too low. - // n is 1 too low about 5% of the time, and very rarely 2 too low. - while (compare(yc, rem, yL, remL) < 1) { - n++; - - // Subtract divisor from remainder. - subtract(rem, yL < remL ? yz : yc, remL, base); - remL = rem.length; - } - } - } else if (cmp === 0) { - n++; - rem = [0]; - } // else cmp === 1 and n will be 0 - - // Add the next digit, n, to the result array. - qc[i++] = n; - - // Update the remainder. - if (rem[0]) { - rem[remL++] = xc[xi] || 0; - } else { - rem = [xc[xi]]; - remL = 1; - } - } while ((xi++ < xL || rem[0] != null) && s--); - - more = rem[0] != null; - - // Leading zero? - if (!qc[0]) qc.splice(0, 1); - } - - if (base == BASE) { - - // To calculate q.e, first get the number of digits of qc[0]. - for (i = 1, s = qc[0]; s >= 10; s /= 10, i++); - - round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more); - - // Caller is convertBase. - } else { - q.e = e; - q.r = +more; - } - - return q; - }; - })(); - - - /* - * Return a string representing the value of BigNumber n in fixed-point or exponential - * notation rounded to the specified decimal places or significant digits. - * - * n: a BigNumber. - * i: the index of the last digit required (i.e. the digit that may be rounded up). - * rm: the rounding mode. - * id: 1 (toExponential) or 2 (toPrecision). - */ - function format(n, i, rm, id) { - var c0, e, ne, len, str; - - if (rm == null) rm = ROUNDING_MODE; - else intCheck(rm, 0, 8); - - if (!n.c) return n.toString(); - - c0 = n.c[0]; - ne = n.e; - - if (i == null) { - str = coeffToString(n.c); - str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) - ? toExponential(str, ne) - : toFixedPoint(str, ne, '0'); - } else { - n = round(new BigNumber(n), i, rm); - - // n.e may have changed if the value was rounded up. - e = n.e; - - str = coeffToString(n.c); - len = str.length; - - // toPrecision returns exponential notation if the number of significant digits - // specified is less than the number of digits necessary to represent the integer - // part of the value in fixed-point notation. - - // Exponential notation. - if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) { - - // Append zeros? - for (; len < i; str += '0', len++); - str = toExponential(str, e); - - // Fixed-point notation. - } else { - i -= ne; - str = toFixedPoint(str, e, '0'); - - // Append zeros? - if (e + 1 > len) { - if (--i > 0) for (str += '.'; i--; str += '0'); - } else { - i += e - len; - if (i > 0) { - if (e + 1 == len) str += '.'; - for (; i--; str += '0'); - } - } - } - } - - return n.s < 0 && c0 ? '-' + str : str; - } - - - // Handle BigNumber.max and BigNumber.min. - function maxOrMin(args, method) { - var n, - i = 1, - m = new BigNumber(args[0]); - - for (; i < args.length; i++) { - n = new BigNumber(args[i]); - - // If any number is NaN, return NaN. - if (!n.s) { - m = n; - break; - } else if (method.call(m, n)) { - m = n; - } - } - - return m; - } - - - /* - * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. - * Called by minus, plus and times. - */ - function normalise(n, c, e) { - var i = 1, - j = c.length; - - // Remove trailing zeros. - for (; !c[--j]; c.pop()); - - // Calculate the base 10 exponent. First get the number of digits of c[0]. - for (j = c[0]; j >= 10; j /= 10, i++); - - // Overflow? - if ((e = i + e * LOG_BASE - 1) > MAX_EXP) { - - // Infinity. - n.c = n.e = null; - - // Underflow? - } else if (e < MIN_EXP) { - - // Zero. - n.c = [n.e = 0]; - } else { - n.e = e; - n.c = c; - } - - return n; - } - - - // Handle values that fail the validity test in BigNumber. - parseNumeric = (function () { - var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, - dotAfter = /^([^.]+)\.$/, - dotBefore = /^\.([^.]+)$/, - isInfinityOrNaN = /^-?(Infinity|NaN)$/, - whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g; - - return function (x, str, isNum, b) { - var base, - s = isNum ? str : str.replace(whitespaceOrPlus, ''); - - // No exception on ±Infinity or NaN. - if (isInfinityOrNaN.test(s)) { - x.s = isNaN(s) ? null : s < 0 ? -1 : 1; - } else { - if (!isNum) { - - // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i - s = s.replace(basePrefix, function (m, p1, p2) { - base = (p2 = p2.toLowerCase()) == 'x' ? 16 : p2 == 'b' ? 2 : 8; - return !b || b == base ? p1 : m; - }); - - if (b) { - base = b; - - // E.g. '1.' to '1', '.1' to '0.1' - s = s.replace(dotAfter, '$1').replace(dotBefore, '0.$1'); - } - - if (str != s) return new BigNumber(s, base); - } - - // '[BigNumber Error] Not a number: {n}' - // '[BigNumber Error] Not a base {b} number: {n}' - if (BigNumber.DEBUG) { - throw Error - (bignumberError + 'Not a' + (b ? ' base ' + b : '') + ' number: ' + str); - } - - // NaN - x.s = null; - } - - x.c = x.e = null; - } - })(); - - - /* - * Round x to sd significant digits using rounding mode rm. Check for over/under-flow. - * If r is truthy, it is known that there are more digits after the rounding digit. - */ - function round(x, sd, rm, r) { - var d, i, j, k, n, ni, rd, - xc = x.c, - pows10 = POWS_TEN; - - // if x is not Infinity or NaN... - if (xc) { - - // rd is the rounding digit, i.e. the digit after the digit that may be rounded up. - // n is a base 1e14 number, the value of the element of array x.c containing rd. - // ni is the index of n within x.c. - // d is the number of digits of n. - // i is the index of rd within n including leading zeros. - // j is the actual index of rd within n (if < 0, rd is a leading zero). - out: { - - // Get the number of digits of the first element of xc. - for (d = 1, k = xc[0]; k >= 10; k /= 10, d++); - i = sd - d; - - // If the rounding digit is in the first element of xc... - if (i < 0) { - i += LOG_BASE; - j = sd; - n = xc[ni = 0]; - - // Get the rounding digit at index j of n. - rd = n / pows10[d - j - 1] % 10 | 0; - } else { - ni = mathceil((i + 1) / LOG_BASE); - - if (ni >= xc.length) { - - if (r) { - - // Needed by sqrt. - for (; xc.length <= ni; xc.push(0)); - n = rd = 0; - d = 1; - i %= LOG_BASE; - j = i - LOG_BASE + 1; - } else { - break out; - } - } else { - n = k = xc[ni]; - - // Get the number of digits of n. - for (d = 1; k >= 10; k /= 10, d++); - - // Get the index of rd within n. - i %= LOG_BASE; - - // Get the index of rd within n, adjusted for leading zeros. - // The number of leading zeros of n is given by LOG_BASE - d. - j = i - LOG_BASE + d; - - // Get the rounding digit at index j of n. - rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10 | 0; - } - } - - r = r || sd < 0 || - - // Are there any non-zero digits after the rounding digit? - // The expression n % pows10[d - j - 1] returns all digits of n to the right - // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714. - xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]); - - r = rm < 4 - ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) - : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && - - // Check whether the digit to the left of the rounding digit is odd. - ((i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10) & 1 || - rm == (x.s < 0 ? 8 : 7)); - - if (sd < 1 || !xc[0]) { - xc.length = 0; - - if (r) { - - // Convert sd to decimal places. - sd -= x.e + 1; - - // 1, 0.1, 0.01, 0.001, 0.0001 etc. - xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE]; - x.e = -sd || 0; - } else { - - // Zero. - xc[0] = x.e = 0; - } - - return x; - } - - // Remove excess digits. - if (i == 0) { - xc.length = ni; - k = 1; - ni--; - } else { - xc.length = ni + 1; - k = pows10[LOG_BASE - i]; - - // E.g. 56700 becomes 56000 if 7 is the rounding digit. - // j > 0 means i > number of leading zeros of n. - xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0; - } - - // Round up? - if (r) { - - for (; ;) { - - // If the digit to be rounded up is in the first element of xc... - if (ni == 0) { - - // i will be the length of xc[0] before k is added. - for (i = 1, j = xc[0]; j >= 10; j /= 10, i++); - j = xc[0] += k; - for (k = 1; j >= 10; j /= 10, k++); - - // if i != k the length has increased. - if (i != k) { - x.e++; - if (xc[0] == BASE) xc[0] = 1; - } - - break; - } else { - xc[ni] += k; - if (xc[ni] != BASE) break; - xc[ni--] = 0; - k = 1; - } - } - } - - // Remove trailing zeros. - for (i = xc.length; xc[--i] === 0; xc.pop()); - } - - // Overflow? Infinity. - if (x.e > MAX_EXP) { - x.c = x.e = null; - - // Underflow? Zero. - } else if (x.e < MIN_EXP) { - x.c = [x.e = 0]; - } - } - - return x; - } - - - function valueOf(n) { - var str, - e = n.e; - - if (e === null) return n.toString(); - - str = coeffToString(n.c); - - str = e <= TO_EXP_NEG || e >= TO_EXP_POS - ? toExponential(str, e) - : toFixedPoint(str, e, '0'); - - return n.s < 0 ? '-' + str : str; - } - - - // PROTOTYPE/INSTANCE METHODS - - - /* - * Return a new BigNumber whose value is the absolute value of this BigNumber. - */ - P.absoluteValue = P.abs = function () { - var x = new BigNumber(this); - if (x.s < 0) x.s = 1; - return x; - }; - - - /* - * Return - * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b), - * -1 if the value of this BigNumber is less than the value of BigNumber(y, b), - * 0 if they have the same value, - * or null if the value of either is NaN. - */ - P.comparedTo = function (y, b) { - return compare(this, new BigNumber(y, b)); - }; - - - /* - * If dp is undefined or null or true or false, return the number of decimal places of the - * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. - * - * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this - * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or - * ROUNDING_MODE if rm is omitted. - * - * [dp] {number} Decimal places: integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' - */ - P.decimalPlaces = P.dp = function (dp, rm) { - var c, n, v, - x = this; - - if (dp != null) { - intCheck(dp, 0, MAX); - if (rm == null) rm = ROUNDING_MODE; - else intCheck(rm, 0, 8); - - return round(new BigNumber(x), dp + x.e + 1, rm); - } - - if (!(c = x.c)) return null; - n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE; - - // Subtract the number of trailing zeros of the last number. - if (v = c[v]) for (; v % 10 == 0; v /= 10, n--); - if (n < 0) n = 0; - - return n; - }; - - - /* - * n / 0 = I - * n / N = N - * n / I = 0 - * 0 / n = 0 - * 0 / 0 = N - * 0 / N = N - * 0 / I = 0 - * N / n = N - * N / 0 = N - * N / N = N - * N / I = N - * I / n = I - * I / 0 = I - * I / N = N - * I / I = N - * - * Return a new BigNumber whose value is the value of this BigNumber divided by the value of - * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE. - */ - P.dividedBy = P.div = function (y, b) { - return div(this, new BigNumber(y, b), DECIMAL_PLACES, ROUNDING_MODE); - }; - - - /* - * Return a new BigNumber whose value is the integer part of dividing the value of this - * BigNumber by the value of BigNumber(y, b). - */ - P.dividedToIntegerBy = P.idiv = function (y, b) { - return div(this, new BigNumber(y, b), 0, 1); - }; - - - /* - * Return a BigNumber whose value is the value of this BigNumber exponentiated by n. - * - * If m is present, return the result modulo m. - * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE. - * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE. - * - * The modular power operation works efficiently when x, n, and m are integers, otherwise it - * is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0. - * - * n {number|string|BigNumber} The exponent. An integer. - * [m] {number|string|BigNumber} The modulus. - * - * '[BigNumber Error] Exponent not an integer: {n}' - */ - P.exponentiatedBy = P.pow = function (n, m) { - var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, - x = this; - - n = new BigNumber(n); - - // Allow NaN and ±Infinity, but not other non-integers. - if (n.c && !n.isInteger()) { - throw Error - (bignumberError + 'Exponent not an integer: ' + valueOf(n)); - } - - if (m != null) m = new BigNumber(m); - - // Exponent of MAX_SAFE_INTEGER is 15. - nIsBig = n.e > 14; - - // If x is NaN, ±Infinity, ±0 or ±1, or n is ±Infinity, NaN or ±0. - if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) { - - // The sign of the result of pow when x is negative depends on the evenness of n. - // If +n overflows to ±Infinity, the evenness of n would be not be known. - y = new BigNumber(Math.pow(+valueOf(x), nIsBig ? 2 - isOdd(n) : +valueOf(n))); - return m ? y.mod(m) : y; - } - - nIsNeg = n.s < 0; - - if (m) { - - // x % m returns NaN if abs(m) is zero, or m is NaN. - if (m.c ? !m.c[0] : !m.s) return new BigNumber(NaN); - - isModExp = !nIsNeg && x.isInteger() && m.isInteger(); - - if (isModExp) x = x.mod(m); - - // Overflow to ±Infinity: >=2**1e10 or >=1.0000024**1e15. - // Underflow to ±0: <=0.79**1e10 or <=0.9999975**1e15. - } else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 - // [1, 240000000] - ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 - // [80000000000000] [99999750000000] - : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) { - - // If x is negative and n is odd, k = -0, else k = 0. - k = x.s < 0 && isOdd(n) ? -0 : 0; - - // If x >= 1, k = ±Infinity. - if (x.e > -1) k = 1 / k; - - // If n is negative return ±0, else return ±Infinity. - return new BigNumber(nIsNeg ? 1 / k : k); - - } else if (POW_PRECISION) { - - // Truncating each coefficient array to a length of k after each multiplication - // equates to truncating significant digits to POW_PRECISION + [28, 41], - // i.e. there will be a minimum of 28 guard digits retained. - k = mathceil(POW_PRECISION / LOG_BASE + 2); - } - - if (nIsBig) { - half = new BigNumber(0.5); - if (nIsNeg) n.s = 1; - nIsOdd = isOdd(n); - } else { - i = Math.abs(+valueOf(n)); - nIsOdd = i % 2; - } - - y = new BigNumber(ONE); - - // Performs 54 loop iterations for n of 9007199254740991. - for (; ;) { - - if (nIsOdd) { - y = y.times(x); - if (!y.c) break; - - if (k) { - if (y.c.length > k) y.c.length = k; - } else if (isModExp) { - y = y.mod(m); //y = y.minus(div(y, m, 0, MODULO_MODE).times(m)); - } - } - - if (i) { - i = mathfloor(i / 2); - if (i === 0) break; - nIsOdd = i % 2; - } else { - n = n.times(half); - round(n, n.e + 1, 1); - - if (n.e > 14) { - nIsOdd = isOdd(n); - } else { - i = +valueOf(n); - if (i === 0) break; - nIsOdd = i % 2; - } - } - - x = x.times(x); - - if (k) { - if (x.c && x.c.length > k) x.c.length = k; - } else if (isModExp) { - x = x.mod(m); //x = x.minus(div(x, m, 0, MODULO_MODE).times(m)); - } - } - - if (isModExp) return y; - if (nIsNeg) y = ONE.div(y); - - return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y; - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer - * using rounding mode rm, or ROUNDING_MODE if rm is omitted. - * - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}' - */ - P.integerValue = function (rm) { - var n = new BigNumber(this); - if (rm == null) rm = ROUNDING_MODE; - else intCheck(rm, 0, 8); - return round(n, n.e + 1, rm); - }; - - - /* - * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b), - * otherwise return false. - */ - P.isEqualTo = P.eq = function (y, b) { - return compare(this, new BigNumber(y, b)) === 0; - }; - - - /* - * Return true if the value of this BigNumber is a finite number, otherwise return false. - */ - P.isFinite = function () { - return !!this.c; - }; - - - /* - * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b), - * otherwise return false. - */ - P.isGreaterThan = P.gt = function (y, b) { - return compare(this, new BigNumber(y, b)) > 0; - }; - - - /* - * Return true if the value of this BigNumber is greater than or equal to the value of - * BigNumber(y, b), otherwise return false. - */ - P.isGreaterThanOrEqualTo = P.gte = function (y, b) { - return (b = compare(this, new BigNumber(y, b))) === 1 || b === 0; - - }; - - - /* - * Return true if the value of this BigNumber is an integer, otherwise return false. - */ - P.isInteger = function () { - return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2; - }; - - - /* - * Return true if the value of this BigNumber is less than the value of BigNumber(y, b), - * otherwise return false. - */ - P.isLessThan = P.lt = function (y, b) { - return compare(this, new BigNumber(y, b)) < 0; - }; - - - /* - * Return true if the value of this BigNumber is less than or equal to the value of - * BigNumber(y, b), otherwise return false. - */ - P.isLessThanOrEqualTo = P.lte = function (y, b) { - return (b = compare(this, new BigNumber(y, b))) === -1 || b === 0; - }; - - - /* - * Return true if the value of this BigNumber is NaN, otherwise return false. - */ - P.isNaN = function () { - return !this.s; - }; - - - /* - * Return true if the value of this BigNumber is negative, otherwise return false. - */ - P.isNegative = function () { - return this.s < 0; - }; - - - /* - * Return true if the value of this BigNumber is positive, otherwise return false. - */ - P.isPositive = function () { - return this.s > 0; - }; - - - /* - * Return true if the value of this BigNumber is 0 or -0, otherwise return false. - */ - P.isZero = function () { - return !!this.c && this.c[0] == 0; - }; - - - /* - * n - 0 = n - * n - N = N - * n - I = -I - * 0 - n = -n - * 0 - 0 = 0 - * 0 - N = N - * 0 - I = -I - * N - n = N - * N - 0 = N - * N - N = N - * N - I = N - * I - n = I - * I - 0 = I - * I - N = N - * I - I = N - * - * Return a new BigNumber whose value is the value of this BigNumber minus the value of - * BigNumber(y, b). - */ - P.minus = function (y, b) { - var i, j, t, xLTy, - x = this, - a = x.s; - - y = new BigNumber(y, b); - b = y.s; - - // Either NaN? - if (!a || !b) return new BigNumber(NaN); - - // Signs differ? - if (a != b) { - y.s = -b; - return x.plus(y); - } - - var xe = x.e / LOG_BASE, - ye = y.e / LOG_BASE, - xc = x.c, - yc = y.c; - - if (!xe || !ye) { - - // Either Infinity? - if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber(yc ? x : NaN); - - // Either zero? - if (!xc[0] || !yc[0]) { - - // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. - return yc[0] ? (y.s = -b, y) : new BigNumber(xc[0] ? x : - - // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity - ROUNDING_MODE == 3 ? -0 : 0); - } - } - - xe = bitFloor(xe); - ye = bitFloor(ye); - xc = xc.slice(); - - // Determine which is the bigger number. - if (a = xe - ye) { - - if (xLTy = a < 0) { - a = -a; - t = xc; - } else { - ye = xe; - t = yc; - } - - t.reverse(); - - // Prepend zeros to equalise exponents. - for (b = a; b--; t.push(0)); - t.reverse(); - } else { - - // Exponents equal. Check digit by digit. - j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b; - - for (a = b = 0; b < j; b++) { - - if (xc[b] != yc[b]) { - xLTy = xc[b] < yc[b]; - break; - } - } - } - - // x < y? Point xc to the array of the bigger number. - if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s; - - b = (j = yc.length) - (i = xc.length); - - // Append zeros to xc if shorter. - // No need to add zeros to yc if shorter as subtract only needs to start at yc.length. - if (b > 0) for (; b--; xc[i++] = 0); - b = BASE - 1; - - // Subtract yc from xc. - for (; j > a;) { - - if (xc[--j] < yc[j]) { - for (i = j; i && !xc[--i]; xc[i] = b); - --xc[i]; - xc[j] += BASE; - } - - xc[j] -= yc[j]; - } - - // Remove leading zeros and adjust exponent accordingly. - for (; xc[0] == 0; xc.splice(0, 1), --ye); - - // Zero? - if (!xc[0]) { - - // Following IEEE 754 (2008) 6.3, - // n - n = +0 but n - n = -0 when rounding towards -Infinity. - y.s = ROUNDING_MODE == 3 ? -1 : 1; - y.c = [y.e = 0]; - return y; - } - - // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity - // for finite x and y. - return normalise(y, xc, ye); - }; - - - /* - * n % 0 = N - * n % N = N - * n % I = n - * 0 % n = 0 - * -0 % n = -0 - * 0 % 0 = N - * 0 % N = N - * 0 % I = 0 - * N % n = N - * N % 0 = N - * N % N = N - * N % I = N - * I % n = N - * I % 0 = N - * I % N = N - * I % I = N - * - * Return a new BigNumber whose value is the value of this BigNumber modulo the value of - * BigNumber(y, b). The result depends on the value of MODULO_MODE. - */ - P.modulo = P.mod = function (y, b) { - var q, s, - x = this; - - y = new BigNumber(y, b); - - // Return NaN if x is Infinity or NaN, or y is NaN or zero. - if (!x.c || !y.s || y.c && !y.c[0]) { - return new BigNumber(NaN); - - // Return x if y is Infinity or x is zero. - } else if (!y.c || x.c && !x.c[0]) { - return new BigNumber(x); - } - - if (MODULO_MODE == 9) { - - // Euclidian division: q = sign(y) * floor(x / abs(y)) - // r = x - qy where 0 <= r < abs(y) - s = y.s; - y.s = 1; - q = div(x, y, 0, 3); - y.s = s; - q.s *= s; - } else { - q = div(x, y, 0, MODULO_MODE); - } - - y = x.minus(q.times(y)); - - // To match JavaScript %, ensure sign of zero is sign of dividend. - if (!y.c[0] && MODULO_MODE == 1) y.s = x.s; - - return y; - }; - - - /* - * n * 0 = 0 - * n * N = N - * n * I = I - * 0 * n = 0 - * 0 * 0 = 0 - * 0 * N = N - * 0 * I = N - * N * n = N - * N * 0 = N - * N * N = N - * N * I = N - * I * n = I - * I * 0 = N - * I * N = N - * I * I = I - * - * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value - * of BigNumber(y, b). - */ - P.multipliedBy = P.times = function (y, b) { - var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, - base, sqrtBase, - x = this, - xc = x.c, - yc = (y = new BigNumber(y, b)).c; - - // Either NaN, ±Infinity or ±0? - if (!xc || !yc || !xc[0] || !yc[0]) { - - // Return NaN if either is NaN, or one is 0 and the other is Infinity. - if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) { - y.c = y.e = y.s = null; - } else { - y.s *= x.s; - - // Return ±Infinity if either is ±Infinity. - if (!xc || !yc) { - y.c = y.e = null; - - // Return ±0 if either is ±0. - } else { - y.c = [0]; - y.e = 0; - } - } - - return y; - } - - e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE); - y.s *= x.s; - xcL = xc.length; - ycL = yc.length; - - // Ensure xc points to longer array and xcL to its length. - if (xcL < ycL) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i; - - // Initialise the result array with zeros. - for (i = xcL + ycL, zc = []; i--; zc.push(0)); - - base = BASE; - sqrtBase = SQRT_BASE; - - for (i = ycL; --i >= 0;) { - c = 0; - ylo = yc[i] % sqrtBase; - yhi = yc[i] / sqrtBase | 0; - - for (k = xcL, j = i + k; j > i;) { - xlo = xc[--k] % sqrtBase; - xhi = xc[k] / sqrtBase | 0; - m = yhi * xlo + xhi * ylo; - xlo = ylo * xlo + ((m % sqrtBase) * sqrtBase) + zc[j] + c; - c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi; - zc[j--] = xlo % base; - } - - zc[j] = c; - } - - if (c) { - ++e; - } else { - zc.splice(0, 1); - } - - return normalise(y, zc, e); - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber negated, - * i.e. multiplied by -1. - */ - P.negated = function () { - var x = new BigNumber(this); - x.s = -x.s || null; - return x; - }; - - - /* - * n + 0 = n - * n + N = N - * n + I = I - * 0 + n = n - * 0 + 0 = 0 - * 0 + N = N - * 0 + I = I - * N + n = N - * N + 0 = N - * N + N = N - * N + I = N - * I + n = I - * I + 0 = I - * I + N = N - * I + I = I - * - * Return a new BigNumber whose value is the value of this BigNumber plus the value of - * BigNumber(y, b). - */ - P.plus = function (y, b) { - var t, - x = this, - a = x.s; - - y = new BigNumber(y, b); - b = y.s; - - // Either NaN? - if (!a || !b) return new BigNumber(NaN); - - // Signs differ? - if (a != b) { - y.s = -b; - return x.minus(y); - } - - var xe = x.e / LOG_BASE, - ye = y.e / LOG_BASE, - xc = x.c, - yc = y.c; - - if (!xe || !ye) { - - // Return ±Infinity if either ±Infinity. - if (!xc || !yc) return new BigNumber(a / 0); - - // Either zero? - // Return y if y is non-zero, x if x is non-zero, or zero if both are zero. - if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber(xc[0] ? x : a * 0); - } - - xe = bitFloor(xe); - ye = bitFloor(ye); - xc = xc.slice(); - - // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts. - if (a = xe - ye) { - if (a > 0) { - ye = xe; - t = yc; - } else { - a = -a; - t = xc; - } - - t.reverse(); - for (; a--; t.push(0)); - t.reverse(); - } - - a = xc.length; - b = yc.length; - - // Point xc to the longer array, and b to the shorter length. - if (a - b < 0) t = yc, yc = xc, xc = t, b = a; - - // Only start adding at yc.length - 1 as the further digits of xc can be ignored. - for (a = 0; b;) { - a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0; - xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE; - } - - if (a) { - xc = [a].concat(xc); - ++ye; - } - - // No need to check for zero, as +x + +y != 0 && -x + -y != 0 - // ye = MAX_EXP + 1 possible - return normalise(y, xc, ye); - }; - - - /* - * If sd is undefined or null or true or false, return the number of significant digits of - * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN. - * If sd is true include integer-part trailing zeros in the count. - * - * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this - * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or - * ROUNDING_MODE if rm is omitted. - * - * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive. - * boolean: whether to count integer-part trailing zeros: true or false. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' - */ - P.precision = P.sd = function (sd, rm) { - var c, n, v, - x = this; - - if (sd != null && sd !== !!sd) { - intCheck(sd, 1, MAX); - if (rm == null) rm = ROUNDING_MODE; - else intCheck(rm, 0, 8); - - return round(new BigNumber(x), sd, rm); - } - - if (!(c = x.c)) return null; - v = c.length - 1; - n = v * LOG_BASE + 1; - - if (v = c[v]) { - - // Subtract the number of trailing zeros of the last element. - for (; v % 10 == 0; v /= 10, n--); - - // Add the number of digits of the first element. - for (v = c[0]; v >= 10; v /= 10, n++); - } - - if (sd && x.e + 1 > n) n = x.e + 1; - - return n; - }; - - - /* - * Return a new BigNumber whose value is the value of this BigNumber shifted by k places - * (powers of 10). Shift to the right if n > 0, and to the left if n < 0. - * - * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}' - */ - P.shiftedBy = function (k) { - intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); - return this.times('1e' + k); - }; - - - /* - * sqrt(-n) = N - * sqrt(N) = N - * sqrt(-I) = N - * sqrt(I) = I - * sqrt(0) = 0 - * sqrt(-0) = -0 - * - * Return a new BigNumber whose value is the square root of the value of this BigNumber, - * rounded according to DECIMAL_PLACES and ROUNDING_MODE. - */ - P.squareRoot = P.sqrt = function () { - var m, n, r, rep, t, - x = this, - c = x.c, - s = x.s, - e = x.e, - dp = DECIMAL_PLACES + 4, - half = new BigNumber('0.5'); - - // Negative/NaN/Infinity/zero? - if (s !== 1 || !c || !c[0]) { - return new BigNumber(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0); - } - - // Initial estimate. - s = Math.sqrt(+valueOf(x)); - - // Math.sqrt underflow/overflow? - // Pass x to Math.sqrt as integer, then adjust the exponent of the result. - if (s == 0 || s == 1 / 0) { - n = coeffToString(c); - if ((n.length + e) % 2 == 0) n += '0'; - s = Math.sqrt(+n); - e = bitFloor((e + 1) / 2) - (e < 0 || e % 2); - - if (s == 1 / 0) { - n = '1e' + e; - } else { - n = s.toExponential(); - n = n.slice(0, n.indexOf('e') + 1) + e; - } - - r = new BigNumber(n); - } else { - r = new BigNumber(s + ''); - } - - // Check for zero. - // r could be zero if MIN_EXP is changed after the this value was created. - // This would cause a division by zero (x/t) and hence Infinity below, which would cause - // coeffToString to throw. - if (r.c[0]) { - e = r.e; - s = e + dp; - if (s < 3) s = 0; - - // Newton-Raphson iteration. - for (; ;) { - t = r; - r = half.times(t.plus(div(x, t, dp, 1))); - - if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) { - - // The exponent of r may here be one less than the final result exponent, - // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits - // are indexed correctly. - if (r.e < e) --s; - n = n.slice(s - 3, s + 1); - - // The 4th rounding digit may be in error by -1 so if the 4 rounding digits - // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the - // iteration. - if (n == '9999' || !rep && n == '4999') { - - // On the first iteration only, check to see if rounding up gives the - // exact result as the nines may infinitely repeat. - if (!rep) { - round(t, t.e + DECIMAL_PLACES + 2, 0); - - if (t.times(t).eq(x)) { - r = t; - break; - } - } - - dp += 4; - s += 4; - rep = 1; - } else { - - // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact - // result. If not, then there are further digits and m will be truthy. - if (!+n || !+n.slice(1) && n.charAt(0) == '5') { - - // Truncate to the first rounding digit. - round(r, r.e + DECIMAL_PLACES + 2, 1); - m = !r.times(r).eq(x); - } - - break; - } - } - } - } - - return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m); - }; - - - /* - * Return a string representing the value of this BigNumber in exponential notation and - * rounded using ROUNDING_MODE to dp fixed decimal places. - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' - */ - P.toExponential = function (dp, rm) { - if (dp != null) { - intCheck(dp, 0, MAX); - dp++; - } - return format(this, dp, rm, 1); - }; - - - /* - * Return a string representing the value of this BigNumber in fixed-point notation rounding - * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted. - * - * Note: as with JavaScript's number type, (-0).toFixed(0) is '0', - * but e.g. (-0.00001).toFixed(0) is '-0'. - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' - */ - P.toFixed = function (dp, rm) { - if (dp != null) { - intCheck(dp, 0, MAX); - dp = dp + this.e + 1; - } - return format(this, dp, rm); - }; - - - /* - * Return a string representing the value of this BigNumber in fixed-point notation rounded - * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties - * of the format or FORMAT object (see BigNumber.set). - * - * The formatting object may contain some or all of the properties shown below. - * - * FORMAT = { - * prefix: '', - * groupSize: 3, - * secondaryGroupSize: 0, - * groupSeparator: ',', - * decimalSeparator: '.', - * fractionGroupSize: 0, - * fractionGroupSeparator: '\xA0', // non-breaking space - * suffix: '' - * }; - * - * [dp] {number} Decimal places. Integer, 0 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * [format] {object} Formatting options. See FORMAT pbject above. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}' - * '[BigNumber Error] Argument not an object: {format}' - */ - P.toFormat = function (dp, rm, format) { - var str, - x = this; - - if (format == null) { - if (dp != null && rm && typeof rm == 'object') { - format = rm; - rm = null; - } else if (dp && typeof dp == 'object') { - format = dp; - dp = rm = null; - } else { - format = FORMAT; - } - } else if (typeof format != 'object') { - throw Error - (bignumberError + 'Argument not an object: ' + format); - } - - str = x.toFixed(dp, rm); - - if (x.c) { - var i, - arr = str.split('.'), - g1 = +format.groupSize, - g2 = +format.secondaryGroupSize, - groupSeparator = format.groupSeparator || '', - intPart = arr[0], - fractionPart = arr[1], - isNeg = x.s < 0, - intDigits = isNeg ? intPart.slice(1) : intPart, - len = intDigits.length; - - if (g2) i = g1, g1 = g2, g2 = i, len -= i; - - if (g1 > 0 && len > 0) { - i = len % g1 || g1; - intPart = intDigits.substr(0, i); - for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1); - if (g2 > 0) intPart += groupSeparator + intDigits.slice(i); - if (isNeg) intPart = '-' + intPart; - } - - str = fractionPart - ? intPart + (format.decimalSeparator || '') + ((g2 = +format.fractionGroupSize) - ? fractionPart.replace(new RegExp('\\d{' + g2 + '}\\B', 'g'), - '$&' + (format.fractionGroupSeparator || '')) - : fractionPart) - : intPart; - } - - return (format.prefix || '') + str + (format.suffix || ''); - }; - - - /* - * Return an array of two BigNumbers representing the value of this BigNumber as a simple - * fraction with an integer numerator and an integer denominator. - * The denominator will be a positive non-zero value less than or equal to the specified - * maximum denominator. If a maximum denominator is not specified, the denominator will be - * the lowest value necessary to represent the number exactly. - * - * [md] {number|string|BigNumber} Integer >= 1, or Infinity. The maximum denominator. - * - * '[BigNumber Error] Argument {not an integer|out of range} : {md}' - */ - P.toFraction = function (md) { - var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, - x = this, - xc = x.c; - - if (md != null) { - n = new BigNumber(md); - - // Throw if md is less than one or is not an integer, unless it is Infinity. - if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) { - throw Error - (bignumberError + 'Argument ' + - (n.isInteger() ? 'out of range: ' : 'not an integer: ') + valueOf(n)); - } - } - - if (!xc) return new BigNumber(x); - - d = new BigNumber(ONE); - n1 = d0 = new BigNumber(ONE); - d1 = n0 = new BigNumber(ONE); - s = coeffToString(xc); - - // Determine initial denominator. - // d is a power of 10 and the minimum max denominator that specifies the value exactly. - e = d.e = s.length - x.e - 1; - d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp]; - md = !md || n.comparedTo(d) > 0 ? (e > 0 ? d : n1) : n; - - exp = MAX_EXP; - MAX_EXP = 1 / 0; - n = new BigNumber(s); - - // n0 = d1 = 0 - n0.c[0] = 0; - - for (; ;) { - q = div(n, d, 0, 1); - d2 = d0.plus(q.times(d1)); - if (d2.comparedTo(md) == 1) break; - d0 = d1; - d1 = d2; - n1 = n0.plus(q.times(d2 = n1)); - n0 = d2; - d = n.minus(q.times(d2 = d)); - n = d2; - } - - d2 = div(md.minus(d0), d1, 0, 1); - n0 = n0.plus(d2.times(n1)); - d0 = d0.plus(d2.times(d1)); - n0.s = n1.s = x.s; - e = e * 2; - - // Determine which fraction is closer to x, n0/d0 or n1/d1 - r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo( - div(n0, d0, e, ROUNDING_MODE).minus(x).abs()) < 1 ? [n1, d1] : [n0, d0]; - - MAX_EXP = exp; - - return r; - }; - - - /* - * Return the value of this BigNumber converted to a number primitive. - */ - P.toNumber = function () { - return +valueOf(this); - }; - - - /* - * Return a string representing the value of this BigNumber rounded to sd significant digits - * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits - * necessary to represent the integer part of the value in fixed-point notation, then use - * exponential notation. - * - * [sd] {number} Significant digits. Integer, 1 to MAX inclusive. - * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive. - * - * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}' - */ - P.toPrecision = function (sd, rm) { - if (sd != null) intCheck(sd, 1, MAX); - return format(this, sd, rm, 2); - }; - - - /* - * Return a string representing the value of this BigNumber in base b, or base 10 if b is - * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and - * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent - * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than - * TO_EXP_NEG, return exponential notation. - * - * [b] {number} Integer, 2 to ALPHABET.length inclusive. - * - * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}' - */ - P.toString = function (b) { - var str, - n = this, - s = n.s, - e = n.e; - - // Infinity or NaN? - if (e === null) { - if (s) { - str = 'Infinity'; - if (s < 0) str = '-' + str; - } else { - str = 'NaN'; - } - } else { - if (b == null) { - str = e <= TO_EXP_NEG || e >= TO_EXP_POS - ? toExponential(coeffToString(n.c), e) - : toFixedPoint(coeffToString(n.c), e, '0'); - } else if (b === 10) { - n = round(new BigNumber(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE); - str = toFixedPoint(coeffToString(n.c), n.e, '0'); - } else { - intCheck(b, 2, ALPHABET.length, 'Base'); - str = convertBase(toFixedPoint(coeffToString(n.c), e, '0'), 10, b, s, true); - } - - if (s < 0 && n.c[0]) str = '-' + str; - } - - return str; - }; - - - /* - * Return as toString, but do not accept a base argument, and include the minus sign for - * negative zero. - */ - P.valueOf = P.toJSON = function () { - return valueOf(this); - }; - - - P._isBigNumber = true; - - P[Symbol.toStringTag] = 'BigNumber'; - - // Node.js v10.12.0+ - P[Symbol.for('nodejs.util.inspect.custom')] = P.valueOf; - - if (configObject != null) BigNumber.set(configObject); - - return BigNumber; -} - - -// PRIVATE HELPER FUNCTIONS - -// These functions don't need access to variables, -// e.g. DECIMAL_PLACES, in the scope of the `clone` function above. - - -function bitFloor(n) { - var i = n | 0; - return n > 0 || n === i ? i : i - 1; -} - - -// Return a coefficient array as a string of base 10 digits. -function coeffToString(a) { - var s, z, - i = 1, - j = a.length, - r = a[0] + ''; - - for (; i < j;) { - s = a[i++] + ''; - z = LOG_BASE - s.length; - for (; z--; s = '0' + s); - r += s; - } - - // Determine trailing zeros. - for (j = r.length; r.charCodeAt(--j) === 48;); - - return r.slice(0, j + 1 || 1); -} - - -// Compare the value of BigNumbers x and y. -function compare(x, y) { - var a, b, - xc = x.c, - yc = y.c, - i = x.s, - j = y.s, - k = x.e, - l = y.e; - - // Either NaN? - if (!i || !j) return null; - - a = xc && !xc[0]; - b = yc && !yc[0]; - - // Either zero? - if (a || b) return a ? b ? 0 : -j : i; - - // Signs differ? - if (i != j) return i; - - a = i < 0; - b = k == l; - - // Either Infinity? - if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1; - - // Compare exponents. - if (!b) return k > l ^ a ? 1 : -1; - - j = (k = xc.length) < (l = yc.length) ? k : l; - - // Compare digit by digit. - for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1; - - // Compare lengths. - return k == l ? 0 : k > l ^ a ? 1 : -1; -} - - -/* - * Check that n is a primitive number, an integer, and in range, otherwise throw. - */ -function intCheck(n, min, max, name) { - if (n < min || n > max || n !== mathfloor(n)) { - throw Error - (bignumberError + (name || 'Argument') + (typeof n == 'number' - ? n < min || n > max ? ' out of range: ' : ' not an integer: ' - : ' not a primitive number: ') + String(n)); - } -} - - -// Assumes finite n. -function isOdd(n) { - var k = n.c.length - 1; - return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0; -} - - -function toExponential(str, e) { - return (str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str) + - (e < 0 ? 'e' : 'e+') + e; -} - - -function toFixedPoint(str, e, z) { - var len, zs; - - // Negative exponent? - if (e < 0) { - - // Prepend zeros. - for (zs = z + '.'; ++e; zs += z); - str = zs + str; - - // Positive exponent - } else { - len = str.length; - - // Append zeros. - if (++e > len) { - for (zs = z, e -= len; --e; zs += z); - str += zs; - } else if (e < len) { - str = str.slice(0, e) + '.' + str.slice(e); - } - } - - return str; -} - - -// EXPORT - - -export var BigNumber = clone(); - -export default BigNumber; diff --git a/node_modules/bignumber.js/doc/API.html b/node_modules/bignumber.js/doc/API.html deleted file mode 100644 index 424a914..0000000 --- a/node_modules/bignumber.js/doc/API.html +++ /dev/null @@ -1,2237 +0,0 @@ - - - - - - -bignumber.js API - - - - - - -
    - -

    bignumber.js

    - -

    A JavaScript library for arbitrary-precision arithmetic.

    -

    Hosted on GitHub.

    - -

    API

    - -

    - See the README on GitHub for a - quick-start introduction. -

    -

    - In all examples below, var and semicolons are not shown, and if a commented-out - value is in quotes it means toString has been called on the preceding expression. -

    - - -

    CONSTRUCTOR

    - - -
    - BigNumberBigNumber(n [, base]) ⇒ BigNumber -
    -

    - n: number|string|BigNumber
    - base: number: integer, 2 to 36 inclusive. (See - ALPHABET to extend this range). -

    -

    - Returns a new instance of a BigNumber object with value n, where n - is a numeric value in the specified base, or base 10 if - base is omitted or is null or undefined. -

    -
    -x = new BigNumber(123.4567)                // '123.4567'
    -// 'new' is optional
    -y = BigNumber(x)                           // '123.4567'
    -

    - If n is a base 10 value it can be in normal (fixed-point) or - exponential notation. Values in other bases must be in normal notation. Values in any base can - have fraction digits, i.e. digits after the decimal point. -

    -
    -new BigNumber(43210)                       // '43210'
    -new BigNumber('4.321e+4')                  // '43210'
    -new BigNumber('-735.0918e-430')            // '-7.350918e-428'
    -new BigNumber('123412421.234324', 5)       // '607236.557696'
    -

    - Signed 0, signed Infinity and NaN are supported. -

    -
    -new BigNumber('-Infinity')                 // '-Infinity'
    -new BigNumber(NaN)                         // 'NaN'
    -new BigNumber(-0)                          // '0'
    -new BigNumber('.5')                        // '0.5'
    -new BigNumber('+2')                        // '2'
    -

    - String values in hexadecimal literal form, e.g. '0xff', are valid, as are - string values with the octal and binary prefixs '0o' and '0b'. - String values in octal literal form without the prefix will be interpreted as - decimals, e.g. '011' is interpreted as 11, not 9. -

    -
    -new BigNumber(-10110100.1, 2)              // '-180.5'
    -new BigNumber('-0b10110100.1')             // '-180.5'
    -new BigNumber('ff.8', 16)                  // '255.5'
    -new BigNumber('0xff.8')                    // '255.5'
    -

    - If a base is specified, n is rounded according to the current - DECIMAL_PLACES and - ROUNDING_MODE settings. This includes base - 10 so don't include a base parameter for decimal values unless - this behaviour is wanted. -

    -
    BigNumber.config({ DECIMAL_PLACES: 5 })
    -new BigNumber(1.23456789)                  // '1.23456789'
    -new BigNumber(1.23456789, 10)              // '1.23457'
    -

    An error is thrown if base is invalid. See Errors.

    -

    - There is no limit to the number of digits of a value of type string (other than - that of JavaScript's maximum array size). See RANGE to set - the maximum and minimum possible exponent value of a BigNumber. -

    -
    -new BigNumber('5032485723458348569331745.33434346346912144534543')
    -new BigNumber('4.321e10000000')
    -

    BigNumber NaN is returned if n is invalid - (unless BigNumber.DEBUG is true, see below).

    -
    -new BigNumber('.1*')                       // 'NaN'
    -new BigNumber('blurgh')                    // 'NaN'
    -new BigNumber(9, 2)                        // 'NaN'
    -

    - To aid in debugging, if BigNumber.DEBUG is true then an error will - be thrown on an invalid n. An error will also be thrown if n is of - type number with more than 15 significant digits, as calling - toString or valueOf on - these numbers may not result in the intended value. -

    -
    -console.log(823456789123456.3)            //  823456789123456.2
    -new BigNumber(823456789123456.3)          // '823456789123456.2'
    -BigNumber.DEBUG = true
    -// '[BigNumber Error] Number primitive has more than 15 significant digits'
    -new BigNumber(823456789123456.3)
    -// '[BigNumber Error] Not a base 2 number'
    -new BigNumber(9, 2)
    -

    - A BigNumber can also be created from an object literal. - Use isBigNumber to check that it is well-formed. -

    -
    new BigNumber({ s: 1, e: 2, c: [ 777, 12300000000000 ], _isBigNumber: true })    // '777.123'
    - - - - -

    Methods

    -

    The static methods of a BigNumber constructor.

    - - - - -
    clone - .clone([object]) ⇒ BigNumber constructor -
    -

    object: object

    -

    - Returns a new independent BigNumber constructor with configuration as described by - object (see config), or with the default - configuration if object is null or undefined. -

    -

    - Throws if object is not an object. See Errors. -

    -
    BigNumber.config({ DECIMAL_PLACES: 5 })
    -BN = BigNumber.clone({ DECIMAL_PLACES: 9 })
    -
    -x = new BigNumber(1)
    -y = new BN(1)
    -
    -x.div(3)                        // 0.33333
    -y.div(3)                        // 0.333333333
    -
    -// BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) is equivalent to:
    -BN = BigNumber.clone()
    -BN.config({ DECIMAL_PLACES: 9 })
    - - - -
    configset([object]) ⇒ object
    -

    - object: object: an object that contains some or all of the following - properties. -

    -

    Configures the settings for this particular BigNumber constructor.

    - -
    -
    DECIMAL_PLACES
    -
    - number: integer, 0 to 1e+9 inclusive
    - Default value: 20 -
    -
    - The maximum number of decimal places of the results of operations involving - division, i.e. division, square root and base conversion operations, and power - operations with negative exponents.
    -
    -
    -
    BigNumber.config({ DECIMAL_PLACES: 5 })
    -BigNumber.set({ DECIMAL_PLACES: 5 })    // equivalent
    -
    - - - -
    ROUNDING_MODE
    -
    - number: integer, 0 to 8 inclusive
    - Default value: 4 (ROUND_HALF_UP) -
    -
    - The rounding mode used in the above operations and the default rounding mode of - decimalPlaces, - precision, - toExponential, - toFixed, - toFormat and - toPrecision. -
    -
    The modes are available as enumerated properties of the BigNumber constructor.
    -
    -
    BigNumber.config({ ROUNDING_MODE: 0 })
    -BigNumber.set({ ROUNDING_MODE: BigNumber.ROUND_UP })    // equivalent
    -
    - - - -
    EXPONENTIAL_AT
    -
    - number: integer, magnitude 0 to 1e+9 inclusive, or -
    - number[]: [ integer -1e+9 to 0 inclusive, integer - 0 to 1e+9 inclusive ]
    - Default value: [-7, 20] -
    -
    - The exponent value(s) at which toString returns exponential notation. -
    -
    - If a single number is assigned, the value is the exponent magnitude.
    - If an array of two numbers is assigned then the first number is the negative exponent - value at and beneath which exponential notation is used, and the second number is the - positive exponent value at and above which the same. -
    -
    - For example, to emulate JavaScript numbers in terms of the exponent values at which they - begin to use exponential notation, use [-7, 20]. -
    -
    -
    BigNumber.config({ EXPONENTIAL_AT: 2 })
    -new BigNumber(12.3)         // '12.3'        e is only 1
    -new BigNumber(123)          // '1.23e+2'
    -new BigNumber(0.123)        // '0.123'       e is only -1
    -new BigNumber(0.0123)       // '1.23e-2'
    -
    -BigNumber.config({ EXPONENTIAL_AT: [-7, 20] })
    -new BigNumber(123456789)    // '123456789'   e is only 8
    -new BigNumber(0.000000123)  // '1.23e-7'
    -
    -// Almost never return exponential notation:
    -BigNumber.config({ EXPONENTIAL_AT: 1e+9 })
    -
    -// Always return exponential notation:
    -BigNumber.config({ EXPONENTIAL_AT: 0 })
    -
    -
    - Regardless of the value of EXPONENTIAL_AT, the toFixed method - will always return a value in normal notation and the toExponential method - will always return a value in exponential form. -
    -
    - Calling toString with a base argument, e.g. toString(10), will - also always return normal notation. -
    - - - -
    RANGE
    -
    - number: integer, magnitude 1 to 1e+9 inclusive, or -
    - number[]: [ integer -1e+9 to -1 inclusive, integer - 1 to 1e+9 inclusive ]
    - Default value: [-1e+9, 1e+9] -
    -
    - The exponent value(s) beyond which overflow to Infinity and underflow to - zero occurs. -
    -
    - If a single number is assigned, it is the maximum exponent magnitude: values wth a - positive exponent of greater magnitude become Infinity and those with a - negative exponent of greater magnitude become zero. -
    - If an array of two numbers is assigned then the first number is the negative exponent - limit and the second number is the positive exponent limit. -
    -
    - For example, to emulate JavaScript numbers in terms of the exponent values at which they - become zero and Infinity, use [-324, 308]. -
    -
    -
    BigNumber.config({ RANGE: 500 })
    -BigNumber.config().RANGE     // [ -500, 500 ]
    -new BigNumber('9.999e499')   // '9.999e+499'
    -new BigNumber('1e500')       // 'Infinity'
    -new BigNumber('1e-499')      // '1e-499'
    -new BigNumber('1e-500')      // '0'
    -
    -BigNumber.config({ RANGE: [-3, 4] })
    -new BigNumber(99999)         // '99999'      e is only 4
    -new BigNumber(100000)        // 'Infinity'   e is 5
    -new BigNumber(0.001)         // '0.01'       e is only -3
    -new BigNumber(0.0001)        // '0'          e is -4
    -
    -
    - The largest possible magnitude of a finite BigNumber is - 9.999...e+1000000000.
    - The smallest possible magnitude of a non-zero BigNumber is 1e-1000000000. -
    - - - -
    CRYPTO
    -
    - boolean: true or false.
    - Default value: false -
    -
    - The value that determines whether cryptographically-secure pseudo-random number - generation is used. -
    -
    - If CRYPTO is set to true then the - random method will generate random digits using - crypto.getRandomValues in browsers that support it, or - crypto.randomBytes if using Node.js. -
    -
    - If neither function is supported by the host environment then attempting to set - CRYPTO to true will fail and an exception will be thrown. -
    -
    - If CRYPTO is false then the source of randomness used will be - Math.random (which is assumed to generate at least 30 bits of - randomness). -
    -
    See random.
    -
    -
    -// Node.js
    -global.crypto = require('crypto')
    -
    -BigNumber.config({ CRYPTO: true })
    -BigNumber.config().CRYPTO       // true
    -BigNumber.random()              // 0.54340758610486147524
    -
    - - - -
    MODULO_MODE
    -
    - number: integer, 0 to 9 inclusive
    - Default value: 1 (ROUND_DOWN) -
    -
    The modulo mode used when calculating the modulus: a mod n.
    -
    - The quotient, q = a / n, is calculated according to the - ROUNDING_MODE that corresponds to the chosen - MODULO_MODE. -
    -
    The remainder, r, is calculated as: r = a - n * q.
    -
    - The modes that are most commonly used for the modulus/remainder operation are shown in - the following table. Although the other rounding modes can be used, they may not give - useful results. -
    -
    - - - - - - - - - - - - - - - - - - - - - - -
    PropertyValueDescription
    ROUND_UP0 - The remainder is positive if the dividend is negative, otherwise it is negative. -
    ROUND_DOWN1 - The remainder has the same sign as the dividend.
    - This uses 'truncating division' and matches the behaviour of JavaScript's - remainder operator %. -
    ROUND_FLOOR3 - The remainder has the same sign as the divisor.
    - This matches Python's % operator. -
    ROUND_HALF_EVEN6The IEEE 754 remainder function.
    EUCLID9 - The remainder is always positive. Euclidian division:
    - q = sign(n) * floor(a / abs(n)) -
    -
    -
    - The rounding/modulo modes are available as enumerated properties of the BigNumber - constructor. -
    -
    See modulo.
    -
    -
    BigNumber.config({ MODULO_MODE: BigNumber.EUCLID })
    -BigNumber.config({ MODULO_MODE: 9 })          // equivalent
    -
    - - - -
    POW_PRECISION
    -
    - number: integer, 0 to 1e+9 inclusive.
    - Default value: 0 -
    -
    - The maximum precision, i.e. number of significant digits, of the result of the power - operation (unless a modulus is specified). -
    -
    If set to 0, the number of significant digits will not be limited.
    -
    See exponentiatedBy.
    -
    BigNumber.config({ POW_PRECISION: 100 })
    - - - -
    FORMAT
    -
    object
    -
    - The FORMAT object configures the format of the string returned by the - toFormat method. -
    -
    - The example below shows the properties of the FORMAT object that are - recognised, and their default values. -
    -
    - Unlike the other configuration properties, the values of the properties of the - FORMAT object will not be checked for validity. The existing - FORMAT object will simply be replaced by the object that is passed in. - The object can include any number of the properties shown below. -
    -
    See toFormat for examples of usage.
    -
    -
    -BigNumber.config({
    -  FORMAT: {
    -    // string to prepend
    -    prefix: '',
    -    // decimal separator
    -    decimalSeparator: '.',
    -    // grouping separator of the integer part
    -    groupSeparator: ',',
    -    // primary grouping size of the integer part
    -    groupSize: 3,
    -    // secondary grouping size of the integer part
    -    secondaryGroupSize: 0,
    -    // grouping separator of the fraction part
    -    fractionGroupSeparator: ' ',
    -    // grouping size of the fraction part
    -    fractionGroupSize: 0,
    -    // string to append
    -    suffix: ''
    -  }
    -});
    -
    - - - -
    ALPHABET
    -
    - string
    - Default value: '0123456789abcdefghijklmnopqrstuvwxyz' -
    -
    - The alphabet used for base conversion. The length of the alphabet corresponds to the - maximum value of the base argument that can be passed to the - BigNumber constructor or - toString. -
    -
    - There is no maximum length for the alphabet, but it must be at least 2 characters long, and - it must not contain whitespace or a repeated character, or the sign indicators - '+' and '-', or the decimal separator '.'. -
    -
    -
    // duodecimal (base 12)
    -BigNumber.config({ ALPHABET: '0123456789TE' })
    -x = new BigNumber('T', 12)
    -x.toString()                // '10'
    -x.toString(12)              // 'T'
    -
    - - - -
    -

    -

    Returns an object with the above properties and their current values.

    -

    - Throws if object is not an object, or if an invalid value is assigned to - one or more of the above properties. See Errors. -

    -
    -BigNumber.config({
    -  DECIMAL_PLACES: 40,
    -  ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL,
    -  EXPONENTIAL_AT: [-10, 20],
    -  RANGE: [-500, 500],
    -  CRYPTO: true,
    -  MODULO_MODE: BigNumber.ROUND_FLOOR,
    -  POW_PRECISION: 80,
    -  FORMAT: {
    -    groupSize: 3,
    -    groupSeparator: ' ',
    -    decimalSeparator: ','
    -  },
    -  ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'
    -});
    -
    -obj = BigNumber.config();
    -obj.DECIMAL_PLACES        // 40
    -obj.RANGE                 // [-500, 500]
    - - - -
    - isBigNumber.isBigNumber(value) ⇒ boolean -
    -

    value: any

    -

    - Returns true if value is a BigNumber instance, otherwise returns - false. -

    -
    x = 42
    -y = new BigNumber(x)
    -
    -BigNumber.isBigNumber(x)             // false
    -y instanceof BigNumber               // true
    -BigNumber.isBigNumber(y)             // true
    -
    -BN = BigNumber.clone();
    -z = new BN(x)
    -z instanceof BigNumber               // false
    -BigNumber.isBigNumber(z)             // true
    -

    - If value is a BigNumber instance and BigNumber.DEBUG is true, - then this method will also check if value is well-formed, and throw if it is not. - See Errors. -

    -

    - The check can be useful if creating a BigNumber from an object literal. - See BigNumber. -

    -
    -x = new BigNumber(10)
    -
    -// Change x.c to an illegitimate value.
    -x.c = NaN
    -
    -BigNumber.DEBUG = false
    -
    -// No error.
    -BigNumber.isBigNumber(x)    // true
    -
    -BigNumber.DEBUG = true
    -
    -// Error.
    -BigNumber.isBigNumber(x)    // '[BigNumber Error] Invalid BigNumber'
    - - - -
    maximum.max(n...) ⇒ BigNumber
    -

    - n: number|string|BigNumber
    - See BigNumber for further parameter details. -

    -

    - Returns a BigNumber whose value is the maximum of the arguments. -

    -

    The return value is always exact and unrounded.

    -
    x = new BigNumber('3257869345.0378653')
    -BigNumber.maximum(4e9, x, '123456789.9')      // '4000000000'
    -
    -arr = [12, '13', new BigNumber(14)]
    -BigNumber.max.apply(null, arr)                // '14'
    - - - -
    minimum.min(n...) ⇒ BigNumber
    -

    - n: number|string|BigNumber
    - See BigNumber for further parameter details. -

    -

    - Returns a BigNumber whose value is the minimum of the arguments. -

    -

    The return value is always exact and unrounded.

    -
    x = new BigNumber('3257869345.0378653')
    -BigNumber.minimum(4e9, x, '123456789.9')      // '123456789.9'
    -
    -arr = [2, new BigNumber(-14), '-15.9999', -12]
    -BigNumber.min.apply(null, arr)                // '-15.9999'
    - - - -
    - random.random([dp]) ⇒ BigNumber -
    -

    dp: number: integer, 0 to 1e+9 inclusive

    -

    - Returns a new BigNumber with a pseudo-random value equal to or greater than 0 and - less than 1. -

    -

    - The return value will have dp decimal places (or less if trailing zeros are - produced).
    - If dp is omitted then the number of decimal places will default to the current - DECIMAL_PLACES setting. -

    -

    - Depending on the value of this BigNumber constructor's - CRYPTO setting and the support for the - crypto object in the host environment, the random digits of the return value are - generated by either Math.random (fastest), crypto.getRandomValues - (Web Cryptography API in recent browsers) or crypto.randomBytes (Node.js). -

    -

    - To be able to set CRYPTO to true when using - Node.js, the crypto object must be available globally: -

    -
    global.crypto = require('crypto')
    -

    - If CRYPTO is true, i.e. one of the - crypto methods is to be used, the value of a returned BigNumber should be - cryptographically-secure and statistically indistinguishable from a random value. -

    -

    - Throws if dp is invalid. See Errors. -

    -
    BigNumber.config({ DECIMAL_PLACES: 10 })
    -BigNumber.random()              // '0.4117936847'
    -BigNumber.random(20)            // '0.78193327636914089009'
    - - - -
    sum.sum(n...) ⇒ BigNumber
    -

    - n: number|string|BigNumber
    - See BigNumber for further parameter details. -

    -

    Returns a BigNumber whose value is the sum of the arguments.

    -

    The return value is always exact and unrounded.

    -
    x = new BigNumber('3257869345.0378653')
    -BigNumber.sum(4e9, x, '123456789.9')      // '7381326134.9378653'
    -
    -arr = [2, new BigNumber(14), '15.9999', 12]
    -BigNumber.sum.apply(null, arr)            // '43.9999'
    - - - -

    Properties

    -

    - The library's enumerated rounding modes are stored as properties of the constructor.
    - (They are not referenced internally by the library itself.) -

    -

    - Rounding modes 0 to 6 (inclusive) are the same as those of Java's - BigDecimal class. -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyValueDescription
    ROUND_UP0Rounds away from zero
    ROUND_DOWN1Rounds towards zero
    ROUND_CEIL2Rounds towards Infinity
    ROUND_FLOOR3Rounds towards -Infinity
    ROUND_HALF_UP4 - Rounds towards nearest neighbour.
    - If equidistant, rounds away from zero -
    ROUND_HALF_DOWN5 - Rounds towards nearest neighbour.
    - If equidistant, rounds towards zero -
    ROUND_HALF_EVEN6 - Rounds towards nearest neighbour.
    - If equidistant, rounds towards even neighbour -
    ROUND_HALF_CEIL7 - Rounds towards nearest neighbour.
    - If equidistant, rounds towards Infinity -
    ROUND_HALF_FLOOR8 - Rounds towards nearest neighbour.
    - If equidistant, rounds towards -Infinity -
    -
    -BigNumber.config({ ROUNDING_MODE: BigNumber.ROUND_CEIL })
    -BigNumber.config({ ROUNDING_MODE: 2 })     // equivalent
    - -
    DEBUG
    -

    undefined|false|true

    -

    - If BigNumber.DEBUG is set true then an error will be thrown - if this BigNumber constructor receives an invalid value, such as - a value of type number with more than 15 significant digits. - See BigNumber. -

    -

    - An error will also be thrown if the isBigNumber - method receives a BigNumber that is not well-formed. - See isBigNumber. -

    -
    BigNumber.DEBUG = true
    - - -

    INSTANCE

    - - -

    Methods

    -

    The methods inherited by a BigNumber instance from its constructor's prototype object.

    -

    A BigNumber is immutable in the sense that it is not changed by its methods.

    -

    - The treatment of ±0, ±Infinity and NaN is - consistent with how JavaScript treats these values. -

    -

    Many method names have a shorter alias.

    - - - -
    absoluteValue.abs() ⇒ BigNumber
    -

    - Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of - this BigNumber. -

    -

    The return value is always exact and unrounded.

    -
    -x = new BigNumber(-0.8)
    -y = x.absoluteValue()           // '0.8'
    -z = y.abs()                     // '0.8'
    - - - -
    - comparedTo.comparedTo(n [, base]) ⇒ number -
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    - - - - - - - - - - - - - - - - - - -
    Returns 
    1If the value of this BigNumber is greater than the value of n
    -1If the value of this BigNumber is less than the value of n
    0If this BigNumber and n have the same value
    nullIf the value of either this BigNumber or n is NaN
    -
    -x = new BigNumber(Infinity)
    -y = new BigNumber(5)
    -x.comparedTo(y)                 // 1
    -x.comparedTo(x.minus(1))        // 0
    -y.comparedTo(NaN)               // null
    -y.comparedTo('110', 2)          // -1
    - - - -
    - decimalPlaces.dp([dp [, rm]]) ⇒ BigNumber|number -
    -

    - dp: number: integer, 0 to 1e+9 inclusive
    - rm: number: integer, 0 to 8 inclusive -

    -

    - If dp is a number, returns a BigNumber whose value is the value of this BigNumber - rounded by rounding mode rm to a maximum of dp decimal places. -

    -

    - If dp is omitted, or is null or undefined, the return - value is the number of decimal places of the value of this BigNumber, or null if - the value of this BigNumber is ±Infinity or NaN. -

    -

    - If rm is omitted, or is null or undefined, - ROUNDING_MODE is used. -

    -

    - Throws if dp or rm is invalid. See Errors. -

    -
    -x = new BigNumber(1234.56)
    -x.decimalPlaces(1)                     // '1234.6'
    -x.dp()                                 // 2
    -x.decimalPlaces(2)                     // '1234.56'
    -x.dp(10)                               // '1234.56'
    -x.decimalPlaces(0, 1)                  // '1234'
    -x.dp(0, 6)                             // '1235'
    -x.decimalPlaces(1, 1)                  // '1234.5'
    -x.dp(1, BigNumber.ROUND_HALF_EVEN)     // '1234.6'
    -x                                      // '1234.56'
    -y = new BigNumber('9.9e-101')
    -y.dp()                                 // 102
    - - - -
    dividedBy.div(n [, base]) ⇒ BigNumber -
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    - Returns a BigNumber whose value is the value of this BigNumber divided by - n, rounded according to the current - DECIMAL_PLACES and - ROUNDING_MODE settings. -

    -
    -x = new BigNumber(355)
    -y = new BigNumber(113)
    -x.dividedBy(y)                  // '3.14159292035398230088'
    -x.div(5)                        // '71'
    -x.div(47, 16)                   // '5'
    - - - -
    - dividedToIntegerBy.idiv(n [, base]) ⇒ - BigNumber -
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    - Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by - n. -

    -
    -x = new BigNumber(5)
    -y = new BigNumber(3)
    -x.dividedToIntegerBy(y)         // '1'
    -x.idiv(0.7)                     // '7'
    -x.idiv('0.f', 16)               // '5'
    - - - -
    - exponentiatedBy.pow(n [, m]) ⇒ BigNumber -
    -

    - n: number|string|BigNumber: integer
    - m: number|string|BigNumber -

    -

    - Returns a BigNumber whose value is the value of this BigNumber exponentiated by - n, i.e. raised to the power n, and optionally modulo a modulus - m. -

    -

    - Throws if n is not an integer. See Errors. -

    -

    - If n is negative the result is rounded according to the current - DECIMAL_PLACES and - ROUNDING_MODE settings. -

    -

    - As the number of digits of the result of the power operation can grow so large so quickly, - e.g. 123.45610000 has over 50000 digits, the number of significant - digits calculated is limited to the value of the - POW_PRECISION setting (unless a modulus - m is specified). -

    -

    - By default POW_PRECISION is set to 0. - This means that an unlimited number of significant digits will be calculated, and that the - method's performance will decrease dramatically for larger exponents. -

    -

    - If m is specified and the value of m, n and this - BigNumber are integers, and n is positive, then a fast modular exponentiation - algorithm is used, otherwise the operation will be performed as - x.exponentiatedBy(n).modulo(m) with a - POW_PRECISION of 0. -

    -
    -Math.pow(0.7, 2)                // 0.48999999999999994
    -x = new BigNumber(0.7)
    -x.exponentiatedBy(2)            // '0.49'
    -BigNumber(3).pow(-2)            // '0.11111111111111111111'
    - - - -
    - integerValue.integerValue([rm]) ⇒ BigNumber -
    -

    - rm: number: integer, 0 to 8 inclusive -

    -

    - Returns a BigNumber whose value is the value of this BigNumber rounded to an integer using - rounding mode rm. -

    -

    - If rm is omitted, or is null or undefined, - ROUNDING_MODE is used. -

    -

    - Throws if rm is invalid. See Errors. -

    -
    -x = new BigNumber(123.456)
    -x.integerValue()                        // '123'
    -x.integerValue(BigNumber.ROUND_CEIL)    // '124'
    -y = new BigNumber(-12.7)
    -y.integerValue()                        // '-13'
    -y.integerValue(BigNumber.ROUND_DOWN)    // '-12'
    -

    - The following is an example of how to add a prototype method that emulates JavaScript's - Math.round function. Math.ceil, Math.floor and - Math.trunc can be emulated in the same way with - BigNumber.ROUND_CEIL, BigNumber.ROUND_FLOOR and - BigNumber.ROUND_DOWN respectively. -

    -
    -BigNumber.prototype.round = function (n) {
    -  return n.integerValue(BigNumber.ROUND_HALF_CEIL);
    -};
    -x.round()                               // '123'
    - - - -
    isEqualTo.eq(n [, base]) ⇒ boolean
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    - Returns true if the value of this BigNumber is equal to the value of - n, otherwise returns false.
    - As with JavaScript, NaN does not equal NaN. -

    -

    Note: This method uses the comparedTo method internally.

    -
    -0 === 1e-324                    // true
    -x = new BigNumber(0)
    -x.isEqualTo('1e-324')           // false
    -BigNumber(-0).eq(x)             // true  ( -0 === 0 )
    -BigNumber(255).eq('ff', 16)     // true
    -
    -y = new BigNumber(NaN)
    -y.isEqualTo(NaN)                // false
    - - - -
    isFinite.isFinite() ⇒ boolean
    -

    - Returns true if the value of this BigNumber is a finite number, otherwise - returns false. -

    -

    - The only possible non-finite values of a BigNumber are NaN, Infinity - and -Infinity. -

    -
    -x = new BigNumber(1)
    -x.isFinite()                    // true
    -y = new BigNumber(Infinity)
    -y.isFinite()                    // false
    -

    - Note: The native method isFinite() can be used if - n <= Number.MAX_VALUE. -

    - - - -
    isGreaterThan.gt(n [, base]) ⇒ boolean
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    - Returns true if the value of this BigNumber is greater than the value of - n, otherwise returns false. -

    -

    Note: This method uses the comparedTo method internally.

    -
    -0.1 > (0.3 - 0.2)                             // true
    -x = new BigNumber(0.1)
    -x.isGreaterThan(BigNumber(0.3).minus(0.2))    // false
    -BigNumber(0).gt(x)                            // false
    -BigNumber(11, 3).gt(11.1, 2)                  // true
    - - - -
    - isGreaterThanOrEqualTo.gte(n [, base]) ⇒ boolean -
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    - Returns true if the value of this BigNumber is greater than or equal to the value - of n, otherwise returns false. -

    -

    Note: This method uses the comparedTo method internally.

    -
    -(0.3 - 0.2) >= 0.1                     // false
    -x = new BigNumber(0.3).minus(0.2)
    -x.isGreaterThanOrEqualTo(0.1)          // true
    -BigNumber(1).gte(x)                    // true
    -BigNumber(10, 18).gte('i', 36)         // true
    - - - -
    isInteger.isInteger() ⇒ boolean
    -

    - Returns true if the value of this BigNumber is an integer, otherwise returns - false. -

    -
    -x = new BigNumber(1)
    -x.isInteger()                   // true
    -y = new BigNumber(123.456)
    -y.isInteger()                   // false
    - - - -
    isLessThan.lt(n [, base]) ⇒ boolean
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    - Returns true if the value of this BigNumber is less than the value of - n, otherwise returns false. -

    -

    Note: This method uses the comparedTo method internally.

    -
    -(0.3 - 0.2) < 0.1                       // true
    -x = new BigNumber(0.3).minus(0.2)
    -x.isLessThan(0.1)                       // false
    -BigNumber(0).lt(x)                      // true
    -BigNumber(11.1, 2).lt(11, 3)            // true
    - - - -
    - isLessThanOrEqualTo.lte(n [, base]) ⇒ boolean -
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    - Returns true if the value of this BigNumber is less than or equal to the value of - n, otherwise returns false. -

    -

    Note: This method uses the comparedTo method internally.

    -
    -0.1 <= (0.3 - 0.2)                                // false
    -x = new BigNumber(0.1)
    -x.isLessThanOrEqualTo(BigNumber(0.3).minus(0.2))  // true
    -BigNumber(-1).lte(x)                              // true
    -BigNumber(10, 18).lte('i', 36)                    // true
    - - - -
    isNaN.isNaN() ⇒ boolean
    -

    - Returns true if the value of this BigNumber is NaN, otherwise - returns false. -

    -
    -x = new BigNumber(NaN)
    -x.isNaN()                       // true
    -y = new BigNumber('Infinity')
    -y.isNaN()                       // false
    -

    Note: The native method isNaN() can also be used.

    - - - -
    isNegative.isNegative() ⇒ boolean
    -

    - Returns true if the sign of this BigNumber is negative, otherwise returns - false. -

    -
    -x = new BigNumber(-0)
    -x.isNegative()                  // true
    -y = new BigNumber(2)
    -y.isNegative()                  // false
    -

    Note: n < 0 can be used if n <= -Number.MIN_VALUE.

    - - - -
    isPositive.isPositive() ⇒ boolean
    -

    - Returns true if the sign of this BigNumber is positive, otherwise returns - false. -

    -
    -x = new BigNumber(-0)
    -x.isPositive()                  // false
    -y = new BigNumber(2)
    -y.isPositive()                  // true
    - - - -
    isZero.isZero() ⇒ boolean
    -

    - Returns true if the value of this BigNumber is zero or minus zero, otherwise - returns false. -

    -
    -x = new BigNumber(-0)
    -x.isZero() && x.isNegative()         // true
    -y = new BigNumber(Infinity)
    -y.isZero()                      // false
    -

    Note: n == 0 can be used if n >= Number.MIN_VALUE.

    - - - -
    - minus.minus(n [, base]) ⇒ BigNumber -
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    Returns a BigNumber whose value is the value of this BigNumber minus n.

    -

    The return value is always exact and unrounded.

    -
    -0.3 - 0.1                       // 0.19999999999999998
    -x = new BigNumber(0.3)
    -x.minus(0.1)                    // '0.2'
    -x.minus(0.6, 20)                // '0'
    - - - -
    modulo.mod(n [, base]) ⇒ BigNumber
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    - Returns a BigNumber whose value is the value of this BigNumber modulo n, i.e. - the integer remainder of dividing this BigNumber by n. -

    -

    - The value returned, and in particular its sign, is dependent on the value of the - MODULO_MODE setting of this BigNumber constructor. - If it is 1 (default value), the result will have the same sign as this BigNumber, - and it will match that of Javascript's % operator (within the limits of double - precision) and BigDecimal's remainder method. -

    -

    The return value is always exact and unrounded.

    -

    - See MODULO_MODE for a description of the other - modulo modes. -

    -
    -1 % 0.9                         // 0.09999999999999998
    -x = new BigNumber(1)
    -x.modulo(0.9)                   // '0.1'
    -y = new BigNumber(33)
    -y.mod('a', 33)                  // '3'
    - - - -
    - multipliedBy.times(n [, base]) ⇒ BigNumber -
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    - Returns a BigNumber whose value is the value of this BigNumber multiplied by n. -

    -

    The return value is always exact and unrounded.

    -
    -0.6 * 3                         // 1.7999999999999998
    -x = new BigNumber(0.6)
    -y = x.multipliedBy(3)           // '1.8'
    -BigNumber('7e+500').times(y)    // '1.26e+501'
    -x.multipliedBy('-a', 16)        // '-6'
    - - - -
    negated.negated() ⇒ BigNumber
    -

    - Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by - -1. -

    -
    -x = new BigNumber(1.8)
    -x.negated()                     // '-1.8'
    -y = new BigNumber(-1.3)
    -y.negated()                     // '1.3'
    - - - -
    plus.plus(n [, base]) ⇒ BigNumber
    -

    - n: number|string|BigNumber
    - base: number
    - See BigNumber for further parameter details. -

    -

    Returns a BigNumber whose value is the value of this BigNumber plus n.

    -

    The return value is always exact and unrounded.

    -
    -0.1 + 0.2                       // 0.30000000000000004
    -x = new BigNumber(0.1)
    -y = x.plus(0.2)                 // '0.3'
    -BigNumber(0.7).plus(x).plus(y)  // '1'
    -x.plus('0.1', 8)                // '0.225'
    - - - -
    - precision.sd([d [, rm]]) ⇒ BigNumber|number -
    -

    - d: number|boolean: integer, 1 to 1e+9 - inclusive, or true or false
    - rm: number: integer, 0 to 8 inclusive. -

    -

    - If d is a number, returns a BigNumber whose value is the value of this BigNumber - rounded to a precision of d significant digits using rounding mode - rm. -

    -

    - If d is omitted or is null or undefined, the return - value is the number of significant digits of the value of this BigNumber, or null - if the value of this BigNumber is ±Infinity or NaN.

    -

    -

    - If d is true then any trailing zeros of the integer - part of a number are counted as significant digits, otherwise they are not. -

    -

    - If rm is omitted or is null or undefined, - ROUNDING_MODE will be used. -

    -

    - Throws if d or rm is invalid. See Errors. -

    -
    -x = new BigNumber(9876.54321)
    -x.precision(6)                         // '9876.54'
    -x.sd()                                 // 9
    -x.precision(6, BigNumber.ROUND_UP)     // '9876.55'
    -x.sd(2)                                // '9900'
    -x.precision(2, 1)                      // '9800'
    -x                                      // '9876.54321'
    -y = new BigNumber(987000)
    -y.precision()                          // 3
    -y.sd(true)                             // 6
    - - - -
    shiftedBy.shiftedBy(n) ⇒ BigNumber
    -

    - n: number: integer, - -9007199254740991 to 9007199254740991 inclusive -

    -

    - Returns a BigNumber whose value is the value of this BigNumber shifted by n - places. -

    - The shift is of the decimal point, i.e. of powers of ten, and is to the left if n - is negative or to the right if n is positive. -

    -

    The return value is always exact and unrounded.

    -

    - Throws if n is invalid. See Errors. -

    -
    -x = new BigNumber(1.23)
    -x.shiftedBy(3)                      // '1230'
    -x.shiftedBy(-3)                     // '0.00123'
    - - - -
    squareRoot.sqrt() ⇒ BigNumber
    -

    - Returns a BigNumber whose value is the square root of the value of this BigNumber, - rounded according to the current - DECIMAL_PLACES and - ROUNDING_MODE settings. -

    -

    - The return value will be correctly rounded, i.e. rounded as if the result was first calculated - to an infinite number of correct digits before rounding. -

    -
    -x = new BigNumber(16)
    -x.squareRoot()                  // '4'
    -y = new BigNumber(3)
    -y.sqrt()                        // '1.73205080756887729353'
    - - - -
    - toExponential.toExponential([dp [, rm]]) ⇒ string -
    -

    - dp: number: integer, 0 to 1e+9 inclusive
    - rm: number: integer, 0 to 8 inclusive -

    -

    - Returns a string representing the value of this BigNumber in exponential notation rounded - using rounding mode rm to dp decimal places, i.e with one digit - before the decimal point and dp digits after it. -

    -

    - If the value of this BigNumber in exponential notation has fewer than dp fraction - digits, the return value will be appended with zeros accordingly. -

    -

    - If dp is omitted, or is null or undefined, the number - of digits after the decimal point defaults to the minimum number of digits necessary to - represent the value exactly.
    - If rm is omitted or is null or undefined, - ROUNDING_MODE is used. -

    -

    - Throws if dp or rm is invalid. See Errors. -

    -
    -x = 45.6
    -y = new BigNumber(x)
    -x.toExponential()               // '4.56e+1'
    -y.toExponential()               // '4.56e+1'
    -x.toExponential(0)              // '5e+1'
    -y.toExponential(0)              // '5e+1'
    -x.toExponential(1)              // '4.6e+1'
    -y.toExponential(1)              // '4.6e+1'
    -y.toExponential(1, 1)           // '4.5e+1'  (ROUND_DOWN)
    -x.toExponential(3)              // '4.560e+1'
    -y.toExponential(3)              // '4.560e+1'
    - - - -
    - toFixed.toFixed([dp [, rm]]) ⇒ string -
    -

    - dp: number: integer, 0 to 1e+9 inclusive
    - rm: number: integer, 0 to 8 inclusive -

    -

    - Returns a string representing the value of this BigNumber in normal (fixed-point) notation - rounded to dp decimal places using rounding mode rm. -

    -

    - If the value of this BigNumber in normal notation has fewer than dp fraction - digits, the return value will be appended with zeros accordingly. -

    -

    - Unlike Number.prototype.toFixed, which returns exponential notation if a number - is greater or equal to 1021, this method will always return normal - notation. -

    -

    - If dp is omitted or is null or undefined, the return - value will be unrounded and in normal notation. This is also unlike - Number.prototype.toFixed, which returns the value to zero decimal places.
    - It is useful when fixed-point notation is required and the current - EXPONENTIAL_AT setting causes - toString to return exponential notation.
    - If rm is omitted or is null or undefined, - ROUNDING_MODE is used. -

    -

    - Throws if dp or rm is invalid. See Errors. -

    -
    -x = 3.456
    -y = new BigNumber(x)
    -x.toFixed()                     // '3'
    -y.toFixed()                     // '3.456'
    -y.toFixed(0)                    // '3'
    -x.toFixed(2)                    // '3.46'
    -y.toFixed(2)                    // '3.46'
    -y.toFixed(2, 1)                 // '3.45'  (ROUND_DOWN)
    -x.toFixed(5)                    // '3.45600'
    -y.toFixed(5)                    // '3.45600'
    - - - -
    - toFormat.toFormat([dp [, rm[, format]]]) ⇒ string -
    -

    - dp: number: integer, 0 to 1e+9 inclusive
    - rm: number: integer, 0 to 8 inclusive
    - format: object: see FORMAT -

    -

    -

    - Returns a string representing the value of this BigNumber in normal (fixed-point) notation - rounded to dp decimal places using rounding mode rm, and formatted - according to the properties of the format object. -

    -

    - See FORMAT and the examples below for the properties of the - format object, their types, and their usage. A formatting object may contain - some or all of the recognised properties. -

    -

    - If dp is omitted or is null or undefined, then the - return value is not rounded to a fixed number of decimal places.
    - If rm is omitted or is null or undefined, - ROUNDING_MODE is used.
    - If format is omitted or is null or undefined, the - FORMAT object is used. -

    -

    - Throws if dp, rm or format is invalid. See - Errors. -

    -
    -fmt = {
    -  prefix = '',
    -  decimalSeparator: '.',
    -  groupSeparator: ',',
    -  groupSize: 3,
    -  secondaryGroupSize: 0,
    -  fractionGroupSeparator: ' ',
    -  fractionGroupSize: 0,
    -  suffix = ''
    -}
    -
    -x = new BigNumber('123456789.123456789')
    -
    -// Set the global formatting options
    -BigNumber.config({ FORMAT: fmt })
    -
    -x.toFormat()                              // '123,456,789.123456789'
    -x.toFormat(3)                             // '123,456,789.123'
    -
    -// If a reference to the object assigned to FORMAT has been retained,
    -// the format properties can be changed directly
    -fmt.groupSeparator = ' '
    -fmt.fractionGroupSize = 5
    -x.toFormat()                              // '123 456 789.12345 6789'
    -
    -// Alternatively, pass the formatting options as an argument
    -fmt = {
    -  prefix: '=> ',
    -  decimalSeparator: ',',
    -  groupSeparator: '.',
    -  groupSize: 3,
    -  secondaryGroupSize: 2
    -}
    -
    -x.toFormat()                              // '123 456 789.12345 6789'
    -x.toFormat(fmt)                           // '=> 12.34.56.789,123456789'
    -x.toFormat(2, fmt)                        // '=> 12.34.56.789,12'
    -x.toFormat(3, BigNumber.ROUND_UP, fmt)    // '=> 12.34.56.789,124'
    - - - -
    - toFraction.toFraction([maximum_denominator]) - ⇒ [BigNumber, BigNumber] -
    -

    - maximum_denominator: - number|string|BigNumber: integer >= 1 and <= - Infinity -

    -

    - Returns an array of two BigNumbers representing the value of this BigNumber as a simple - fraction with an integer numerator and an integer denominator. The denominator will be a - positive non-zero value less than or equal to maximum_denominator. -

    -

    - If a maximum_denominator is not specified, or is null or - undefined, the denominator will be the lowest value necessary to represent the - number exactly. -

    -

    - Throws if maximum_denominator is invalid. See Errors. -

    -
    -x = new BigNumber(1.75)
    -x.toFraction()                  // '7, 4'
    -
    -pi = new BigNumber('3.14159265358')
    -pi.toFraction()                 // '157079632679,50000000000'
    -pi.toFraction(100000)           // '312689, 99532'
    -pi.toFraction(10000)            // '355, 113'
    -pi.toFraction(100)              // '311, 99'
    -pi.toFraction(10)               // '22, 7'
    -pi.toFraction(1)                // '3, 1'
    - - - -
    toJSON.toJSON() ⇒ string
    -

    As valueOf.

    -
    -x = new BigNumber('177.7e+457')
    -y = new BigNumber(235.4325)
    -z = new BigNumber('0.0098074')
    -
    -// Serialize an array of three BigNumbers
    -str = JSON.stringify( [x, y, z] )
    -// "["1.777e+459","235.4325","0.0098074"]"
    -
    -// Return an array of three BigNumbers
    -JSON.parse(str, function (key, val) {
    -    return key === '' ? val : new BigNumber(val)
    -})
    - - - -
    toNumber.toNumber() ⇒ number
    -

    Returns the value of this BigNumber as a JavaScript number primitive.

    -

    - This method is identical to using type coercion with the unary plus operator. -

    -
    -x = new BigNumber(456.789)
    -x.toNumber()                    // 456.789
    -+x                              // 456.789
    -
    -y = new BigNumber('45987349857634085409857349856430985')
    -y.toNumber()                    // 4.598734985763409e+34
    -
    -z = new BigNumber(-0)
    -1 / z.toNumber()                // -Infinity
    -1 / +z                          // -Infinity
    - - - -
    - toPrecision.toPrecision([sd [, rm]]) ⇒ string -
    -

    - sd: number: integer, 1 to 1e+9 inclusive
    - rm: number: integer, 0 to 8 inclusive -

    -

    - Returns a string representing the value of this BigNumber rounded to sd - significant digits using rounding mode rm. -

    -

    - If sd is less than the number of digits necessary to represent the integer part - of the value in normal (fixed-point) notation, then exponential notation is used. -

    -

    - If sd is omitted, or is null or undefined, then the - return value is the same as n.toString().
    - If rm is omitted or is null or undefined, - ROUNDING_MODE is used. -

    -

    - Throws if sd or rm is invalid. See Errors. -

    -
    -x = 45.6
    -y = new BigNumber(x)
    -x.toPrecision()                 // '45.6'
    -y.toPrecision()                 // '45.6'
    -x.toPrecision(1)                // '5e+1'
    -y.toPrecision(1)                // '5e+1'
    -y.toPrecision(2, 0)             // '4.6e+1'  (ROUND_UP)
    -y.toPrecision(2, 1)             // '4.5e+1'  (ROUND_DOWN)
    -x.toPrecision(5)                // '45.600'
    -y.toPrecision(5)                // '45.600'
    - - - -
    toString.toString([base]) ⇒ string
    -

    - base: number: integer, 2 to ALPHABET.length - inclusive (see ALPHABET). -

    -

    - Returns a string representing the value of this BigNumber in the specified base, or base - 10 if base is omitted or is null or - undefined. -

    -

    - For bases above 10, and using the default base conversion alphabet - (see ALPHABET), values from 10 to - 35 are represented by a-z - (as with Number.prototype.toString). -

    -

    - If a base is specified the value is rounded according to the current - DECIMAL_PLACES - and ROUNDING_MODE settings. -

    -

    - If a base is not specified, and this BigNumber has a positive - exponent that is equal to or greater than the positive component of the - current EXPONENTIAL_AT setting, - or a negative exponent equal to or less than the negative component of the - setting, then exponential notation is returned. -

    -

    If base is null or undefined it is ignored.

    -

    - Throws if base is invalid. See Errors. -

    -
    -x = new BigNumber(750000)
    -x.toString()                    // '750000'
    -BigNumber.config({ EXPONENTIAL_AT: 5 })
    -x.toString()                    // '7.5e+5'
    -
    -y = new BigNumber(362.875)
    -y.toString(2)                   // '101101010.111'
    -y.toString(9)                   // '442.77777777777777777778'
    -y.toString(32)                  // 'ba.s'
    -
    -BigNumber.config({ DECIMAL_PLACES: 4 });
    -z = new BigNumber('1.23456789')
    -z.toString()                    // '1.23456789'
    -z.toString(10)                  // '1.2346'
    - - - -
    valueOf.valueOf() ⇒ string
    -

    - As toString, but does not accept a base argument and includes - the minus sign for negative zero. -

    -
    -x = new BigNumber('-0')
    -x.toString()                    // '0'
    -x.valueOf()                     // '-0'
    -y = new BigNumber('1.777e+457')
    -y.valueOf()                     // '1.777e+457'
    - - - -

    Properties

    -

    The properties of a BigNumber instance:

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    PropertyDescriptionTypeValue
    ccoefficient*number[] Array of base 1e14 numbers
    eexponentnumberInteger, -1000000000 to 1000000000 inclusive
    ssignnumber-1 or 1
    -

    *significand

    -

    - The value of any of the c, e and s properties may also - be null. -

    -

    - The above properties are best considered to be read-only. In early versions of this library it - was okay to change the exponent of a BigNumber by writing to its exponent property directly, - but this is no longer reliable as the value of the first element of the coefficient array is - now dependent on the exponent. -

    -

    - Note that, as with JavaScript numbers, the original exponent and fractional trailing zeros are - not necessarily preserved. -

    -
    x = new BigNumber(0.123)              // '0.123'
    -x.toExponential()                     // '1.23e-1'
    -x.c                                   // '1,2,3'
    -x.e                                   // -1
    -x.s                                   // 1
    -
    -y = new Number(-123.4567000e+2)       // '-12345.67'
    -y.toExponential()                     // '-1.234567e+4'
    -z = new BigNumber('-123.4567000e+2')  // '-12345.67'
    -z.toExponential()                     // '-1.234567e+4'
    -z.c                                   // '1,2,3,4,5,6,7'
    -z.e                                   // 4
    -z.s                                   // -1
    - - - -

    Zero, NaN and Infinity

    -

    - The table below shows how ±0, NaN and - ±Infinity are stored. -

    - - - - - - - - - - - - - - - - - - - - - - - - - -
    ces
    ±0[0]0±1
    NaNnullnullnull
    ±Infinitynullnull±1
    -
    -x = new Number(-0)              // 0
    -1 / x == -Infinity              // true
    -
    -y = new BigNumber(-0)           // '0'
    -y.c                             // '0' ( [0].toString() )
    -y.e                             // 0
    -y.s                             // -1
    - - - -

    Errors

    -

    The table below shows the errors that are thrown.

    -

    - The errors are generic Error objects whose message begins - '[BigNumber Error]'. -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    MethodThrows
    - BigNumber
    - comparedTo
    - dividedBy
    - dividedToIntegerBy
    - isEqualTo
    - isGreaterThan
    - isGreaterThanOrEqualTo
    - isLessThan
    - isLessThanOrEqualTo
    - minus
    - modulo
    - plus
    - multipliedBy -
    Base not a primitive number
    Base not an integer
    Base out of range
    Number primitive has more than 15 significant digits*
    Not a base... number*
    Not a number*
    cloneObject expected
    configObject expected
    DECIMAL_PLACES not a primitive number
    DECIMAL_PLACES not an integer
    DECIMAL_PLACES out of range
    ROUNDING_MODE not a primitive number
    ROUNDING_MODE not an integer
    ROUNDING_MODE out of range
    EXPONENTIAL_AT not a primitive number
    EXPONENTIAL_AT not an integer
    EXPONENTIAL_AT out of range
    RANGE not a primitive number
    RANGE not an integer
    RANGE cannot be zero
    RANGE cannot be zero
    CRYPTO not true or false
    crypto unavailable
    MODULO_MODE not a primitive number
    MODULO_MODE not an integer
    MODULO_MODE out of range
    POW_PRECISION not a primitive number
    POW_PRECISION not an integer
    POW_PRECISION out of range
    FORMAT not an object
    ALPHABET invalid
    - decimalPlaces
    - precision
    - random
    - shiftedBy
    - toExponential
    - toFixed
    - toFormat
    - toPrecision -
    Argument not a primitive number
    Argument not an integer
    Argument out of range
    - decimalPlaces
    - precision -
    Argument not true or false
    exponentiatedByArgument not an integer
    isBigNumberInvalid BigNumber*
    - minimum
    - maximum -
    Not a number*
    - random - crypto unavailable
    - toFormat - Argument not an object
    toFractionArgument not an integer
    Argument out of range
    toStringBase not a primitive number
    Base not an integer
    Base out of range
    -

    *Only thrown if BigNumber.DEBUG is true.

    -

    To determine if an exception is a BigNumber Error:

    -
    -try {
    -  // ...
    -} catch (e) {
    -  if (e instanceof Error && e.message.indexOf('[BigNumber Error]') === 0) {
    -      // ...
    -  }
    -}
    - - - -

    Type coercion

    -

    - To prevent the accidental use of a BigNumber in primitive number operations, or the - accidental addition of a BigNumber to a string, the valueOf method can be safely - overwritten as shown below. -

    -

    - The valueOf method is the same as the - toJSON method, and both are the same as the - toString method except they do not take a base - argument and they include the minus sign for negative zero. -

    -
    -BigNumber.prototype.valueOf = function () {
    -  throw Error('valueOf called!')
    -}
    -
    -x = new BigNumber(1)
    -x / 2                    // '[BigNumber Error] valueOf called!'
    -x + 'abc'                // '[BigNumber Error] valueOf called!'
    -
    - - - -

    FAQ

    - -
    Why are trailing fractional zeros removed from BigNumbers?
    -

    - Some arbitrary-precision libraries retain trailing fractional zeros as they can indicate the - precision of a value. This can be useful but the results of arithmetic operations can be - misleading. -

    -
    -x = new BigDecimal("1.0")
    -y = new BigDecimal("1.1000")
    -z = x.add(y)                      // 2.1000
    -
    -x = new BigDecimal("1.20")
    -y = new BigDecimal("3.45000")
    -z = x.multiply(y)                 // 4.1400000
    -

    - To specify the precision of a value is to specify that the value lies - within a certain range. -

    -

    - In the first example, x has a value of 1.0. The trailing zero shows - the precision of the value, implying that it is in the range 0.95 to - 1.05. Similarly, the precision indicated by the trailing zeros of y - indicates that the value is in the range 1.09995 to 1.10005. -

    -

    - If we add the two lowest values in the ranges we have, 0.95 + 1.09995 = 2.04995, - and if we add the two highest values we have, 1.05 + 1.10005 = 2.15005, so the - range of the result of the addition implied by the precision of its operands is - 2.04995 to 2.15005. -

    -

    - The result given by BigDecimal of 2.1000 however, indicates that the value is in - the range 2.09995 to 2.10005 and therefore the precision implied by - its trailing zeros may be misleading. -

    -

    - In the second example, the true range is 4.122744 to 4.157256 yet - the BigDecimal answer of 4.1400000 indicates a range of 4.13999995 - to 4.14000005. Again, the precision implied by the trailing zeros may be - misleading. -

    -

    - This library, like binary floating point and most calculators, does not retain trailing - fractional zeros. Instead, the toExponential, toFixed and - toPrecision methods enable trailing zeros to be added if and when required.
    -

    -
    - - - diff --git a/node_modules/bignumber.js/package.json b/node_modules/bignumber.js/package.json deleted file mode 100644 index 475a813..0000000 --- a/node_modules/bignumber.js/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "bignumber.js", - "description": "A library for arbitrary-precision decimal and non-decimal arithmetic", - "version": "9.0.0", - "keywords": [ - "arbitrary", - "precision", - "arithmetic", - "big", - "number", - "decimal", - "float", - "biginteger", - "bigdecimal", - "bignumber", - "bigint", - "bignum" - ], - "repository": { - "type": "git", - "url": "https://github.com/MikeMcl/bignumber.js.git" - }, - "main": "bignumber", - "module": "bignumber.mjs", - "browser": "bignumber.js", - "types": "bignumber.d.ts", - "author": { - "name": "Michael Mclaughlin", - "email": "M8ch88l@gmail.com" - }, - "engines": { - "node": "*" - }, - "license": "MIT", - "scripts": { - "test": "node test/test", - "build": "uglifyjs bignumber.js --source-map -c -m -o bignumber.min.js" - }, - "dependencies": {} -} diff --git a/node_modules/body-parser/HISTORY.md b/node_modules/body-parser/HISTORY.md deleted file mode 100644 index fb212b3..0000000 --- a/node_modules/body-parser/HISTORY.md +++ /dev/null @@ -1,657 +0,0 @@ -1.20.1 / 2022-10-06 -=================== - - * deps: qs@6.11.0 - * perf: remove unnecessary object clone - -1.20.0 / 2022-04-02 -=================== - - * Fix error message for json parse whitespace in `strict` - * Fix internal error when inflated body exceeds limit - * Prevent loss of async hooks context - * Prevent hanging when request already read - * deps: depd@2.0.0 - - Replace internal `eval` usage with `Function` constructor - - Use instance methods on `process` to check for listeners - * deps: http-errors@2.0.0 - - deps: depd@2.0.0 - - deps: statuses@2.0.1 - * deps: on-finished@2.4.1 - * deps: qs@6.10.3 - * deps: raw-body@2.5.1 - - deps: http-errors@2.0.0 - -1.19.2 / 2022-02-15 -=================== - - * deps: bytes@3.1.2 - * deps: qs@6.9.7 - * Fix handling of `__proto__` keys - * deps: raw-body@2.4.3 - - deps: bytes@3.1.2 - -1.19.1 / 2021-12-10 -=================== - - * deps: bytes@3.1.1 - * deps: http-errors@1.8.1 - - deps: inherits@2.0.4 - - deps: toidentifier@1.0.1 - - deps: setprototypeof@1.2.0 - * deps: qs@6.9.6 - * deps: raw-body@2.4.2 - - deps: bytes@3.1.1 - - deps: http-errors@1.8.1 - * deps: safe-buffer@5.2.1 - * deps: type-is@~1.6.18 - -1.19.0 / 2019-04-25 -=================== - - * deps: bytes@3.1.0 - - Add petabyte (`pb`) support - * deps: http-errors@1.7.2 - - Set constructor name when possible - - deps: setprototypeof@1.1.1 - - deps: statuses@'>= 1.5.0 < 2' - * deps: iconv-lite@0.4.24 - - Added encoding MIK - * deps: qs@6.7.0 - - Fix parsing array brackets after index - * deps: raw-body@2.4.0 - - deps: bytes@3.1.0 - - deps: http-errors@1.7.2 - - deps: iconv-lite@0.4.24 - * deps: type-is@~1.6.17 - - deps: mime-types@~2.1.24 - - perf: prevent internal `throw` on invalid type - -1.18.3 / 2018-05-14 -=================== - - * Fix stack trace for strict json parse error - * deps: depd@~1.1.2 - - perf: remove argument reassignment - * deps: http-errors@~1.6.3 - - deps: depd@~1.1.2 - - deps: setprototypeof@1.1.0 - - deps: statuses@'>= 1.3.1 < 2' - * deps: iconv-lite@0.4.23 - - Fix loading encoding with year appended - - Fix deprecation warnings on Node.js 10+ - * deps: qs@6.5.2 - * deps: raw-body@2.3.3 - - deps: http-errors@1.6.3 - - deps: iconv-lite@0.4.23 - * deps: type-is@~1.6.16 - - deps: mime-types@~2.1.18 - -1.18.2 / 2017-09-22 -=================== - - * deps: debug@2.6.9 - * perf: remove argument reassignment - -1.18.1 / 2017-09-12 -=================== - - * deps: content-type@~1.0.4 - - perf: remove argument reassignment - - perf: skip parameter parsing when no parameters - * deps: iconv-lite@0.4.19 - - Fix ISO-8859-1 regression - - Update Windows-1255 - * deps: qs@6.5.1 - - Fix parsing & compacting very deep objects - * deps: raw-body@2.3.2 - - deps: iconv-lite@0.4.19 - -1.18.0 / 2017-09-08 -=================== - - * Fix JSON strict violation error to match native parse error - * Include the `body` property on verify errors - * Include the `type` property on all generated errors - * Use `http-errors` to set status code on errors - * deps: bytes@3.0.0 - * deps: debug@2.6.8 - * deps: depd@~1.1.1 - - Remove unnecessary `Buffer` loading - * deps: http-errors@~1.6.2 - - deps: depd@1.1.1 - * deps: iconv-lite@0.4.18 - - Add support for React Native - - Add a warning if not loaded as utf-8 - - Fix CESU-8 decoding in Node.js 8 - - Improve speed of ISO-8859-1 encoding - * deps: qs@6.5.0 - * deps: raw-body@2.3.1 - - Use `http-errors` for standard emitted errors - - deps: bytes@3.0.0 - - deps: iconv-lite@0.4.18 - - perf: skip buffer decoding on overage chunk - * perf: prevent internal `throw` when missing charset - -1.17.2 / 2017-05-17 -=================== - - * deps: debug@2.6.7 - - Fix `DEBUG_MAX_ARRAY_LENGTH` - - deps: ms@2.0.0 - * deps: type-is@~1.6.15 - - deps: mime-types@~2.1.15 - -1.17.1 / 2017-03-06 -=================== - - * deps: qs@6.4.0 - - Fix regression parsing keys starting with `[` - -1.17.0 / 2017-03-01 -=================== - - * deps: http-errors@~1.6.1 - - Make `message` property enumerable for `HttpError`s - - deps: setprototypeof@1.0.3 - * deps: qs@6.3.1 - - Fix compacting nested arrays - -1.16.1 / 2017-02-10 -=================== - - * deps: debug@2.6.1 - - Fix deprecation messages in WebStorm and other editors - - Undeprecate `DEBUG_FD` set to `1` or `2` - -1.16.0 / 2017-01-17 -=================== - - * deps: debug@2.6.0 - - Allow colors in workers - - Deprecated `DEBUG_FD` environment variable - - Fix error when running under React Native - - Use same color for same namespace - - deps: ms@0.7.2 - * deps: http-errors@~1.5.1 - - deps: inherits@2.0.3 - - deps: setprototypeof@1.0.2 - - deps: statuses@'>= 1.3.1 < 2' - * deps: iconv-lite@0.4.15 - - Added encoding MS-31J - - Added encoding MS-932 - - Added encoding MS-936 - - Added encoding MS-949 - - Added encoding MS-950 - - Fix GBK/GB18030 handling of Euro character - * deps: qs@6.2.1 - - Fix array parsing from skipping empty values - * deps: raw-body@~2.2.0 - - deps: iconv-lite@0.4.15 - * deps: type-is@~1.6.14 - - deps: mime-types@~2.1.13 - -1.15.2 / 2016-06-19 -=================== - - * deps: bytes@2.4.0 - * deps: content-type@~1.0.2 - - perf: enable strict mode - * deps: http-errors@~1.5.0 - - Use `setprototypeof` module to replace `__proto__` setting - - deps: statuses@'>= 1.3.0 < 2' - - perf: enable strict mode - * deps: qs@6.2.0 - * deps: raw-body@~2.1.7 - - deps: bytes@2.4.0 - - perf: remove double-cleanup on happy path - * deps: type-is@~1.6.13 - - deps: mime-types@~2.1.11 - -1.15.1 / 2016-05-05 -=================== - - * deps: bytes@2.3.0 - - Drop partial bytes on all parsed units - - Fix parsing byte string that looks like hex - * deps: raw-body@~2.1.6 - - deps: bytes@2.3.0 - * deps: type-is@~1.6.12 - - deps: mime-types@~2.1.10 - -1.15.0 / 2016-02-10 -=================== - - * deps: http-errors@~1.4.0 - - Add `HttpError` export, for `err instanceof createError.HttpError` - - deps: inherits@2.0.1 - - deps: statuses@'>= 1.2.1 < 2' - * deps: qs@6.1.0 - * deps: type-is@~1.6.11 - - deps: mime-types@~2.1.9 - -1.14.2 / 2015-12-16 -=================== - - * deps: bytes@2.2.0 - * deps: iconv-lite@0.4.13 - * deps: qs@5.2.0 - * deps: raw-body@~2.1.5 - - deps: bytes@2.2.0 - - deps: iconv-lite@0.4.13 - * deps: type-is@~1.6.10 - - deps: mime-types@~2.1.8 - -1.14.1 / 2015-09-27 -=================== - - * Fix issue where invalid charset results in 400 when `verify` used - * deps: iconv-lite@0.4.12 - - Fix CESU-8 decoding in Node.js 4.x - * deps: raw-body@~2.1.4 - - Fix masking critical errors from `iconv-lite` - - deps: iconv-lite@0.4.12 - * deps: type-is@~1.6.9 - - deps: mime-types@~2.1.7 - -1.14.0 / 2015-09-16 -=================== - - * Fix JSON strict parse error to match syntax errors - * Provide static `require` analysis in `urlencoded` parser - * deps: depd@~1.1.0 - - Support web browser loading - * deps: qs@5.1.0 - * deps: raw-body@~2.1.3 - - Fix sync callback when attaching data listener causes sync read - * deps: type-is@~1.6.8 - - Fix type error when given invalid type to match against - - deps: mime-types@~2.1.6 - -1.13.3 / 2015-07-31 -=================== - - * deps: type-is@~1.6.6 - - deps: mime-types@~2.1.4 - -1.13.2 / 2015-07-05 -=================== - - * deps: iconv-lite@0.4.11 - * deps: qs@4.0.0 - - Fix dropping parameters like `hasOwnProperty` - - Fix user-visible incompatibilities from 3.1.0 - - Fix various parsing edge cases - * deps: raw-body@~2.1.2 - - Fix error stack traces to skip `makeError` - - deps: iconv-lite@0.4.11 - * deps: type-is@~1.6.4 - - deps: mime-types@~2.1.2 - - perf: enable strict mode - - perf: remove argument reassignment - -1.13.1 / 2015-06-16 -=================== - - * deps: qs@2.4.2 - - Downgraded from 3.1.0 because of user-visible incompatibilities - -1.13.0 / 2015-06-14 -=================== - - * Add `statusCode` property on `Error`s, in addition to `status` - * Change `type` default to `application/json` for JSON parser - * Change `type` default to `application/x-www-form-urlencoded` for urlencoded parser - * Provide static `require` analysis - * Use the `http-errors` module to generate errors - * deps: bytes@2.1.0 - - Slight optimizations - * deps: iconv-lite@0.4.10 - - The encoding UTF-16 without BOM now defaults to UTF-16LE when detection fails - - Leading BOM is now removed when decoding - * deps: on-finished@~2.3.0 - - Add defined behavior for HTTP `CONNECT` requests - - Add defined behavior for HTTP `Upgrade` requests - - deps: ee-first@1.1.1 - * deps: qs@3.1.0 - - Fix dropping parameters like `hasOwnProperty` - - Fix various parsing edge cases - - Parsed object now has `null` prototype - * deps: raw-body@~2.1.1 - - Use `unpipe` module for unpiping requests - - deps: iconv-lite@0.4.10 - * deps: type-is@~1.6.3 - - deps: mime-types@~2.1.1 - - perf: reduce try block size - - perf: remove bitwise operations - * perf: enable strict mode - * perf: remove argument reassignment - * perf: remove delete call - -1.12.4 / 2015-05-10 -=================== - - * deps: debug@~2.2.0 - * deps: qs@2.4.2 - - Fix allowing parameters like `constructor` - * deps: on-finished@~2.2.1 - * deps: raw-body@~2.0.1 - - Fix a false-positive when unpiping in Node.js 0.8 - - deps: bytes@2.0.1 - * deps: type-is@~1.6.2 - - deps: mime-types@~2.0.11 - -1.12.3 / 2015-04-15 -=================== - - * Slight efficiency improvement when not debugging - * deps: depd@~1.0.1 - * deps: iconv-lite@0.4.8 - - Add encoding alias UNICODE-1-1-UTF-7 - * deps: raw-body@1.3.4 - - Fix hanging callback if request aborts during read - - deps: iconv-lite@0.4.8 - -1.12.2 / 2015-03-16 -=================== - - * deps: qs@2.4.1 - - Fix error when parameter `hasOwnProperty` is present - -1.12.1 / 2015-03-15 -=================== - - * deps: debug@~2.1.3 - - Fix high intensity foreground color for bold - - deps: ms@0.7.0 - * deps: type-is@~1.6.1 - - deps: mime-types@~2.0.10 - -1.12.0 / 2015-02-13 -=================== - - * add `debug` messages - * accept a function for the `type` option - * use `content-type` to parse `Content-Type` headers - * deps: iconv-lite@0.4.7 - - Gracefully support enumerables on `Object.prototype` - * deps: raw-body@1.3.3 - - deps: iconv-lite@0.4.7 - * deps: type-is@~1.6.0 - - fix argument reassignment - - fix false-positives in `hasBody` `Transfer-Encoding` check - - support wildcard for both type and subtype (`*/*`) - - deps: mime-types@~2.0.9 - -1.11.0 / 2015-01-30 -=================== - - * make internal `extended: true` depth limit infinity - * deps: type-is@~1.5.6 - - deps: mime-types@~2.0.8 - -1.10.2 / 2015-01-20 -=================== - - * deps: iconv-lite@0.4.6 - - Fix rare aliases of single-byte encodings - * deps: raw-body@1.3.2 - - deps: iconv-lite@0.4.6 - -1.10.1 / 2015-01-01 -=================== - - * deps: on-finished@~2.2.0 - * deps: type-is@~1.5.5 - - deps: mime-types@~2.0.7 - -1.10.0 / 2014-12-02 -=================== - - * make internal `extended: true` array limit dynamic - -1.9.3 / 2014-11-21 -================== - - * deps: iconv-lite@0.4.5 - - Fix Windows-31J and X-SJIS encoding support - * deps: qs@2.3.3 - - Fix `arrayLimit` behavior - * deps: raw-body@1.3.1 - - deps: iconv-lite@0.4.5 - * deps: type-is@~1.5.3 - - deps: mime-types@~2.0.3 - -1.9.2 / 2014-10-27 -================== - - * deps: qs@2.3.2 - - Fix parsing of mixed objects and values - -1.9.1 / 2014-10-22 -================== - - * deps: on-finished@~2.1.1 - - Fix handling of pipelined requests - * deps: qs@2.3.0 - - Fix parsing of mixed implicit and explicit arrays - * deps: type-is@~1.5.2 - - deps: mime-types@~2.0.2 - -1.9.0 / 2014-09-24 -================== - - * include the charset in "unsupported charset" error message - * include the encoding in "unsupported content encoding" error message - * deps: depd@~1.0.0 - -1.8.4 / 2014-09-23 -================== - - * fix content encoding to be case-insensitive - -1.8.3 / 2014-09-19 -================== - - * deps: qs@2.2.4 - - Fix issue with object keys starting with numbers truncated - -1.8.2 / 2014-09-15 -================== - - * deps: depd@0.4.5 - -1.8.1 / 2014-09-07 -================== - - * deps: media-typer@0.3.0 - * deps: type-is@~1.5.1 - -1.8.0 / 2014-09-05 -================== - - * make empty-body-handling consistent between chunked requests - - empty `json` produces `{}` - - empty `raw` produces `new Buffer(0)` - - empty `text` produces `''` - - empty `urlencoded` produces `{}` - * deps: qs@2.2.3 - - Fix issue where first empty value in array is discarded - * deps: type-is@~1.5.0 - - fix `hasbody` to be true for `content-length: 0` - -1.7.0 / 2014-09-01 -================== - - * add `parameterLimit` option to `urlencoded` parser - * change `urlencoded` extended array limit to 100 - * respond with 413 when over `parameterLimit` in `urlencoded` - -1.6.7 / 2014-08-29 -================== - - * deps: qs@2.2.2 - - Remove unnecessary cloning - -1.6.6 / 2014-08-27 -================== - - * deps: qs@2.2.0 - - Array parsing fix - - Performance improvements - -1.6.5 / 2014-08-16 -================== - - * deps: on-finished@2.1.0 - -1.6.4 / 2014-08-14 -================== - - * deps: qs@1.2.2 - -1.6.3 / 2014-08-10 -================== - - * deps: qs@1.2.1 - -1.6.2 / 2014-08-07 -================== - - * deps: qs@1.2.0 - - Fix parsing array of objects - -1.6.1 / 2014-08-06 -================== - - * deps: qs@1.1.0 - - Accept urlencoded square brackets - - Accept empty values in implicit array notation - -1.6.0 / 2014-08-05 -================== - - * deps: qs@1.0.2 - - Complete rewrite - - Limits array length to 20 - - Limits object depth to 5 - - Limits parameters to 1,000 - -1.5.2 / 2014-07-27 -================== - - * deps: depd@0.4.4 - - Work-around v8 generating empty stack traces - -1.5.1 / 2014-07-26 -================== - - * deps: depd@0.4.3 - - Fix exception when global `Error.stackTraceLimit` is too low - -1.5.0 / 2014-07-20 -================== - - * deps: depd@0.4.2 - - Add `TRACE_DEPRECATION` environment variable - - Remove non-standard grey color from color output - - Support `--no-deprecation` argument - - Support `--trace-deprecation` argument - * deps: iconv-lite@0.4.4 - - Added encoding UTF-7 - * deps: raw-body@1.3.0 - - deps: iconv-lite@0.4.4 - - Added encoding UTF-7 - - Fix `Cannot switch to old mode now` error on Node.js 0.10+ - * deps: type-is@~1.3.2 - -1.4.3 / 2014-06-19 -================== - - * deps: type-is@1.3.1 - - fix global variable leak - -1.4.2 / 2014-06-19 -================== - - * deps: type-is@1.3.0 - - improve type parsing - -1.4.1 / 2014-06-19 -================== - - * fix urlencoded extended deprecation message - -1.4.0 / 2014-06-19 -================== - - * add `text` parser - * add `raw` parser - * check accepted charset in content-type (accepts utf-8) - * check accepted encoding in content-encoding (accepts identity) - * deprecate `bodyParser()` middleware; use `.json()` and `.urlencoded()` as needed - * deprecate `urlencoded()` without provided `extended` option - * lazy-load urlencoded parsers - * parsers split into files for reduced mem usage - * support gzip and deflate bodies - - set `inflate: false` to turn off - * deps: raw-body@1.2.2 - - Support all encodings from `iconv-lite` - -1.3.1 / 2014-06-11 -================== - - * deps: type-is@1.2.1 - - Switch dependency from mime to mime-types@1.0.0 - -1.3.0 / 2014-05-31 -================== - - * add `extended` option to urlencoded parser - -1.2.2 / 2014-05-27 -================== - - * deps: raw-body@1.1.6 - - assert stream encoding on node.js 0.8 - - assert stream encoding on node.js < 0.10.6 - - deps: bytes@1 - -1.2.1 / 2014-05-26 -================== - - * invoke `next(err)` after request fully read - - prevents hung responses and socket hang ups - -1.2.0 / 2014-05-11 -================== - - * add `verify` option - * deps: type-is@1.2.0 - - support suffix matching - -1.1.2 / 2014-05-11 -================== - - * improve json parser speed - -1.1.1 / 2014-05-11 -================== - - * fix repeated limit parsing with every request - -1.1.0 / 2014-05-10 -================== - - * add `type` option - * deps: pin for safety and consistency - -1.0.2 / 2014-04-14 -================== - - * use `type-is` module - -1.0.1 / 2014-03-20 -================== - - * lower default limits to 100kb diff --git a/node_modules/body-parser/LICENSE b/node_modules/body-parser/LICENSE deleted file mode 100644 index 386b7b6..0000000 --- a/node_modules/body-parser/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2014-2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/body-parser/README.md b/node_modules/body-parser/README.md deleted file mode 100644 index c507cbb..0000000 --- a/node_modules/body-parser/README.md +++ /dev/null @@ -1,464 +0,0 @@ -# body-parser - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][github-actions-ci-image]][github-actions-ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Node.js body parsing middleware. - -Parse incoming request bodies in a middleware before your handlers, available -under the `req.body` property. - -**Note** As `req.body`'s shape is based on user-controlled input, all -properties and values in this object are untrusted and should be validated -before trusting. For example, `req.body.foo.toString()` may fail in multiple -ways, for example the `foo` property may not be there or may not be a string, -and `toString` may not be a function and instead a string or other user input. - -[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/). - -_This does not handle multipart bodies_, due to their complex and typically -large nature. For multipart bodies, you may be interested in the following -modules: - - * [busboy](https://www.npmjs.org/package/busboy#readme) and - [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme) - * [multiparty](https://www.npmjs.org/package/multiparty#readme) and - [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme) - * [formidable](https://www.npmjs.org/package/formidable#readme) - * [multer](https://www.npmjs.org/package/multer#readme) - -This module provides the following parsers: - - * [JSON body parser](#bodyparserjsonoptions) - * [Raw body parser](#bodyparserrawoptions) - * [Text body parser](#bodyparsertextoptions) - * [URL-encoded form body parser](#bodyparserurlencodedoptions) - -Other body parsers you might be interested in: - -- [body](https://www.npmjs.org/package/body#readme) -- [co-body](https://www.npmjs.org/package/co-body#readme) - -## Installation - -```sh -$ npm install body-parser -``` - -## API - -```js -var bodyParser = require('body-parser') -``` - -The `bodyParser` object exposes various factories to create middlewares. All -middlewares will populate the `req.body` property with the parsed body when -the `Content-Type` request header matches the `type` option, or an empty -object (`{}`) if there was no body to parse, the `Content-Type` was not matched, -or an error occurred. - -The various errors returned by this module are described in the -[errors section](#errors). - -### bodyParser.json([options]) - -Returns middleware that only parses `json` and only looks at requests where -the `Content-Type` header matches the `type` option. This parser accepts any -Unicode encoding of the body and supports automatic inflation of `gzip` and -`deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). - -#### Options - -The `json` function takes an optional `options` object that may contain any of -the following keys: - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### reviver - -The `reviver` option is passed directly to `JSON.parse` as the second -argument. You can find more information on this argument -[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter). - -##### strict - -When set to `true`, will only accept arrays and objects; when `false` will -accept anything `JSON.parse` accepts. Defaults to `true`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not a -function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `json`), a mime type (like `application/json`), or -a mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type` -option is called as `fn(req)` and the request is parsed if it returns a truthy -value. Defaults to `application/json`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.raw([options]) - -Returns middleware that parses all bodies as a `Buffer` and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser supports automatic inflation of `gzip` and `deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This will be a `Buffer` object -of the body. - -#### Options - -The `raw` function takes an optional `options` object that may contain any of -the following keys: - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. -If not a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this -can be an extension name (like `bin`), a mime type (like -`application/octet-stream`), or a mime type with a wildcard (like `*/*` or -`application/*`). If a function, the `type` option is called as `fn(req)` -and the request is parsed if it returns a truthy value. Defaults to -`application/octet-stream`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.text([options]) - -Returns middleware that parses all bodies as a string and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser supports automatic inflation of `gzip` and `deflate` encodings. - -A new `body` string containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This will be a string of the -body. - -#### Options - -The `text` function takes an optional `options` object that may contain any of -the following keys: - -##### defaultCharset - -Specify the default character set for the text content if the charset is not -specified in the `Content-Type` header of the request. Defaults to `utf-8`. - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not -a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `txt`), a mime type (like `text/plain`), or a mime -type with a wildcard (like `*/*` or `text/*`). If a function, the `type` -option is called as `fn(req)` and the request is parsed if it returns a -truthy value. Defaults to `text/plain`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -### bodyParser.urlencoded([options]) - -Returns middleware that only parses `urlencoded` bodies and only looks at -requests where the `Content-Type` header matches the `type` option. This -parser accepts only UTF-8 encoding of the body and supports automatic -inflation of `gzip` and `deflate` encodings. - -A new `body` object containing the parsed data is populated on the `request` -object after the middleware (i.e. `req.body`). This object will contain -key-value pairs, where the value can be a string or array (when `extended` is -`false`), or any type (when `extended` is `true`). - -#### Options - -The `urlencoded` function takes an optional `options` object that may contain -any of the following keys: - -##### extended - -The `extended` option allows to choose between parsing the URL-encoded data -with the `querystring` library (when `false`) or the `qs` library (when -`true`). The "extended" syntax allows for rich objects and arrays to be -encoded into the URL-encoded format, allowing for a JSON-like experience -with URL-encoded. For more information, please -[see the qs library](https://www.npmjs.org/package/qs#readme). - -Defaults to `true`, but using the default has been deprecated. Please -research into the difference between `qs` and `querystring` and choose the -appropriate setting. - -##### inflate - -When set to `true`, then deflated (compressed) bodies will be inflated; when -`false`, deflated bodies are rejected. Defaults to `true`. - -##### limit - -Controls the maximum request body size. If this is a number, then the value -specifies the number of bytes; if it is a string, the value is passed to the -[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults -to `'100kb'`. - -##### parameterLimit - -The `parameterLimit` option controls the maximum number of parameters that -are allowed in the URL-encoded data. If a request contains more parameters -than this value, a 413 will be returned to the client. Defaults to `1000`. - -##### type - -The `type` option is used to determine what media type the middleware will -parse. This option can be a string, array of strings, or a function. If not -a function, `type` option is passed directly to the -[type-is](https://www.npmjs.org/package/type-is#readme) library and this can -be an extension name (like `urlencoded`), a mime type (like -`application/x-www-form-urlencoded`), or a mime type with a wildcard (like -`*/x-www-form-urlencoded`). If a function, the `type` option is called as -`fn(req)` and the request is parsed if it returns a truthy value. Defaults -to `application/x-www-form-urlencoded`. - -##### verify - -The `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`, -where `buf` is a `Buffer` of the raw request body and `encoding` is the -encoding of the request. The parsing can be aborted by throwing an error. - -## Errors - -The middlewares provided by this module create errors using the -[`http-errors` module](https://www.npmjs.com/package/http-errors). The errors -will typically have a `status`/`statusCode` property that contains the suggested -HTTP response code, an `expose` property to determine if the `message` property -should be displayed to the client, a `type` property to determine the type of -error without matching against the `message`, and a `body` property containing -the read body, if available. - -The following are the common errors created, though any error can come through -for various reasons. - -### content encoding unsupported - -This error will occur when the request had a `Content-Encoding` header that -contained an encoding but the "inflation" option was set to `false`. The -`status` property is set to `415`, the `type` property is set to -`'encoding.unsupported'`, and the `charset` property will be set to the -encoding that is unsupported. - -### entity parse failed - -This error will occur when the request contained an entity that could not be -parsed by the middleware. The `status` property is set to `400`, the `type` -property is set to `'entity.parse.failed'`, and the `body` property is set to -the entity value that failed parsing. - -### entity verify failed - -This error will occur when the request contained an entity that could not be -failed verification by the defined `verify` option. The `status` property is -set to `403`, the `type` property is set to `'entity.verify.failed'`, and the -`body` property is set to the entity value that failed verification. - -### request aborted - -This error will occur when the request is aborted by the client before reading -the body has finished. The `received` property will be set to the number of -bytes received before the request was aborted and the `expected` property is -set to the number of expected bytes. The `status` property is set to `400` -and `type` property is set to `'request.aborted'`. - -### request entity too large - -This error will occur when the request body's size is larger than the "limit" -option. The `limit` property will be set to the byte limit and the `length` -property will be set to the request body's length. The `status` property is -set to `413` and the `type` property is set to `'entity.too.large'`. - -### request size did not match content length - -This error will occur when the request's length did not match the length from -the `Content-Length` header. This typically occurs when the request is malformed, -typically when the `Content-Length` header was calculated based on characters -instead of bytes. The `status` property is set to `400` and the `type` property -is set to `'request.size.invalid'`. - -### stream encoding should not be set - -This error will occur when something called the `req.setEncoding` method prior -to this middleware. This module operates directly on bytes only and you cannot -call `req.setEncoding` when using this module. The `status` property is set to -`500` and the `type` property is set to `'stream.encoding.set'`. - -### stream is not readable - -This error will occur when the request is no longer readable when this middleware -attempts to read it. This typically means something other than a middleware from -this module read the request body already and the middleware was also configured to -read the same request. The `status` property is set to `500` and the `type` -property is set to `'stream.not.readable'`. - -### too many parameters - -This error will occur when the content of the request exceeds the configured -`parameterLimit` for the `urlencoded` parser. The `status` property is set to -`413` and the `type` property is set to `'parameters.too.many'`. - -### unsupported charset "BOGUS" - -This error will occur when the request had a charset parameter in the -`Content-Type` header, but the `iconv-lite` module does not support it OR the -parser does not support it. The charset is contained in the message as well -as in the `charset` property. The `status` property is set to `415`, the -`type` property is set to `'charset.unsupported'`, and the `charset` property -is set to the charset that is unsupported. - -### unsupported content encoding "bogus" - -This error will occur when the request had a `Content-Encoding` header that -contained an unsupported encoding. The encoding is contained in the message -as well as in the `encoding` property. The `status` property is set to `415`, -the `type` property is set to `'encoding.unsupported'`, and the `encoding` -property is set to the encoding that is unsupported. - -## Examples - -### Express/Connect top-level generic - -This example demonstrates adding a generic JSON and URL-encoded parser as a -top-level middleware, which will parse the bodies of all incoming requests. -This is the simplest setup. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// parse application/x-www-form-urlencoded -app.use(bodyParser.urlencoded({ extended: false })) - -// parse application/json -app.use(bodyParser.json()) - -app.use(function (req, res) { - res.setHeader('Content-Type', 'text/plain') - res.write('you posted:\n') - res.end(JSON.stringify(req.body, null, 2)) -}) -``` - -### Express route-specific - -This example demonstrates adding body parsers specifically to the routes that -need them. In general, this is the most recommended way to use body-parser with -Express. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// create application/json parser -var jsonParser = bodyParser.json() - -// create application/x-www-form-urlencoded parser -var urlencodedParser = bodyParser.urlencoded({ extended: false }) - -// POST /login gets urlencoded bodies -app.post('/login', urlencodedParser, function (req, res) { - res.send('welcome, ' + req.body.username) -}) - -// POST /api/users gets JSON bodies -app.post('/api/users', jsonParser, function (req, res) { - // create user in req.body -}) -``` - -### Change accepted type for parsers - -All the parsers accept a `type` option which allows you to change the -`Content-Type` that the middleware will parse. - -```js -var express = require('express') -var bodyParser = require('body-parser') - -var app = express() - -// parse various different custom JSON types as JSON -app.use(bodyParser.json({ type: 'application/*+json' })) - -// parse some custom thing into a Buffer -app.use(bodyParser.raw({ type: 'application/vnd.custom-type' })) - -// parse an HTML body into a string -app.use(bodyParser.text({ type: 'text/html' })) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/body-parser.svg -[npm-url]: https://npmjs.org/package/body-parser -[coveralls-image]: https://img.shields.io/coveralls/expressjs/body-parser/master.svg -[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master -[downloads-image]: https://img.shields.io/npm/dm/body-parser.svg -[downloads-url]: https://npmjs.org/package/body-parser -[github-actions-ci-image]: https://img.shields.io/github/workflow/status/expressjs/body-parser/ci/master?label=ci -[github-actions-ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml diff --git a/node_modules/body-parser/SECURITY.md b/node_modules/body-parser/SECURITY.md deleted file mode 100644 index 9694d42..0000000 --- a/node_modules/body-parser/SECURITY.md +++ /dev/null @@ -1,25 +0,0 @@ -# Security Policies and Procedures - -## Reporting a Bug - -The Express team and community take all security bugs seriously. Thank you -for improving the security of Express. We appreciate your efforts and -responsible disclosure and will make every effort to acknowledge your -contributions. - -Report security bugs by emailing the current owner(s) of `body-parser`. This -information can be found in the npm registry using the command -`npm owner ls body-parser`. -If unsure or unable to get the information from the above, open an issue -in the [project issue tracker](https://github.com/expressjs/body-parser/issues) -asking for the current contact information. - -To ensure the timely response to your report, please ensure that the entirety -of the report is contained within the email body and not solely behind a web -link or an attachment. - -At least one owner will acknowledge your email within 48 hours, and will send a -more detailed response within 48 hours indicating the next steps in handling -your report. After the initial reply to your report, the owners will -endeavor to keep you informed of the progress towards a fix and full -announcement, and may ask for additional information or guidance. diff --git a/node_modules/body-parser/index.js b/node_modules/body-parser/index.js deleted file mode 100644 index bb24d73..0000000 --- a/node_modules/body-parser/index.js +++ /dev/null @@ -1,156 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var deprecate = require('depd')('body-parser') - -/** - * Cache of loaded parsers. - * @private - */ - -var parsers = Object.create(null) - -/** - * @typedef Parsers - * @type {function} - * @property {function} json - * @property {function} raw - * @property {function} text - * @property {function} urlencoded - */ - -/** - * Module exports. - * @type {Parsers} - */ - -exports = module.exports = deprecate.function(bodyParser, - 'bodyParser: use individual json/urlencoded middlewares') - -/** - * JSON parser. - * @public - */ - -Object.defineProperty(exports, 'json', { - configurable: true, - enumerable: true, - get: createParserGetter('json') -}) - -/** - * Raw parser. - * @public - */ - -Object.defineProperty(exports, 'raw', { - configurable: true, - enumerable: true, - get: createParserGetter('raw') -}) - -/** - * Text parser. - * @public - */ - -Object.defineProperty(exports, 'text', { - configurable: true, - enumerable: true, - get: createParserGetter('text') -}) - -/** - * URL-encoded parser. - * @public - */ - -Object.defineProperty(exports, 'urlencoded', { - configurable: true, - enumerable: true, - get: createParserGetter('urlencoded') -}) - -/** - * Create a middleware to parse json and urlencoded bodies. - * - * @param {object} [options] - * @return {function} - * @deprecated - * @public - */ - -function bodyParser (options) { - // use default type for parsers - var opts = Object.create(options || null, { - type: { - configurable: true, - enumerable: true, - value: undefined, - writable: true - } - }) - - var _urlencoded = exports.urlencoded(opts) - var _json = exports.json(opts) - - return function bodyParser (req, res, next) { - _json(req, res, function (err) { - if (err) return next(err) - _urlencoded(req, res, next) - }) - } -} - -/** - * Create a getter for loading a parser. - * @private - */ - -function createParserGetter (name) { - return function get () { - return loadParser(name) - } -} - -/** - * Load a parser module. - * @private - */ - -function loadParser (parserName) { - var parser = parsers[parserName] - - if (parser !== undefined) { - return parser - } - - // this uses a switch for static require analysis - switch (parserName) { - case 'json': - parser = require('./lib/types/json') - break - case 'raw': - parser = require('./lib/types/raw') - break - case 'text': - parser = require('./lib/types/text') - break - case 'urlencoded': - parser = require('./lib/types/urlencoded') - break - } - - // store to prevent invoking require() - return (parsers[parserName] = parser) -} diff --git a/node_modules/body-parser/lib/read.js b/node_modules/body-parser/lib/read.js deleted file mode 100644 index fce6283..0000000 --- a/node_modules/body-parser/lib/read.js +++ /dev/null @@ -1,205 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var createError = require('http-errors') -var destroy = require('destroy') -var getBody = require('raw-body') -var iconv = require('iconv-lite') -var onFinished = require('on-finished') -var unpipe = require('unpipe') -var zlib = require('zlib') - -/** - * Module exports. - */ - -module.exports = read - -/** - * Read a request into a buffer and parse. - * - * @param {object} req - * @param {object} res - * @param {function} next - * @param {function} parse - * @param {function} debug - * @param {object} options - * @private - */ - -function read (req, res, next, parse, debug, options) { - var length - var opts = options - var stream - - // flag as parsed - req._body = true - - // read options - var encoding = opts.encoding !== null - ? opts.encoding - : null - var verify = opts.verify - - try { - // get the content stream - stream = contentstream(req, debug, opts.inflate) - length = stream.length - stream.length = undefined - } catch (err) { - return next(err) - } - - // set raw-body options - opts.length = length - opts.encoding = verify - ? null - : encoding - - // assert charset is supported - if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) { - return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { - charset: encoding.toLowerCase(), - type: 'charset.unsupported' - })) - } - - // read body - debug('read body') - getBody(stream, opts, function (error, body) { - if (error) { - var _error - - if (error.type === 'encoding.unsupported') { - // echo back charset - _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { - charset: encoding.toLowerCase(), - type: 'charset.unsupported' - }) - } else { - // set status code on error - _error = createError(400, error) - } - - // unpipe from stream and destroy - if (stream !== req) { - unpipe(req) - destroy(stream, true) - } - - // read off entire request - dump(req, function onfinished () { - next(createError(400, _error)) - }) - return - } - - // verify - if (verify) { - try { - debug('verify body') - verify(req, res, body, encoding) - } catch (err) { - next(createError(403, err, { - body: body, - type: err.type || 'entity.verify.failed' - })) - return - } - } - - // parse - var str = body - try { - debug('parse body') - str = typeof body !== 'string' && encoding !== null - ? iconv.decode(body, encoding) - : body - req.body = parse(str) - } catch (err) { - next(createError(400, err, { - body: str, - type: err.type || 'entity.parse.failed' - })) - return - } - - next() - }) -} - -/** - * Get the content stream of the request. - * - * @param {object} req - * @param {function} debug - * @param {boolean} [inflate=true] - * @return {object} - * @api private - */ - -function contentstream (req, debug, inflate) { - var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase() - var length = req.headers['content-length'] - var stream - - debug('content-encoding "%s"', encoding) - - if (inflate === false && encoding !== 'identity') { - throw createError(415, 'content encoding unsupported', { - encoding: encoding, - type: 'encoding.unsupported' - }) - } - - switch (encoding) { - case 'deflate': - stream = zlib.createInflate() - debug('inflate body') - req.pipe(stream) - break - case 'gzip': - stream = zlib.createGunzip() - debug('gunzip body') - req.pipe(stream) - break - case 'identity': - stream = req - stream.length = length - break - default: - throw createError(415, 'unsupported content encoding "' + encoding + '"', { - encoding: encoding, - type: 'encoding.unsupported' - }) - } - - return stream -} - -/** - * Dump the contents of a request. - * - * @param {object} req - * @param {function} callback - * @api private - */ - -function dump (req, callback) { - if (onFinished.isFinished(req)) { - callback(null) - } else { - onFinished(req, callback) - req.resume() - } -} diff --git a/node_modules/body-parser/lib/types/json.js b/node_modules/body-parser/lib/types/json.js deleted file mode 100644 index c2745be..0000000 --- a/node_modules/body-parser/lib/types/json.js +++ /dev/null @@ -1,236 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var createError = require('http-errors') -var debug = require('debug')('body-parser:json') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = json - -/** - * RegExp to match the first non-space in a string. - * - * Allowed whitespace is defined in RFC 7159: - * - * ws = *( - * %x20 / ; Space - * %x09 / ; Horizontal tab - * %x0A / ; Line feed or New line - * %x0D ) ; Carriage return - */ - -var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex - -/** - * Create a middleware to parse JSON bodies. - * - * @param {object} [options] - * @return {function} - * @public - */ - -function json (options) { - var opts = options || {} - - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var inflate = opts.inflate !== false - var reviver = opts.reviver - var strict = opts.strict !== false - var type = opts.type || 'application/json' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (body) { - if (body.length === 0) { - // special-case empty json body, as it's a common client-side mistake - // TODO: maybe make this configurable or part of "strict" option - return {} - } - - if (strict) { - var first = firstchar(body) - - if (first !== '{' && first !== '[') { - debug('strict violation') - throw createStrictSyntaxError(body, first) - } - } - - try { - debug('parse json') - return JSON.parse(body, reviver) - } catch (e) { - throw normalizeJsonSyntaxError(e, { - message: e.message, - stack: e.stack - }) - } - } - - return function jsonParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // assert charset per RFC 7159 sec 8.1 - var charset = getCharset(req) || 'utf-8' - if (charset.slice(0, 4) !== 'utf-') { - debug('invalid charset') - next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { - charset: charset, - type: 'charset.unsupported' - })) - return - } - - // read - read(req, res, next, parse, debug, { - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Create strict violation syntax error matching native error. - * - * @param {string} str - * @param {string} char - * @return {Error} - * @private - */ - -function createStrictSyntaxError (str, char) { - var index = str.indexOf(char) - var partial = index !== -1 - ? str.substring(0, index) + '#' - : '' - - try { - JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation') - } catch (e) { - return normalizeJsonSyntaxError(e, { - message: e.message.replace('#', char), - stack: e.stack - }) - } -} - -/** - * Get the first non-whitespace character in a string. - * - * @param {string} str - * @return {function} - * @private - */ - -function firstchar (str) { - var match = FIRST_CHAR_REGEXP.exec(str) - - return match - ? match[1] - : undefined -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Normalize a SyntaxError for JSON.parse. - * - * @param {SyntaxError} error - * @param {object} obj - * @return {SyntaxError} - */ - -function normalizeJsonSyntaxError (error, obj) { - var keys = Object.getOwnPropertyNames(error) - - for (var i = 0; i < keys.length; i++) { - var key = keys[i] - if (key !== 'stack' && key !== 'message') { - delete error[key] - } - } - - // replace stack before message for Node.js 0.10 and below - error.stack = obj.stack.replace(error.message, obj.message) - error.message = obj.message - - return error -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/raw.js b/node_modules/body-parser/lib/types/raw.js deleted file mode 100644 index f5d1b67..0000000 --- a/node_modules/body-parser/lib/types/raw.js +++ /dev/null @@ -1,101 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - */ - -var bytes = require('bytes') -var debug = require('debug')('body-parser:raw') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = raw - -/** - * Create a middleware to parse raw bodies. - * - * @param {object} [options] - * @return {function} - * @api public - */ - -function raw (options) { - var opts = options || {} - - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'application/octet-stream' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (buf) { - return buf - } - - return function rawParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // read - read(req, res, next, parse, debug, { - encoding: null, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/text.js b/node_modules/body-parser/lib/types/text.js deleted file mode 100644 index 083a009..0000000 --- a/node_modules/body-parser/lib/types/text.js +++ /dev/null @@ -1,121 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var debug = require('debug')('body-parser:text') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = text - -/** - * Create a middleware to parse text bodies. - * - * @param {object} [options] - * @return {function} - * @api public - */ - -function text (options) { - var opts = options || {} - - var defaultCharset = opts.defaultCharset || 'utf-8' - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'text/plain' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (buf) { - return buf - } - - return function textParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // get charset - var charset = getCharset(req) || defaultCharset - - // read - read(req, res, next, parse, debug, { - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/lib/types/urlencoded.js b/node_modules/body-parser/lib/types/urlencoded.js deleted file mode 100644 index b2ca8f1..0000000 --- a/node_modules/body-parser/lib/types/urlencoded.js +++ /dev/null @@ -1,284 +0,0 @@ -/*! - * body-parser - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2014-2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var bytes = require('bytes') -var contentType = require('content-type') -var createError = require('http-errors') -var debug = require('debug')('body-parser:urlencoded') -var deprecate = require('depd')('body-parser') -var read = require('../read') -var typeis = require('type-is') - -/** - * Module exports. - */ - -module.exports = urlencoded - -/** - * Cache of parser modules. - */ - -var parsers = Object.create(null) - -/** - * Create a middleware to parse urlencoded bodies. - * - * @param {object} [options] - * @return {function} - * @public - */ - -function urlencoded (options) { - var opts = options || {} - - // notice because option default will flip in next major - if (opts.extended === undefined) { - deprecate('undefined extended: provide extended option') - } - - var extended = opts.extended !== false - var inflate = opts.inflate !== false - var limit = typeof opts.limit !== 'number' - ? bytes.parse(opts.limit || '100kb') - : opts.limit - var type = opts.type || 'application/x-www-form-urlencoded' - var verify = opts.verify || false - - if (verify !== false && typeof verify !== 'function') { - throw new TypeError('option verify must be function') - } - - // create the appropriate query parser - var queryparse = extended - ? extendedparser(opts) - : simpleparser(opts) - - // create the appropriate type checking function - var shouldParse = typeof type !== 'function' - ? typeChecker(type) - : type - - function parse (body) { - return body.length - ? queryparse(body) - : {} - } - - return function urlencodedParser (req, res, next) { - if (req._body) { - debug('body already parsed') - next() - return - } - - req.body = req.body || {} - - // skip requests without bodies - if (!typeis.hasBody(req)) { - debug('skip empty body') - next() - return - } - - debug('content-type %j', req.headers['content-type']) - - // determine if request should be parsed - if (!shouldParse(req)) { - debug('skip parsing') - next() - return - } - - // assert charset - var charset = getCharset(req) || 'utf-8' - if (charset !== 'utf-8') { - debug('invalid charset') - next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', { - charset: charset, - type: 'charset.unsupported' - })) - return - } - - // read - read(req, res, next, parse, debug, { - debug: debug, - encoding: charset, - inflate: inflate, - limit: limit, - verify: verify - }) - } -} - -/** - * Get the extended query parser. - * - * @param {object} options - */ - -function extendedparser (options) { - var parameterLimit = options.parameterLimit !== undefined - ? options.parameterLimit - : 1000 - var parse = parser('qs') - - if (isNaN(parameterLimit) || parameterLimit < 1) { - throw new TypeError('option parameterLimit must be a positive number') - } - - if (isFinite(parameterLimit)) { - parameterLimit = parameterLimit | 0 - } - - return function queryparse (body) { - var paramCount = parameterCount(body, parameterLimit) - - if (paramCount === undefined) { - debug('too many parameters') - throw createError(413, 'too many parameters', { - type: 'parameters.too.many' - }) - } - - var arrayLimit = Math.max(100, paramCount) - - debug('parse extended urlencoding') - return parse(body, { - allowPrototypes: true, - arrayLimit: arrayLimit, - depth: Infinity, - parameterLimit: parameterLimit - }) - } -} - -/** - * Get the charset of a request. - * - * @param {object} req - * @api private - */ - -function getCharset (req) { - try { - return (contentType.parse(req).parameters.charset || '').toLowerCase() - } catch (e) { - return undefined - } -} - -/** - * Count the number of parameters, stopping once limit reached - * - * @param {string} body - * @param {number} limit - * @api private - */ - -function parameterCount (body, limit) { - var count = 0 - var index = 0 - - while ((index = body.indexOf('&', index)) !== -1) { - count++ - index++ - - if (count === limit) { - return undefined - } - } - - return count -} - -/** - * Get parser for module name dynamically. - * - * @param {string} name - * @return {function} - * @api private - */ - -function parser (name) { - var mod = parsers[name] - - if (mod !== undefined) { - return mod.parse - } - - // this uses a switch for static require analysis - switch (name) { - case 'qs': - mod = require('qs') - break - case 'querystring': - mod = require('querystring') - break - } - - // store to prevent invoking require() - parsers[name] = mod - - return mod.parse -} - -/** - * Get the simple query parser. - * - * @param {object} options - */ - -function simpleparser (options) { - var parameterLimit = options.parameterLimit !== undefined - ? options.parameterLimit - : 1000 - var parse = parser('querystring') - - if (isNaN(parameterLimit) || parameterLimit < 1) { - throw new TypeError('option parameterLimit must be a positive number') - } - - if (isFinite(parameterLimit)) { - parameterLimit = parameterLimit | 0 - } - - return function queryparse (body) { - var paramCount = parameterCount(body, parameterLimit) - - if (paramCount === undefined) { - debug('too many parameters') - throw createError(413, 'too many parameters', { - type: 'parameters.too.many' - }) - } - - debug('parse urlencoding') - return parse(body, undefined, undefined, { maxKeys: parameterLimit }) - } -} - -/** - * Get the simple type checker. - * - * @param {string} type - * @return {function} - */ - -function typeChecker (type) { - return function checkType (req) { - return Boolean(typeis(req, type)) - } -} diff --git a/node_modules/body-parser/package.json b/node_modules/body-parser/package.json deleted file mode 100644 index 9cd2ccb..0000000 --- a/node_modules/body-parser/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "body-parser", - "description": "Node.js body parsing middleware", - "version": "1.20.1", - "contributors": [ - "Douglas Christopher Wilson ", - "Jonathan Ong (http://jongleberry.com)" - ], - "license": "MIT", - "repository": "expressjs/body-parser", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "devDependencies": { - "eslint": "8.24.0", - "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.26.0", - "eslint-plugin-markdown": "3.0.0", - "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "6.0.1", - "eslint-plugin-standard": "4.1.0", - "methods": "1.1.2", - "mocha": "10.0.0", - "nyc": "15.1.0", - "safe-buffer": "5.2.1", - "supertest": "6.3.0" - }, - "files": [ - "lib/", - "LICENSE", - "HISTORY.md", - "SECURITY.md", - "index.js" - ], - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/node_modules/boolean/.eslintrc.json b/node_modules/boolean/.eslintrc.json deleted file mode 100644 index 0b7481d..0000000 --- a/node_modules/boolean/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "es/node" -} diff --git a/node_modules/boolean/.npmpackagejsonlintrc.json b/node_modules/boolean/.npmpackagejsonlintrc.json deleted file mode 100644 index fa44555..0000000 --- a/node_modules/boolean/.npmpackagejsonlintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "npm-package-json-lint-config-tnw/lib.json" -} \ No newline at end of file diff --git a/node_modules/boolean/.releaserc.json b/node_modules/boolean/.releaserc.json deleted file mode 100644 index ca62656..0000000 --- a/node_modules/boolean/.releaserc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "semantic-release-configuration" -} diff --git a/node_modules/boolean/CHANGELOG.md b/node_modules/boolean/CHANGELOG.md deleted file mode 100644 index 00828a5..0000000 --- a/node_modules/boolean/CHANGELOG.md +++ /dev/null @@ -1,70 +0,0 @@ -# [3.2.0](https://github.com/thenativeweb/boolean/compare/3.1.4...3.2.0) (2022-02-16) - - -### Features - -* Introduce isBooleanable function. ([#341](https://github.com/thenativeweb/boolean/issues/341)) ([e2ecfb3](https://github.com/thenativeweb/boolean/commit/e2ecfb357db729990e533dfd498211cea6126a17)) - -## [3.1.4](https://github.com/thenativeweb/boolean/compare/3.1.3...3.1.4) (2021-08-19) - - -### Bug Fixes - -* Downgrade workflows to Node 14. ([#319](https://github.com/thenativeweb/boolean/issues/319)) ([072b068](https://github.com/thenativeweb/boolean/commit/072b0685f8de7602f6be9da9b80cda08cdd71778)) -* Rollback versions and remove engines field. ([#318](https://github.com/thenativeweb/boolean/issues/318)) ([145dfcf](https://github.com/thenativeweb/boolean/commit/145dfcf7f4c5e3f5898e43661b9a017a2d8cb6a9)) - -## [3.1.3](https://github.com/thenativeweb/boolean/compare/3.1.2...3.1.3) (2021-08-19) - - -### Bug Fixes - -* bump path-parse from 1.0.6 to 1.0.7 ([#316](https://github.com/thenativeweb/boolean/issues/316)) ([0817f9d](https://github.com/thenativeweb/boolean/commit/0817f9d5c7e4691558e7562146afac19258a655c)) - -## [3.1.2](https://github.com/thenativeweb/boolean/compare/3.1.1...3.1.2) (2021-06-10) - - -### Bug Fixes - -* bump trim-newlines from 3.0.0 to 3.0.1 ([#302](https://github.com/thenativeweb/boolean/issues/302)) ([376489f](https://github.com/thenativeweb/boolean/commit/376489fe37ec9c46aafb44d3c9abf0edeabc6f93)) - -## [3.1.1](https://github.com/thenativeweb/boolean/compare/3.1.0...3.1.1) (2021-06-10) - - -### Bug Fixes - -* bump glob-parent from 5.1.1 to 5.1.2 ([#303](https://github.com/thenativeweb/boolean/issues/303)) ([8265437](https://github.com/thenativeweb/boolean/commit/8265437b1b3215256f8649e10ac65d4036a38bad)) - -# [3.1.0](https://github.com/thenativeweb/boolean/compare/3.0.4...3.1.0) (2021-05-30) - - -### Features - -* Add support for primitive object wrappers (fixes [#295](https://github.com/thenativeweb/boolean/issues/295)) ([#296](https://github.com/thenativeweb/boolean/issues/296)) ([5ae115f](https://github.com/thenativeweb/boolean/commit/5ae115f09f123cdb624452fc163fc8724e0ab926)) - -## [3.0.4](https://github.com/thenativeweb/boolean/compare/3.0.3...3.0.4) (2021-05-10) - - -### Bug Fixes - -* bump hosted-git-info from 2.8.8 to 2.8.9 ([#289](https://github.com/thenativeweb/boolean/issues/289)) ([69ead2c](https://github.com/thenativeweb/boolean/commit/69ead2c8fe897d546f8329ed262e6158938581be)) - -## [3.0.3](https://github.com/thenativeweb/boolean/compare/3.0.2...3.0.3) (2021-03-25) - - -### Bug Fixes - -* Migrate from master to main. ([#273](https://github.com/thenativeweb/boolean/issues/273)) ([18b640a](https://github.com/thenativeweb/boolean/commit/18b640af858d26b4dd76b9de443a4039e1e2131a)) - -## [3.0.2](https://github.com/thenativeweb/boolean/compare/3.0.1...3.0.2) (2020-11-03) - - -### Bug Fixes - -* Fix headline for robot section in readme. ([#191](https://github.com/thenativeweb/boolean/issues/191)) ([6b7b72b](https://github.com/thenativeweb/boolean/commit/6b7b72b6d5d5c1ad2251c5959b35c8c87b3421a5)) - -## [3.0.1](https://github.com/thenativeweb/boolean/compare/3.0.0...3.0.1) (2020-02-11) - - -### Bug Fixes - -* Simplify comparison code to not use unicode regexp flag ([#99](https://github.com/thenativeweb/boolean/issues/99)) ([2be2aeb](https://github.com/thenativeweb/boolean/commit/2be2aeb244c060eccb388dacc6903bbad193e745)) diff --git a/node_modules/boolean/LICENSE.txt b/node_modules/boolean/LICENSE.txt deleted file mode 100644 index c152105..0000000 --- a/node_modules/boolean/LICENSE.txt +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2014-2022 the native web. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/boolean/README.md b/node_modules/boolean/README.md deleted file mode 100644 index 11fe8e5..0000000 --- a/node_modules/boolean/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# boolean - -boolean converts lots of things to boolean. - -## Status - -| Category | Status | -| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| Version | [![npm](https://img.shields.io/npm/v/boolean)](https://www.npmjs.com/package/boolean) | -| Dependencies | ![David](https://img.shields.io/david/thenativeweb/boolean) | -| Dev dependencies | ![David](https://img.shields.io/david/dev/thenativeweb/boolean) | -| Build | ![GitHub Actions](https://github.com/thenativeweb/boolean/workflows/Release/badge.svg?branch=main) | -| License | ![GitHub](https://img.shields.io/github/license/thenativeweb/boolean) | - -## Installation - -```shell -$ npm install boolean -``` - -## Quick start - -First you need to add a reference to boolean in your application: - -```javascript -const { boolean, isBooleanable } = require('boolean'); -``` - -If you use TypeScript, use the following code instead: - -```typescript -import { boolean, isBooleanable } from 'boolean'; -``` - -To verify a value for its boolean value, call the `boolean` function and provide the value in question as parameter: - -```javascript -console.log(boolean('true')); // => true -``` - -The `boolean` function considers the following values to be equivalent to `true`: - -- `true` (boolean) -- `'true'` (string) -- `'TRUE'` (string) -- `'t'` (string) -- `'T'` (string) -- `'yes'` (string) -- `'YES'` (string) -- `'y'` (string) -- `'Y'` (string) -- `'on'` (string) -- `'ON'` (string) -- `'1'` (string) -- `1` (number) - -In addition to the primitive types mentioned above, boolean also supports their object wrappers `Boolean`, `String`, and `Number`. - -_Please note that if you provide a `string` or a `String` object, it will be trimmed._ - -All other values, including `undefined` and `null` are considered to be `false`. - -### Figuring out whether a value can be considered to be boolean - -From time to time, you may not want to directly convert a value to its boolean equivalent, but explicitly check whether it looks like a boolean. E.g., although `boolean('F')` returns `false`, the string `F` at least looks like a boolean, in contrast to something such as `123` (for which `boolean(123)` would also return `false`). - -To figure out whether a value can be considered to be a boolean, use the `isBooleanable` function: - -```javascript -console.log(isBooleanable('true')); // => true -``` - -The `isBooleanable` function considers all of the above mentioned values to be reasonable boolean values, and additionally, also the following ones: - -- `false` (boolean) -- `'false'` (string) -- `'FALSE'` (string) -- `'f'` (string) -- `'F'` (string) -- `'no'` (string) -- `'NO'` (string) -- `'n'` (string) -- `'N'` (string) -- `'off'` (string) -- `'OFF'` (string) -- `'0'` (string) -- `0` (number) - -## Running quality assurance - -To run quality assurance for this module use [roboter](https://www.npmjs.com/package/roboter): - -```shell -$ npx roboter -``` diff --git a/node_modules/boolean/build/lib/boolean.d.ts b/node_modules/boolean/build/lib/boolean.d.ts deleted file mode 100644 index 379e720..0000000 --- a/node_modules/boolean/build/lib/boolean.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const boolean: (value: any) => boolean; -export { boolean }; diff --git a/node_modules/boolean/build/lib/boolean.js b/node_modules/boolean/build/lib/boolean.js deleted file mode 100644 index 7716581..0000000 --- a/node_modules/boolean/build/lib/boolean.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.boolean = void 0; -const boolean = function (value) { - switch (Object.prototype.toString.call(value)) { - case '[object String]': - return ['true', 't', 'yes', 'y', 'on', '1'].includes(value.trim().toLowerCase()); - case '[object Number]': - return value.valueOf() === 1; - case '[object Boolean]': - return value.valueOf(); - default: - return false; - } -}; -exports.boolean = boolean; diff --git a/node_modules/boolean/build/lib/index.d.ts b/node_modules/boolean/build/lib/index.d.ts deleted file mode 100644 index 8ead670..0000000 --- a/node_modules/boolean/build/lib/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { boolean } from './boolean'; -import { isBooleanable } from './isBooleanable'; -export { boolean, isBooleanable }; diff --git a/node_modules/boolean/build/lib/index.js b/node_modules/boolean/build/lib/index.js deleted file mode 100644 index cd0a2c9..0000000 --- a/node_modules/boolean/build/lib/index.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isBooleanable = exports.boolean = void 0; -const boolean_1 = require("./boolean"); -Object.defineProperty(exports, "boolean", { enumerable: true, get: function () { return boolean_1.boolean; } }); -const isBooleanable_1 = require("./isBooleanable"); -Object.defineProperty(exports, "isBooleanable", { enumerable: true, get: function () { return isBooleanable_1.isBooleanable; } }); diff --git a/node_modules/boolean/build/lib/isBooleanable.d.ts b/node_modules/boolean/build/lib/isBooleanable.d.ts deleted file mode 100644 index d87ce7c..0000000 --- a/node_modules/boolean/build/lib/isBooleanable.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const isBooleanable: (value: any) => boolean; -export { isBooleanable }; diff --git a/node_modules/boolean/build/lib/isBooleanable.js b/node_modules/boolean/build/lib/isBooleanable.js deleted file mode 100644 index dee9c5d..0000000 --- a/node_modules/boolean/build/lib/isBooleanable.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isBooleanable = void 0; -const isBooleanable = function (value) { - switch (Object.prototype.toString.call(value)) { - case '[object String]': - return [ - 'true', 't', 'yes', 'y', 'on', '1', - 'false', 'f', 'no', 'n', 'off', '0' - ].includes(value.trim().toLowerCase()); - case '[object Number]': - return [0, 1].includes(value.valueOf()); - case '[object Boolean]': - return true; - default: - return false; - } -}; -exports.isBooleanable = isBooleanable; diff --git a/node_modules/boolean/lib/boolean.ts b/node_modules/boolean/lib/boolean.ts deleted file mode 100644 index 2cbdc2d..0000000 --- a/node_modules/boolean/lib/boolean.ts +++ /dev/null @@ -1,17 +0,0 @@ -const boolean = function (value: any): boolean { - switch (Object.prototype.toString.call(value)) { - case '[object String]': - return [ 'true', 't', 'yes', 'y', 'on', '1' ].includes(value.trim().toLowerCase()); - - case '[object Number]': - return value.valueOf() === 1; - - case '[object Boolean]': - return value.valueOf(); - - default: - return false; - } -}; - -export { boolean }; diff --git a/node_modules/boolean/lib/index.ts b/node_modules/boolean/lib/index.ts deleted file mode 100644 index 0388edc..0000000 --- a/node_modules/boolean/lib/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { boolean } from './boolean'; -import { isBooleanable } from './isBooleanable'; - -export { boolean, isBooleanable }; diff --git a/node_modules/boolean/lib/isBooleanable.ts b/node_modules/boolean/lib/isBooleanable.ts deleted file mode 100644 index 7052ee3..0000000 --- a/node_modules/boolean/lib/isBooleanable.ts +++ /dev/null @@ -1,20 +0,0 @@ -const isBooleanable = function (value: any): boolean { - switch (Object.prototype.toString.call(value)) { - case '[object String]': - return [ - 'true', 't', 'yes', 'y', 'on', '1', - 'false', 'f', 'no', 'n', 'off', '0' - ].includes(value.trim().toLowerCase()); - - case '[object Number]': - return [ 0, 1 ].includes(value.valueOf()); - - case '[object Boolean]': - return true; - - default: - return false; - } -}; - -export { isBooleanable }; diff --git a/node_modules/boolean/licenseCheck.json b/node_modules/boolean/licenseCheck.json deleted file mode 100644 index d689b76..0000000 --- a/node_modules/boolean/licenseCheck.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compatibleLicenses": [ - "0BSD", - "Apache-2.0", - "Artistic-2.0", - "BSD-2-Clause", - "BSD-3-Clause", - "CC0-1.0", - "CC-BY-3.0", - "CC-BY-4.0", - "ISC", - "MIT", - "Python-2.0", - "Unlicense" - ] -} \ No newline at end of file diff --git a/node_modules/boolean/package.json b/node_modules/boolean/package.json deleted file mode 100644 index 402080d..0000000 --- a/node_modules/boolean/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "boolean", - "version": "3.2.0", - "description": "boolean converts lots of things to boolean.", - "contributors": [ - { - "name": "Golo Roden", - "email": "golo.roden@thenativeweb.io" - }, - { - "name": "Matthias Wagler", - "email": "matthias.wagler@thenativeweb.io" - }, - { - "name": "Ryan Smith", - "email": "ryan.smith@ht2labs.com" - }, - { - "name": "Thomas Schaaf", - "email": "schaaf@komola.de" - }, - { - "name": "Sebastian Mares", - "email": "camil.sebastian@mares.email" - } - ], - "private": false, - "main": "build/lib/index.js", - "types": "build/lib/index.d.ts", - "dependencies": {}, - "devDependencies": { - "assertthat": "6.4.0", - "roboter": "12.7.0", - "semantic-release-configuration": "2.0.7" - }, - "scripts": {}, - "repository": { - "type": "git", - "url": "git://github.com/thenativeweb/boolean.git" - }, - "keywords": [ - "boolean", - "parser" - ], - "license": "MIT" -} diff --git a/node_modules/boolean/tsconfig.json b/node_modules/boolean/tsconfig.json deleted file mode 100644 index 98d16e7..0000000 --- a/node_modules/boolean/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "declaration": true, - "esModuleInterop": true, - "lib": [ "esnext" ], - "module": "commonjs", - "outDir": "build", - "resolveJsonModule": true, - "strict": true, - "target": "es2019" - }, - "include": [ - "./**/*.ts" - ], - "exclude": [ - "./build" - ] -} diff --git a/node_modules/brace-expansion/LICENSE b/node_modules/brace-expansion/LICENSE deleted file mode 100644 index de32266..0000000 --- a/node_modules/brace-expansion/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2013 Julian Gruber - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/brace-expansion/README.md b/node_modules/brace-expansion/README.md deleted file mode 100644 index 6b4e0e1..0000000 --- a/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,129 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) -[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## Sponsors - -This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! - -Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/brace-expansion/index.js b/node_modules/brace-expansion/index.js deleted file mode 100644 index 0478be8..0000000 --- a/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/node_modules/brace-expansion/package.json b/node_modules/brace-expansion/package.json deleted file mode 100644 index a18faa8..0000000 --- a/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.11", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh", - "bench": "matcha test/perf/bench.js" - }, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - }, - "devDependencies": { - "matcha": "^0.7.0", - "tape": "^4.6.0" - }, - "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - } -} diff --git a/node_modules/bytes/History.md b/node_modules/bytes/History.md deleted file mode 100644 index d60ce0e..0000000 --- a/node_modules/bytes/History.md +++ /dev/null @@ -1,97 +0,0 @@ -3.1.2 / 2022-01-27 -================== - - * Fix return value for un-parsable strings - -3.1.1 / 2021-11-15 -================== - - * Fix "thousandsSeparator" incorrecting formatting fractional part - -3.1.0 / 2019-01-22 -================== - - * Add petabyte (`pb`) support - -3.0.0 / 2017-08-31 -================== - - * Change "kB" to "KB" in format output - * Remove support for Node.js 0.6 - * Remove support for ComponentJS - -2.5.0 / 2017-03-24 -================== - - * Add option "unit" - -2.4.0 / 2016-06-01 -================== - - * Add option "unitSeparator" - -2.3.0 / 2016-02-15 -================== - - * Drop partial bytes on all parsed units - * Fix non-finite numbers to `.format` to return `null` - * Fix parsing byte string that looks like hex - * perf: hoist regular expressions - -2.2.0 / 2015-11-13 -================== - - * add option "decimalPlaces" - * add option "fixedDecimals" - -2.1.0 / 2015-05-21 -================== - - * add `.format` export - * add `.parse` export - -2.0.2 / 2015-05-20 -================== - - * remove map recreation - * remove unnecessary object construction - -2.0.1 / 2015-05-07 -================== - - * fix browserify require - * remove node.extend dependency - -2.0.0 / 2015-04-12 -================== - - * add option "case" - * add option "thousandsSeparator" - * return "null" on invalid parse input - * support proper round-trip: bytes(bytes(num)) === num - * units no longer case sensitive when parsing - -1.0.0 / 2014-05-05 -================== - - * add negative support. fixes #6 - -0.3.0 / 2014-03-19 -================== - - * added terabyte support - -0.2.1 / 2013-04-01 -================== - - * add .component - -0.2.0 / 2012-10-28 -================== - - * bytes(200).should.eql('200b') - -0.1.0 / 2012-07-04 -================== - - * add bytes to string conversion [yields] diff --git a/node_modules/bytes/LICENSE b/node_modules/bytes/LICENSE deleted file mode 100644 index 63e95a9..0000000 --- a/node_modules/bytes/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2014 TJ Holowaychuk -Copyright (c) 2015 Jed Watson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/bytes/Readme.md b/node_modules/bytes/Readme.md deleted file mode 100644 index 5790e23..0000000 --- a/node_modules/bytes/Readme.md +++ /dev/null @@ -1,152 +0,0 @@ -# Bytes utility - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Build Status][ci-image]][ci-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Utility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa. - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```bash -$ npm install bytes -``` - -## Usage - -```js -var bytes = require('bytes'); -``` - -#### bytes(number|string value, [options]): number|string|null - -Default export function. Delegates to either `bytes.format` or `bytes.parse` based on the type of `value`. - -**Arguments** - -| Name | Type | Description | -|---------|----------|--------------------| -| value | `number`|`string` | Number value to format or string value to parse | -| options | `Object` | Conversion options for `format` | - -**Returns** - -| Name | Type | Description | -|---------|------------------|-------------------------------------------------| -| results | `string`|`number`|`null` | Return null upon error. Numeric value in bytes, or string value otherwise. | - -**Example** - -```js -bytes(1024); -// output: '1KB' - -bytes('1KB'); -// output: 1024 -``` - -#### bytes.format(number value, [options]): string|null - -Format the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is - rounded. - -**Arguments** - -| Name | Type | Description | -|---------|----------|--------------------| -| value | `number` | Value in bytes | -| options | `Object` | Conversion options | - -**Options** - -| Property | Type | Description | -|-------------------|--------|-----------------------------------------------------------------------------------------| -| decimalPlaces | `number`|`null` | Maximum number of decimal places to include in output. Default value to `2`. | -| fixedDecimals | `boolean`|`null` | Whether to always display the maximum number of decimal places. Default value to `false` | -| thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `'.'`... Default value to `''`. | -| unit | `string`|`null` | The unit in which the result will be returned (B/KB/MB/GB/TB). Default value to `''` (which means auto detect). | -| unitSeparator | `string`|`null` | Separator to use between number and unit. Default value to `''`. | - -**Returns** - -| Name | Type | Description | -|---------|------------------|-------------------------------------------------| -| results | `string`|`null` | Return null upon error. String value otherwise. | - -**Example** - -```js -bytes.format(1024); -// output: '1KB' - -bytes.format(1000); -// output: '1000B' - -bytes.format(1000, {thousandsSeparator: ' '}); -// output: '1 000B' - -bytes.format(1024 * 1.7, {decimalPlaces: 0}); -// output: '2KB' - -bytes.format(1024, {unitSeparator: ' '}); -// output: '1 KB' -``` - -#### bytes.parse(string|number value): number|null - -Parse the string value into an integer in bytes. If no unit is given, or `value` -is a number, it is assumed the value is in bytes. - -Supported units and abbreviations are as follows and are case-insensitive: - - * `b` for bytes - * `kb` for kilobytes - * `mb` for megabytes - * `gb` for gigabytes - * `tb` for terabytes - * `pb` for petabytes - -The units are in powers of two, not ten. This means 1kb = 1024b according to this parser. - -**Arguments** - -| Name | Type | Description | -|---------------|--------|--------------------| -| value | `string`|`number` | String to parse, or number in bytes. | - -**Returns** - -| Name | Type | Description | -|---------|-------------|-------------------------| -| results | `number`|`null` | Return null upon error. Value in bytes otherwise. | - -**Example** - -```js -bytes.parse('1KB'); -// output: 1024 - -bytes.parse('1024'); -// output: 1024 - -bytes.parse(1024); -// output: 1024 -``` - -## License - -[MIT](LICENSE) - -[ci-image]: https://badgen.net/github/checks/visionmedia/bytes.js/master?label=ci -[ci-url]: https://github.com/visionmedia/bytes.js/actions?query=workflow%3Aci -[coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master -[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master -[downloads-image]: https://badgen.net/npm/dm/bytes -[downloads-url]: https://npmjs.org/package/bytes -[npm-image]: https://badgen.net/npm/v/bytes -[npm-url]: https://npmjs.org/package/bytes diff --git a/node_modules/bytes/index.js b/node_modules/bytes/index.js deleted file mode 100644 index 6f2d0f8..0000000 --- a/node_modules/bytes/index.js +++ /dev/null @@ -1,170 +0,0 @@ -/*! - * bytes - * Copyright(c) 2012-2014 TJ Holowaychuk - * Copyright(c) 2015 Jed Watson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - -module.exports = bytes; -module.exports.format = format; -module.exports.parse = parse; - -/** - * Module variables. - * @private - */ - -var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g; - -var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/; - -var map = { - b: 1, - kb: 1 << 10, - mb: 1 << 20, - gb: 1 << 30, - tb: Math.pow(1024, 4), - pb: Math.pow(1024, 5), -}; - -var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; - -/** - * Convert the given value in bytes into a string or parse to string to an integer in bytes. - * - * @param {string|number} value - * @param {{ - * case: [string], - * decimalPlaces: [number] - * fixedDecimals: [boolean] - * thousandsSeparator: [string] - * unitSeparator: [string] - * }} [options] bytes options. - * - * @returns {string|number|null} - */ - -function bytes(value, options) { - if (typeof value === 'string') { - return parse(value); - } - - if (typeof value === 'number') { - return format(value, options); - } - - return null; -} - -/** - * Format the given value in bytes into a string. - * - * If the value is negative, it is kept as such. If it is a float, - * it is rounded. - * - * @param {number} value - * @param {object} [options] - * @param {number} [options.decimalPlaces=2] - * @param {number} [options.fixedDecimals=false] - * @param {string} [options.thousandsSeparator=] - * @param {string} [options.unit=] - * @param {string} [options.unitSeparator=] - * - * @returns {string|null} - * @public - */ - -function format(value, options) { - if (!Number.isFinite(value)) { - return null; - } - - var mag = Math.abs(value); - var thousandsSeparator = (options && options.thousandsSeparator) || ''; - var unitSeparator = (options && options.unitSeparator) || ''; - var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2; - var fixedDecimals = Boolean(options && options.fixedDecimals); - var unit = (options && options.unit) || ''; - - if (!unit || !map[unit.toLowerCase()]) { - if (mag >= map.pb) { - unit = 'PB'; - } else if (mag >= map.tb) { - unit = 'TB'; - } else if (mag >= map.gb) { - unit = 'GB'; - } else if (mag >= map.mb) { - unit = 'MB'; - } else if (mag >= map.kb) { - unit = 'KB'; - } else { - unit = 'B'; - } - } - - var val = value / map[unit.toLowerCase()]; - var str = val.toFixed(decimalPlaces); - - if (!fixedDecimals) { - str = str.replace(formatDecimalsRegExp, '$1'); - } - - if (thousandsSeparator) { - str = str.split('.').map(function (s, i) { - return i === 0 - ? s.replace(formatThousandsRegExp, thousandsSeparator) - : s - }).join('.'); - } - - return str + unitSeparator + unit; -} - -/** - * Parse the string value into an integer in bytes. - * - * If no unit is given, it is assumed the value is in bytes. - * - * @param {number|string} val - * - * @returns {number|null} - * @public - */ - -function parse(val) { - if (typeof val === 'number' && !isNaN(val)) { - return val; - } - - if (typeof val !== 'string') { - return null; - } - - // Test if the string passed is valid - var results = parseRegExp.exec(val); - var floatValue; - var unit = 'b'; - - if (!results) { - // Nothing could be extracted from the given string - floatValue = parseInt(val, 10); - unit = 'b' - } else { - // Retrieve the value and the unit - floatValue = parseFloat(results[1]); - unit = results[4].toLowerCase(); - } - - if (isNaN(floatValue)) { - return null; - } - - return Math.floor(map[unit] * floatValue); -} diff --git a/node_modules/bytes/package.json b/node_modules/bytes/package.json deleted file mode 100644 index f2b6a8b..0000000 --- a/node_modules/bytes/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "bytes", - "description": "Utility to parse a string bytes to bytes and vice-versa", - "version": "3.1.2", - "author": "TJ Holowaychuk (http://tjholowaychuk.com)", - "contributors": [ - "Jed Watson ", - "Théo FIDRY " - ], - "license": "MIT", - "keywords": [ - "byte", - "bytes", - "utility", - "parse", - "parser", - "convert", - "converter" - ], - "repository": "visionmedia/bytes.js", - "devDependencies": { - "eslint": "7.32.0", - "eslint-plugin-markdown": "2.2.1", - "mocha": "9.2.0", - "nyc": "15.1.0" - }, - "files": [ - "History.md", - "LICENSE", - "Readme.md", - "index.js" - ], - "engines": { - "node": ">= 0.8" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --check-leaks --reporter spec", - "test-ci": "nyc --reporter=lcov --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test" - } -} diff --git a/node_modules/call-bind/.eslintignore b/node_modules/call-bind/.eslintignore deleted file mode 100644 index 404abb2..0000000 --- a/node_modules/call-bind/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -coverage/ diff --git a/node_modules/call-bind/.eslintrc b/node_modules/call-bind/.eslintrc deleted file mode 100644 index e5d3c9a..0000000 --- a/node_modules/call-bind/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "root": true, - - "extends": "@ljharb", - - "rules": { - "func-name-matching": 0, - "id-length": 0, - "new-cap": [2, { - "capIsNewExceptions": [ - "GetIntrinsic", - ], - }], - "no-magic-numbers": 0, - "operator-linebreak": [2, "before"], - }, -} diff --git a/node_modules/call-bind/.github/FUNDING.yml b/node_modules/call-bind/.github/FUNDING.yml deleted file mode 100644 index c70c2ec..0000000 --- a/node_modules/call-bind/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [ljharb] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: npm/call-bind -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/node_modules/call-bind/.nycrc b/node_modules/call-bind/.nycrc deleted file mode 100644 index 1826526..0000000 --- a/node_modules/call-bind/.nycrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "all": true, - "check-coverage": false, - "reporter": ["text-summary", "text", "html", "json"], - "lines": 86, - "statements": 85.93, - "functions": 82.43, - "branches": 76.06, - "exclude": [ - "coverage", - "test" - ] -} diff --git a/node_modules/call-bind/CHANGELOG.md b/node_modules/call-bind/CHANGELOG.md deleted file mode 100644 index 62a3727..0000000 --- a/node_modules/call-bind/CHANGELOG.md +++ /dev/null @@ -1,42 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11 - -### Commits - -- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d) - -## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08 - -### Commits - -- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1) -- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e) -- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb) -- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8) -- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71) -- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee) -- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2) -- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8) -- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532) -- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6) - -## v1.0.0 - 2020-10-30 - -### Commits - -- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50) -- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df) -- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65) -- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249) -- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13) -- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4) -- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717) -- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af) -- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650) -- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f) diff --git a/node_modules/call-bind/LICENSE b/node_modules/call-bind/LICENSE deleted file mode 100644 index 48f05d0..0000000 --- a/node_modules/call-bind/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Jordan Harband - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/call-bind/README.md b/node_modules/call-bind/README.md deleted file mode 100644 index 53649eb..0000000 --- a/node_modules/call-bind/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# call-bind -Robustly `.call.bind()` a function. diff --git a/node_modules/call-bind/callBound.js b/node_modules/call-bind/callBound.js deleted file mode 100644 index 8374adf..0000000 --- a/node_modules/call-bind/callBound.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('get-intrinsic'); - -var callBind = require('./'); - -var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); - -module.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { - return callBind(intrinsic); - } - return intrinsic; -}; diff --git a/node_modules/call-bind/index.js b/node_modules/call-bind/index.js deleted file mode 100644 index 6fa3e4a..0000000 --- a/node_modules/call-bind/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -var bind = require('function-bind'); -var GetIntrinsic = require('get-intrinsic'); - -var $apply = GetIntrinsic('%Function.prototype.apply%'); -var $call = GetIntrinsic('%Function.prototype.call%'); -var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); - -var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); -var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); -var $max = GetIntrinsic('%Math.max%'); - -if ($defineProperty) { - try { - $defineProperty({}, 'a', { value: 1 }); - } catch (e) { - // IE 8 has a broken defineProperty - $defineProperty = null; - } -} - -module.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, 'length'); - if (desc.configurable) { - // original length, plus the receiver, minus any additional arguments (after the receiver) - $defineProperty( - func, - 'length', - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } - } - return func; -}; - -var applyBind = function applyBind() { - return $reflectApply(bind, $apply, arguments); -}; - -if ($defineProperty) { - $defineProperty(module.exports, 'apply', { value: applyBind }); -} else { - module.exports.apply = applyBind; -} diff --git a/node_modules/call-bind/package.json b/node_modules/call-bind/package.json deleted file mode 100644 index 4360556..0000000 --- a/node_modules/call-bind/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "call-bind", - "version": "1.0.2", - "description": "Robustly `.call.bind()` a function", - "main": "index.js", - "exports": { - ".": [ - { - "default": "./index.js" - }, - "./index.js" - ], - "./callBound": [ - { - "default": "./callBound.js" - }, - "./callBound.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "prepublish": "safe-publish-latest", - "lint": "eslint --ext=.js,.mjs .", - "pretest": "npm run lint", - "tests-only": "nyc tape 'test/*'", - "test": "npm run tests-only", - "posttest": "aud --production", - "version": "auto-changelog && git add CHANGELOG.md", - "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/ljharb/call-bind.git" - }, - "keywords": [ - "javascript", - "ecmascript", - "es", - "js", - "callbind", - "callbound", - "call", - "bind", - "bound", - "call-bind", - "call-bound", - "function", - "es-abstract" - ], - "author": "Jordan Harband ", - "funding": { - "url": "https://github.com/sponsors/ljharb" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/ljharb/call-bind/issues" - }, - "homepage": "https://github.com/ljharb/call-bind#readme", - "devDependencies": { - "@ljharb/eslint-config": "^17.3.0", - "aud": "^1.1.3", - "auto-changelog": "^2.2.1", - "eslint": "^7.17.0", - "nyc": "^10.3.2", - "safe-publish-latest": "^1.1.4", - "tape": "^5.1.1" - }, - "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - } -} diff --git a/node_modules/call-bind/test/callBound.js b/node_modules/call-bind/test/callBound.js deleted file mode 100644 index 209ce3c..0000000 --- a/node_modules/call-bind/test/callBound.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -var test = require('tape'); - -var callBound = require('../callBound'); - -test('callBound', function (t) { - // static primitive - t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself'); - t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself'); - - // static non-function object - t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself'); - t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself'); - t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself'); - t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself'); - - // static function - t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself'); - t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself'); - - // prototype primitive - t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself'); - t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself'); - - // prototype function - t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself'); - t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself'); - t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original'); - t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original'); - - t['throws']( - function () { callBound('does not exist'); }, - SyntaxError, - 'nonexistent intrinsic throws' - ); - t['throws']( - function () { callBound('does not exist', true); }, - SyntaxError, - 'allowMissing arg still throws for unknown intrinsic' - ); - - /* globals WeakRef: false */ - t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) { - st['throws']( - function () { callBound('WeakRef'); }, - TypeError, - 'real but absent intrinsic throws' - ); - st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception'); - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/call-bind/test/index.js b/node_modules/call-bind/test/index.js deleted file mode 100644 index bf6769c..0000000 --- a/node_modules/call-bind/test/index.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -var callBind = require('../'); -var bind = require('function-bind'); - -var test = require('tape'); - -/* - * older engines have length nonconfigurable - * in io.js v3, it is configurable except on bound functions, hence the .bind() - */ -var functionsHaveConfigurableLengths = !!( - Object.getOwnPropertyDescriptor - && Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable -); - -test('callBind', function (t) { - var sentinel = { sentinel: true }; - var func = function (a, b) { - // eslint-disable-next-line no-invalid-this - return [this, a, b]; - }; - t.equal(func.length, 2, 'original function length is 2'); - t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args'); - t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args'); - t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args'); - - var bound = callBind(func); - t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args'); - t.deepEqual(bound(1, 2), [1, 2, undefined], 'bound func with right args'); - t.deepEqual(bound(1, 2, 3), [1, 2, 3], 'bound func with too many args'); - - var boundR = callBind(func, sentinel); - t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args'); - t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args'); - t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args'); - - var boundArg = callBind(func, sentinel, 1); - t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths }); - t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args'); - t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg'); - t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args'); - - t.test('callBind.apply', function (st) { - var aBound = callBind.apply(func); - st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args'); - st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); - st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); - - var aBoundArg = callBind.apply(func); - st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args'); - st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args'); - st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args'); - - var aBoundR = callBind.apply(func, sentinel); - st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args'); - st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args'); - st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args'); - - st.end(); - }); - - t.end(); -}); diff --git a/node_modules/chalk/index.d.ts b/node_modules/chalk/index.d.ts deleted file mode 100644 index 9cd88f3..0000000 --- a/node_modules/chalk/index.d.ts +++ /dev/null @@ -1,415 +0,0 @@ -/** -Basic foreground colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type ForegroundColor = - | 'black' - | 'red' - | 'green' - | 'yellow' - | 'blue' - | 'magenta' - | 'cyan' - | 'white' - | 'gray' - | 'grey' - | 'blackBright' - | 'redBright' - | 'greenBright' - | 'yellowBright' - | 'blueBright' - | 'magentaBright' - | 'cyanBright' - | 'whiteBright'; - -/** -Basic background colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type BackgroundColor = - | 'bgBlack' - | 'bgRed' - | 'bgGreen' - | 'bgYellow' - | 'bgBlue' - | 'bgMagenta' - | 'bgCyan' - | 'bgWhite' - | 'bgGray' - | 'bgGrey' - | 'bgBlackBright' - | 'bgRedBright' - | 'bgGreenBright' - | 'bgYellowBright' - | 'bgBlueBright' - | 'bgMagentaBright' - | 'bgCyanBright' - | 'bgWhiteBright'; - -/** -Basic colors. - -[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support) -*/ -declare type Color = ForegroundColor | BackgroundColor; - -declare type Modifiers = - | 'reset' - | 'bold' - | 'dim' - | 'italic' - | 'underline' - | 'inverse' - | 'hidden' - | 'strikethrough' - | 'visible'; - -declare namespace chalk { - /** - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - type Level = 0 | 1 | 2 | 3; - - interface Options { - /** - Specify the color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level?: Level; - } - - /** - Return a new Chalk instance. - */ - type Instance = new (options?: Options) => Chalk; - - /** - Detect whether the terminal supports color. - */ - interface ColorSupport { - /** - The color level used by Chalk. - */ - level: Level; - - /** - Return whether Chalk supports basic 16 colors. - */ - hasBasic: boolean; - - /** - Return whether Chalk supports ANSI 256 colors. - */ - has256: boolean; - - /** - Return whether Chalk supports Truecolor 16 million colors. - */ - has16m: boolean; - } - - interface ChalkFunction { - /** - Use a template string. - - @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341)) - - @example - ``` - import chalk = require('chalk'); - - log(chalk` - CPU: {red ${cpu.totalPercent}%} - RAM: {green ${ram.used / ram.total * 100}%} - DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} - `); - ``` - - @example - ``` - import chalk = require('chalk'); - - log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`) - ``` - */ - (text: TemplateStringsArray, ...placeholders: unknown[]): string; - - (...text: unknown[]): string; - } - - interface Chalk extends ChalkFunction { - /** - Return a new Chalk instance. - */ - Instance: Instance; - - /** - The color support for Chalk. - - By default, color support is automatically detected based on the environment. - - Levels: - - `0` - All colors disabled. - - `1` - Basic 16 colors support. - - `2` - ANSI 256 colors support. - - `3` - Truecolor 16 million colors support. - */ - level: Level; - - /** - Use HEX value to set text color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.hex('#DEADED'); - ``` - */ - hex(color: string): Chalk; - - /** - Use keyword color value to set text color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.keyword('orange'); - ``` - */ - keyword(color: string): Chalk; - - /** - Use RGB values to set text color. - */ - rgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set text color. - */ - hsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set text color. - */ - hsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set text color. - */ - hwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - */ - ansi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color. - */ - ansi256(index: number): Chalk; - - /** - Use HEX value to set background color. - - @param color - Hexadecimal value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgHex('#DEADED'); - ``` - */ - bgHex(color: string): Chalk; - - /** - Use keyword color value to set background color. - - @param color - Keyword value representing the desired color. - - @example - ``` - import chalk = require('chalk'); - - chalk.bgKeyword('orange'); - ``` - */ - bgKeyword(color: string): Chalk; - - /** - Use RGB values to set background color. - */ - bgRgb(red: number, green: number, blue: number): Chalk; - - /** - Use HSL values to set background color. - */ - bgHsl(hue: number, saturation: number, lightness: number): Chalk; - - /** - Use HSV values to set background color. - */ - bgHsv(hue: number, saturation: number, value: number): Chalk; - - /** - Use HWB values to set background color. - */ - bgHwb(hue: number, whiteness: number, blackness: number): Chalk; - - /** - Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color. - - 30 <= code && code < 38 || 90 <= code && code < 98 - For example, 31 for red, 91 for redBright. - Use the foreground code, not the background code (for example, not 41, nor 101). - */ - bgAnsi(code: number): Chalk; - - /** - Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color. - */ - bgAnsi256(index: number): Chalk; - - /** - Modifier: Resets the current color chain. - */ - readonly reset: Chalk; - - /** - Modifier: Make text bold. - */ - readonly bold: Chalk; - - /** - Modifier: Emitting only a small amount of light. - */ - readonly dim: Chalk; - - /** - Modifier: Make text italic. (Not widely supported) - */ - readonly italic: Chalk; - - /** - Modifier: Make text underline. (Not widely supported) - */ - readonly underline: Chalk; - - /** - Modifier: Inverse background and foreground colors. - */ - readonly inverse: Chalk; - - /** - Modifier: Prints the text, but makes it invisible. - */ - readonly hidden: Chalk; - - /** - Modifier: Puts a horizontal line through the center of the text. (Not widely supported) - */ - readonly strikethrough: Chalk; - - /** - Modifier: Prints the text only when Chalk has a color support level > 0. - Can be useful for things that are purely cosmetic. - */ - readonly visible: Chalk; - - readonly black: Chalk; - readonly red: Chalk; - readonly green: Chalk; - readonly yellow: Chalk; - readonly blue: Chalk; - readonly magenta: Chalk; - readonly cyan: Chalk; - readonly white: Chalk; - - /* - Alias for `blackBright`. - */ - readonly gray: Chalk; - - /* - Alias for `blackBright`. - */ - readonly grey: Chalk; - - readonly blackBright: Chalk; - readonly redBright: Chalk; - readonly greenBright: Chalk; - readonly yellowBright: Chalk; - readonly blueBright: Chalk; - readonly magentaBright: Chalk; - readonly cyanBright: Chalk; - readonly whiteBright: Chalk; - - readonly bgBlack: Chalk; - readonly bgRed: Chalk; - readonly bgGreen: Chalk; - readonly bgYellow: Chalk; - readonly bgBlue: Chalk; - readonly bgMagenta: Chalk; - readonly bgCyan: Chalk; - readonly bgWhite: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGray: Chalk; - - /* - Alias for `bgBlackBright`. - */ - readonly bgGrey: Chalk; - - readonly bgBlackBright: Chalk; - readonly bgRedBright: Chalk; - readonly bgGreenBright: Chalk; - readonly bgYellowBright: Chalk; - readonly bgBlueBright: Chalk; - readonly bgMagentaBright: Chalk; - readonly bgCyanBright: Chalk; - readonly bgWhiteBright: Chalk; - } -} - -/** -Main Chalk object that allows to chain styles together. -Call the last one as a method with a string argument. -Order doesn't matter, and later styles take precedent in case of a conflict. -This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`. -*/ -declare const chalk: chalk.Chalk & chalk.ChalkFunction & { - supportsColor: chalk.ColorSupport | false; - Level: chalk.Level; - Color: Color; - ForegroundColor: ForegroundColor; - BackgroundColor: BackgroundColor; - Modifiers: Modifiers; - stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false}; -}; - -export = chalk; diff --git a/node_modules/chalk/license b/node_modules/chalk/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/chalk/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json deleted file mode 100644 index 47c23f2..0000000 --- a/node_modules/chalk/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "chalk", - "version": "4.1.2", - "description": "Terminal string styling done right", - "license": "MIT", - "repository": "chalk/chalk", - "funding": "https://github.com/chalk/chalk?sponsor=1", - "main": "source", - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && nyc ava && tsd", - "bench": "matcha benchmark.js" - }, - "files": [ - "source", - "index.d.ts" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "devDependencies": { - "ava": "^2.4.0", - "coveralls": "^3.0.7", - "execa": "^4.0.0", - "import-fresh": "^3.1.0", - "matcha": "^0.7.0", - "nyc": "^15.0.0", - "resolve-from": "^5.0.0", - "tsd": "^0.7.4", - "xo": "^0.28.2" - }, - "xo": { - "rules": { - "unicorn/prefer-string-slice": "off", - "unicorn/prefer-includes": "off", - "@typescript-eslint/member-ordering": "off", - "no-redeclare": "off", - "unicorn/string-content": "off", - "unicorn/better-regex": "off" - } - } -} diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md deleted file mode 100644 index a055d21..0000000 --- a/node_modules/chalk/readme.md +++ /dev/null @@ -1,341 +0,0 @@ -

    -
    -
    - Chalk -
    -
    -
    -

    - -> Terminal string styling done right - -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk) - - - -
    - ---- - - - ---- - -
    - -## Highlights - -- Expressive API -- Highly performant -- Ability to nest styles -- [256/Truecolor color support](#256-and-truecolor-color-support) -- Auto-detects color support -- Doesn't extend `String.prototype` -- Clean and focused -- Actively maintained -- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020 - -## Install - -```console -$ npm install chalk -``` - -## Usage - -```js -const chalk = require('chalk'); - -console.log(chalk.blue('Hello world!')); -``` - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -const chalk = require('chalk'); -const log = console.log; - -// Combine styled and normal strings -log(chalk.blue('Hello') + ' World' + chalk.red('!')); - -// Compose multiple styles using the chainable API -log(chalk.blue.bgRed.bold('Hello world!')); - -// Pass in multiple arguments -log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); - -// Nest styles -log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); - -// Nest styles of the same type even (color, underline, background) -log(chalk.green( - 'I am a green line ' + - chalk.blue.underline.bold('with a blue substring') + - ' that becomes green again!' -)); - -// ES2015 template literal -log(` -CPU: ${chalk.red('90%')} -RAM: ${chalk.green('40%')} -DISK: ${chalk.yellow('70%')} -`); - -// ES2015 tagged template literal -log(chalk` -CPU: {red ${cpu.totalPercent}%} -RAM: {green ${ram.used / ram.total * 100}%} -DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} -`); - -// Use RGB colors in terminal emulators that support it. -log(chalk.keyword('orange')('Yay for orange colored text!')); -log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); -log(chalk.hex('#DEADED').bold('Bold gray!')); -``` - -Easily define your own themes: - -```js -const chalk = require('chalk'); - -const error = chalk.bold.red; -const warning = chalk.keyword('orange'); - -console.log(error('Error!')); -console.log(warning('Warning!')); -``` - -Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): - -```js -const name = 'Sindre'; -console.log(chalk.green('Hello %s'), name); -//=> 'Hello Sindre' -``` - -## API - -### chalk.`