{"version":3,"file":"vts-voffice-ng-vts-core-polyfill.mjs","sources":["../../components/core/polyfill/request-animation.ts","../../components/core/polyfill/public-api.ts","../../components/core/polyfill/vts-voffice-ng-vts-core-polyfill.ts"],"sourcesContent":["/**\r\n * Use of this source code is governed by an MIT-style license that can be\r\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\r\n */\r\nimport { VtsSafeAny } from '@vts-voffice/ng-vts/core/types';\r\n\r\n// tslint:disable: typedef no-invalid-this\r\nconst availablePrefixes = ['moz', 'ms', 'webkit'];\r\n\r\nfunction requestAnimationFramePolyfill(): typeof requestAnimationFrame {\r\n  let lastTime = 0;\r\n  return function (callback: FrameRequestCallback): number {\r\n    const currTime = new Date().getTime();\r\n    const timeToCall = Math.max(0, 16 - (currTime - lastTime));\r\n    const id = setTimeout(() => {\r\n      callback(currTime + timeToCall);\r\n    }, timeToCall) as any as number;\r\n    lastTime = currTime + timeToCall;\r\n    return id;\r\n  };\r\n}\r\n\r\nfunction getRequestAnimationFrame(): typeof requestAnimationFrame {\r\n  if (typeof window === 'undefined') {\r\n    return () => 0;\r\n  }\r\n  if (window.requestAnimationFrame) {\r\n    // https://github.com/vuejs/vue/issues/4465\r\n    return window.requestAnimationFrame.bind(window);\r\n  }\r\n\r\n  const prefix = availablePrefixes.filter(key => `${key}RequestAnimationFrame` in window)[0];\r\n\r\n  return prefix\r\n    ? (window as VtsSafeAny)[`${prefix}RequestAnimationFrame`]\r\n    : requestAnimationFramePolyfill();\r\n}\r\nexport function cancelRequestAnimationFrame(id: number): VtsSafeAny {\r\n  if (typeof window === 'undefined') {\r\n    return null;\r\n  }\r\n  if (window.cancelAnimationFrame) {\r\n    return window.cancelAnimationFrame(id);\r\n  }\r\n  const prefix = availablePrefixes.filter(\r\n    key => `${key}CancelAnimationFrame` in window || `${key}CancelRequestAnimationFrame` in window\r\n  )[0];\r\n\r\n  return prefix\r\n    ? (\r\n        (window as VtsSafeAny)[`${prefix}CancelAnimationFrame`] ||\r\n        (window as VtsSafeAny)[`${prefix}CancelRequestAnimationFrame`]\r\n      )\r\n        // @ts-ignore\r\n        .call(this, id)\r\n    : clearTimeout(id);\r\n}\r\n\r\nexport const reqAnimFrame = getRequestAnimationFrame();\r\n","/**\r\n * Use of this source code is governed by an MIT-style license that can be\r\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\r\n */\r\n\r\nexport * from './request-animation';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAMA;AACA,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;AAElD,SAAS,6BAA6B,GAAA;IACpC,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,IAAA,OAAO,UAAU,QAA8B,EAAA;QAC7C,MAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AACtC,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,IAAI,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC3D,QAAA,MAAM,EAAE,GAAG,UAAU,CAAC,MAAK;AACzB,YAAA,QAAQ,CAAC,QAAQ,GAAG,UAAU,CAAC,CAAC;SACjC,EAAE,UAAU,CAAkB,CAAC;AAChC,QAAA,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AACjC,QAAA,OAAO,EAAE,CAAC;AACZ,KAAC,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,GAAA;AAC/B,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA,OAAO,MAAM,CAAC,CAAC;KAChB;AACD,IAAA,IAAI,MAAM,CAAC,qBAAqB,EAAE;;QAEhC,OAAO,MAAM,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAClD;AAED,IAAA,MAAM,MAAM,GAAG,i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