node.js 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. 'use strict';
  2. exports.__esModule = true;
  3. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  5. var _cssSyntaxError = require('./css-syntax-error');
  6. var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);
  7. var _stringifier = require('./stringifier');
  8. var _stringifier2 = _interopRequireDefault(_stringifier);
  9. var _stringify = require('./stringify');
  10. var _stringify2 = _interopRequireDefault(_stringify);
  11. var _warnOnce = require('./warn-once');
  12. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  13. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15. var cloneNode = function cloneNode(obj, parent) {
  16. var cloned = new obj.constructor();
  17. for (var i in obj) {
  18. if (!obj.hasOwnProperty(i)) continue;
  19. var value = obj[i];
  20. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  21. if (i === 'parent' && type === 'object') {
  22. if (parent) cloned[i] = parent;
  23. } else if (i === 'source') {
  24. cloned[i] = value;
  25. } else if (value instanceof Array) {
  26. cloned[i] = value.map(function (j) {
  27. return cloneNode(j, cloned);
  28. });
  29. } else if (i !== 'before' && i !== 'after' && i !== 'between' && i !== 'semicolon') {
  30. if (type === 'object' && value !== null) value = cloneNode(value);
  31. cloned[i] = value;
  32. }
  33. }
  34. return cloned;
  35. };
  36. /**
  37. * All node classes inherit the following common methods.
  38. *
  39. * @abstract
  40. */
  41. var Node = function () {
  42. /**
  43. * @param {object} [defaults] - value for node properties
  44. */
  45. function Node() {
  46. var defaults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  47. _classCallCheck(this, Node);
  48. this.raws = {};
  49. if ((typeof defaults === 'undefined' ? 'undefined' : _typeof(defaults)) !== 'object' && typeof defaults !== 'undefined') {
  50. throw new Error('PostCSS nodes constructor accepts object, not ' + JSON.stringify(defaults));
  51. }
  52. for (var name in defaults) {
  53. this[name] = defaults[name];
  54. }
  55. }
  56. /**
  57. * Returns a CssSyntaxError instance containing the original position
  58. * of the node in the source, showing line and column numbers and also
  59. * a small excerpt to facilitate debugging.
  60. *
  61. * If present, an input source map will be used to get the original position
  62. * of the source, even from a previous compilation step
  63. * (e.g., from Sass compilation).
  64. *
  65. * This method produces very useful error messages.
  66. *
  67. * @param {string} message - error description
  68. * @param {object} [opts] - options
  69. * @param {string} opts.plugin - plugin name that created this error.
  70. * PostCSS will set it automatically.
  71. * @param {string} opts.word - a word inside a node’s string that should
  72. * be highlighted as the source of the error
  73. * @param {number} opts.index - an index inside a node’s string that should
  74. * be highlighted as the source of the error
  75. *
  76. * @return {CssSyntaxError} error object to throw it
  77. *
  78. * @example
  79. * if ( !variables[name] ) {
  80. * throw decl.error('Unknown variable ' + name, { word: name });
  81. * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
  82. * // color: $black
  83. * // a
  84. * // ^
  85. * // background: white
  86. * }
  87. */
  88. Node.prototype.error = function error(message) {
  89. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  90. if (this.source) {
  91. var pos = this.positionBy(opts);
  92. return this.source.input.error(message, pos.line, pos.column, opts);
  93. } else {
  94. return new _cssSyntaxError2.default(message);
  95. }
  96. };
  97. /**
  98. * This method is provided as a convenience wrapper for {@link Result#warn}.
  99. *
  100. * @param {Result} result - the {@link Result} instance
  101. * that will receive the warning
  102. * @param {string} text - warning message
  103. * @param {object} [opts] - options
  104. * @param {string} opts.plugin - plugin name that created this warning.
  105. * PostCSS will set it automatically.
  106. * @param {string} opts.word - a word inside a node’s string that should
  107. * be highlighted as the source of the warning
  108. * @param {number} opts.index - an index inside a node’s string that should
  109. * be highlighted as the source of the warning
  110. *
  111. * @return {Warning} created warning object
  112. *
  113. * @example
  114. * const plugin = postcss.plugin('postcss-deprecated', () => {
  115. * return (root, result) => {
  116. * root.walkDecls('bad', decl => {
  117. * decl.warn(result, 'Deprecated property bad');
  118. * });
  119. * };
  120. * });
  121. */
  122. Node.prototype.warn = function warn(result, text, opts) {
  123. var data = { node: this };
  124. for (var i in opts) {
  125. data[i] = opts[i];
  126. }return result.warn(text, data);
  127. };
  128. /**
  129. * Removes the node from its parent and cleans the parent properties
  130. * from the node and its children.
  131. *
  132. * @example
  133. * if ( decl.prop.match(/^-webkit-/) ) {
  134. * decl.remove();
  135. * }
  136. *
  137. * @return {Node} node to make calls chain
  138. */
  139. Node.prototype.remove = function remove() {
  140. if (this.parent) {
  141. this.parent.removeChild(this);
  142. }
  143. this.parent = undefined;
  144. return this;
  145. };
  146. /**
  147. * Returns a CSS string representing the node.
  148. *
  149. * @param {stringifier|syntax} [stringifier] - a syntax to use
  150. * in string generation
  151. *
  152. * @return {string} CSS string of this node
  153. *
  154. * @example
  155. * postcss.rule({ selector: 'a' }).toString() //=> "a {}"
  156. */
  157. Node.prototype.toString = function toString() {
  158. var stringifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _stringify2.default;
  159. if (stringifier.stringify) stringifier = stringifier.stringify;
  160. var result = '';
  161. stringifier(this, function (i) {
  162. result += i;
  163. });
  164. return result;
  165. };
  166. /**
  167. * Returns a clone of the node.
  168. *
  169. * The resulting cloned node and its (cloned) children will have
  170. * a clean parent and code style properties.
  171. *
  172. * @param {object} [overrides] - new properties to override in the clone.
  173. *
  174. * @example
  175. * const cloned = decl.clone({ prop: '-moz-' + decl.prop });
  176. * cloned.raws.before //=> undefined
  177. * cloned.parent //=> undefined
  178. * cloned.toString() //=> -moz-transform: scale(0)
  179. *
  180. * @return {Node} clone of the node
  181. */
  182. Node.prototype.clone = function clone() {
  183. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  184. var cloned = cloneNode(this);
  185. for (var name in overrides) {
  186. cloned[name] = overrides[name];
  187. }
  188. return cloned;
  189. };
  190. /**
  191. * Shortcut to clone the node and insert the resulting cloned node
  192. * before the current node.
  193. *
  194. * @param {object} [overrides] - new properties to override in the clone.
  195. *
  196. * @example
  197. * decl.cloneBefore({ prop: '-moz-' + decl.prop });
  198. *
  199. * @return {Node} - new node
  200. */
  201. Node.prototype.cloneBefore = function cloneBefore() {
  202. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  203. var cloned = this.clone(overrides);
  204. this.parent.insertBefore(this, cloned);
  205. return cloned;
  206. };
  207. /**
  208. * Shortcut to clone the node and insert the resulting cloned node
  209. * after the current node.
  210. *
  211. * @param {object} [overrides] - new properties to override in the clone.
  212. *
  213. * @return {Node} - new node
  214. */
  215. Node.prototype.cloneAfter = function cloneAfter() {
  216. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  217. var cloned = this.clone(overrides);
  218. this.parent.insertAfter(this, cloned);
  219. return cloned;
  220. };
  221. /**
  222. * Inserts node(s) before the current node and removes the current node.
  223. *
  224. * @param {...Node} nodes - node(s) to replace current one
  225. *
  226. * @example
  227. * if ( atrule.name == 'mixin' ) {
  228. * atrule.replaceWith(mixinRules[atrule.params]);
  229. * }
  230. *
  231. * @return {Node} current node to methods chain
  232. */
  233. Node.prototype.replaceWith = function replaceWith() {
  234. if (this.parent) {
  235. for (var _len = arguments.length, nodes = Array(_len), _key = 0; _key < _len; _key++) {
  236. nodes[_key] = arguments[_key];
  237. }
  238. for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  239. var _ref;
  240. if (_isArray) {
  241. if (_i >= _iterator.length) break;
  242. _ref = _iterator[_i++];
  243. } else {
  244. _i = _iterator.next();
  245. if (_i.done) break;
  246. _ref = _i.value;
  247. }
  248. var node = _ref;
  249. this.parent.insertBefore(this, node);
  250. }
  251. this.remove();
  252. }
  253. return this;
  254. };
  255. /**
  256. * Removes the node from its current parent and inserts it
  257. * at the end of `newParent`.
  258. *
  259. * This will clean the `before` and `after` code {@link Node#raws} data
  260. * from the node and replace them with the indentation style of `newParent`.
  261. * It will also clean the `between` property
  262. * if `newParent` is in another {@link Root}.
  263. *
  264. * @param {Container} newParent - container node where the current node
  265. * will be moved
  266. *
  267. * @example
  268. * atrule.moveTo(atrule.root());
  269. *
  270. * @return {Node} current node to methods chain
  271. */
  272. Node.prototype.moveTo = function moveTo(newParent) {
  273. this.cleanRaws(this.root() === newParent.root());
  274. this.remove();
  275. newParent.append(this);
  276. return this;
  277. };
  278. /**
  279. * Removes the node from its current parent and inserts it into
  280. * a new parent before `otherNode`.
  281. *
  282. * This will also clean the node’s code style properties just as it would
  283. * in {@link Node#moveTo}.
  284. *
  285. * @param {Node} otherNode - node that will be before current node
  286. *
  287. * @return {Node} current node to methods chain
  288. */
  289. Node.prototype.moveBefore = function moveBefore(otherNode) {
  290. this.cleanRaws(this.root() === otherNode.root());
  291. this.remove();
  292. otherNode.parent.insertBefore(otherNode, this);
  293. return this;
  294. };
  295. /**
  296. * Removes the node from its current parent and inserts it into
  297. * a new parent after `otherNode`.
  298. *
  299. * This will also clean the node’s code style properties just as it would
  300. * in {@link Node#moveTo}.
  301. *
  302. * @param {Node} otherNode - node that will be after current node
  303. *
  304. * @return {Node} current node to methods chain
  305. */
  306. Node.prototype.moveAfter = function moveAfter(otherNode) {
  307. this.cleanRaws(this.root() === otherNode.root());
  308. this.remove();
  309. otherNode.parent.insertAfter(otherNode, this);
  310. return this;
  311. };
  312. /**
  313. * Returns the next child of the node’s parent.
  314. * Returns `undefined` if the current node is the last child.
  315. *
  316. * @return {Node|undefined} next node
  317. *
  318. * @example
  319. * if ( comment.text === 'delete next' ) {
  320. * const next = comment.next();
  321. * if ( next ) {
  322. * next.remove();
  323. * }
  324. * }
  325. */
  326. Node.prototype.next = function next() {
  327. var index = this.parent.index(this);
  328. return this.parent.nodes[index + 1];
  329. };
  330. /**
  331. * Returns the previous child of the node’s parent.
  332. * Returns `undefined` if the current node is the first child.
  333. *
  334. * @return {Node|undefined} previous node
  335. *
  336. * @example
  337. * const annotation = decl.prev();
  338. * if ( annotation.type == 'comment' ) {
  339. * readAnnotation(annotation.text);
  340. * }
  341. */
  342. Node.prototype.prev = function prev() {
  343. var index = this.parent.index(this);
  344. return this.parent.nodes[index - 1];
  345. };
  346. Node.prototype.toJSON = function toJSON() {
  347. var fixed = {};
  348. for (var name in this) {
  349. if (!this.hasOwnProperty(name)) continue;
  350. if (name === 'parent') continue;
  351. var value = this[name];
  352. if (value instanceof Array) {
  353. fixed[name] = value.map(function (i) {
  354. if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && i.toJSON) {
  355. return i.toJSON();
  356. } else {
  357. return i;
  358. }
  359. });
  360. } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.toJSON) {
  361. fixed[name] = value.toJSON();
  362. } else {
  363. fixed[name] = value;
  364. }
  365. }
  366. return fixed;
  367. };
  368. /**
  369. * Returns a {@link Node#raws} value. If the node is missing
  370. * the code style property (because the node was manually built or cloned),
  371. * PostCSS will try to autodetect the code style property by looking
  372. * at other nodes in the tree.
  373. *
  374. * @param {string} prop - name of code style property
  375. * @param {string} [defaultType] - name of default value, it can be missed
  376. * if the value is the same as prop
  377. *
  378. * @example
  379. * const root = postcss.parse('a { background: white }');
  380. * root.nodes[0].append({ prop: 'color', value: 'black' });
  381. * root.nodes[0].nodes[1].raws.before //=> undefined
  382. * root.nodes[0].nodes[1].raw('before') //=> ' '
  383. *
  384. * @return {string} code style value
  385. */
  386. Node.prototype.raw = function raw(prop, defaultType) {
  387. var str = new _stringifier2.default();
  388. return str.raw(this, prop, defaultType);
  389. };
  390. /**
  391. * Finds the Root instance of the node’s tree.
  392. *
  393. * @example
  394. * root.nodes[0].nodes[0].root() === root
  395. *
  396. * @return {Root} root parent
  397. */
  398. Node.prototype.root = function root() {
  399. var result = this;
  400. while (result.parent) {
  401. result = result.parent;
  402. }return result;
  403. };
  404. Node.prototype.cleanRaws = function cleanRaws(keepBetween) {
  405. delete this.raws.before;
  406. delete this.raws.after;
  407. if (!keepBetween) delete this.raws.between;
  408. };
  409. Node.prototype.positionInside = function positionInside(index) {
  410. var string = this.toString();
  411. var column = this.source.start.column;
  412. var line = this.source.start.line;
  413. for (var i = 0; i < index; i++) {
  414. if (string[i] === '\n') {
  415. column = 1;
  416. line += 1;
  417. } else {
  418. column += 1;
  419. }
  420. }
  421. return { line: line, column: column };
  422. };
  423. Node.prototype.positionBy = function positionBy(opts) {
  424. var pos = this.source.start;
  425. if (opts.index) {
  426. pos = this.positionInside(opts.index);
  427. } else if (opts.word) {
  428. var index = this.toString().indexOf(opts.word);
  429. if (index !== -1) pos = this.positionInside(index);
  430. }
  431. return pos;
  432. };
  433. Node.prototype.removeSelf = function removeSelf() {
  434. (0, _warnOnce2.default)('Node#removeSelf is deprecated. Use Node#remove.');
  435. return this.remove();
  436. };
  437. Node.prototype.replace = function replace(nodes) {
  438. (0, _warnOnce2.default)('Node#replace is deprecated. Use Node#replaceWith');
  439. return this.replaceWith(nodes);
  440. };
  441. Node.prototype.style = function style(own, detect) {
  442. (0, _warnOnce2.default)('Node#style() is deprecated. Use Node#raw()');
  443. return this.raw(own, detect);
  444. };
  445. Node.prototype.cleanStyles = function cleanStyles(keepBetween) {
  446. (0, _warnOnce2.default)('Node#cleanStyles() is deprecated. Use Node#cleanRaws()');
  447. return this.cleanRaws(keepBetween);
  448. };
  449. _createClass(Node, [{
  450. key: 'before',
  451. get: function get() {
  452. (0, _warnOnce2.default)('Node#before is deprecated. Use Node#raws.before');
  453. return this.raws.before;
  454. },
  455. set: function set(val) {
  456. (0, _warnOnce2.default)('Node#before is deprecated. Use Node#raws.before');
  457. this.raws.before = val;
  458. }
  459. }, {
  460. key: 'between',
  461. get: function get() {
  462. (0, _warnOnce2.default)('Node#between is deprecated. Use Node#raws.between');
  463. return this.raws.between;
  464. },
  465. set: function set(val) {
  466. (0, _warnOnce2.default)('Node#between is deprecated. Use Node#raws.between');
  467. this.raws.between = val;
  468. }
  469. /**
  470. * @memberof Node#
  471. * @member {string} type - String representing the node’s type.
  472. * Possible values are `root`, `atrule`, `rule`,
  473. * `decl`, or `comment`.
  474. *
  475. * @example
  476. * postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
  477. */
  478. /**
  479. * @memberof Node#
  480. * @member {Container} parent - the node’s parent node.
  481. *
  482. * @example
  483. * root.nodes[0].parent == root;
  484. */
  485. /**
  486. * @memberof Node#
  487. * @member {source} source - the input source of the node
  488. *
  489. * The property is used in source map generation.
  490. *
  491. * If you create a node manually (e.g., with `postcss.decl()`),
  492. * that node will not have a `source` property and will be absent
  493. * from the source map. For this reason, the plugin developer should
  494. * consider cloning nodes to create new ones (in which case the new node’s
  495. * source will reference the original, cloned node) or setting
  496. * the `source` property manually.
  497. *
  498. * ```js
  499. * // Bad
  500. * const prefixed = postcss.decl({
  501. * prop: '-moz-' + decl.prop,
  502. * value: decl.value
  503. * });
  504. *
  505. * // Good
  506. * const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
  507. * ```
  508. *
  509. * ```js
  510. * if ( atrule.name == 'add-link' ) {
  511. * const rule = postcss.rule({ selector: 'a', source: atrule.source });
  512. * atrule.parent.insertBefore(atrule, rule);
  513. * }
  514. * ```
  515. *
  516. * @example
  517. * decl.source.input.from //=> '/home/ai/a.sass'
  518. * decl.source.start //=> { line: 10, column: 2 }
  519. * decl.source.end //=> { line: 10, column: 12 }
  520. */
  521. /**
  522. * @memberof Node#
  523. * @member {object} raws - Information to generate byte-to-byte equal
  524. * node string as it was in the origin input.
  525. *
  526. * Every parser saves its own properties,
  527. * but the default CSS parser uses:
  528. *
  529. * * `before`: the space symbols before the node. It also stores `*`
  530. * and `_` symbols before the declaration (IE hack).
  531. * * `after`: the space symbols after the last child of the node
  532. * to the end of the node.
  533. * * `between`: the symbols between the property and value
  534. * for declarations, selector and `{` for rules, or last parameter
  535. * and `{` for at-rules.
  536. * * `semicolon`: contains true if the last child has
  537. * an (optional) semicolon.
  538. * * `afterName`: the space between the at-rule name and its parameters.
  539. * * `left`: the space symbols between `/*` and the comment’s text.
  540. * * `right`: the space symbols between the comment’s text
  541. * and <code>*&#47;</code>.
  542. * * `important`: the content of the important statement,
  543. * if it is not just `!important`.
  544. *
  545. * PostCSS cleans selectors, declaration values and at-rule parameters
  546. * from comments and extra spaces, but it stores origin content in raws
  547. * properties. As such, if you don’t change a declaration’s value,
  548. * PostCSS will use the raw value with comments.
  549. *
  550. * @example
  551. * const root = postcss.parse('a {\n color:black\n}')
  552. * root.first.first.raws //=> { before: '\n ', between: ':' }
  553. */
  554. }]);
  555. return Node;
  556. }();
  557. exports.default = Node;
  558. /**
  559. * @typedef {object} position
  560. * @property {number} line - source line in file
  561. * @property {number} column - source column in file
  562. */
  563. /**
  564. * @typedef {object} source
  565. * @property {Input} input - {@link Input} with input file
  566. * @property {position} start - The starting position of the node’s source
  567. * @property {position} end - The ending position of the node’s source
  568. */
  569. module.exports = exports['default'];
  570. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGUuZXM2Il0sIm5hbWVzIjpbImNsb25lTm9kZSIsIm9iaiIsInBhcmVudCIsImNsb25lZCIsImNvbnN0cnVjdG9yIiwiaSIsImhhc093blByb3BlcnR5IiwidmFsdWUiLCJ0eXBlIiwiQXJyYXkiLCJtYXAiLCJqIiwiTm9kZSIsImRlZmF1bHRzIiwicmF3cyIsIkVycm9yIiwiSlNPTiIsInN0cmluZ2lmeSIsIm5hbWUiLCJlcnJvciIsIm1lc3NhZ2UiLCJvcHRzIiwic291cmNlIiwicG9zIiwicG9zaXRpb25CeSIsImlucHV0IiwibGluZSIsImNvbHVtbiIsIndhcm4iLCJyZXN1bHQiLCJ0ZXh0IiwiZGF0YSIsIm5vZGUiLCJyZW1vdmUiLCJyZW1vdmVDaGlsZCIsInVuZGVmaW5lZCIsInRvU3RyaW5nIiwic3RyaW5naWZpZXIiLCJjbG9uZSIsIm92ZXJyaWRlcyIsImNsb25lQmVmb3JlIiwiaW5zZXJ0QmVmb3JlIiwiY2xvbmVBZnRlciIsImluc2VydEFmdGVyIiwicmVwbGFjZVdpdGgiLCJub2RlcyIsIm1vdmVUbyIsIm5ld1BhcmVudCIsImNsZWFuUmF3cyI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gICAgICogaWYgKCAhdmFyaWFibGVzW25hbWVdICkge1xuICAgICAqICAgdGhyb3cgZGVjbC5lcnJvcignVW5rbm93biB2YXJpYWJsZSAnICsgbmFtZSwgeyB3b3JkOiBuYW1lIH0pO1xuICAgICAqICAgLy8gQ3NzU3ludGF4RXJyb3I6IHBvc3Rjc3MtdmFyczphLnNhc3M6NDozOiBVbmtub3duIHZhcmlhYmxlICRibGFja1xuICAgICAqICAgLy8gICBjb2xvcjogJGJsYWNrXG4gICAgICogICAvLyBhXG4gICAgICogICAvLyAgICAgICAgICBeXG4gICAgICogICAvLyAgIGJhY2tncm91bmQ6IHdoaXRlXG4gICAgICogfVxuICAgICAqL1xuICAgIGVycm9yKG1lc3NhZ2UsIG9wdHMgPSB7IH0pIHtcbiAgICAgICAgaWYgKCB0aGlzLnNvdXJjZSApIHtcbiAgICAgICAgICAgIGxldCBwb3MgPSB0aGlzLnBvc2l0aW9uQnkob3B0cyk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5zb3VyY2UuaW5wdXQuZXJyb3IobWVzc2FnZSwgcG9zLmxpbmUsIHBvcy5jb2x1bW4sIG9wdHMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBDc3NTeW50YXhFcnJvcihtZXNzYWdlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIGlzIHByb3ZpZGVkIGFzIGEgY29udmVuaWVuY2Ugd3JhcHBlciBmb3Ige0BsaW5rIFJlc3VsdCN3YXJufS5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7UmVzdWx0fSByZXN1bHQgICAgICAtIHRoZSB7QGxpbmsgUmVzdWx0fSBpbnN0YW5jZVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoYXQgd2lsbCByZWNlaXZlIHRoZSB3YXJuaW5nXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IHRleHQgICAgICAgIC0gd2FybmluZyBtZXNzYWdlXG4gICAgICogQHBhcmFtIHtvYmplY3R9IFtvcHRzXSAgICAgIC0gb3B0aW9uc1xuICAgICAqIEBwYXJhbSB7c3RyaW5nfSBvcHRzLnBsdWdpbiAtIHBsdWdpbiBuYW1lIHRoYXQgY3JlYXRlZCB0aGlzIHdhcm5pbmcuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUG9zdENTUyB3aWxsIHNldCBpdCBhdXRvbWF0aWNhbGx5LlxuICAgICAqIEBwYXJhbSB7c3RyaW5nfSBvcHRzLndvcmQgICAtIGEgd29yZCBpbnNpZGUgYSBub2Rl4oCZcyBzdHJpbmcgdGhhdCBzaG91bGRcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZSBoaWdobGlnaHRlZCBhcyB0aGUgc291cmNlIG9mIHRoZSB3YXJuaW5nXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IG9wdHMuaW5kZXggIC0gYW4gaW5kZXggaW5zaWRlIGEgbm9kZeKAmXMgc3RyaW5nIHRoYXQgc2hvdWxkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmUgaGlnaGxpZ2h0ZWQgYXMgdGhlIHNvdXJjZSBvZiB0aGUgd2FybmluZ1xuICAgICAqXG4gICAgICogQHJldHVybiB7V2FybmluZ30gY3JlYXRlZCB3YXJuaW5nIG9iamVjdFxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBjb25zdCBwbHVnaW4gPSBwb3N0Y3NzLnBsdWdpbigncG9zdGNzcy1kZXByZWNhdGVkJywgKCkgPT4ge1xuICAgICAqICAgcmV0dXJuIChyb290LCByZXN1bHQpID0+IHtcbiAgICAgKiAgICAgcm9vdC53YWxrRGVjbHMoJ2JhZCcsIGRlY2wgPT4ge1xuICAgICAqICAgICAgIGRlY2wud2FybihyZXN1bHQsICdEZXByZWNhdGVkIHByb3BlcnR5IGJhZCcpO1xuICAgICAqICAgICB9KTtcbiAgICAgKiAgIH07XG4gICAgICogfSk7XG4gICAgICovXG4gICAgd2FybihyZXN1bHQsIHRleHQsIG9wdHMpIHtcbiAgICAgICAgbGV0IGRhdGEgPSB7IG5vZGU6IHRoaXMgfTtcbiAgICAgICAgZm9yICggbGV0IGkgaW4gb3B0cyApIGRhdGFbaV0gPSBvcHRzW2ldO1xuICAgICAgICByZXR1cm4gcmVzdWx0Lndhcm4odGV4dCwgZGF0YSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUmVtb3ZlcyB0aGUgbm9kZSBmcm9tIGl0cyBwYXJlbnQgYW5kIGNsZWFucyB0aGUgcGFyZW50IHByb3BlcnRpZXNcbiAgICAgKiBmcm9tIHRoZSBub2RlIGFuZCBpdHMgY2hpbGRyZW4uXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGlmICggZGVjbC5wcm9wLm1hdGNoKC9eLXdlYmtpdC0vKSApIHtcbiAgICAgKiAgIGRlY2wucmVtb3ZlKCk7XG4gICAgICogfVxuICAgICAqXG4gICAgICogQHJldHVybiB7Tm9kZX0gbm9kZSB0byBtYWtlIGNhbGxzIGNoYWluXG4gICAgICovXG4gICAgcmVtb3ZlKCkge1xuICAgICAgICBpZiAoIHRoaXMucGFyZW50ICkge1xuICAgICAgICAgICAgdGhpcy5wYXJlbnQucmVtb3ZlQ2hpbGQodGhpcyk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5wYXJlbnQgPSB1bmRlZmluZWQ7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYSBDU1Mgc3RyaW5nIHJlcHJlc2VudGluZyB0aGUgbm9kZS5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7c3RyaW5naWZpZXJ8c3ludGF4fSBbc3RyaW5naWZpZXJdIC0gYSBzeW50YXggdG8gdXNlXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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GlmICggbmV4dCApIHtcbiAgICAgKiAgICAgbmV4dC5yZW1vdmUoKTtcbiAgICAgKiAgIH1cbiAgICAgKiB9XG4gICAgICovXG4gICAgbmV4dCgpIHtcbiAgICAgICAgbGV0IGluZGV4ID0gdGhpcy5wYXJlbnQuaW5kZXgodGhpcyk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcmVudC5ub2Rlc1tpbmRleCArIDFdO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgdGhlIHByZXZpb3VzIGNoaWxkIG9mIHRoZSBub2Rl4oCZcyBwYXJlbnQuXG4gICAgICogUmV0dXJucyBgdW5kZWZpbmVkYCBpZiB0aGUgY3VycmVudCBub2RlIGlzIHRoZSBmaXJzdCBjaGlsZC5cbiAgICAgKlxuICAgICAqIEByZXR1cm4ge05vZGV8dW5kZWZpbmVkfSBwcmV2aW91cyBub2RlXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGNvbnN0IGFubm90YXRpb24gPSBkZWNsLnByZXYoKTtcbiAgICAgKiBpZiAoIGFubm90YXRpb24udHlwZSA9PSAnY29tbWVudCcgKSB7XG4gICAgICogIHJlYWRBbm5vdGF0aW9uKGFubm90YXRpb24udGV4dCk7XG4gICAgICogfVxuICAgICAqL1xuICAgIHByZXYoKSB7XG4gICAgICAgIGxldCBpbmRleCA9IHRoaXMucGFyZW50LmluZGV4KHRoaXMpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJlbnQubm9kZXNbaW5kZXggLSAxXTtcbiAgICB9XG5cbiAgICB0b0pTT04oKSB7XG4gICAgICAgIGxldCBmaXhlZCA9IHsgfTtcblxuICAgICAgICBmb3IgKCBsZXQgbmFtZSBpbiB0aGlzICkge1xuICAgICAgICAgICAgaWYgKCAhdGhpcy5oYXNPd25Qcm9wZXJ0eShuYW1lKSApIGNvbnRpbnVlO1xuICAgICAgICAgICAgaWYgKCBuYW1lID09PSAncGFyZW50JyApIGNvbnRpbnVlO1xuICAgICAgICAgICAgbGV0IHZhbHVlID0gdGhpc1tuYW1lXTtcblxuICAgICAgICAgICAgaWYgKCB2YWx1ZSBpbnN0YW5jZW9mIEFycmF5ICkge1xuICAgICAgICAgICAgICAgIGZpeGVkW25hbWVdID0gdmFsdWUubWFwKCBpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCB0eXBlb2YgaSA9PT0gJ29iamVjdCcgJiYgaS50b0pTT04gKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaS50b0pTT04oKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2YgdmFsdWUgPT09ICdvYmplY3QnICYmIHZhbHVlLnRvSlNPTiApIHtcbiAgICAgICAgICAgICAgICBmaXhlZFtuYW1lXSA9IHZhbHVlLnRvSlNPTigpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBmaXhlZFtuYW1lXSA9IHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGZpeGVkO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYSB7QGxpbmsgTm9kZSNyYXdzfSB2YWx1ZS4gSWYgdGhlIG5vZGUgaXMgbWlzc2luZ1xuICAgICAqIHRoZSBjb2RlIHN0eWxlIHByb3BlcnR5IChiZWNhdXNlIHRoZSBub2RlIHdhcyBtYW51YWxseSBidWlsdCBvciBjbG9uZWQpLFxuICAgICAqIFBvc3RDU1Mgd2lsbCB0cnkgdG8gYXV0b2RldGVjdCB0aGUgY29kZSBzdHlsZSBwcm9wZXJ0eSBieSBsb29raW5nXG4gICAgICogYXQgb3RoZXIgbm9kZXMgaW4gdGhlIHRyZWUuXG4gICAgICpcb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B7Um9vdH0gcm9vdCBwYXJlbnRcbiAgICAgKi9cbiAgICByb290KCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gdGhpcztcbiAgICAgICAgd2hpbGUgKCByZXN1bHQucGFyZW50ICkgcmVzdWx0ID0gcmVzdWx0LnBhcmVudDtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjbGVhblJhd3Moa2VlcEJldHdlZW4pIHtcbiAgICAgICAgZGVsZXRlIHRoaXMucmF3cy5iZWZvcmU7XG4gICAgICAgIGRlbGV0ZSB0aGlzLnJhd3MuYWZ0ZXI7XG4gICAgICAgIGlmICggIWtlZXBCZXR3ZWVuICkgZGVsZXRlIHRoaXMucmF3cy5iZXR3ZWVuO1xuICAgIH1cblxuICAgIHBvc2l0aW9uSW5zaWRlKGluZGV4KSB7XG4gICAgICAgIGxldCBzdHJpbmcgPSB0aGlzLnRvU3RyaW5nKCk7XG4gICAgICAgIGxldCBjb2x1bW4gPSB0aGlzLnNvdXJjZS5zdGFydC5jb2x1bW47XG4gICAgICAgIGxldCBsaW5lICAgPSB0aGlzLnNvdXJjZS5zdGFydC5saW5lO1xuXG4gICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IGluZGV4OyBpKysgKSB7XG4gICAgICAgICAgICBpZiAoIHN0cmluZ1tpXSA9PT0gJ1xcbicgKSB7XG4gICAgICAgICAgICAgICAgY29sdW1uID0gMTtcbiAgICAgICAgICAgICAgICBsaW5lICArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb2x1bW4gKz0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB7IGxpbmUsIGNvbHVtbiB9O1xuICAgIH1cblxuICAgIHBvc2l0aW9uQnkob3B0cykge1xuICAgICAgICBsZXQgcG9zID0gdGhpcy5zb3VyY2Uuc3RhcnQ7XG4gICAgICAgIGlmICggb3B0cy5pbmRleCApIHtcb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