{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getMouseEventOptions = getMouseEventOptions;\nfunction isMousePressEvent(event) {\n  return event === 'mousedown' || event === 'mouseup' || event === 'click' || event === 'dblclick';\n} // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n\nconst BUTTONS_NAMES = {\n  none: 0,\n  primary: 1,\n  secondary: 2,\n  auxiliary: 4\n}; // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n\nconst BUTTON_NAMES = {\n  primary: 0,\n  auxiliary: 1,\n  secondary: 2\n};\nfunction translateButtonNumber(value, from) {\n  var _Object$entries$find;\n  const [mapIn, mapOut] = from === 'button' ? [BUTTON_NAMES, BUTTONS_NAMES] : [BUTTONS_NAMES, BUTTON_NAMES];\n  const name = (_Object$entries$find = Object.entries(mapIn).find(([, i]) => i === value)) == null ? void 0 : _Object$entries$find[0]; // istanbul ignore next\n\n  return name && Object.prototype.hasOwnProperty.call(mapOut, name) ? mapOut[name] : 0;\n}\nfunction convertMouseButtons(event, init, property) {\n  if (!isMousePressEvent(event)) {\n    return 0;\n  }\n  if (typeof init[property] === 'number') {\n    return init[property];\n  } else if (property === 'button' && typeof init.buttons === 'number') {\n    return translateButtonNumber(init.buttons, 'buttons');\n  } else if (property === 'buttons' && typeof init.button === 'number') {\n    return translateButtonNumber(init.button, 'button');\n  }\n  return property != 'button' && isMousePressEvent(event) ? 1 : 0;\n}\nfunction getMouseEventOptions(event, init, clickCount = 0) {\n  var _init;\n  init = (_init = init) != null ? _init : {};\n  return {\n    ...init,\n    // https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail\n    detail: event === 'mousedown' || event === 'mouseup' || event === 'click' ? 1 + clickCount : clickCount,\n    buttons: convertMouseButtons(event, init, 'buttons'),\n    button: convertMouseButtons(event, init, 'button')\n  };\n}","map":{"version":3,"names":["Object","defineProperty","exports","value","getMouseEventOptions","isMousePressEvent","event","BUTTONS_NAMES","none","primary","secondary","auxiliary","BUTTON_NAMES","translateButtonNumber","from","_Object$entries$find","mapIn","mapOut","name","entries","find","i","prototype","hasOwnProperty","call","convertMouseButtons","init","property","buttons","button","clickCount","_init","detail"],"sources":["C:/Users/user/Desktop/000newport/node_modules/@testing-library/user-event/dist/utils/click/getMouseEventOptions.js"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.getMouseEventOptions = getMouseEventOptions;\n\nfunction isMousePressEvent(event) {\n  return event === 'mousedown' || event === 'mouseup' || event === 'click' || event === 'dblclick';\n} // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons\n\n\nconst BUTTONS_NAMES = {\n  none: 0,\n  primary: 1,\n  secondary: 2,\n  auxiliary: 4\n}; // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n\nconst BUTTON_NAMES = {\n  primary: 0,\n  auxiliary: 1,\n  secondary: 2\n};\n\nfunction translateButtonNumber(value, from) {\n  var _Object$entries$find;\n\n  const [mapIn, mapOut] = from === 'button' ? [BUTTON_NAMES, BUTTONS_NAMES] : [BUTTONS_NAMES, BUTTON_NAMES];\n  const name = (_Object$entries$find = Object.entries(mapIn).find(([, i]) => i === value)) == null ? void 0 : _Object$entries$find[0]; // istanbul ignore next\n\n  return name && Object.prototype.hasOwnProperty.call(mapOut, name) ? mapOut[name] : 0;\n}\n\nfunction convertMouseButtons(event, init, property) {\n  if (!isMousePressEvent(event)) {\n    return 0;\n  }\n\n  if (typeof init[property] === 'number') {\n    return init[property];\n  } else if (property === 'button' && typeof init.buttons === 'number') {\n    return translateButtonNumber(init.buttons, 'buttons');\n  } else if (property === 'buttons' && typeof init.button === 'number') {\n    return translateButtonNumber(init.button, 'button');\n  }\n\n  return property != 'button' && isMousePressEvent(event) ? 1 : 0;\n}\n\nfunction getMouseEventOptions(event, init, clickCount = 0) {\n  var _init;\n\n  init = (_init = init) != null ? _init : {};\n  return { ...init,\n    // https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail\n    detail: event === 'mousedown' || event === 'mouseup' || event === 'click' ? 1 + clickCount : clickCount,\n    buttons: convertMouseButtons(event, init, 'buttons'),\n    button: convertMouseButtons(event, init, 'button')\n  };\n}"],"mappings":"AAAA,YAAY;;AAEZA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAC3CC,KAAK,EAAE;AACT,CAAC,CAAC;AACFD,OAAO,CAACE,oBAAoB,GAAGA,oBAAoB;AAEnD,SAASC,iBAAiBA,CAACC,KAAK,EAAE;EAChC,OAAOA,KAAK,KAAK,WAAW,IAAIA,KAAK,KAAK,SAAS,IAAIA,KAAK,KAAK,OAAO,IAAIA,KAAK,KAAK,UAAU;AAClG,CAAC,CAAC;;AAGF,MAAMC,aAAa,GAAG;EACpBC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,CAAC;EACVC,SAAS,EAAE,CAAC;EACZC,SAAS,EAAE;AACb,CAAC,CAAC,CAAC;;AAEH,MAAMC,YAAY,GAAG;EACnBH,OAAO,EAAE,CAAC;EACVE,SAAS,EAAE,CAAC;EACZD,SAAS,EAAE;AACb,CAAC;AAED,SAASG,qBAAqBA,CAACV,KAAK,EAAEW,IAAI,EAAE;EAC1C,IAAIC,oBAAoB;EAExB,MAAM,CAACC,KAAK,EAAEC,MAAM,CAAC,GAAGH,IAAI,KAAK,QAAQ,GAAG,CAACF,YAAY,EAAEL,aAAa,CAAC,GAAG,CAACA,aAAa,EAAEK,YAAY,CAAC;EACzG,MAAMM,IAAI,GAAG,CAACH,oBAAoB,GAAGf,MAAM,CAACmB,OAAO,CAACH,KAAK,CAAC,CAACI,IAAI,CAAC,CAAC,GAAGC,CAAC,CAAC,KAAKA,CAAC,KAAKlB,KAAK,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,GAAGY,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;;EAErI,OAAOG,IAAI,IAAIlB,MAAM,CAACsB,SAAS,CAACC,cAA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