"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.styles = exports.animations = void 0;var _taggedTemplateLiteralLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _Emotion = require("../../lib/theming/Emotion");var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;


var styles = exports.styles = (0, _Emotion.memoizeStyle)({
  outer: function outer(t) {
    return (0, _Emotion.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2.default)(["\n      width: ", ";\n      height: ", ";\n      background-color: ", ";\n      position: ", ";\n      left: ", ";\n      top: ", ";\n      right: ", ";\n      bottom: ", ";\n      overflow: hidden;\n    "])),
    t.globalLoaderWidth,
    t.globalLoaderHeight,
    t.globalLoaderBackgroundColor,
    t.globalLoaderPosition,
    t.globalLoaderLeft,
    t.globalLoaderTop,
    t.globalLoaderRight,
    t.globalLoaderBottom);


  },
  inner: function inner(t) {
    return (0, _Emotion.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteralLoose2.default)(["\n      background-color: ", ";\n      width: 0;\n      height: ", ";\n      position: absolute;\n      left: 0;\n      overflow: hidden;\n    "])),
    t.globalLoaderColor,

    t.globalLoaderHeight);




  },
  standardWithoutAnimation: function standardWithoutAnimation() {
    return (0, _Emotion.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteralLoose2.default)(["\n      left: 0;\n      width: 90%;\n    "])));



  },
  successWithoutAnimation: function successWithoutAnimation() {
    return (0, _Emotion.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteralLoose2.default)(["\n      left: 0;\n      width: 100%;\n    "])));



  },
  errorWithoutAnimation: function errorWithoutAnimation() {
    return (0, _Emotion.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteralLoose2.default)(["\n      left: 40%;\n      width: 20%;\n    "])));



  }
});

var moveToRightAnimation = (0, _Emotion.keyframes)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteralLoose2.default)(["\n  0% {\n    left: 0;\n    width: 100%;\n  }\n  50% {\n    left: 50%;\n    width: 50%;\n  }\n  100% {\n    left: 99%;\n    width: 1%\n  }\n"])));













var spinnerAnimation = (0, _Emotion.keyframes)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteralLoose2.default)(["\n  0% {\n    transform: translateX(50%) scaleX(.005);\n    animation-timing-function: cubic-bezier(.895,.03,.685,.22);\n  }\n  50% {\n    transform: translateX(0) scaleX(.35);\n    animation-timing-function: cubic-bezier(.165,.84,.44,1);\n  }\n  100% {\n    transform: translateX(-50%) scaleX(.005);\n  }\n"])));












var linearProgressAnimation = (0, _Emotion.keyframes)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteralLoose2.default)(["\n  from { width: 0; }\n  to { width: 80% }\n"])));



var slowProgressAnimation = (0, _Emotion.keyframes)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteralLoose2.default)(["\n  from { width: 80%; }\n  to { width: 90% }\n"])));




var animations = exports.animations = {
  successAnimation: function successAnimation(delayBeforeHide, width, left) {
    return (0, _Emotion.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteralLoose2.default)(["\n      animation: successAnimation;\n      animation-duration: ", "ms;\n      @keyframes successAnimation {\n        0% {\n          width: ", "px;\n          left: ", "px;\n          opacity: 1;\n        }\n        20% {\n          width: 100%;\n          left: 0;\n          opacity: 1;\n        }\n        80% {\n          width: 100%;\n          left: 0;\n          opacity: 1;\n        }\n        100% {\n          width: 100%;\n          opacity: 0;\n        }\n      }\n    "])),

    delayBeforeHide,


    width,
    left);


















  },
  errorAnimation: function errorAnimation(t) {
    var transitionDuration = parseInt(t.globalLoaderTransitionToSpinnerDuration);
    var spinnerAnimationDuration = parseInt(t.globalLoaderSpinnerAnimationDuration);

    return (0, _Emotion.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteralLoose2.default)(["\n      left: 0;\n      width: 100%;\n      animation:\n        ", " ", "ms linear,\n        ", "ms ", " ", "ms infinite alternate;\n    "])),



    moveToRightAnimation, transitionDuration,
    spinnerAnimationDuration, spinnerAnimation, transitionDuration);

  },
  standardAnimation: function standardAnimation(t, expectedTime) {
    var slowProgressAnimationTime = parseInt(t.globalLoaderSlowAnimationDuration);
    return (0, _Emotion.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteralLoose2.default)(["\n      width: 90%;\n      animation:\n        ", " ", "ms cubic-bezier(0, 0.4, 0.4, 1),\n        ", "ms ", " ", "ms linear;\n    "])),


    linearProgressAnimation, expectedTime,
    slowProgressAnimationTime, slowProgressAnimation, expectedTime);

  },
  acceptAnimation: function acceptAnimation(t, startWidth, expectedTime, width, left) {
    var transitionTime = parseInt(t.globalLoaderTransitionFromSpinnerDuration);
    var slowProgressAnimationTime = parseInt(t.globalLoaderSlowAnimationDuration);
    return (0, _Emotion.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteralLoose2.default)(["\n      width: 90%;\n      animation:\n        transitionAnimation ", "ms linear,\n        ", "ms acceptAnimation ", "ms cubic-bezier(0, 0.4, 0.4, 1),\n        ", "ms ", " ", "ms linear;\n      @keyframes transitionAnimation {\n        from {\n          width: ", "px;\n          left: ", "px;\n        }\n        to {\n          width: ", "px;\n          left: 0;\n        }\n      }\n      @keyframes acceptAnimation {\n        from {\n          width: ", "px;\n        }\n        to {\n          width: 80%;\n        }\n      }\n    "])),


    transitionTime,
    expectedTime, transitionTime,
    slowProgressAnimationTime, slowProgressAnimation, expectedTime + transitionTime,


    width,
    left,


    startWidth,





    startWidth);






  },
  slowAcceptAnimation: function slowAcceptAnimation(t, startWidth, width, left) {
    var transitionTime = parseInt(t.globalLoaderTransitionFromSpinnerDuration);
    var slowProgressAnimationTime = parseInt(t.globalLoaderSlowAnimationDuration);
    return (0, _Emotion.css)(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteralLoose2.default)(["\n      width: 90%;\n      animation:\n        transitionAnimation ", "ms linear,\n        ", "ms acceptAnimation ", "ms linear;\n      @keyframes transitionAnimation {\n        from {\n          width: ", "px;\n          left: ", "px;\n        }\n        to {\n          width: ", "px;\n          left: 0;\n        }\n      }\n      @keyframes acceptAnimation {\n        from {\n          width: ", "px;\n        }\n        to {\n          width: 90%;\n        }\n      }\n    "])),


    transitionTime,
    slowProgressAnimationTime, transitionTime,


    width,
    left,


    startWidth,





    startWidth);






  },
  acceptWithoutAnimation: function acceptWithoutAnimation(startWidth) {
    return (0, _Emotion.css)(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteralLoose2.default)(["\n      width: ", "px;\n    "])),
    startWidth);

  }
};