import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import * as SkipLink from './SkipLink.stories.mdx';
import { generateChromaticStory } from '../../chromatic/utils';
import { within } from '@storybook/testing-library';

var play = /*#__PURE__*/function () {
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
    var canvasElement, canvas, link;
    return _regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            canvasElement = _ref.canvasElement;
            canvas = within(canvasElement);
            link = canvas.getByRole('link', {
              name: /skip to main content/i
            });
            link.style.animation = 'none';
            link.style.margin = '1em';
            link.focus();

          case 6:
          case "end":
            return _context.stop();
        }
      }
    }, _callee);
  }));

  return function play(_x) {
    return _ref2.apply(this, arguments);
  };
}();

export var Default = generateChromaticStory(SkipLink);
Default.play = play;

var _SkipLink$default = SkipLink.default,
    includeStories = _SkipLink$default.includeStories,
    meta = _objectWithoutProperties(_SkipLink$default, ["includeStories"]);

export default meta;