Fonction de link de la directive, indépendant du sens du scroll
@param {type} $timeout
@param {type} $compile
@param {type} scope
@param {type} ngelt
@param {type} attrs
@param {type} ctrl
550292
function link($timeout, $compile, scope, ngelt, attrs, ctrl) {
		ctrl.reItems = new RegExp("\s?limitTo\s?\:\s?" + attrs.ngLimit + "\s?\:\s?" + attrs.ngBegin + ""); // pour déterminer quel items sont gerer
		scope.ngBegin = 0;
		scope.ngLimit = 1;
		ctrl.ngelt = ngelt; // on sauve l'element jquery
		ctrl.elt = getHtmlElement(ngelt); // on sauve l'element
		ctrl.ngsb = $compile("<span mode='hidden' class='scrollbar')></span>")(scope);
		var info = $compile("<span ng-show='ctrl.infos' class='infos-scrolling' ng-bind='ctrl.infos'></span>")(scope);
		ngelt.append(info);
		ngelt.append(ctrl.ngsb);
		ctrl.sb = getHtmlElement(ctrl.ngsb);
		var watcherClears = [];
		if (ngelt.css('display') === 'none') { // si c'est une popup, on surveille le display
			var watcherClear = scope.$watch(function (scope) {
				return scope.ctrl.ngelt.css('display');
			}, function (v1, v2, s) {
				if (v1 !== 'none') {
					if (s.max) {
						s.ngLimit = s.max;
						s.ctrl.updateTotal();
					} else {
						s.ngLimit = 1;
						s.ctrl.updateSize();
					}
					watcherClear();
				}
			});
			watcherClears.push(watcherClear);
		}
		if (ctrl.horizontal) {
			watcherClears.push(scope.$watch(function (scope) {
				return scope.ctrl.ngelt.width();
			}, function (v1, v2, s) {
				if (v1 !== v2) {
					s.ctrl.getScrollbarArea().invalid = true;
					s.ctrl.getEltArea().invalid = true;
					s.ctrl.updateSize();
				}
			}));
		} else {
			watcherClears.push(scope.$watch(function (scope) {
				return scope.ctrl.ngelt.height();
			}, function (v1, v2, s) {
				if (v1 !== v2) {
					s.ctrl.getScrollbarArea().invalid = true;
					s.ctrl.getEltArea().invalid = true;
					s.ctrl.updateSize();
				}
			}));
		}
		var totalTimer;
		watcherClears.push(scope.$watch('total', function (v1, v2, s) {
			if (v1 !== v2) {
				if(totalTimer) $timeout.cancel(totalTimer);
				totalTimer = $timeout(s.ctrl.updateTotal, s.debounce || DEBOUNCE, true);
			}
		}));
		var limitTimer;
		watcherClears.push(scope.$watch('ngLimit', function (v1, v2, s) {
			if (v1 !== v2) {
				if(limitTimer) $timeout.cancel(limitTimer);
				limitTimer = $timeout(s.ctrl.updateLimit, s.debounce || DEBOUNCE, true);
			}
		}));
		watcherClears.push(scope.$watch('ngBegin', function (v1, v2, s) {
			if (v1 >= 0 && v1 <= s.total - s.ctrl.getInnerLimit()) {
				s.ctrl.updateBegin();
			} else if (v1 < 0) {
				s.ngBegin = 0;
			} else {
				s.ngBegin = Math.max(s.total - s.ctrl.getInnerLimit(), 0);
			}
		}));
		scope.$on('$destroy', function () {
			ctrl.removeEventListeners();
			watcherClears.forEach(function (watcherClear) {
				watcherClear();
			});
		});
		ctrl.addEventListeners();
	}
1160005
function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,
                        previousCompileContext) {
      if (!($compileNodes instanceof jqLite)) {
        // jquery always rewraps, whereas we need to preserve the original selector so that we can
        // modify it.
        $compileNodes = jqLite($compileNodes);
      }

      var NOT_EMPTY = /\S+/;

      // We can not compile top level text elements since text nodes can be merged and we will
      // not be able to attach scope data to them, so we will wrap them in <span>
      for (var i = 0, len = $compileNodes.length; i < len; i++) {
        var domNode = $compileNodes[i];

        if (domNode.nodeType === NODE_TYPE_TEXT && domNode.nodeValue.match(NOT_EMPTY) /* non-empty */) {
          jqLiteWrapNode(domNode, $compileNodes[i] = document.createElement('span'));
        }
      }

      var compositeLinkFn =
              compileNodes($compileNodes, transcludeFn, $compileNodes,
                           maxPriority, ignoreDirective, previousCompileContext);
      compile.$$addScopeClass($compileNodes);
      var namespace = null;
      return function publicLinkFn(scope, cloneConnectFn, options) {
        assertArg(scope, 'scope');

        if (previousCompileContext && previousCompileContext.needsNewScope) {
          // A parent directive did a replace and a directive on this element asked
          // for transclusion, which caused us to lose a layer of element on which
          // we could hold the new transclusion scope, so we will create it manually
          // here.
          scope = scope.$parent.$new();
        }

        options = options || {};
        var parentBoundTranscludeFn = options.parentBoundTranscludeFn,
          transcludeControllers = options.transcludeControllers,
          futureParentElement = options.futureParentElement;

        // When `parentBoundTranscludeFn` is passed, it is a
        // `controllersBoundTransclude` function (it was previously passed
        // as `transclude` to directive.link) so we must unwrap it to get
        // its `boundTranscludeFn`
        if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {
          parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;
        }

        if (!namespace) {
          namespace = detectNamespaceForChildElements(futureParentElement);
        }
        var $linkNode;
        if (namespace !== 'html') {
          // When using a directive with replace:true and templateUrl the $compileNodes
          // (or a child element inside of them)
          // might change, so we need to recreate the namespace adapted compileNodes
          // for call to the link function.
          // Note: This will already clone the nodes...
          $linkNode = jqLite(
            wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html())
          );
        } else if (cloneConnectFn) {
          // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart
          // and sometimes changes the structure of the DOM.
          $linkNode = JQLitePrototype.clone.call($compileNodes);
        } else {
          $linkNode = $compileNodes;
        }

        if (transcludeControllers) {
          for (var controllerName in transcludeControllers) {
            $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);
          }
        }

        compile.$$addScopeInfo($linkNode, scope);

        if (cloneConnectFn) cloneConnectFn($linkNode, scope);
        if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);
        return $linkNode;
      };
    }
568950
function checkLater() {
        setTimeout(function () {
            ctrl.options(ctrl.searchTerms, function (options) {
                ctrl._options = options;
                if (options.length === 0) checkLater();
                $scope.$apply();
            });
        }, 1000);
    }
1053128
void read_attribute_reply(int timeout)
	{
		DevError[]			errors = null;
		DeviceAttribute[]	argout = null;
		try
		{
			if (timeout==NO_TIMEOUT)
				argout = dev.read_attribute_reply(id);
			else
				argout = dev.read_attribute_reply(id, timeout);
		}
		catch(AsynReplyNotArrived e)
		{
			errors = e.errors;
		}
		catch(DevFailed e)
		{
			errors = e.errors;
		}
		cb.attr_read(new AttrReadEvent(dev, names, argout, errors));
	}
283401
public void setTimeout(int timeout) {
        this.timeout = timeout;



        httpClient.connectTimeout(timeout, TimeUnit.MILLISECONDS);
        httpClient.readTimeout(timeout, TimeUnit.MILLISECONDS);
        httpClient.writeTimeout(timeout, TimeUnit.MILLISECONDS);

    }
1163505
function ExampleCtrl($scope, $timeout) {
    var pomo_nonsense = 'The fallacy of disciplinary boundaries thematizes the figuralization of civil society.',
      regex = /(of\s.+\sboundaries|eht)/;

    $scope.reset = function reset() {
      delete $scope.data.pomo_nonsense;
      $timeout(function () {
        $scope.data.pomo_nonsense = pomo_nonsense;
      });
    };

    $scope.reverse = function reverse() {
      var arr = Array.prototype.slice.call($scope.data.pomo_nonsense);
      arr.reverse();
      $scope.data.pomo_nonsense = arr.join('');
    };

    $scope.data = {
      regex: regex,
      pomo_nonsense: pomo_nonsense
    };
  }
149951
function compile(inFile, outFile, sourceMap, cb) {
    console.log('Compiling ' + inFile + ' to ' + outFile);
    var outStream = fs.createWriteStream(outFile, 'utf8');
    outStream.on('close', cb);
    browserify({debug: true})
      .require(inFile, { entry: true })
      .bundle()
      .pipe(exorcist(sourceMap))
      .pipe(outStream);
}
1222699
function BoxScrollCtrl($window, $document, $interval, $timeout, $scope, boxesScrollServices) {
		var ctrl = this;
		ctrl.reItems;
		ctrl.ngelt; // le composant lui meme
		ctrl.elt; // le composant lui meme
		ctrl.infos = null;

		ctrl.removeEventListeners = removeEventListeners; // gestion des events
		ctrl.addEventListeners = addEventListeners; // gestion des events
		ctrl.updateInfos = updateInfos; // met a jours les infos 
		ctrl.updateTotal = updateTotal;
		ctrl.updateLimit = updateLimit;
		ctrl.updateBegin = updateBegin;
		ctrl.updateSize = updateSize;
		ctrl.getInnerLimit = getInnerLimit;
		ctrl.getEltArea = getEltArea;
		ctrl.getScrollbarArea = getScrollbarArea;

		/**
		 * Retourne la limit pour les calcul interne, cad le nombre d'items vraiment visible
		 * @returns {Number|type.ngLimit|boxesscrollL#1.BoxScrollCtrl.$scope.ngLimit}
		 */
		function getInnerLimit() {
			var items = getItems();
			var notInDeck = 0;
			if (items.length) {
				do {
					notInDeck = notInDeck + 1;
					var cont = false;
					var item = items[items.length - notInDeck];
					if (item) {
						var area = getArea(item);
						if (ctrl.horizontal) {
							cont = area.right > getEltArea().right;
						} else {
							cont = area.bottom > getEltArea().bottom;
						}
						if (!cont) {
							notInDeck--;
						}
					}
				} while (cont);
			} else {
				notInDeck = 1;
			}
			var fix = ($scope.ngLimit - items.length) + notInDeck;
			return $scope.max ? $scope.ngLimit : $scope.ngLimit - fix;
		}
		var hasFocus = false;
		/**
		 * Ajoute et Supprime tous les handlers
		 */
		function addEventListeners() {
			ctrl.ngelt.on('wheel', wheelOnElt);
			ctrl.ngelt.on('computegrabbersizes', ctrl.updateSize);
//			ctrl.elt.addEventListener("wheel", function (event) {
//				boxesScrollServices.execAndApplyIfScrollable($scope, this, wheel, [event]);
//			}, {passive: true, capture: true});
			ctrl.ngsb.on("mouseout", mouseoutOnSb);
			ctrl.ngsb.on("mousedown", mousedownOnSb); // sur le mousedown, si dans le grabber, on init le mode drag, sinon on inc/dec les pages tant que l'on est appuyé
			ctrl.ngsb.on("mouseup", mouseup);  // on stop l'inc/dec des pages
			ctrl.ngsb.on("click", boxesScrollServices.stopEvent); // desactive la propagation entre autrepour eviter la fermeture des popup
			ctrl.ngelt.on("mousemove", mousemoveOnElt); // on définit la couleur du grabber
			if (!ctrl.ngelt.css('display') !== 'none') { // si c'est une popup, le resize de l'ecran ne joue pas
				ng.element($window).on("resize", updateSize);
			}
			$document.on("mousedown", mousedownOnDoc);
			$document.on("keydown", keydownOnOnDoc);
			$document.on("scroll", invalidSizes);
		}
		function removeEventListeners() {
			ctrl.ngelt.off('wheel', wheelOnElt);
			ctrl.ngelt.off('computegrabbersizes', ctrl.updateSize);
			ctrl.ngsb.off("mouseout", mouseoutOnSb);
			ctrl.ngsb.off("mousedown", mousedownOnSb);
			ctrl.ngsb.off("mouseup", mouseup);
			ctrl.ngsb.off("click", boxesScrollServices.stopEvent);
			ctrl.ngelt.off("mousemove", mousemoveOnElt);
			ng.element($window).off("resize", updateSize);
			$document.off("mousedown", mousedownOnDoc);
			$document.off("keydown", keydownOnOnDoc);
			$document.off("scroll", invalidSizes);
		}
		function invalidSizes(event) {
			ctrl.getScrollbarArea().invalid = true;
			ctrl.getEltArea().invalid = true;
		}
		function keydownOnOnDoc(event) {
			if (!$scope.allowKeynav || !hasFocus || event.which < 33 || event.which > 40)
				return;
			boxesScrollServices.execAndApplyIfScrollable($scope, this, keydown, [event]);
		};
		function mousedownOnDoc(event) {
			hasFocus = ctrl.elt.contains(event.target);
		}
		function mousemoveOnElt(event) {
			boxesScrollServices.execAndApplyIfScrollable($scope, this, mousemove, [event]);
		}
		function mousedownOnSb(event) {
			hasFocus = true;
			boxesScrollServices.execAndApplyIfScrollable($scope, this, mousedown, [event]);
		}
		function mouseoutOnSb(event) {
			if (!isDragMode()) {
				hideScrollbar(SHOWSB_TIMEOUT);
			}
		}
		function wheelOnElt(event) {
			boxesScrollServices.execAndApplyIfScrollable($scope, this, wheel, [event]);
		}
		/**
		 * begin, limit ou total on changés
		 */
		var infosTimer;
		function updateInfos() {
			if (infosTimer) {
				$timeout.cancel(infosTimer);
			}
			ctrl.infos = null;
			if (!isNaN($scope.ngBegin) && !isNaN($scope.ngLimit) && !isNaN($scope.total) && $scope.total > 1) {
				var from = $scope.total ? $scope.ngBegin + 1 : 0;
				var to = $scope.ngBegin + boxesScrollServices.minXmax(0, ctrl.getInnerLimit(), $scope.total);
				ctrl.infos = "[" + from + "-" + to + "]/" + $scope.total;
				infosTimer = $timeout(function (c) {
					c.infos = null;
				}, $scope.showInfoDelay || 1000, true, ctrl);
			}
		}
		/**
		 * Le nombre d'items a changé
		 * On repositionne le grabber en 0
		 * Si pas d'items, grabber = 100%
		 * Sinon on set limit a 1, ce qui va lancer le processus updateLimit->adjustLimit
		 */
		function updateTotal() {
			$scope.ngBegin = 0;
			moveGrabber(getGrabberOffsetPercentFromBegin($scope.ngBegin));
			adjustLimit();
			updateGrabberSizes();
			updateInfos();
		}
		/**
		 * La limit a ete mis a jour
		 */
		function updateLimit() {
			moveGrabber(getGrabberOffsetPercentFromBegin($scope.ngBegin));
			adjustLimit();
			updateGrabberSizes();
			updateInfos();
		}
		/**
		 * begin a ete mis a jour
		 */
		function updateBegin() {
			moveGrabber(getGrabberOffsetPercentFromBegin($scope.ngBegin));
			adjustLimit();
//			updateGrabberSizes();
			updateInfos();
		}
		/**
		 * La fenetre a ete redimentionn�
		 */
		var resizeTimer = null;
		function updateSize() {
			if (resizeTimer) {
				$timeout.cancel(resizeTimer);
			}
			if ($scope.ngLimit > 2) {
				resizeTimer = $timeout(function (s) {
					adjustLimit();
					updateGrabberSizes();
				}, 200, true, $scope);
			} else {
				adjustLimit();
				updateGrabberSizes();
			}
		}
		/**
		 * Gere les differents rendus de la scrollbar.
		 * Si on passe au dessus du trigger
		 * Mousemove(!drag) and mouseup
		 * @param {type} event
		 * @returns {undefined}
		 */
		function manageScrollbarRender(event) {
			if (modeTimer) {
				$timeout.cancel(modeTimer);
			}
			var m = boxesScrollServices.getMousePosition(event);
			if (isTriggerOver(m)) { // la souris est au dessus du declencheur
				showScrollbar();
			}
			if (isScrollbarVisible()) {
				if (isScrollbarOver(m)) { // la souris est au dessus de la scrollbar
					showScrollbar();
					if (compareGrabberAndMousePosition(m) === 0) { // la souris est au dessus du curseur
						showScrollbar('hover');
					}
				} else {
					hideScrollbar(SHOWSB_TIMEOUT);
				}
			}
		}
		/**
		 * Gere la navigation clavier
		 * @param {type} event
		 */
		function keydown(event) {
			var inc = 0;
			if (ctrl.horizontal) {
				if (event.which === 37) { // LEFT
					inc = -1;
				} else if (event.which === 39) { // RIGHT
					inc = 1;
				}
			} else {
				var innerLimit = ctrl.getInnerLimit();
				if (event.which === 38) { // UP
					inc = -1;
				} else if (event.which === 40) { // DOWN
					inc = 1;
				} else if (event.which === 33) { // PAGEUP
					inc = -innerLimit;
				} else if (event.which === 34) { // PAGEDOWN
					inc = innerLimit;
				} else if (event.which === 35) { // END
					inc = $scope.total - $scope.ngBegin - innerLimit;
				} else if (event.which === 36) { // HOME
					inc = -$scope.ngBegin;
				}
			}
			if (inc !== 0) {
				boxesScrollServices.stopEvent(event);
				$scope.ngBegin = $scope.ngBegin + inc;
			}
		}
		/**
		 * la souris bouge au dessus de la scrollbar
		 * @param {jqEvent} event
		 */
		function mousemove(event) {
			if (!isDragMode()) {
				manageScrollbarRender(event);
			}
		}
		var downData = {timer: null, scope: null, inc: 0, end: 0};
		var offsetMouse;
		function mousedown(event) {
			var m = boxesScrollServices.getMousePosition(event);
			boxesScrollServices.stopEvent(event);
			var pos = compareGrabberAndMousePosition(m);
			if (!isNaN(pos)) { // dans la scrollbar
				if (pos === 0) { // on a click sur le curseur passage en mode drag
					offsetMouse = getOffsetMouseFromGrabber(m);
					showScrollbar('drag');
					document.addEventListener('mousemove', dragHandler, false);
					document.addEventListener("mouseup", endDrag, false);
				} else {
					var innerLimit = ctrl.getInnerLimit();
					$scope.ngBegin = $scope.ngBegin + (innerLimit * pos); // next or previous page
					downData.scope = $scope;
					downData.inc = pos; // vaut 1 ou -1
					downData.end = getBeginFromPercent(getGrabberOffsetPercentFromMousePosition(m, 0));
					if (pos < 0) {
						downData.end -= innerLimit;
					}
					downData.timer = $interval(function (data) {
						var next = data.scope.ngBegin + (innerLimit * data.inc); // next or previous page;
						if (next * data.inc > data.end * data.inc) {
							$interval.cancel(data.timer);
							return;
						}
						data.scope.ngBegin = next;
					}, 300, 0, true, downData);
				}
			}
		}
		function mouseup(event) {
			if (downData.timer) {
				$interval.cancel(downData.timer);
			}
		}
		function endDrag(event) {
			offsetMouse = 0;
			document.removeEventListener('mousemove', dragHandler);
			document.removeEventListener('mouseup', endDrag);
			boxesScrollServices.execAndApplyIfScrollable($scope, this, manageScrollbarRender, [event]); // 
		}
		function dragHandler(event) {
			boxesScrollServices.stopEvent(event);
			var m = boxesScrollServices.getMousePosition(event);
			var percent = getGrabberOffsetPercentFromMousePosition(m, offsetMouse);
			var begin = getBeginFromPercent(percent);
			if (begin <= $scope.total - ctrl.getInnerLimit()) {
				$scope.ngBegin = begin;
			}
		}
		var wheelData = {timer: null, begin: null};
		function wheel(event) {
			boxesScrollServices.stopEvent(event);
			hideScrollbar();
			wheelData.begin = manageWheelHandler(event, wheelData.begin || $scope.ngBegin);
//			moveGrabber(getGrabberOffsetPercentFromBegin(wheelData.begin));
//			if (!wheelData.timer) {
//				$scope.ngBegin = wheelData.begin;
//				wheelData.timer = $timeout(function (scope, data) {
//					scope.ngBegin = data.begin;
//					data.timer = null;
//					data.begin = null;
//				}, 60, true, $scope, wheelData);
//			}
			$scope.ngBegin = wheelData.begin;
			wheelData.begin = null;
		}
		function manageWheelHandler(event, begin) {
			var evt = event.originalEvent || event;
			return boxesScrollServices.minXmax(0, begin + ((evt.deltaY < 0) ? -SCROLLBY : SCROLLBY), $scope.total - ctrl.getInnerLimit());
		}
		function getGrabberOffsetPercentFromBegin(begin) {
			return begin * 100 / $scope.total;
		}
		function getGrabberOffsetPercentFromMousePosition(m, offset) {
			var grabberOffsetPercent;
			var rect = getTriggerArea();
			var grabberOffsetPixel;
			var onePercent;
			if (ctrl.horizontal) {
				onePercent = rect.width / 100;
				grabberOffsetPixel = m.x - rect.left - offset;
			} else {
				onePercent = rect.height / 100;
				grabberOffsetPixel = m.y - rect.top - offset;
			}
			grabberOffsetPercent = grabberOffsetPixel / onePercent;
			return boxesScrollServices.minXmax(0, grabberOffsetPercent, 100 - getGrabberSizePercentFromScopeValues());
		}
		/**
		 * Est on en mode drag&drop
		 */
		function isDragMode() {
			return ctrl.ngsb.attr('mode') === 'drag';
		}
		function isScrollbarVisible() {
			return ctrl.ngsb.attr('mode') !== 'hidden';
		}
		function showScrollbar(mode) {
			ctrl.ngsb.attr('mode', mode || null);
		}
		var modeTimer;
		function hideScrollbar(defer) {
			if (isScrollbarVisible()) {
				if (modeTimer) {
					$timeout.cancel(modeTimer);
				}
				if (defer) {
					ctrl.ngsb.attr('mode', null);
					modeTimer = $timeout(function () {
						ctrl.ngsb.attr('mode', 'hidden');
					}, defer);
				} else {
					ctrl.ngsb.attr('mode', 'hidden');
				}
			}
		}
		/**
		 * La souris est elle au dessus de la scrollbar
		 * @param {MouseCoordonates} m
		 * @returns {Boolean}
		 */
		function isScrollbarOver(m) {
			return document.elementFromPoint(m.x, m.y) === ctrl.sb;
		}
		/**
		 * 
		 * @param {MouseCoordonates} m
		 * @returns {Boolean}
		 */
		function isTriggerOver(m) {
			var result = false;
			if (document.elementFromPoint(m.x, m.y) === ctrl.elt) {
				if (ctrl.horizontal) {
					result = m.y >= getTriggerArea().top; // on est au dessus de la scrollbar trigger
				} else {
					result = m.x >= getTriggerArea().left; // on est au dessus de la scrollbar trigger
				}
			}
			return result;
		}
		/**
		 * La souris est elle avant le grabber (-1), apres le grabber (1) sur le grabber (0), pas au dessus NaN
		 * @param {type} m
		 * @returns {Number}
		 */
		function compareGrabberAndMousePosition(m) {
			if (isScrollbarOver(m)) {
				if (ctrl.horizontal) {
					var start = getScrollbarArea().left + getGrabberOffsetPixelFromPercent(getGrabberOffsetPercentFromBegin($scope.ngBegin));
					if (m.x < start)
						return -1;
					var end = start + getGrabberSizePixelFromPercent(getGrabberSizePercentFromScopeValues());
					if (m.x > end)
						return 1;
					if (m.x >= start && m.x <= end)
						return 0;
				} else {
					var start = getScrollbarArea().top + getGrabberOffsetPixelFromPercent(getGrabberOffsetPercentFromBegin($scope.ngBegin));
					if (m.y < start)
						return -1;
					var end = start + getGrabberSizePixelFromPercent(getGrabberSizePercentFromScopeValues());
					if (m.y > end)
						return 1;
					if (m.y >= start && m.y <= end)
						return 0;
				}
			}
			return Number.NaN;
		}
		function getOffsetMouseFromGrabber(m) {
			var result = 0;
			if (ctrl.horizontal) {
				var start = getTriggerArea().left + getGrabberOffsetPixelFromPercent(getGrabberOffsetPercentFromBegin($scope.ngBegin));
				result = m.x - start;
			} else {
				var start = getTriggerArea().top + getGrabberOffsetPixelFromPercent(getGrabberOffsetPercentFromBegin($scope.ngBegin));
				result = m.y - start;
			}
			return result;
		}
		function adjustLimit() {
			var items = getItems(); // il y en a au moins un
			computeDirectionIfNeeded(items);
			if ($scope.max) {
				$scope.ngLimit = $scope.max;
			} else if ($scope.total) {
				var nbItems = items.length;
				if (nbItems) {
					var firstItem = items[0];
					var lastItem = items[nbItems - 1];
					var containerSize = ctrl.horizontal ?
							  getArea(lastItem).right - getArea(firstItem).left :
							  getArea(lastItem).bottom - getArea(firstItem).top;
					var offset = getOffsetPixelContainerBeforeItem(firstItem); // on ignore les éléments avant
					var empty = getHeightArea() - offset - containerSize; // zone non remplie
					var inc = 0;
					var average = containerSize / nbItems;
					if (average) { // protect div par 0
						var floatValue = empty / average;
						inc = floatValue < 0 ? Math.ceil(floatValue) : Math.ceil(floatValue); // on veut en voir une de plus
						if (inc === floatValue) { // on tombe pile poil, on rajoute un, pour tjs avoir un de plus
							inc++;
						}
					}
					var max = $scope.total - $scope.ngBegin;
					if (inc !== -1) { // si un depasse on laisse
						var newLimit = boxesScrollServices.minXmax(1, $scope.ngLimit + inc, max + 1);
						if (newLimit !== $scope.ngLimit) {
							$scope.ngLimit = newLimit;
						}
					}
				}
			}
		}
		function computeDirectionIfNeeded(items) {
			if (ctrl.ngelt.is('box-scroll') || ctrl.ngelt.attr('box-scroll') !== undefined) {
				if (!ctrl.ngelt.hasClass('vertical') && !ctrl.ngelt.hasClass('horizontal') && items.length) {
					var inlineDisplays = ['table-cell'];
					var display = ng.element(items[0]).css('display');
					ctrl.ngelt.removeClass('horizontal');
					ctrl.ngelt.removeClass('vertical');
					var inlineElt = display.indexOf('inline') !== -1;
					if (inlineElt || inlineDisplays.indexOf(display) !== -1) {
						if (inlineElt) {
							ctrl.ngelt.css('display', 'flex');
						}
						ctrl.ngelt.addClass('horizontal');
						ctrl.horizontal = true;
					} else {
						ctrl.ngelt.addClass('vertical');
						ctrl.horizontal = false;
					}
				}
			}
		}
		function getItems() {
			var items = ctrl.ngelt.find("[ng-repeat]");
			var result = [];
			items.each(function (idx, item) {
				var ngRepeat = ng.element(item).attr('ng-repeat');
				if (ngRepeat.match(ctrl.reItems)) {
					result.push(item);
				}
			});
			return result;
		}
		/**
		 * Calcul la taille des grabbers 
		 */
		function updateGrabberSizes() {
			if (ctrl.horizontal !== undefined) {
				var bgSizeElt = ctrl.ngelt.css('background-size');
				var bgSizeSb = ctrl.ngsb.css('background-size');

				var grabbersizePixel = '100%';
				if(getInnerLimit() !== $scope.total) {
					grabbersizePixel = getGrabberSizePixelFromPercent(getGrabberSizePercentFromScopeValues())+'px';
				}

				if (ctrl.horizontal) {
					bgSizeElt = bgSizeElt.replace(/.*\s+/, grabbersizePixel + ' ');
					bgSizeSb = bgSizeSb.replace(/.*\s+/, grabbersizePixel + ' ');
				} else {
					bgSizeElt = bgSizeElt.replace(/px\s+\d+(\.\d+)*.*/, 'px ' + grabbersizePixel);
					bgSizeSb = bgSizeSb.replace(/px\s+\d+(\.\d+)*.*/, 'px ' + grabbersizePixel);
				}
				ctrl.ngelt.css({'background-size': bgSizeElt});
				ctrl.ngsb.css({'background-size': bgSizeSb});
			}
		}
		/**
		 * Corrige et déplace le curseur
		 * @param {number} percent
		 */
		function moveGrabber(percent) {
			var offset = 0;
			if (percent && $scope.total) {
				var grabberSizePercent = getGrabberSizePercentFromScopeValues();
				var grabberOffsetPercent = boxesScrollServices.minXmax(0, percent, 100 - grabberSizePercent);
				offset = getGrabberOffsetPixelFromPercent(grabberOffsetPercent);
				var grabberSize = getGrabberSizePixelFromPercent(grabberSizePercent);
				if (offset >= getHeightArea() - grabberSize) {
					offset = getHeightArea() - grabberSize;
				}
			}
			if (ctrl.horizontal) {
				ctrl.ngelt.css({'background-position': offset + 'px bottom'});
				ctrl.ngsb.css({'background-position': offset + 'px bottom'});
			} else {
				ctrl.ngelt.css({'background-position': 'right ' + offset + 'px'});
				ctrl.ngsb.css({'background-position': 'right ' + offset + 'px'});
			}
		}
		/**
		 * Calcul ngBegin à partir de la position du curseur
		 * @param {number} percent : la position en % du curseur, son offset
		 */
		function getBeginFromPercent(percent) {
			return Math.round(percent * $scope.total / 100);
		}
		/**
		 * Calcul la position du curseur en px
		 * @param {type} percentOffset
		 * @returns {Number}
		 */
		function getGrabberOffsetPixelFromPercent(percentOffset) {
			var sbLenght = getHeightArea(); // Longueur de la scrollbar
			var grabberOffsetPixel = sbLenght * percentOffset / 100;
			return Math.max(grabberOffsetPixel, 0);
		}
		/**
		 * Retourne la taille en pourcent du grabber en fonction de ngLimit et total
		 * @returns {Number}
		 */
		function getGrabberSizePercentFromScopeValues() {
			if ($scope.total) {
				return Math.min((($scope.max || ctrl.getInnerLimit()) / $scope.total) * 100, 100);
			}
			return 100;
		}
		/**
		 * Calcul la hauteur du grabber
		 * @param {type} percentSize
		 * @returns {Number}
		 */
		function getGrabberSizePixelFromPercent(percentSize) {
			return Math.max(getHeightArea() * percentSize / 100, GRABBERMIN);
		}
		/**
		 * Retourne l'offset en pixel avant l'item
		 * Typiquement la taille du header dans un tableau 
		 * @param {HtmlElement} item
		 * @returns {number}
		 */
		function getOffsetPixelContainerBeforeItem(item) {
			if (ctrl.horizontal) {
				return getArea(item).left - getEltArea().left;
			} else {
				return getArea(item).top - getEltArea().top;
			}
		}
		/**
		 * Retourne la hauteur utile 
		 * @returns {number}
		 */
		function getHeightArea() {
			return ctrl.horizontal ? getEltArea().width : getEltArea().height;
		}
		/**
		 * Retourne la zone correspondante à l'indicateur de position de la scrollbar, permet aussi de faire apparaitre la scrollbar au survol
		 * @return {Rectangle}
		 */
		var triggerArea = getNullArea();
		function getTriggerArea() {
			if (triggerArea.invalid) {
				var clientRect = ctrl.elt.getClientRects();
				if (clientRect && clientRect.length) {
					var rect = clientRect[0];
					if (rect) {
						// zone de la scrollbar
						var bgSize = ctrl.ngelt.css('background-size');
						if (ctrl.horizontal) {
							var m = bgSize.match(/\D*\d+\D*(\d+)\D*/);
							var s = m.length > 0 ? parseInt(m[1]) : 4;
							triggerArea = {
								left: rect.left, right: rect.right,
								width: rect.width, height: s,
								top: rect.bottom - s, bottom: rect.bottom
							};
						} else {
							var m = bgSize.match(/\D*(\d+)\D*\d+\D*/);
							var s = m.length > 0 ? parseInt(m[1]) : 4;
							triggerArea = {
								left: rect.right - s, right: rect.right,
								width: s, height: rect.height,
								top: rect.top, bottom: rect.bottom
							};
						}
					}
				}
			}
			return triggerArea;
		}
		/**
		 * Retourne la zone correspondante à la scrollbar
		 * @return {Rectangle}
		 */
		var sbArea = getNullArea();
		function getScrollbarArea() {
			if (sbArea.invalid) {
				sbArea = getArea(ctrl.sb, true);
			}
			return sbArea;
		}
		/**
		 * Retourne la zone correspondante à la directive
		 * @return {Rectangle}
		 */
		var eltArea = getNullArea();
		function getEltArea() {
			if (eltArea.invalid) {
				eltArea = getArea(ctrl.elt, true);
			}
			return eltArea;
		}
		/**
		 * Retourne la zone correspondante à l'element html en argument
		 * @param {HTMLElement} elt
		 * @param {boolean} validation
		 * @return {Rectangle}
		 */
		function getArea(elt, validation) {
			var clientRect = elt.getClientRects();
			if (clientRect && clientRect.length) {
				var rect = clientRect[0];
				if (rect) {
					rect.invalid = validation && !isElementInViewport(rect);
					return rect;
				}
			}
			return getNullArea();
		}
		function isElementInViewport(rect) {
			if (ctrl.horizontal) {
				return rect.left >= 0 && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
			} else {
				return rect.top >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight);
			}
		}
		/**
		 * Retourne un rectangle de valeurs 0
		 * @return {Rectangle}
		 */
		function getNullArea() {
			return {left: 0, right: 0, width: 0, height: 0, top: 0, bottom: 0, invalid: true};
		}
	}
148517
function compileDirective (node, scope) {
        var ast = {
                attrs: {},
                dires: {}
            }
        var dirtDefs = _getAllDirts()
        /**
         *  attributes walk
         */
        _slice(node.attributes).forEach(function(att) {
            var aname = att.name
            var v = att.value
            // parse att
            if (~componentProps.indexOf(aname)) {
                return
            } else if (_isExpr(aname)) {
                // variable attribute name
                ast.attrs[aname] = v
            } else if (aname.indexOf(NS) === 0) {
                var def = dirtDefs[aname]
                if (def) {
                    // directive
                    ast.dires[aname] = {
                        def: def,
                        expr: v
                    }
                } else {
                    return
                }
            } else if (_isExpr(v.trim())) {
                // named attribute with expression
                ast.attrs[aname] = v
            } else {
                return
            }
            node.removeAttribute(aname)
        })

        /**
         *  Attributes binding
         */
        util.objEach(ast.attrs, function(name, value) {
            var attd = new AttributeDirective(vm, scope, node, name, value)
            _directives.push(attd)
            _setBindings2Scope(scope, attd)
        })

        /**
         *  Directives binding
         */
        util.objEach(ast.dires, function(dname, spec) {
            var def = spec.def
            var expr = spec.expr
            var sep = ';'
            var d
            // multiple defines expression parse
            if (def.multi && expr.match(sep)) {
                Expression.strip(expr)
                        .split(sep)
                        .forEach(function(item) {
                            // discard empty expression 
                            if (!item.trim()) return
                            
                            d = new Directive(vm, scope, node, def, dname, '{' + item + '}')
                            _directives.push(d)
                            _setBindings2Scope(scope, d)
                        })
            } else {
                d = new Directive(vm, scope, node, def, dname, expr)
                _directives.push(d)
                _setBindings2Scope(scope, d)
            }
        })
    }
109639
function(attrs, buffer){
    var res = compileAttrs(attrs, {
      terse: this.terse,
      format: buffer ? 'html' : 'object',
      runtime: this.runtime.bind(this)
    });
    return res;
  }
541756
function addEventListeners() {
			ctrl.ngelt.on('wheel', wheelOnElt);
			ctrl.ngelt.on('computegrabbersizes', ctrl.updateSize);
//			ctrl.elt.addEventListener("wheel", function (event) {
//				boxesScrollServices.execAndApplyIfScrollable($scope, this, wheel, [event]);
//			}, {passive: true, capture: true});
			ctrl.ngsb.on("mouseout", mouseoutOnSb);
			ctrl.ngsb.on("mousedown", mousedownOnSb); // sur le mousedown, si dans le grabber, on init le mode drag, sinon on inc/dec les pages tant que l'on est appuyé
			ctrl.ngsb.on("mouseup", mouseup);  // on stop l'inc/dec des pages
			ctrl.ngsb.on("click", boxesScrollServices.stopEvent); // desactive la propagation entre autrepour eviter la fermeture des popup
			ctrl.ngelt.on("mousemove", mousemoveOnElt); // on définit la couleur du grabber
			if (!ctrl.ngelt.css('display') !== 'none') { // si c'est une popup, le resize de l'ecran ne joue pas
				ng.element($window).on("resize", updateSize);
			}
			$document.on("mousedown", mousedownOnDoc);
			$document.on("keydown", keydownOnOnDoc);
			$document.on("scroll", invalidSizes);
		}
905894
async function compile(exitOnError = true) {
  config = config || (await asyncConfig());
  const startMessage = chalk.blue('Compiling Static Site...');
  const startTime = timer.start();
  let spinner;
  if (config.verbosity > 2) {
    console.log(startMessage);
  } else {
    spinner = ora(startMessage).start();
  }

  const pages = await getPages(config.srcDir);

  const renderPages = pages.map(async page => {
    const site = await getSiteData(pages);

    const layout = page.meta.layout ? page.meta.layout : 'default';
    const { ok, html, message } = await render(`@bolt/${layout}.twig`, {
      page,
      site,
    });

    if (!ok) {
      if (exitOnError) {
        log.errorAndExit(message);
      } else {
        log.error(message);
      }
    }

    const htmlFilePath = path.join(config.wwwDir, page.url);
    await mkdirp(path.dirname(htmlFilePath));
    await writeFile(htmlFilePath, html);
    if (config.verbosity > 3) {
      log.dim(`Wrote: ${htmlFilePath}`);
    }

    return true;
  });

  Promise.all(renderPages)
    .then(() => {
      const endMessage = chalk.green(
        `Compiled Static Site in ${timer.end(startTime)}`,
      );
      if (config.verbosity > 2) {
        console.log(endMessage);
      } else {
        spinner.succeed(endMessage);
      }
    })
    .catch(error => {
      console.log(error);
      const endMessage = chalk.red(
        `Compiling Static Site failed in ${timer.end(startTime)}`,
      );
      spinner.fail(endMessage);
    });
}
977981
public function compile($args, $compiler)
    {
        static $_is_legal_scope = array('local' => true, 'parent' => true, 'root' => true, 'global' => true);
        // check and get attributes
        $_attr = $this->getAttributes($compiler, $args);

        if ($_attr['nocache'] === true) {
            $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
        }

        // save possible attributes
        $conf_file = $_attr['file'];
        if (isset($_attr['section'])) {
            $section = $_attr['section'];
        } else {
            $section = 'null';
        }
        $scope = 'local';
        // scope setup
        if (isset($_attr['scope'])) {
            $_attr['scope'] = trim($_attr['scope'], "'\"");
            if (isset($_is_legal_scope[$_attr['scope']])) {
                $scope = $_attr['scope'];
            } else {
                $compiler->trigger_template_error('illegal value for "scope" attribute', $compiler->lex->taglineno);
            }
        }
        // create config object
        $_output = "<?php  \$_config = new Smarty_Internal_Config($conf_file, \$_smarty_tpl->smarty, \$_smarty_tpl);";
        $_output .= "\$_config->loadConfigVars($section, '$scope'); ?>";

        return $_output;
    }
284982
public function ensureIndexes($timeout = null)
    {
        foreach ($this->metadataFactory->getAllMetadata() as $class) {
            if ($class->isMappedSuperclass || $class->isEmbeddedDocument) {
                continue;
            }
            $this->ensureDocumentIndexes($class->name, $timeout);
        }
    }
478339
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
    {
        // check and get attributes
        $_attr = $this->getAttributes($compiler, $args);

        list($openTag, $nocache, $local, $sectionVar) = $this->closeTag($compiler, array('section'));
        $this->openTag($compiler, 'sectionelse', array('sectionelse', $nocache, $local, $sectionVar));

        return "<?php }} else {\n ?>";
    }
788757
function render(ctxt, directive){
    var fn = typeof directive === 'function' ? directive : plugins.compile( directive, false, this[0] );
    for(var i = 0, ii = this.length; i < ii; i++){
      this[i] = replaceWith( this[i], fn( ctxt, false ));
    }
    context = null;
    return this;
  }
634997
function postLinkFn(scope, elem, attrs) {
    // compile with `ng-model` pointing to `checked`
    $compile(elem)(scope);

    // getter / setter for original model
    var getter = $parse(attrs.checklistModel);
    var setter = getter.assign;

    // value added to list
    var value = $parse(attrs.checklistValue)(scope.$parent);

    // watch UI checked change
    scope.$watch('checked', function(newValue, oldValue) {
      if (newValue === oldValue) { 
        return;
      } 
      var current = getter(scope.$parent);
      if (newValue === true) {
        setter(scope.$parent, add(current, value));
      } else {
        setter(scope.$parent, remove(current, value));
      }
    });

    // watch original model change
    scope.$parent.$watch(attrs.checklistModel, function(newArr, oldArr) {
      scope.checked = contains(newArr, value);
    }, true);
  }