flexibility.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. /**
  2. * Flexibility is a JavaScript polyfill for Flexbox By Jonathan Neal, 10up. (https://github.com/jonathantneal/flexibility)
  3. * Licensed under MIT ( https://github.com/jonathantneal/flexibility/blob/master/LICENSE.md )
  4. */
  5. ! function(e) {
  6. if ("object" == typeof exports && "undefined" != typeof module) module.exports = e();
  7. else if ("function" == typeof define && define.amd) define([], e);
  8. else {
  9. var t;
  10. t = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, t.flexibility = e()
  11. }
  12. }(function() {
  13. return function e(t, r, l) {
  14. function n(f, i) {
  15. if (!r[f]) {
  16. if (!t[f]) {
  17. var s = "function" == typeof require && require;
  18. if (!i && s) return s(f, !0);
  19. if (o) return o(f, !0);
  20. var a = new Error("Cannot find module '" + f + "'");
  21. throw a.code = "MODULE_NOT_FOUND", a
  22. }
  23. var c = r[f] = {
  24. exports: {}
  25. };
  26. t[f][0].call(c.exports, function(e) {
  27. var r = t[f][1][e];
  28. return n(r ? r : e)
  29. }, c, c.exports, e, t, r, l)
  30. }
  31. return r[f].exports
  32. }
  33. for (var o = "function" == typeof require && require, f = 0; f < l.length; f++) n(l[f]);
  34. return n
  35. }({
  36. 1: [function(e, t, r) {
  37. t.exports = function(e) {
  38. var t, r, l, n = -1;
  39. if (e.lines.length > 1 && "flex-start" === e.style.alignContent)
  40. for (t = 0; l = e.lines[++n];) l.crossStart = t, t += l.cross;
  41. else if (e.lines.length > 1 && "flex-end" === e.style.alignContent)
  42. for (t = e.flexStyle.crossSpace; l = e.lines[++n];) l.crossStart = t, t += l.cross;
  43. else if (e.lines.length > 1 && "center" === e.style.alignContent)
  44. for (t = e.flexStyle.crossSpace / 2; l = e.lines[++n];) l.crossStart = t, t += l.cross;
  45. else if (e.lines.length > 1 && "space-between" === e.style.alignContent)
  46. for (r = e.flexStyle.crossSpace / (e.lines.length - 1), t = 0; l = e.lines[++n];) l.crossStart = t, t += l.cross + r;
  47. else if (e.lines.length > 1 && "space-around" === e.style.alignContent)
  48. for (r = 2 * e.flexStyle.crossSpace / (2 * e.lines.length), t = r / 2; l = e.lines[++n];) l.crossStart = t, t += l.cross + r;
  49. else
  50. for (r = e.flexStyle.crossSpace / e.lines.length, t = e.flexStyle.crossInnerBefore; l = e.lines[++n];) l.crossStart = t, l.cross += r, t += l.cross
  51. }
  52. }, {}],
  53. 2: [function(e, t, r) {
  54. t.exports = function(e) {
  55. for (var t, r = -1; line = e.lines[++r];)
  56. for (t = -1; child = line.children[++t];) {
  57. var l = child.style.alignSelf;
  58. "auto" === l && (l = e.style.alignItems), "flex-start" === l ? child.flexStyle.crossStart = line.crossStart : "flex-end" === l ? child.flexStyle.crossStart = line.crossStart + line.cross - child.flexStyle.crossOuter : "center" === l ? child.flexStyle.crossStart = line.crossStart + (line.cross - child.flexStyle.crossOuter) / 2 : (child.flexStyle.crossStart = line.crossStart, child.flexStyle.crossOuter = line.cross, child.flexStyle.cross = child.flexStyle.crossOuter - child.flexStyle.crossBefore - child.flexStyle.crossAfter)
  59. }
  60. }
  61. }, {}],
  62. 3: [function(e, t, r) {
  63. t.exports = function l(e, l) {
  64. var t = "row" === l || "row-reverse" === l,
  65. r = e.mainAxis;
  66. if (r) {
  67. var n = t && "inline" === r || !t && "block" === r;
  68. n || (e.flexStyle = {
  69. main: e.flexStyle.cross,
  70. cross: e.flexStyle.main,
  71. mainOffset: e.flexStyle.crossOffset,
  72. crossOffset: e.flexStyle.mainOffset,
  73. mainBefore: e.flexStyle.crossBefore,
  74. mainAfter: e.flexStyle.crossAfter,
  75. crossBefore: e.flexStyle.mainBefore,
  76. crossAfter: e.flexStyle.mainAfter,
  77. mainInnerBefore: e.flexStyle.crossInnerBefore,
  78. mainInnerAfter: e.flexStyle.crossInnerAfter,
  79. crossInnerBefore: e.flexStyle.mainInnerBefore,
  80. crossInnerAfter: e.flexStyle.mainInnerAfter,
  81. mainBorderBefore: e.flexStyle.crossBorderBefore,
  82. mainBorderAfter: e.flexStyle.crossBorderAfter,
  83. crossBorderBefore: e.flexStyle.mainBorderBefore,
  84. crossBorderAfter: e.flexStyle.mainBorderAfter
  85. })
  86. } else t ? e.flexStyle = {
  87. main: e.style.width,
  88. cross: e.style.height,
  89. mainOffset: e.style.offsetWidth,
  90. crossOffset: e.style.offsetHeight,
  91. mainBefore: e.style.marginLeft,
  92. mainAfter: e.style.marginRight,
  93. crossBefore: e.style.marginTop,
  94. crossAfter: e.style.marginBottom,
  95. mainInnerBefore: e.style.paddingLeft,
  96. mainInnerAfter: e.style.paddingRight,
  97. crossInnerBefore: e.style.paddingTop,
  98. crossInnerAfter: e.style.paddingBottom,
  99. mainBorderBefore: e.style.borderLeftWidth,
  100. mainBorderAfter: e.style.borderRightWidth,
  101. crossBorderBefore: e.style.borderTopWidth,
  102. crossBorderAfter: e.style.borderBottomWidth
  103. } : e.flexStyle = {
  104. main: e.style.height,
  105. cross: e.style.width,
  106. mainOffset: e.style.offsetHeight,
  107. crossOffset: e.style.offsetWidth,
  108. mainBefore: e.style.marginTop,
  109. mainAfter: e.style.marginBottom,
  110. crossBefore: e.style.marginLeft,
  111. crossAfter: e.style.marginRight,
  112. mainInnerBefore: e.style.paddingTop,
  113. mainInnerAfter: e.style.paddingBottom,
  114. crossInnerBefore: e.style.paddingLeft,
  115. crossInnerAfter: e.style.paddingRight,
  116. mainBorderBefore: e.style.borderTopWidth,
  117. mainBorderAfter: e.style.borderBottomWidth,
  118. crossBorderBefore: e.style.borderLeftWidth,
  119. crossBorderAfter: e.style.borderRightWidth
  120. }, "content-box" === e.style.boxSizing && ("number" == typeof e.flexStyle.main && (e.flexStyle.main += e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter), "number" == typeof e.flexStyle.cross && (e.flexStyle.cross += e.flexStyle.crossInnerBefore + e.flexStyle.crossInnerAfter + e.flexStyle.crossBorderBefore + e.flexStyle.crossBorderAfter));
  121. e.mainAxis = t ? "inline" : "block", e.crossAxis = t ? "block" : "inline", "number" == typeof e.style.flexBasis && (e.flexStyle.main = e.style.flexBasis + e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter), e.flexStyle.mainOuter = e.flexStyle.main, e.flexStyle.crossOuter = e.flexStyle.cross, "auto" === e.flexStyle.mainOuter && (e.flexStyle.mainOuter = e.flexStyle.mainOffset), "auto" === e.flexStyle.crossOuter && (e.flexStyle.crossOuter = e.flexStyle.crossOffset), "number" == typeof e.flexStyle.mainBefore && (e.flexStyle.mainOuter += e.flexStyle.mainBefore), "number" == typeof e.flexStyle.mainAfter && (e.flexStyle.mainOuter += e.flexStyle.mainAfter), "number" == typeof e.flexStyle.crossBefore && (e.flexStyle.crossOuter += e.flexStyle.crossBefore), "number" == typeof e.flexStyle.crossAfter && (e.flexStyle.crossOuter += e.flexStyle.crossAfter)
  122. }
  123. }, {}],
  124. 4: [function(e, t, r) {
  125. var l = e("../reduce");
  126. t.exports = function(e) {
  127. if (e.mainSpace > 0) {
  128. var t = l(e.children, function(e, t) {
  129. return e + parseFloat(t.style.flexGrow)
  130. }, 0);
  131. t > 0 && (e.main = l(e.children, function(r, l) {
  132. return "auto" === l.flexStyle.main ? l.flexStyle.main = l.flexStyle.mainOffset + parseFloat(l.style.flexGrow) / t * e.mainSpace : l.flexStyle.main += parseFloat(l.style.flexGrow) / t * e.mainSpace, l.flexStyle.mainOuter = l.flexStyle.main + l.flexStyle.mainBefore + l.flexStyle.mainAfter, r + l.flexStyle.mainOuter
  133. }, 0), e.mainSpace = 0)
  134. }
  135. }
  136. }, {
  137. "../reduce": 12
  138. }],
  139. 5: [function(e, t, r) {
  140. var l = e("../reduce");
  141. t.exports = function(e) {
  142. if (e.mainSpace < 0) {
  143. var t = l(e.children, function(e, t) {
  144. return e + parseFloat(t.style.flexShrink)
  145. }, 0);
  146. t > 0 && (e.main = l(e.children, function(r, l) {
  147. return l.flexStyle.main += parseFloat(l.style.flexShrink) / t * e.mainSpace, l.flexStyle.mainOuter = l.flexStyle.main + l.flexStyle.mainBefore + l.flexStyle.mainAfter, r + l.flexStyle.mainOuter
  148. }, 0), e.mainSpace = 0)
  149. }
  150. }
  151. }, {
  152. "../reduce": 12
  153. }],
  154. 6: [function(e, t, r) {
  155. var l = e("../reduce");
  156. t.exports = function(e) {
  157. var t;
  158. e.lines = [t = {
  159. main: 0,
  160. cross: 0,
  161. children: []
  162. }];
  163. for (var r, n = -1; r = e.children[++n];) "nowrap" === e.style.flexWrap || 0 === t.children.length || "auto" === e.flexStyle.main || e.flexStyle.main - e.flexStyle.mainInnerBefore - e.flexStyle.mainInnerAfter - e.flexStyle.mainBorderBefore - e.flexStyle.mainBorderAfter >= t.main + r.flexStyle.mainOuter ? (t.main += r.flexStyle.mainOuter, t.cross = Math.max(t.cross, r.flexStyle.crossOuter)) : e.lines.push(t = {
  164. main: r.flexStyle.mainOuter,
  165. cross: r.flexStyle.crossOuter,
  166. children: []
  167. }), t.children.push(r);
  168. e.flexStyle.mainLines = l(e.lines, function(e, t) {
  169. return Math.max(e, t.main)
  170. }, 0), e.flexStyle.crossLines = l(e.lines, function(e, t) {
  171. return e + t.cross
  172. }, 0), "auto" === e.flexStyle.main && (e.flexStyle.main = Math.max(e.flexStyle.mainOffset, e.flexStyle.mainLines + e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter)), "auto" === e.flexStyle.cross && (e.flexStyle.cross = Math.max(e.flexStyle.crossOffset, e.flexStyle.crossLines + e.flexStyle.crossInnerBefore + e.flexStyle.crossInnerAfter + e.flexStyle.crossBorderBefore + e.flexStyle.crossBorderAfter)), e.flexStyle.crossSpace = e.flexStyle.cross - e.flexStyle.crossInnerBefore - e.flexStyle.crossInnerAfter - e.flexStyle.crossBorderBefore - e.flexStyle.crossBorderAfter - e.flexStyle.crossLines, e.flexStyle.mainOuter = e.flexStyle.main + e.flexStyle.mainBefore + e.flexStyle.mainAfter, e.flexStyle.crossOuter = e.flexStyle.cross + e.flexStyle.crossBefore + e.flexStyle.crossAfter
  173. }
  174. }, {
  175. "../reduce": 12
  176. }],
  177. 7: [function(e, t, r) {
  178. function l(t) {
  179. for (var r, l = -1; r = t.children[++l];) e("./flex-direction")(r, t.style.flexDirection);
  180. e("./flex-direction")(t, t.style.flexDirection), e("./order")(t), e("./flexbox-lines")(t), e("./align-content")(t), l = -1;
  181. for (var n; n = t.lines[++l];) n.mainSpace = t.flexStyle.main - t.flexStyle.mainInnerBefore - t.flexStyle.mainInnerAfter - t.flexStyle.mainBorderBefore - t.flexStyle.mainBorderAfter - n.main, e("./flex-grow")(n), e("./flex-shrink")(n), e("./margin-main")(n), e("./margin-cross")(n), e("./justify-content")(n, t.style.justifyContent, t);
  182. e("./align-items")(t)
  183. }
  184. t.exports = l
  185. }, {
  186. "./align-content": 1,
  187. "./align-items": 2,
  188. "./flex-direction": 3,
  189. "./flex-grow": 4,
  190. "./flex-shrink": 5,
  191. "./flexbox-lines": 6,
  192. "./justify-content": 8,
  193. "./margin-cross": 9,
  194. "./margin-main": 10,
  195. "./order": 11
  196. }],
  197. 8: [function(e, t, r) {
  198. t.exports = function(e, t, r) {
  199. var l, n, o, f = r.flexStyle.mainInnerBefore,
  200. i = -1;
  201. if ("flex-end" === t)
  202. for (l = e.mainSpace, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter;
  203. else if ("center" === t)
  204. for (l = e.mainSpace / 2, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter;
  205. else if ("space-between" === t)
  206. for (n = e.mainSpace / (e.children.length - 1), l = 0, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter + n;
  207. else if ("space-around" === t)
  208. for (n = 2 * e.mainSpace / (2 * e.children.length), l = n / 2, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter + n;
  209. else
  210. for (l = 0, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter
  211. }
  212. }, {}],
  213. 9: [function(e, t, r) {
  214. t.exports = function(e) {
  215. for (var t, r = -1; t = e.children[++r];) {
  216. var l = 0;
  217. "auto" === t.flexStyle.crossBefore && ++l, "auto" === t.flexStyle.crossAfter && ++l;
  218. var n = e.cross - t.flexStyle.crossOuter;
  219. "auto" === t.flexStyle.crossBefore && (t.flexStyle.crossBefore = n / l), "auto" === t.flexStyle.crossAfter && (t.flexStyle.crossAfter = n / l), "auto" === t.flexStyle.cross ? t.flexStyle.crossOuter = t.flexStyle.crossOffset + t.flexStyle.crossBefore + t.flexStyle.crossAfter : t.flexStyle.crossOuter = t.flexStyle.cross + t.flexStyle.crossBefore + t.flexStyle.crossAfter
  220. }
  221. }
  222. }, {}],
  223. 10: [function(e, t, r) {
  224. t.exports = function(e) {
  225. for (var t, r = 0, l = -1; t = e.children[++l];) "auto" === t.flexStyle.mainBefore && ++r, "auto" === t.flexStyle.mainAfter && ++r;
  226. if (r > 0) {
  227. for (l = -1; t = e.children[++l];) "auto" === t.flexStyle.mainBefore && (t.flexStyle.mainBefore = e.mainSpace / r), "auto" === t.flexStyle.mainAfter && (t.flexStyle.mainAfter = e.mainSpace / r), "auto" === t.flexStyle.main ? t.flexStyle.mainOuter = t.flexStyle.mainOffset + t.flexStyle.mainBefore + t.flexStyle.mainAfter : t.flexStyle.mainOuter = t.flexStyle.main + t.flexStyle.mainBefore + t.flexStyle.mainAfter;
  228. e.mainSpace = 0
  229. }
  230. }
  231. }, {}],
  232. 11: [function(e, t, r) {
  233. var l = /^(column|row)-reverse$/;
  234. t.exports = function(e) {
  235. e.children.sort(function(e, t) {
  236. return e.style.order - t.style.order || e.index - t.index
  237. }), l.test(e.style.flexDirection) && e.children.reverse()
  238. }
  239. }, {}],
  240. 12: [function(e, t, r) {
  241. function l(e, t, r) {
  242. for (var l = e.length, n = -1; ++n < l;) n in e && (r = t(r, e[n], n));
  243. return r
  244. }
  245. t.exports = l
  246. }, {}],
  247. 13: [function(e, t, r) {
  248. function l(e) {
  249. i(f(e))
  250. }
  251. var n = e("./read"),
  252. o = e("./write"),
  253. f = e("./readAll"),
  254. i = e("./writeAll");
  255. t.exports = l, t.exports.read = n, t.exports.write = o, t.exports.readAll = f, t.exports.writeAll = i
  256. }, {
  257. "./read": 15,
  258. "./readAll": 16,
  259. "./write": 17,
  260. "./writeAll": 18
  261. }],
  262. 14: [function(e, t, r) {
  263. function l(e, t, r) {
  264. var l = e[t],
  265. f = String(l).match(o);
  266. if (!f) {
  267. var a = t.match(s);
  268. if (a) {
  269. var c = e["border" + a[1] + "Style"];
  270. return "none" === c ? 0 : i[l] || 0
  271. }
  272. return l
  273. }
  274. var y = f[1],
  275. x = f[2];
  276. return "px" === x ? 1 * y : "cm" === x ? .3937 * y * 96 : "in" === x ? 96 * y : "mm" === x ? .3937 * y * 96 / 10 : "pc" === x ? 12 * y * 96 / 72 : "pt" === x ? 96 * y / 72 : "rem" === x ? 16 * y : n(l, r)
  277. }
  278. function n(e, t) {
  279. f.style.cssText = "border:none!important;clip:rect(0 0 0 0)!important;display:block!important;font-size:1em!important;height:0!important;margin:0!important;padding:0!important;position:relative!important;width:" + e + "!important", t.parentNode.insertBefore(f, t.nextSibling);
  280. var r = f.offsetWidth;
  281. return t.parentNode.removeChild(f), r
  282. }
  283. t.exports = l;
  284. var o = /^([-+]?\d*\.?\d+)(%|[a-z]+)$/,
  285. f = document.createElement("div"),
  286. i = {
  287. medium: 4,
  288. none: 0,
  289. thick: 6,
  290. thin: 2
  291. },
  292. s = /^border(Bottom|Left|Right|Top)Width$/
  293. }, {}],
  294. 15: [function(e, t, r) {
  295. function l(e) {
  296. var t = {
  297. alignContent: "stretch",
  298. alignItems: "stretch",
  299. alignSelf: "auto",
  300. borderBottomStyle: "none",
  301. borderBottomWidth: 0,
  302. borderLeftStyle: "none",
  303. borderLeftWidth: 0,
  304. borderRightStyle: "none",
  305. borderRightWidth: 0,
  306. borderTopStyle: "none",
  307. borderTopWidth: 0,
  308. boxSizing: "content-box",
  309. display: "inline",
  310. flexBasis: "auto",
  311. flexDirection: "row",
  312. flexGrow: 0,
  313. flexShrink: 1,
  314. flexWrap: "nowrap",
  315. justifyContent: "flex-start",
  316. height: "auto",
  317. marginTop: 0,
  318. marginRight: 0,
  319. marginLeft: 0,
  320. marginBottom: 0,
  321. paddingTop: 0,
  322. paddingRight: 0,
  323. paddingLeft: 0,
  324. paddingBottom: 0,
  325. maxHeight: "none",
  326. maxWidth: "none",
  327. minHeight: 0,
  328. minWidth: 0,
  329. order: 0,
  330. position: "static",
  331. width: "auto"
  332. },
  333. r = e instanceof Element;
  334. if (r) {
  335. var l = e.hasAttribute("data-style"),
  336. i = l ? e.getAttribute("data-style") : e.getAttribute("style") || "";
  337. l || e.setAttribute("data-style", i);
  338. var s = window.getComputedStyle && getComputedStyle(e) || {};
  339. f(t, s);
  340. var c = e.currentStyle || {};
  341. n(t, c), o(t, i);
  342. for (var y in t) t[y] = a(t, y, e);
  343. var x = e.getBoundingClientRect();
  344. t.offsetHeight = x.height || e.offsetHeight, t.offsetWidth = x.width || e.offsetWidth
  345. }
  346. var S = {
  347. element: e,
  348. style: t
  349. };
  350. return S
  351. }
  352. function n(e, t) {
  353. for (var r in e) {
  354. var l = r in t;
  355. if (l) e[r] = t[r];
  356. else {
  357. // Replace uppercase characters with lowercase.
  358. var n = r.replace(/[A-Z]/g, "-$&").toLowerCase(),
  359. o = n in t;
  360. o && (e[r] = t[n])
  361. }
  362. }
  363. var f = "-js-display" in t;
  364. f && (e.display = t["-js-display"])
  365. }
  366. function o(e, t) {
  367. for (var r; r = i.exec(t);) {
  368. // Replace lowercase characters with uppercase.
  369. var l = r[1].toLowerCase().replace(/-[a-z]/g, function(e) {
  370. return e.slice(1).toUpperCase()
  371. });
  372. e[l] = r[2]
  373. }
  374. }
  375. function f(e, t) {
  376. for (var r in e) {
  377. var l = r in t;
  378. l && !s.test(r) && (e[r] = t[r])
  379. }
  380. }
  381. t.exports = l;
  382. var i = /([^\s:;]+)\s*:\s*([^;]+?)\s*(;|$)/g,
  383. s = /^(alignSelf|height|width)$/,
  384. a = e("./getComputedLength")
  385. }, {
  386. "./getComputedLength": 14
  387. }],
  388. 16: [function(e, t, r) {
  389. function l(e) {
  390. var t = [];
  391. return n(e, t), t
  392. }
  393. function n(e, t) {
  394. for (var r, l = o(e), i = [], s = -1; r = e.childNodes[++s];) {
  395. var a = 3 === r.nodeType && !/^\s*$/.test(r.nodeValue);
  396. if (l && a) {
  397. var c = r;
  398. r = e.insertBefore(document.createElement("flex-item"), c), r.appendChild(c)
  399. }
  400. var y = r instanceof Element;
  401. if (y) {
  402. var x = n(r, t);
  403. if (l) {
  404. var S = r.style;
  405. S.display = "inline-block", S.position = "absolute", x.style = f(r).style, i.push(x)
  406. }
  407. }
  408. }
  409. var m = {
  410. element: e,
  411. children: i
  412. };
  413. return l && (m.style = f(e).style, t.push(m)), m
  414. }
  415. function o(e) {
  416. var t = e instanceof Element,
  417. r = t && e.getAttribute("data-style"),
  418. l = t && e.currentStyle && e.currentStyle["-js-display"],
  419. n = i.test(r) || s.test(l);
  420. return n
  421. }
  422. t.exports = l;
  423. var f = e("../read"),
  424. i = /(^|;)\s*display\s*:\s*(inline-)?flex\s*(;|$)/i,
  425. s = /^(inline-)?flex$/i
  426. }, {
  427. "../read": 15
  428. }],
  429. 17: [function(e, t, r) {
  430. function l(e) {
  431. o(e);
  432. var t = e.element.style,
  433. r = "inline" === e.mainAxis ? ["main", "cross"] : ["cross", "main"];
  434. t.boxSizing = "content-box", t.display = "block", t.position = "relative", t.width = n(e.flexStyle[r[0]] - e.flexStyle[r[0] + "InnerBefore"] - e.flexStyle[r[0] + "InnerAfter"] - e.flexStyle[r[0] + "BorderBefore"] - e.flexStyle[r[0] + "BorderAfter"]), t.height = n(e.flexStyle[r[1]] - e.flexStyle[r[1] + "InnerBefore"] - e.flexStyle[r[1] + "InnerAfter"] - e.flexStyle[r[1] + "BorderBefore"] - e.flexStyle[r[1] + "BorderAfter"]);
  435. for (var l, f = -1; l = e.children[++f];) {
  436. var i = l.element.style,
  437. s = "inline" === l.mainAxis ? ["main", "cross"] : ["cross", "main"];
  438. i.boxSizing = "content-box", i.display = "block", i.position = "absolute", "auto" !== l.flexStyle[s[0]] && (i.width = n(l.flexStyle[s[0]] - l.flexStyle[s[0] + "InnerBefore"] - l.flexStyle[s[0] + "InnerAfter"] - l.flexStyle[s[0] + "BorderBefore"] - l.flexStyle[s[0] + "BorderAfter"])), "auto" !== l.flexStyle[s[1]] && (i.height = n(l.flexStyle[s[1]] - l.flexStyle[s[1] + "InnerBefore"] - l.flexStyle[s[1] + "InnerAfter"] - l.flexStyle[s[1] + "BorderBefore"] - l.flexStyle[s[1] + "BorderAfter"])), i.top = n(l.flexStyle[s[1] + "Start"]), i.left = n(l.flexStyle[s[0] + "Start"]), i.marginTop = n(l.flexStyle[s[1] + "Before"]), i.marginRight = n(l.flexStyle[s[0] + "After"]), i.marginBottom = n(l.flexStyle[s[1] + "After"]), i.marginLeft = n(l.flexStyle[s[0] + "Before"])
  439. }
  440. }
  441. function n(e) {
  442. return "string" == typeof e ? e : Math.max(e, 0) + "px"
  443. }
  444. t.exports = l;
  445. var o = e("../flexbox")
  446. }, {
  447. "../flexbox": 7
  448. }],
  449. 18: [function(e, t, r) {
  450. function l(e) {
  451. for (var t, r = -1; t = e[++r];) n(t)
  452. }
  453. t.exports = l;
  454. var n = e("../write")
  455. }, {
  456. "../write": 17
  457. }]
  458. }, {}, [13])(13)
  459. });