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,MAC3B,GAA0B,iBAAf4H,GAA2BlN,EAAM,EAC7B4U,EAAAA,EAAAA,YAAW5U,GACnB6U,OAAOpkB,IAAAA,cAAC0jB,GAAQ,CAACjH,WAAYA,EAAY5H,MAAOA,IACvD,IACA,C","sources":["webpack://html5-video-player-pro/webpack/bootstrap","webpack://html5-video-player-pro/webpack/runtime/compat get default export","webpack://html5-video-player-pro/webpack/runtime/define property getters","webpack://html5-video-player-pro/webpack/runtime/hasOwnProperty shorthand","webpack://html5-video-player-pro/external var [\"React\"]","webpack://html5-video-player-pro/external var [\"ReactDOM\"]","webpack://html5-video-player-pro/../wp-utils/v1/hooks/useWPAjax.js","webpack://html5-video-player-pro/../wp-utils/v1/htmlToElement.js","webpack://html5-video-player-pro/../wp-utils/v1/jsonParse.js","webpack://html5-video-player-pro/../wp-utils/v1/isYoutubeURL.js","webpack://html5-video-player-pro/../../../../../../plugin-modules/node_modules/immer/dist/immer.mjs","webpack://html5-video-player-pro/../../../../../../plugin-modules/node_modules/bp-utils/dist/index.mjs","webpack://html5-video-player-pro/./src/public/MyPlayer.js","webpack://html5-video-player-pro/./src/components/Overlay/Overlay.js","webpack://html5-video-player-pro/./src/components/PopupOpener/PopupOpener.js","webpack://html5-video-player-pro/external var [\"wp\",\"i18n\"]","webpack://html5-video-player-pro/./src/components/Video.js","webpack://html5-video-player-pro/./src/components/Youtube.js","webpack://html5-video-player-pro/./src/utils/isVimeoLink.js","webpack://html5-video-player-pro/./src/components/EndScreen/EndScreen.js","webpack://html5-video-player-pro/./src/utils/camelToKebabCase.js","webpack://html5-video-player-pro/./src/components/Style.js","webpack://html5-video-player-pro/./src/components/Vimeo.js","webpack://html5-video-player-pro/../wp-utils/v1/generateUniqueId.js","webpack://html5-video-player-pro/../wp-utils/v1/components/Loader/SimpleLoader.js","webpack://html5-video-player-pro/./src/components/PasswordForm.js","webpack://html5-video-player-pro/./src/components/VideoPlayer.js","webpack://html5-video-player-pro/./src/public/frontend.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","const __WEBPACK_NAMESPACE_OBJECT__ = React;","const __WEBPACK_NAMESPACE_OBJECT__ = ReactDOM;","import { useState, useEffect } from \"react\";\r\n\r\nconst useWPAjax = (action, params = {}, set = false) => {\r\n  const [isLoading, setIsLoading] = useState(!set);\r\n  const [isError, setIsError] = useState(false);\r\n  const [error, setError] = useState(null);\r\n  const [data, setData] = useState(null);\r\n\r\n  if (!wp.ajax) {\r\n    // eslint-disable-next-line no-console\r\n    console.error(\"Please use wp-util as a dependency\");\r\n    return;\r\n  }\r\n\r\n  const sendRequest = (payload = {}) => {\r\n    setIsLoading(true);\r\n    setIsError(false);\r\n    setError(null);\r\n    wp.ajax\r\n      .post(action, { ...params, ...payload })\r\n      .done((res) => {\r\n        setData(res);\r\n        setIsLoading(false);\r\n      })\r\n      .fail((error) => {\r\n        setIsError(true);\r\n        setError(error);\r\n        setIsLoading(false);\r\n      });\r\n  };\r\n\r\n  const request = async (payload = {}) => {\r\n    sendRequest(payload);\r\n  };\r\n\r\n  useEffect(() => {\r\n    if (!set) {\r\n      sendRequest(params);\r\n    }\r\n  }, []);\r\n\r\n  return {\r\n    data,\r\n    saveData: request,\r\n    refetch: request,\r\n    isLoading,\r\n    isError,\r\n    error,\r\n  };\r\n};\r\nexport default useWPAjax;\r\n","function htmlToElement(html) {\r\n  let temp = document.createElement(\"template\");\r\n  temp.innerHTML = html;\r\n  return temp.content.firstChild;\r\n}\r\n\r\nexport default htmlToElement;\r\n","const jsonParse = (json) => {\r\n  let parsedJson = null;\r\n  try {\r\n    parsedJson = JSON.parse(json);\r\n  } catch (error) {\r\n    console.warn(error.message);\r\n  }\r\n  return parsedJson;\r\n};\r\n\r\nexport default jsonParse;\r\n","function isYoutubeURL(input) {\r\n  // Regular expressions to check for YouTube URLs and extract the video ID\r\n  const youtubeURLRegex = /^(?:(?:https?:\\/\\/)?(?:www\\.)?(?:youtube\\.com|youtu\\.be)\\/(?:watch\\?v=)?([a-zA-Z0-9_-]+))$/;\r\n  const youtubeIDRegex = /^[a-zA-Z0-9_-]{11}$/;\r\n\r\n  if (youtubeURLRegex.test(input)) {\r\n    return input;\r\n  } else if (youtubeIDRegex.test(input)) {\r\n    return `https://www.youtube.com/watch?v=${input}`;\r\n  } else {\r\n    return false;\r\n  }\r\n}\r\n\r\nexport default isYoutubeURL;\r\n","// src/utils/env.ts\nvar NOTHING = Symbol.for(\"immer-nothing\");\nvar DRAFTABLE = Symbol.for(\"immer-draftable\");\nvar DRAFT_STATE = Symbol.for(\"immer-state\");\n\n// src/utils/errors.ts\nvar errors = process.env.NODE_ENV !== \"production\" ? [\n  // All error codes, starting by 0:\n  function(plugin) {\n    return `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`;\n  },\n  function(thing) {\n    return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`;\n  },\n  \"This object has been frozen and should not be mutated\",\n  function(data) {\n    return \"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" + data;\n  },\n  \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n  \"Immer forbids circular references\",\n  \"The first or second argument to `produce` must be a function\",\n  \"The third argument to `produce` must be a function or undefined\",\n  \"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n  \"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n  function(thing) {\n    return `'current' expects a draft, got: ${thing}`;\n  },\n  \"Object.defineProperty() cannot be used on an Immer draft\",\n  \"Object.setPrototypeOf() cannot be used on an Immer draft\",\n  \"Immer only supports deleting array indices\",\n  \"Immer only supports setting array indices and the 'length' property\",\n  function(thing) {\n    return `'original' expects a draft, got: ${thing}`;\n  }\n  // Note: if more errors are added, the errorOffset in Patches.ts should be increased\n  // See Patches.ts for additional errors\n] : [];\nfunction die(error, ...args) {\n  if (process.env.NODE_ENV !== \"production\") {\n    const e = errors[error];\n    const msg = typeof e === \"function\" ? e.apply(null, args) : e;\n    throw new Error(`[Immer] ${msg}`);\n  }\n  throw new Error(\n    `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n  );\n}\n\n// src/utils/common.ts\nvar getPrototypeOf = Object.getPrototypeOf;\nfunction isDraft(value) {\n  return !!value && !!value[DRAFT_STATE];\n}\nfunction isDraftable(value) {\n  if (!value)\n    return false;\n  return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);\n}\nvar objectCtorString = Object.prototype.constructor.toString();\nfunction isPlainObject(value) {\n  if (!value || typeof value !== \"object\")\n    return false;\n  const proto = getPrototypeOf(value);\n  if (proto === null) {\n    return true;\n  }\n  const Ctor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n  if (Ctor === Object)\n    return true;\n  return typeof Ctor == \"function\" && Function.toString.call(Ctor) === objectCtorString;\n}\nfunction original(value) {\n  if (!isDraft(value))\n    die(15, value);\n  return value[DRAFT_STATE].base_;\n}\nfunction each(obj, iter) {\n  if (getArchtype(obj) === 0 /* Object */) {\n    Object.entries(obj).forEach(([key, value]) => {\n      iter(key, value, obj);\n    });\n  } else {\n    obj.forEach((entry, index) => iter(index, entry, obj));\n  }\n}\nfunction getArchtype(thing) {\n  const state = thing[DRAFT_STATE];\n  return state ? state.type_ : Array.isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;\n}\nfunction has(thing, prop) {\n  return getArchtype(thing) === 2 /* Map */ ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);\n}\nfunction get(thing, prop) {\n  return getArchtype(thing) === 2 /* Map */ ? thing.get(prop) : thing[prop];\n}\nfunction set(thing, propOrOldValue, value) {\n  const t = getArchtype(thing);\n  if (t === 2 /* Map */)\n    thing.set(propOrOldValue, value);\n  else if (t === 3 /* Set */) {\n    thing.add(value);\n  } else\n    thing[propOrOldValue] = value;\n}\nfunction is(x, y) {\n  if (x === y) {\n    return x !== 0 || 1 / x === 1 / y;\n  } else {\n    return x !== x && y !== y;\n  }\n}\nfunction isMap(target) {\n  return target instanceof Map;\n}\nfunction isSet(target) {\n  return target instanceof Set;\n}\nfunction latest(state) {\n  return state.copy_ || state.base_;\n}\nfunction shallowCopy(base, strict) {\n  if (isMap(base)) {\n    return new Map(base);\n  }\n  if (isSet(base)) {\n    return new Set(base);\n  }\n  if (Array.isArray(base))\n    return Array.prototype.slice.call(base);\n  if (!strict && isPlainObject(base)) {\n    if (!getPrototypeOf(base)) {\n      const obj = /* @__PURE__ */ Object.create(null);\n      return Object.assign(obj, base);\n    }\n    return { ...base };\n  }\n  const descriptors = Object.getOwnPropertyDescriptors(base);\n  delete descriptors[DRAFT_STATE];\n  let keys = Reflect.ownKeys(descriptors);\n  for (let i = 0; i < keys.length; i++) {\n    const key = keys[i];\n    const desc = descriptors[key];\n    if (desc.writable === false) {\n      desc.writable = true;\n      desc.configurable = true;\n    }\n    if (desc.get || desc.set)\n      descriptors[key] = {\n        configurable: true,\n        writable: true,\n        // could live with !!desc.set as well here...\n        enumerable: desc.enumerable,\n        value: base[key]\n      };\n  }\n  return Object.create(getPrototypeOf(base), descriptors);\n}\nfunction freeze(obj, deep = false) {\n  if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))\n    return obj;\n  if (getArchtype(obj) > 1) {\n    obj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections;\n  }\n  Object.freeze(obj);\n  if (deep)\n    each(obj, (_key, value) => freeze(value, true), true);\n  return obj;\n}\nfunction dontMutateFrozenCollections() {\n  die(2);\n}\nfunction isFrozen(obj) {\n  return Object.isFrozen(obj);\n}\n\n// src/utils/plugins.ts\nvar plugins = {};\nfunction getPlugin(pluginKey) {\n  const plugin = plugins[pluginKey];\n  if (!plugin) {\n    die(0, pluginKey);\n  }\n  return plugin;\n}\nfunction loadPlugin(pluginKey, implementation) {\n  if (!plugins[pluginKey])\n    plugins[pluginKey] = implementation;\n}\n\n// src/core/scope.ts\nvar currentScope;\nfunction getCurrentScope() {\n  return currentScope;\n}\nfunction createScope(parent_, immer_) {\n  return {\n    drafts_: [],\n    parent_,\n    immer_,\n    // Whenever the modified draft contains a draft from another scope, we\n    // need to prevent auto-freezing so the unowned draft can be finalized.\n    canAutoFreeze_: true,\n    unfinalizedDrafts_: 0\n  };\n}\nfunction usePatchesInScope(scope, patchListener) {\n  if (patchListener) {\n    getPlugin(\"Patches\");\n    scope.patches_ = [];\n    scope.inversePatches_ = [];\n    scope.patchListener_ = patchListener;\n  }\n}\nfunction revokeScope(scope) {\n  leaveScope(scope);\n  scope.drafts_.forEach(revokeDraft);\n  scope.drafts_ = null;\n}\nfunction leaveScope(scope) {\n  if (scope === currentScope) {\n    currentScope = scope.parent_;\n  }\n}\nfunction enterScope(immer2) {\n  return currentScope = createScope(currentScope, immer2);\n}\nfunction revokeDraft(draft) {\n  const state = draft[DRAFT_STATE];\n  if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)\n    state.revoke_();\n  else\n    state.revoked_ = true;\n}\n\n// src/core/finalize.ts\nfunction processResult(result, scope) {\n  scope.unfinalizedDrafts_ = scope.drafts_.length;\n  const baseDraft = scope.drafts_[0];\n  const isReplaced = result !== void 0 && result !== baseDraft;\n  if (isReplaced) {\n    if (baseDraft[DRAFT_STATE].modified_) {\n      revokeScope(scope);\n      die(4);\n    }\n    if (isDraftable(result)) {\n      result = finalize(scope, result);\n      if (!scope.parent_)\n        maybeFreeze(scope, result);\n    }\n    if (scope.patches_) {\n      getPlugin(\"Patches\").generateReplacementPatches_(\n        baseDraft[DRAFT_STATE].base_,\n        result,\n        scope.patches_,\n        scope.inversePatches_\n      );\n    }\n  } else {\n    result = finalize(scope, baseDraft, []);\n  }\n  revokeScope(scope);\n  if (scope.patches_) {\n    scope.patchListener_(scope.patches_, scope.inversePatches_);\n  }\n  return result !== NOTHING ? result : void 0;\n}\nfunction finalize(rootScope, value, path) {\n  if (isFrozen(value))\n    return value;\n  const state = value[DRAFT_STATE];\n  if (!state) {\n    each(\n      value,\n      (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path),\n      true\n      // See #590, don't recurse into non-enumerable of non drafted objects\n    );\n    return value;\n  }\n  if (state.scope_ !== rootScope)\n    return value;\n  if (!state.modified_) {\n    maybeFreeze(rootScope, state.base_, true);\n    return state.base_;\n  }\n  if (!state.finalized_) {\n    state.finalized_ = true;\n    state.scope_.unfinalizedDrafts_--;\n    const result = state.copy_;\n    let resultEach = result;\n    let isSet2 = false;\n    if (state.type_ === 3 /* Set */) {\n      resultEach = new Set(result);\n      result.clear();\n      isSet2 = true;\n    }\n    each(\n      resultEach,\n      (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)\n    );\n    maybeFreeze(rootScope, result, false);\n    if (path && rootScope.patches_) {\n      getPlugin(\"Patches\").generatePatches_(\n        state,\n        path,\n        rootScope.patches_,\n        rootScope.inversePatches_\n      );\n    }\n  }\n  return state.copy_;\n}\nfunction finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {\n  if (process.env.NODE_ENV !== \"production\" && childValue === targetObject)\n    die(5);\n  if (isDraft(childValue)) {\n    const path = rootPath && parentState && parentState.type_ !== 3 /* Set */ && // Set objects are atomic since they have no keys.\n    !has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0;\n    const res = finalize(rootScope, childValue, path);\n    set(targetObject, prop, res);\n    if (isDraft(res)) {\n      rootScope.canAutoFreeze_ = false;\n    } else\n      return;\n  } else if (targetIsSet) {\n    targetObject.add(childValue);\n  }\n  if (isDraftable(childValue) && !isFrozen(childValue)) {\n    if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n      return;\n    }\n    finalize(rootScope, childValue);\n    if (!parentState || !parentState.scope_.parent_)\n      maybeFreeze(rootScope, childValue);\n  }\n}\nfunction maybeFreeze(scope, value, deep = false) {\n  if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n    freeze(value, deep);\n  }\n}\n\n// src/core/proxy.ts\nfunction createProxyProxy(base, parent) {\n  const isArray = Array.isArray(base);\n  const state = {\n    type_: isArray ? 1 /* Array */ : 0 /* Object */,\n    // Track which produce call this is associated with.\n    scope_: parent ? parent.scope_ : getCurrentScope(),\n    // True for both shallow and deep changes.\n    modified_: false,\n    // Used during finalization.\n    finalized_: false,\n    // Track which properties have been assigned (true) or deleted (false).\n    assigned_: {},\n    // The parent draft state.\n    parent_: parent,\n    // The base state.\n    base_: base,\n    // The base proxy.\n    draft_: null,\n    // set below\n    // The base copy with any updated values.\n    copy_: null,\n    // Called by the `produce` function.\n    revoke_: null,\n    isManual_: false\n  };\n  let target = state;\n  let traps = objectTraps;\n  if (isArray) {\n    target = [state];\n    traps = arrayTraps;\n  }\n  const { revoke, proxy } = Proxy.revocable(target, traps);\n  state.draft_ = proxy;\n  state.revoke_ = revoke;\n  return proxy;\n}\nvar objectTraps = {\n  get(state, prop) {\n    if (prop === DRAFT_STATE)\n      return state;\n    const source = latest(state);\n    if (!has(source, prop)) {\n      return readPropFromProto(state, source, prop);\n    }\n    const value = source[prop];\n    if (state.finalized_ || !isDraftable(value)) {\n      return value;\n    }\n    if (value === peek(state.base_, prop)) {\n      prepareCopy(state);\n      return state.copy_[prop] = createProxy(value, state);\n    }\n    return value;\n  },\n  has(state, prop) {\n    return prop in latest(state);\n  },\n  ownKeys(state) {\n    return Reflect.ownKeys(latest(state));\n  },\n  set(state, prop, value) {\n    const desc = getDescriptorFromProto(latest(state), prop);\n    if (desc?.set) {\n      desc.set.call(state.draft_, value);\n      return true;\n    }\n    if (!state.modified_) {\n      const current2 = peek(latest(state), prop);\n      const currentState = current2?.[DRAFT_STATE];\n      if (currentState && currentState.base_ === value) {\n        state.copy_[prop] = value;\n        state.assigned_[prop] = false;\n        return true;\n      }\n      if (is(value, current2) && (value !== void 0 || has(state.base_, prop)))\n        return true;\n      prepareCopy(state);\n      markChanged(state);\n    }\n    if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'\n    (value !== void 0 || prop in state.copy_) || // special case: NaN\n    Number.isNaN(value) && Number.isNaN(state.copy_[prop]))\n      return true;\n    state.copy_[prop] = value;\n    state.assigned_[prop] = true;\n    return true;\n  },\n  deleteProperty(state, prop) {\n    if (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n      state.assigned_[prop] = false;\n      prepareCopy(state);\n      markChanged(state);\n    } else {\n      delete state.assigned_[prop];\n    }\n    if (state.copy_) {\n      delete state.copy_[prop];\n    }\n    return true;\n  },\n  // Note: We never coerce `desc.value` into an Immer draft, because we can't make\n  // the same guarantee in ES5 mode.\n  getOwnPropertyDescriptor(state, prop) {\n    const owner = latest(state);\n    const desc = Reflect.getOwnPropertyDescriptor(owner, prop);\n    if (!desc)\n      return desc;\n    return {\n      writable: true,\n      configurable: state.type_ !== 1 /* Array */ || prop !== \"length\",\n      enumerable: desc.enumerable,\n      value: owner[prop]\n    };\n  },\n  defineProperty() {\n    die(11);\n  },\n  getPrototypeOf(state) {\n    return getPrototypeOf(state.base_);\n  },\n  setPrototypeOf() {\n    die(12);\n  }\n};\nvar arrayTraps = {};\neach(objectTraps, (key, fn) => {\n  arrayTraps[key] = function() {\n    arguments[0] = arguments[0][0];\n    return fn.apply(this, arguments);\n  };\n});\narrayTraps.deleteProperty = function(state, prop) {\n  if (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop)))\n    die(13);\n  return arrayTraps.set.call(this, state, prop, void 0);\n};\narrayTraps.set = function(state, prop, value) {\n  if (process.env.NODE_ENV !== \"production\" && prop !== \"length\" && isNaN(parseInt(prop)))\n    die(14);\n  return objectTraps.set.call(this, state[0], prop, value, state[0]);\n};\nfunction peek(draft, prop) {\n  const state = draft[DRAFT_STATE];\n  const source = state ? latest(state) : draft;\n  return source[prop];\n}\nfunction readPropFromProto(state, source, prop) {\n  const desc = getDescriptorFromProto(source, prop);\n  return desc ? `value` in desc ? desc.value : (\n    // This is a very special case, if the prop is a getter defined by the\n    // prototype, we should invoke it with the draft as context!\n    desc.get?.call(state.draft_)\n  ) : void 0;\n}\nfunction getDescriptorFromProto(source, prop) {\n  if (!(prop in source))\n    return void 0;\n  let proto = getPrototypeOf(source);\n  while (proto) {\n    const desc = Object.getOwnPropertyDescriptor(proto, prop);\n    if (desc)\n      return desc;\n    proto = getPrototypeOf(proto);\n  }\n  return void 0;\n}\nfunction markChanged(state) {\n  if (!state.modified_) {\n    state.modified_ = true;\n    if (state.parent_) {\n      markChanged(state.parent_);\n    }\n  }\n}\nfunction prepareCopy(state) {\n  if (!state.copy_) {\n    state.copy_ = shallowCopy(\n      state.base_,\n      state.scope_.immer_.useStrictShallowCopy_\n    );\n  }\n}\n\n// src/core/immerClass.ts\nvar Immer2 = class {\n  constructor(config) {\n    this.autoFreeze_ = true;\n    this.useStrictShallowCopy_ = false;\n    /**\n     * The `produce` function takes a value and a \"recipe function\" (whose\n     * return value often depends on the base state). The recipe function is\n     * free to mutate its first argument however it wants. All mutations are\n     * only ever applied to a __copy__ of the base state.\n     *\n     * Pass only a function to create a \"curried producer\" which relieves you\n     * from passing the recipe function every time.\n     *\n     * Only plain objects and arrays are made mutable. All other objects are\n     * considered uncopyable.\n     *\n     * Note: This function is __bound__ to its `Immer` instance.\n     *\n     * @param {any} base - the initial state\n     * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n     * @param {Function} patchListener - optional function that will be called with all the patches produced here\n     * @returns {any} a new state, or the initial state if nothing was modified\n     */\n    this.produce = (base, recipe, patchListener) => {\n      if (typeof base === \"function\" && typeof recipe !== \"function\") {\n        const defaultBase = recipe;\n        recipe = base;\n        const self = this;\n        return function curriedProduce(base2 = defaultBase, ...args) {\n          return self.produce(base2, (draft) => recipe.call(this, draft, ...args));\n        };\n      }\n      if (typeof recipe !== \"function\")\n        die(6);\n      if (patchListener !== void 0 && typeof patchListener !== \"function\")\n        die(7);\n      let result;\n      if (isDraftable(base)) {\n        const scope = enterScope(this);\n        const proxy = createProxy(base, void 0);\n        let hasError = true;\n        try {\n          result = recipe(proxy);\n          hasError = false;\n        } finally {\n          if (hasError)\n            revokeScope(scope);\n          else\n            leaveScope(scope);\n        }\n        usePatchesInScope(scope, patchListener);\n        return processResult(result, scope);\n      } else if (!base || typeof base !== \"object\") {\n        result = recipe(base);\n        if (result === void 0)\n          result = base;\n        if (result === NOTHING)\n          result = void 0;\n        if (this.autoFreeze_)\n          freeze(result, true);\n        if (patchListener) {\n          const p = [];\n          const ip = [];\n          getPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip);\n          patchListener(p, ip);\n        }\n        return result;\n      } else\n        die(1, base);\n    };\n    this.produceWithPatches = (base, recipe) => {\n      if (typeof base === \"function\") {\n        return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));\n      }\n      let patches, inversePatches;\n      const result = this.produce(base, recipe, (p, ip) => {\n        patches = p;\n        inversePatches = ip;\n      });\n      return [result, patches, inversePatches];\n    };\n    if (typeof config?.autoFreeze === \"boolean\")\n      this.setAutoFreeze(config.autoFreeze);\n    if (typeof config?.useStrictShallowCopy === \"boolean\")\n      this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n  }\n  createDraft(base) {\n    if (!isDraftable(base))\n      die(8);\n    if (isDraft(base))\n      base = current(base);\n    const scope = enterScope(this);\n    const proxy = createProxy(base, void 0);\n    proxy[DRAFT_STATE].isManual_ = true;\n    leaveScope(scope);\n    return proxy;\n  }\n  finishDraft(draft, patchListener) {\n    const state = draft && draft[DRAFT_STATE];\n    if (!state || !state.isManual_)\n      die(9);\n    const { scope_: scope } = state;\n    usePatchesInScope(scope, patchListener);\n    return processResult(void 0, scope);\n  }\n  /**\n   * Pass true to automatically freeze all copies created by Immer.\n   *\n   * By default, auto-freezing is enabled.\n   */\n  setAutoFreeze(value) {\n    this.autoFreeze_ = value;\n  }\n  /**\n   * Pass true to enable strict shallow copy.\n   *\n   * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n   */\n  setUseStrictShallowCopy(value) {\n    this.useStrictShallowCopy_ = value;\n  }\n  applyPatches(base, patches) {\n    let i;\n    for (i = patches.length - 1; i >= 0; i--) {\n      const patch = patches[i];\n      if (patch.path.length === 0 && patch.op === \"replace\") {\n        base = patch.value;\n        break;\n      }\n    }\n    if (i > -1) {\n      patches = patches.slice(i + 1);\n    }\n    const applyPatchesImpl = getPlugin(\"Patches\").applyPatches_;\n    if (isDraft(base)) {\n      return applyPatchesImpl(base, patches);\n    }\n    return this.produce(\n      base,\n      (draft) => applyPatchesImpl(draft, patches)\n    );\n  }\n};\nfunction createProxy(value, parent) {\n  const draft = isMap(value) ? getPlugin(\"MapSet\").proxyMap_(value, parent) : isSet(value) ? getPlugin(\"MapSet\").proxySet_(value, parent) : createProxyProxy(value, parent);\n  const scope = parent ? parent.scope_ : getCurrentScope();\n  scope.drafts_.push(draft);\n  return draft;\n}\n\n// src/core/current.ts\nfunction current(value) {\n  if (!isDraft(value))\n    die(10, value);\n  return currentImpl(value);\n}\nfunction currentImpl(value) {\n  if (!isDraftable(value) || isFrozen(value))\n    return value;\n  const state = value[DRAFT_STATE];\n  let copy;\n  if (state) {\n    if (!state.modified_)\n      return state.base_;\n    state.finalized_ = true;\n    copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n  } else {\n    copy = shallowCopy(value, true);\n  }\n  each(copy, (key, childValue) => {\n    set(copy, key, currentImpl(childValue));\n  });\n  if (state) {\n    state.finalized_ = false;\n  }\n  return copy;\n}\n\n// src/plugins/patches.ts\nfunction enablePatches() {\n  const errorOffset = 16;\n  if (process.env.NODE_ENV !== \"production\") {\n    errors.push(\n      'Sets cannot have \"replace\" patches.',\n      function(op) {\n        return \"Unsupported patch operation: \" + op;\n      },\n      function(path) {\n        return \"Cannot apply patch, path doesn't resolve: \" + path;\n      },\n      \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n    );\n  }\n  const REPLACE = \"replace\";\n  const ADD = \"add\";\n  const REMOVE = \"remove\";\n  function generatePatches_(state, basePath, patches, inversePatches) {\n    switch (state.type_) {\n      case 0 /* Object */:\n      case 2 /* Map */:\n        return generatePatchesFromAssigned(\n          state,\n          basePath,\n          patches,\n          inversePatches\n        );\n      case 1 /* Array */:\n        return generateArrayPatches(state, basePath, patches, inversePatches);\n      case 3 /* Set */:\n        return generateSetPatches(\n          state,\n          basePath,\n          patches,\n          inversePatches\n        );\n    }\n  }\n  function generateArrayPatches(state, basePath, patches, inversePatches) {\n    let { base_, assigned_ } = state;\n    let copy_ = state.copy_;\n    if (copy_.length < base_.length) {\n      ;\n      [base_, copy_] = [copy_, base_];\n      [patches, inversePatches] = [inversePatches, patches];\n    }\n    for (let i = 0; i < base_.length; i++) {\n      if (assigned_[i] && copy_[i] !== base_[i]) {\n        const path = basePath.concat([i]);\n        patches.push({\n          op: REPLACE,\n          path,\n          // Need to maybe clone it, as it can in fact be the original value\n          // due to the base/copy inversion at the start of this function\n          value: clonePatchValueIfNeeded(copy_[i])\n        });\n        inversePatches.push({\n          op: REPLACE,\n          path,\n          value: clonePatchValueIfNeeded(base_[i])\n        });\n      }\n    }\n    for (let i = base_.length; i < copy_.length; i++) {\n      const path = basePath.concat([i]);\n      patches.push({\n        op: ADD,\n        path,\n        // Need to maybe clone it, as it can in fact be the original value\n        // due to the base/copy inversion at the start of this function\n        value: clonePatchValueIfNeeded(copy_[i])\n      });\n    }\n    for (let i = copy_.length - 1; base_.length <= i; --i) {\n      const path = basePath.concat([i]);\n      inversePatches.push({\n        op: REMOVE,\n        path\n      });\n    }\n  }\n  function generatePatchesFromAssigned(state, basePath, patches, inversePatches) {\n    const { base_, copy_ } = state;\n    each(state.assigned_, (key, assignedValue) => {\n      const origValue = get(base_, key);\n      const value = get(copy_, key);\n      const op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD;\n      if (origValue === value && op === REPLACE)\n        return;\n      const path = basePath.concat(key);\n      patches.push(op === REMOVE ? { op, path } : { op, path, value });\n      inversePatches.push(\n        op === ADD ? { op: REMOVE, path } : op === REMOVE ? { op: ADD, path, value: clonePatchValueIfNeeded(origValue) } : { op: REPLACE, path, value: clonePatchValueIfNeeded(origValue) }\n      );\n    });\n  }\n  function generateSetPatches(state, basePath, patches, inversePatches) {\n    let { base_, copy_ } = state;\n    let i = 0;\n    base_.forEach((value) => {\n      if (!copy_.has(value)) {\n        const path = basePath.concat([i]);\n        patches.push({\n          op: REMOVE,\n          path,\n          value\n        });\n        inversePatches.unshift({\n          op: ADD,\n          path,\n          value\n        });\n      }\n      i++;\n    });\n    i = 0;\n    copy_.forEach((value) => {\n      if (!base_.has(value)) {\n        const path = basePath.concat([i]);\n        patches.push({\n          op: ADD,\n          path,\n          value\n        });\n        inversePatches.unshift({\n          op: REMOVE,\n          path,\n          value\n        });\n      }\n      i++;\n    });\n  }\n  function generateReplacementPatches_(baseValue, replacement, patches, inversePatches) {\n    patches.push({\n      op: REPLACE,\n      path: [],\n      value: replacement === NOTHING ? void 0 : replacement\n    });\n    inversePatches.push({\n      op: REPLACE,\n      path: [],\n      value: baseValue\n    });\n  }\n  function applyPatches_(draft, patches) {\n    patches.forEach((patch) => {\n      const { path, op } = patch;\n      let base = draft;\n      for (let i = 0; i < path.length - 1; i++) {\n        const parentType = getArchtype(base);\n        let p = path[i];\n        if (typeof p !== \"string\" && typeof p !== \"number\") {\n          p = \"\" + p;\n        }\n        if ((parentType === 0 /* Object */ || parentType === 1 /* Array */) && (p === \"__proto__\" || p === \"constructor\"))\n          die(errorOffset + 3);\n        if (typeof base === \"function\" && p === \"prototype\")\n          die(errorOffset + 3);\n        base = get(base, p);\n        if (typeof base !== \"object\")\n          die(errorOffset + 2, path.join(\"/\"));\n      }\n      const type = getArchtype(base);\n      const value = deepClonePatchValue(patch.value);\n      const key = path[path.length - 1];\n      switch (op) {\n        case REPLACE:\n          switch (type) {\n            case 2 /* Map */:\n              return base.set(key, value);\n            case 3 /* Set */:\n              die(errorOffset);\n            default:\n              return base[key] = value;\n          }\n        case ADD:\n          switch (type) {\n            case 1 /* Array */:\n              return key === \"-\" ? base.push(value) : base.splice(key, 0, value);\n            case 2 /* Map */:\n              return base.set(key, value);\n            case 3 /* Set */:\n              return base.add(value);\n            default:\n              return base[key] = value;\n          }\n        case REMOVE:\n          switch (type) {\n            case 1 /* Array */:\n              return base.splice(key, 1);\n            case 2 /* Map */:\n              return base.delete(key);\n            case 3 /* Set */:\n              return base.delete(patch.value);\n            default:\n              return delete base[key];\n          }\n        default:\n          die(errorOffset + 1, op);\n      }\n    });\n    return draft;\n  }\n  function deepClonePatchValue(obj) {\n    if (!isDraftable(obj))\n      return obj;\n    if (Array.isArray(obj))\n      return obj.map(deepClonePatchValue);\n    if (isMap(obj))\n      return new Map(\n        Array.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)])\n      );\n    if (isSet(obj))\n      return new Set(Array.from(obj).map(deepClonePatchValue));\n    const cloned = Object.create(getPrototypeOf(obj));\n    for (const key in obj)\n      cloned[key] = deepClonePatchValue(obj[key]);\n    if (has(obj, DRAFTABLE))\n      cloned[DRAFTABLE] = obj[DRAFTABLE];\n    return cloned;\n  }\n  function clonePatchValueIfNeeded(obj) {\n    if (isDraft(obj)) {\n      return deepClonePatchValue(obj);\n    } else\n      return obj;\n  }\n  loadPlugin(\"Patches\", {\n    applyPatches_,\n    generatePatches_,\n    generateReplacementPatches_\n  });\n}\n\n// src/plugins/mapset.ts\nfunction enableMapSet() {\n  class DraftMap extends Map {\n    constructor(target, parent) {\n      super();\n      this[DRAFT_STATE] = {\n        type_: 2 /* Map */,\n        parent_: parent,\n        scope_: parent ? parent.scope_ : getCurrentScope(),\n        modified_: false,\n        finalized_: false,\n        copy_: void 0,\n        assigned_: void 0,\n        base_: target,\n        draft_: this,\n        isManual_: false,\n        revoked_: false\n      };\n    }\n    get size() {\n      return latest(this[DRAFT_STATE]).size;\n    }\n    has(key) {\n      return latest(this[DRAFT_STATE]).has(key);\n    }\n    set(key, value) {\n      const state = this[DRAFT_STATE];\n      assertUnrevoked(state);\n      if (!latest(state).has(key) || latest(state).get(key) !== value) {\n        prepareMapCopy(state);\n        markChanged(state);\n        state.assigned_.set(key, true);\n        state.copy_.set(key, value);\n        state.assigned_.set(key, true);\n      }\n      return this;\n    }\n    delete(key) {\n      if (!this.has(key)) {\n        return false;\n      }\n      const state = this[DRAFT_STATE];\n      assertUnrevoked(state);\n      prepareMapCopy(state);\n      markChanged(state);\n      if (state.base_.has(key)) {\n        state.assigned_.set(key, false);\n      } else {\n        state.assigned_.delete(key);\n      }\n      state.copy_.delete(key);\n      return true;\n    }\n    clear() {\n      const state = this[DRAFT_STATE];\n      assertUnrevoked(state);\n      if (latest(state).size) {\n        prepareMapCopy(state);\n        markChanged(state);\n        state.assigned_ = /* @__PURE__ */ new Map();\n        each(state.base_, (key) => {\n          state.assigned_.set(key, false);\n        });\n        state.copy_.clear();\n      }\n    }\n    forEach(cb, thisArg) {\n      const state = this[DRAFT_STATE];\n      latest(state).forEach((_value, key, _map) => {\n        cb.call(thisArg, this.get(key), key, this);\n      });\n    }\n    get(key) {\n      const state = this[DRAFT_STATE];\n      assertUnrevoked(state);\n      const value = latest(state).get(key);\n      if (state.finalized_ || !isDraftable(value)) {\n        return value;\n      }\n      if (value !== state.base_.get(key)) {\n        return value;\n      }\n      const draft = createProxy(value, state);\n      prepareMapCopy(state);\n      state.copy_.set(key, draft);\n      return draft;\n    }\n    keys() {\n      return latest(this[DRAFT_STATE]).keys();\n    }\n    values() {\n      const iterator = this.keys();\n      return {\n        [Symbol.iterator]: () => this.values(),\n        next: () => {\n          const r = iterator.next();\n          if (r.done)\n            return r;\n          const value = this.get(r.value);\n          return {\n            done: false,\n            value\n          };\n        }\n      };\n    }\n    entries() {\n      const iterator = this.keys();\n      return {\n        [Symbol.iterator]: () => this.entries(),\n        next: () => {\n          const r = iterator.next();\n          if (r.done)\n            return r;\n          const value = this.get(r.value);\n          return {\n            done: false,\n            value: [r.value, value]\n          };\n        }\n      };\n    }\n    [(DRAFT_STATE, Symbol.iterator)]() {\n      return this.entries();\n    }\n  }\n  function proxyMap_(target, parent) {\n    return new DraftMap(target, parent);\n  }\n  function prepareMapCopy(state) {\n    if (!state.copy_) {\n      state.assigned_ = /* @__PURE__ */ new Map();\n      state.copy_ = new Map(state.base_);\n    }\n  }\n  class DraftSet extends Set {\n    constructor(target, parent) {\n      super();\n      this[DRAFT_STATE] = {\n        type_: 3 /* Set */,\n        parent_: parent,\n        scope_: parent ? parent.scope_ : getCurrentScope(),\n        modified_: false,\n        finalized_: false,\n        copy_: void 0,\n        base_: target,\n        draft_: this,\n        drafts_: /* @__PURE__ */ new Map(),\n        revoked_: false,\n        isManual_: false\n      };\n    }\n    get size() {\n      return latest(this[DRAFT_STATE]).size;\n    }\n    has(value) {\n      const state = this[DRAFT_STATE];\n      assertUnrevoked(state);\n      if (!state.copy_) {\n        return state.base_.has(value);\n      }\n      if (state.copy_.has(value))\n        return true;\n      if (state.drafts_.has(value) && state.copy_.has(state.drafts_.get(value)))\n        return true;\n      return false;\n    }\n    add(value) {\n      const state = this[DRAFT_STATE];\n      assertUnrevoked(state);\n      if (!this.has(value)) {\n        prepareSetCopy(state);\n        markChanged(state);\n        state.copy_.add(value);\n      }\n      return this;\n    }\n    delete(value) {\n      if (!this.has(value)) {\n        return false;\n      }\n      const state = this[DRAFT_STATE];\n      assertUnrevoked(state);\n      prepareSetCopy(state);\n      markChanged(state);\n      return state.copy_.delete(value) || (state.drafts_.has(value) ? state.copy_.delete(state.drafts_.get(value)) : (\n        /* istanbul ignore next */\n        false\n      ));\n    }\n    clear() {\n      const state = this[DRAFT_STATE];\n      assertUnrevoked(state);\n      if (latest(state).size) {\n        prepareSetCopy(state);\n        markChanged(state);\n        state.copy_.clear();\n      }\n    }\n    values() {\n      const state = this[DRAFT_STATE];\n      assertUnrevoked(state);\n      prepareSetCopy(state);\n      return state.copy_.values();\n    }\n    entries() {\n      const state = this[DRAFT_STATE];\n      assertUnrevoked(state);\n      prepareSetCopy(state);\n      return state.copy_.entries();\n    }\n    keys() {\n      return this.values();\n    }\n    [(DRAFT_STATE, Symbol.iterator)]() {\n      return this.values();\n    }\n    forEach(cb, thisArg) {\n      const iterator = this.values();\n      let result = iterator.next();\n      while (!result.done) {\n        cb.call(thisArg, result.value, result.value, this);\n        result = iterator.next();\n      }\n    }\n  }\n  function proxySet_(target, parent) {\n    return new DraftSet(target, parent);\n  }\n  function prepareSetCopy(state) {\n    if (!state.copy_) {\n      state.copy_ = /* @__PURE__ */ new Set();\n      state.base_.forEach((value) => {\n        if (isDraftable(value)) {\n          const draft = createProxy(value, state);\n          state.drafts_.set(value, draft);\n          state.copy_.add(draft);\n        } else {\n          state.copy_.add(value);\n        }\n      });\n    }\n  }\n  function assertUnrevoked(state) {\n    if (state.revoked_)\n      die(3, JSON.stringify(latest(state)));\n  }\n  loadPlugin(\"MapSet\", { proxyMap_, proxySet_ });\n}\n\n// src/immer.ts\nvar immer = new Immer2();\nvar produce = immer.produce;\nvar produceWithPatches = immer.produceWithPatches.bind(\n  immer\n);\nvar setAutoFreeze = immer.setAutoFreeze.bind(immer);\nvar setUseStrictShallowCopy = immer.setUseStrictShallowCopy.bind(immer);\nvar applyPatches = immer.applyPatches.bind(immer);\nvar createDraft = immer.createDraft.bind(immer);\nvar finishDraft = immer.finishDraft.bind(immer);\nfunction castDraft(value) {\n  return value;\n}\nfunction castImmutable(value) {\n  return value;\n}\nexport {\n  Immer2 as Immer,\n  applyPatches,\n  castDraft,\n  castImmutable,\n  createDraft,\n  current,\n  enableMapSet,\n  enablePatches,\n  finishDraft,\n  freeze,\n  DRAFTABLE as immerable,\n  isDraft,\n  isDraftable,\n  NOTHING as nothing,\n  original,\n  produce,\n  produceWithPatches,\n  setAutoFreeze,\n  setUseStrictShallowCopy\n};\n//# sourceMappingURL=immer.mjs.map","\"use client\";\nimport b from\"react\";import y from\"react\";var p=({children:r})=>y.createElement(\"div\",null,r);var w=()=>b.createElement(p,null,b.createElement(\"h2\",null,\"Nothing to hide\"));var C=r=>r.replace(/(^\\w)|(\\.\\s+\\w)/g,function(t){return t.toUpperCase()});function x(r){if(r===\"transparent\")return{r:255,g:255,b:255,a:0};if(r.includes(\"rgba\")){let e=r.match(/rgba?\\((\\d+),(\\d+),(\\d+)(?:,([\\d.]+))?\\)/);if(e){let[,n,o,a,i=1]=e.map(Number);return{r:n,g:o,b:a,a:i}}return null}var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})?$/i.exec(r.replace(\"#\",\"\"));return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16),a:parseInt(t[4],16)?parseInt(t[4],16):parseInt(t[4],16)===0?0:255}:null}function E(r){let t=document.createElement(\"template\");return t.innerHTML=r,t.content.firstChild}function U(r,t=1){if(!/^#([A-Fa-f0-9]{3}){1,2}$/.test(r))throw new Error(\"Invalid hex color format\");r.length===4&&(r=\"#\"+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]);let e=parseInt(r.slice(1,3),16),n=parseInt(r.slice(3,5),16),o=parseInt(r.slice(5,7),16),a=Math.max(0,Math.min(1,t));return`rgba(${e}, ${n}, ${o}, ${a})`}function R(r){let t=new Date(r);return!isNaN(t.getTime())}var L=R;var T=r=>{let t=null;try{t=JSON.parse(r)}catch(e){console.warn(e.message)}return t};function j(r){let t=\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",e=\"\";for(let n=0;n<r;n++){let o=Math.floor(Math.random()*t.length);e+=t.charAt(o)}return e}var A=j;var u=class{constructor(){this.callbacks={}}addEventListener(t,e){typeof e==\"function\"&&(this.callbacks[t]===void 0&&(this.callbacks[t]=[void 0]),this.callbacks[t].push(e))}dispatchEvent(t,e){if(this.callbacks[t]===void 0)return;let n=new u.Event;n.type=t,n.target=this,n.data=e,this.callbacks[t].forEach(o=>{typeof o==\"function\"&&o(n)})}},s=u;s.Event=class{constructor(){this.type=\"\";this.target={};this.data={}}};var v={time:22,height:405,width:720,quality:.7},g=class extends s{constructor(e,n=v){super();if(typeof n!=\"object\")throw new Error(\"Invalid config\");this.config={...v,...n},this.dataURL=\"\";let{width:o,height:a,time:i,quality:m}=this.config,f=document.createElement(\"canvas\"),c=document.createElement(\"video\");c.crossOrigin=\"Anonymous\";let d=f.getContext(\"2d\");c.src=e,c.currentTime=parseFloat(String(i)),c.load(),f.width=o,f.height=a;let B=0,l=null,h=setInterval(()=>{try{d==null||d.drawImage(c,0,0,o,a),l=f.toDataURL(\"image/webp\",m),(l==null?void 0:l.length)>3e3&&(this.dataURL=l,this.dispatchEvent(\"ready\",{}),clearInterval(h))}catch(I){console.log(I.message),clearInterval(h)}},100)}getBlob(){for(var e=atob(this.dataURL.split(\",\")[1]),n=this.dataURL.split(\",\")[0].split(\":\")[1].split(\";\")[0],o=new ArrayBuffer(e.length),a=new Uint8Array(o),i=0;i<e.length;i++)a[i]=e.charCodeAt(i);var m=new Blob([o],{type:n});return m}getBlobURL(){return URL.createObjectURL(this.getBlob())}};var ct=()=>{console.log(\"Hello\")},lt=()=>{console.log(\"Hello\")};export{p as Card,w as Cards,s as EventEmitter,g as GenerateThumbnailFromVideo,A as generateUniqueID,x as hexToRGB,U as hexToRgba,E as htmlToElement,E as htmlToNode,L as isValidDate,T as jsonParse,lt as sayGoodMorning,ct as sayHello,C as strToCapitalize};\n//# sourceMappingURL=index.mjs.map","// import Plyr from \"plyr\";\r\nimport { htmlToElement } from \"../../../wp-utils/v1\";\r\n\r\nimport { produce } from \"immer\";\r\nimport { EventEmitter } from \"bp-utils\";\r\n\r\nclass MyPlayer extends EventEmitter {\r\n  constructor(media, options, features = {}, isPremium = false) {\r\n    super();\r\n    this.media = media;\r\n    this.isPremium = isPremium;\r\n    this.features = features;\r\n    this.options = produce(options, (draft) => {\r\n      draft.markers.enabled = true;\r\n      draft.speed.options = options.speed.options.map((item) => parseFloat(item));\r\n      // draft.ads.enabled = true;\r\n      draft.fullscreen = {\r\n        container: \".plyr_wrapper\",\r\n        iosNative: true,\r\n      };\r\n      // draft.captions = { active: false, language: \"auto\", update: true };\r\n    });\r\n\r\n    this.local = window.h5vpBlock || {};\r\n\r\n    if (!options.urls.enabled) {\r\n      this.options = produce(this.options, (draft) => {\r\n        draft.urls.download = null;\r\n      });\r\n    }\r\n\r\n    if (this.media.closest(\".plyr_wrapper\")?.offsetWidth <= 425) {\r\n      this.options = produce(this.options, (draft) => {\r\n        draft.controls = this.options.controls.filter((control) => ![\"fast-forward\", \"restart\", \"rewind\"].includes(control));\r\n      });\r\n    }\r\n\r\n    if (this.options.muted) {\r\n      this.options = produce(this.options, (draft) => {\r\n        draft.volume = 0;\r\n        draft.storage.enabled = false;\r\n        // captions will not work properly\r\n      });\r\n    } else {\r\n      this.options = produce(this.options, (draft) => {\r\n        draft.volume = 0.5;\r\n        draft.storage.enabled = true;\r\n      });\r\n    }\r\n\r\n    // console.log(this.media, this.options);\r\n    this.player = new Plyr(this.media, { ...this.options, i18n: window.h5vpI18n || {} });\r\n    // window.options = this.options;\r\n    // window.features = this.features;\r\n    // window.player = this.player;\r\n\r\n    if (this.media.src?.split(\".\").pop() === \"m3u8\") {\r\n      this.videoHls();\r\n    }\r\n\r\n    if (this.media.src?.split(\".\").pop() === \"mpd\") {\r\n      this.videoDash();\r\n    }\r\n\r\n    if (!this.features.passwordProtected?.enabled) {\r\n      this.init();\r\n    }\r\n\r\n    this.player.on(\"pause\", () => {\r\n      if (this.features.disablePause) {\r\n        this.player.play();\r\n      }\r\n    });\r\n\r\n    // unmute event - set volume to 40% when click on mute button if volume is 0\r\n    this.player.elements?.buttons?.mute?.addEventListener(\"click\", () => {\r\n      if (this.player.volume === 0) {\r\n        this.player.volume = 0.4;\r\n      }\r\n    });\r\n\r\n    this.addEventListener(\"update-source\", ({ data }) => {\r\n      this.setSource(data.source, data.qualities, data.captions);\r\n    });\r\n  }\r\n\r\n  setIsPremium(isPremium) {\r\n    this.isPremium = isPremium;\r\n  }\r\n\r\n  setSource(source = null, qualities = null, captions = null) {\r\n    qualities = qualities || this.features.qualities;\r\n    const sources =\r\n      qualities?.map((item) => {\r\n        return {\r\n          type: `video/${item?.video_file?.split(\".\").pop()}`,\r\n          size: parseInt(item.size),\r\n          src: item.video_file,\r\n        };\r\n      }) || [];\r\n\r\n    const tracks =\r\n      this.features.captions?.map((item, index) => {\r\n        if (item.caption_file) {\r\n          const info = item.label.split(\"/\");\r\n          return {\r\n            kind: \"captions\",\r\n            size: item.size,\r\n            label: info[0],\r\n            srclang: info[1],\r\n            src: item.caption_file,\r\n            // default: index === 0,\r\n          };\r\n        }\r\n      }) || [];\r\n\r\n    this.player.download = this.player.source;\r\n\r\n    if (this.player.source || source) {\r\n      sources.push({\r\n        src: this.player.source || source,\r\n        type: \"video/mp4\",\r\n        size: 720,\r\n      });\r\n    }\r\n\r\n    this.player.source = {\r\n      type: \"video\",\r\n      title: \"\",\r\n      sources,\r\n      poster: this.player.poster && this.player.poster !== \"false\" ? this.player.poster : \"\",\r\n      // tracks,\r\n    };\r\n\r\n    tracks?.map((item) => {\r\n      if (item?.src) {\r\n        const track = document.createElement(\"track\");\r\n        Object.assign(track, item);\r\n        this.player.media.appendChild(track);\r\n      }\r\n    });\r\n  }\r\n  reInit() {\r\n    this.init();\r\n  }\r\n\r\n  init() {\r\n    if (!this.player) {\r\n      console.error(\"something went wrong!\");\r\n      return;\r\n    }\r\n\r\n    // alert(\"init\");\r\n\r\n    const sources =\r\n      this.features.qualities?.map((item) => {\r\n        return {\r\n          type: `video/${item?.video_file?.split(\".\").pop()}`,\r\n          size: parseInt(item.size),\r\n          src: item.video_file,\r\n        };\r\n      }) || [];\r\n\r\n    const tracks =\r\n      this.features.captions?.map((item, index) => {\r\n        const info = item.label.split(\"/\");\r\n        return {\r\n          kind: \"captions\",\r\n          size: item.size,\r\n          label: info[0],\r\n          srclang: info[1],\r\n          src: item.caption_file,\r\n          // default: index === 0,\r\n        };\r\n      }) || [];\r\n\r\n    this.player.download = this.player.source;\r\n\r\n    if (this.player.source) {\r\n      sources.push({\r\n        src: this.player.source,\r\n        type: \"video/mp4\",\r\n        size: 720,\r\n      });\r\n    }\r\n\r\n    this.player.source = {\r\n      type: \"video\",\r\n      sources,\r\n      poster: this.player.poster && this.player.poster !== \"false\" ? this.player.poster : \"\",\r\n      // tracks,\r\n    };\r\n\r\n    tracks?.map((item) => {\r\n      if (item?.src) {\r\n        const track = document.createElement(\"track\");\r\n        Object.assign(track, item);\r\n        this.player.media.appendChild(track);\r\n      }\r\n    });\r\n\r\n    this.player.on(\"play\", () => {\r\n      if (window.location.pathname.includes(\"/wp-admin\")) {\r\n        this.player.pause();\r\n        this.player.currentTime = 0;\r\n      }\r\n    });\r\n\r\n    if (typeof this.features === \"object\") {\r\n      this.makeElementSticky(this.features.sticky);\r\n      this.createChapter();\r\n      this.watermark(this.features.watermark);\r\n      this.thumbInPause(this.features?.thumbInPause);\r\n      this.autoplayWhenVisible();\r\n      this.pauseOther();\r\n      this.createView();\r\n    }\r\n\r\n    this.player.on(\"play\", () => {\r\n      if (this.disabled) {\r\n        this.player.currentTime = 0;\r\n        this.player.pause();\r\n      }\r\n    });\r\n\r\n    this.player.on(\"ready\", () => {\r\n      this.media.plyr = this.player;\r\n      if (this.features.startTime) {\r\n        setTimeout(() => {\r\n          this.player.currentTime = parseInt(this.features.startTime);\r\n        }, 200);\r\n      }\r\n\r\n      if (this.options.autoplay) {\r\n        this.player?.play();\r\n      }\r\n\r\n      // this.player.fullscreen.container = this.player.elements.container.parentNode;\r\n      this.controlTouchAction();\r\n    });\r\n  }\r\n\r\n  /**\r\n   *\r\n   * @param {media player} player\r\n   * @param {int} videoId\r\n   * @param {string} type\r\n   * @param {boolean} interval\r\n   */\r\n  createView(interval = false) {\r\n    this.player.on(\"pause\", () => {\r\n      if (!this.videoId || !this.isPremium) {\r\n        return;\r\n      }\r\n      let pending = false;\r\n      const currentTime = this.player?.currentTime;\r\n      let maxViewed = localStorage.getItem(`video-progress-max-${this.videoId}`);\r\n      let created_at = new Date();\r\n\r\n      if (!maxViewed) {\r\n        localStorage.setItem(`video-progress-max-${this.videoId}`, JSON.stringify({ currentTime, created_at }));\r\n      } else {\r\n        maxViewed = JSON.parse(maxViewed);\r\n      }\r\n\r\n      const viewCreated = (created_at - new Date(maxViewed?.created_at)) / (1000 * 60);\r\n      let condition = false;\r\n      if (interval) {\r\n        condition = this.player.playing && (currentTime >= maxViewed?.currentTime || viewCreated > 1440);\r\n      } else {\r\n        condition = currentTime >= maxViewed?.currentTime || viewCreated > 1440;\r\n      }\r\n\r\n      if (condition) {\r\n        if (viewCreated > 1440) {\r\n          maxViewed.created_at = created_at;\r\n        }\r\n\r\n        maxViewed.currentTime = this.player.currentTime;\r\n        localStorage.setItem(`video-progress-max-${this.videoId}`, JSON.stringify(maxViewed));\r\n\r\n        if (!pending) {\r\n          pending = true;\r\n          wp.ajax\r\n            .post(\"h5vp_ajax_handler\", {\r\n              nonce: this.nonce,\r\n              model: \"View\",\r\n              method: \"createOrUpdate\",\r\n              video_id: this.videoId,\r\n              // type: this.player.provider,\r\n              duration: parseInt(this.player.currentTime),\r\n            })\r\n            .done((res) => {\r\n              console.log(res);\r\n            })\r\n            .fail((res) => {\r\n              console.log(res);\r\n            });\r\n        }\r\n      }\r\n    });\r\n  }\r\n\r\n  autoplayWhenVisible() {\r\n    if (this.features.playWhenVisible) {\r\n      let scrollPlayed = false;\r\n      this.player.on(\"ready\", () => {\r\n        window.addEventListener(\"scroll\", () => {\r\n          if (!this.isPremium) {\r\n            return false;\r\n          }\r\n          if (this.player.elements?.container?.offsetParent?.offsetTop < window.scrollY && !scrollPlayed) {\r\n            this.player.muted = true;\r\n            this.player.play();\r\n            scrollPlayed = true;\r\n          }\r\n        });\r\n      });\r\n    }\r\n  }\r\n\r\n  /**\r\n   * handle sticky feature\r\n   * @param {Sticky {}} sticky\r\n   * @returns\r\n   */\r\n  makeElementSticky(sticky) {\r\n    if (!sticky?.enabled) {\r\n      return false;\r\n    }\r\n    const element = this.player.elements.fullscreen;\r\n    if (element && this.player) {\r\n      const originalTop = element.getBoundingClientRect().top;\r\n      const closeBtn = htmlToElement(\"<span class='close'>&times;</span>\");\r\n\r\n      window.addEventListener(\"scroll\", () => {\r\n        if (!this.isPremium) {\r\n          return;\r\n        }\r\n        const closeBtnExists = element.querySelector(\".close\");\r\n        const scrollTop = window.scrollY;\r\n        if (scrollTop >= originalTop && this.player.playing) {\r\n          element.classList.add(sticky.position);\r\n          element.classList.add(\"sticky\");\r\n          if (!closeBtnExists) {\r\n            element.appendChild(closeBtn);\r\n          }\r\n        } else if (!this.player.playing) {\r\n          element.classList.remove(\"sticky\");\r\n          element.classList.remove(sticky.position);\r\n        }\r\n        closeBtn.addEventListener(\"click\", () => {\r\n          element.classList.remove(sticky.position);\r\n          element.classList.remove(\"sticky\");\r\n          this.player.pause();\r\n        });\r\n      });\r\n    }\r\n  }\r\n\r\n  /**\r\n   * handle chapter feature\r\n   * @param {Chapters[]} chapters\r\n   * @returns\r\n   */\r\n  createChapter() {\r\n    const wrapper = this.player?.elements?.container;\r\n    const chapters = this.options.markers.points?.map((point) => ({ ...point, time: this.chapterTimeToSeconds(point.time) }));\r\n    if (!Array.isArray(chapters) || !wrapper) {\r\n      return false;\r\n    }\r\n\r\n    const exists = wrapper.querySelector(\".h5vp-chapter-wrapper\");\r\n    if (!chapters || exists || !chapters.length) {\r\n      return false;\r\n    }\r\n    const chapterWrapper = document.createElement(\"div\");\r\n    const chapterListWrapper = document.createElement(\"div\");\r\n    const markerControl = document.createElement(\"button\");\r\n    const chapterList = document.createElement(\"div\");\r\n\r\n    markerControl.classList = \"h5vp-chapter-button plyr__controls__item plyr__control\";\r\n    markerControl.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 487.3 487.3\"> <path d=\"M487.2,69.7c0,12.9-10.5,23.4-23.4,23.4h-322c-12.9,0-23.4-10.5-23.4-23.4s10.5-23.4,23.4-23.4h322.1 C476.8,46.4,487.2,56.8,487.2,69.7z M463.9,162.3H141.8c-12.9,0-23.4,10.5-23.4,23.4s10.5,23.4,23.4,23.4h322.1 c12.9,0,23.4-10.5,23.4-23.4C487.2,172.8,476.8,162.3,463.9,162.3z M463.9,278.3H141.8c-12.9,0-23.4,10.5-23.4,23.4 s10.5,23.4,23.4,23.4h322.1c12.9,0,23.4-10.5,23.4-23.4C487.2,288.8,476.8,278.3,463.9,278.3z M463.9,394.3H141.8 c-12.9,0-23.4,10.5-23.4,23.4s10.5,23.4,23.4,23.4h322.1c12.9,0,23.4-10.5,23.4-23.4C487.2,404.8,476.8,394.3,463.9,394.3z M38.9,30.8C17.4,30.8,0,48.2,0,69.7s17.4,39,38.9,39s38.9-17.5,38.9-39S60.4,30.8,38.9,30.8z M38.9,146.8 C17.4,146.8,0,164.2,0,185.7s17.4,38.9,38.9,38.9s38.9-17.4,38.9-38.9S60.4,146.8,38.9,146.8z M38.9,262.8 C17.4,262.8,0,280.2,0,301.7s17.4,38.9,38.9,38.9s38.9-17.4,38.9-38.9S60.4,262.8,38.9,262.8z M38.9,378.7 C17.4,378.7,0,396.1,0,417.6s17.4,38.9,38.9,38.9s38.9-17.4,38.9-38.9C77.8,396.2,60.4,378.7,38.9,378.7z\"/> </svg><span class=\"plyr__tooltip\">Chapter</span>`;\r\n    chapterWrapper.classList = \"h5vp-chapter-wrapper\";\r\n    chapterListWrapper.classList = \"h5vp-chapter-list-wrapper\";\r\n    chapterList.classList = \"h5vp-chapter-list\";\r\n\r\n    chapters.map((point) => {\r\n      const label = point?.label || point?.name;\r\n      if (label != \"\" && point?.time != \"\") {\r\n        const time = this.chapterTimeToSeconds(point?.time);\r\n        const chapterItem = document.createElement(\"button\");\r\n\r\n        //chapter item\r\n        chapterItem.innerHTML = `<span>${point?.label}</span>`;\r\n        chapterList.appendChild(chapterItem);\r\n\r\n        chapterItem.onclick = () => {\r\n          chapterList.classList.remove(\"showing\");\r\n          this.player.currentTime = time;\r\n          this.player.play();\r\n        };\r\n\r\n        markerControl.onclick = () => {\r\n          if (chapterList.classList.contains(\"showing\")) {\r\n            chapterList.classList.remove(\"showing\");\r\n          } else {\r\n            chapterList.classList.add(\"showing\");\r\n          }\r\n        };\r\n\r\n        wrapper.addEventListener(\"click\", function (event) {\r\n          if (!chapterList.contains(event.target) && !markerControl.contains(event.target)) {\r\n            if (chapterList.classList.contains(\"showing\")) {\r\n              chapterList.classList.remove(\"showing\");\r\n            }\r\n          }\r\n        });\r\n\r\n        this.onClick(wrapper.querySelector(\".plyr__controls__item.plyr__menu button\"), function () {\r\n          if (chapterList.classList.contains(\"showing\")) {\r\n            chapterList.classList.remove(\"showing\");\r\n          }\r\n        });\r\n      }\r\n    });\r\n\r\n    chapterListWrapper?.appendChild(chapterList);\r\n    this.player.on(\"ready\", () => {\r\n      const volumeElem = wrapper.querySelector(\".plyr__controls__item.plyr__volume\");\r\n      const menu = wrapper.querySelector(\".plyr__controls__item.plyr__menu\");\r\n      const fullscreen = wrapper.querySelector(\".plyr__controls__item[data-plyr='fullscreen']\");\r\n      const duration = wrapper.querySelector(\".plyr__controls__item.plyr__time--current.plyr__time\");\r\n      if (volumeElem) {\r\n        volumeElem.before(markerControl);\r\n      } else if (menu) {\r\n        menu.before(markerControl);\r\n      } else if (fullscreen) {\r\n        fullscreen.before(markerControl);\r\n      } else if (duration) {\r\n        duration.before(markerControl);\r\n      }\r\n      wrapper.querySelector(\".plyr__controls\")?.after(chapterListWrapper);\r\n    });\r\n  }\r\n\r\n  /**\r\n   * handle watermark feature\r\n   * @param {watermark Object} watermark\r\n   * @returns\r\n   */\r\n\r\n  watermark(watermark = {}) {\r\n    const { enabled, type, text, color } = watermark;\r\n    const plyrWrapper = this.player.elements?.container;\r\n    if (!plyrWrapper || !enabled) {\r\n      return false;\r\n    }\r\n\r\n    // I didn't find the reason to disable\r\n    let content = text;\r\n\r\n    setTimeout(async () => {\r\n      if ([\"email\", \"name\"].includes(type)) {\r\n        try {\r\n          this.disabled = true;\r\n          console.log(this.nonce);\r\n          const response = await wp.ajax.post(\"watermark_data\", { nonce: this.nonce || window.h5vpBlock?.nonce });\r\n          content = response.user[type] || window.location.origin;\r\n\r\n          this.disabled = false;\r\n        } catch (error) {\r\n          this.disabled = false;\r\n        }\r\n      }\r\n\r\n      // let content = \"\";\r\n      let tag = \"watermark\";\r\n      this.player.on(\"play\", () => {\r\n        if (!this.isPremium) {\r\n          return false;\r\n        }\r\n        const watermarkInterval = setInterval(() => {\r\n          const watermarkElement = document.querySelector(tag);\r\n          if (watermarkElement) {\r\n            plyrWrapper.removeChild(watermarkElement);\r\n          }\r\n          tag = \"watermark\" + Math.round(Math.random() * 1000);\r\n          const span = document.createElement(tag);\r\n          span.setAttribute(\"style\", \"display: block !important\");\r\n          if (type === \"email\") {\r\n            span.innerText = content;\r\n          }\r\n          plyrWrapper.appendChild(span);\r\n          span.innerText = content;\r\n          span.setAttribute(\"style\", `position:absolute; display:block !important; opacity:1 !important;top: ${Math.round(Math.random() * 90)}% !important; left: ${Math.round(Math.random() * 70)}% !important; transform: none !important`);\r\n          span.style.color = color;\r\n\r\n          plyrWrapper.appendChild(span);\r\n        }, 2000);\r\n\r\n        this.player.on(\"pause\", () => {\r\n          setTimeout(() => {\r\n            clearInterval(watermarkInterval);\r\n            const watermarkElement = document.querySelector(tag);\r\n            if (watermarkElement) {\r\n              plyrWrapper.removeChild(watermarkElement);\r\n            }\r\n          }, 0);\r\n        });\r\n      });\r\n    }, 100);\r\n  }\r\n\r\n  /**\r\n   * handle show thumbnail in video pause feature\r\n   * @param {*} wrapper\r\n   * @param {*} player\r\n   * @param {*} infos\r\n   */\r\n  thumbInPause() {\r\n    if (!this.features?.thumbInPause?.enabled) {\r\n      return;\r\n    }\r\n\r\n    if (this.features.thumbInPause?.type == \"custom\") {\r\n      const img = document.createElement(\"img\");\r\n      img.src = this.player.poster;\r\n      const overlaid = this.player?.elements?.buttons?.play?.[0];\r\n      this.player.on(\"ready\", () => {\r\n        const overlaid = this.player?.elements?.buttons?.play?.[0];\r\n        if (overlaid) {\r\n          overlaid.classList.add(\"thumbInPause\");\r\n          overlaid.appendChild(img);\r\n        }\r\n      });\r\n\r\n      this.player.on(\"play\", () => {\r\n        overlaid.classList.remove(\"thumbInPause\");\r\n      });\r\n      this.player.on(\"pause\", () => {\r\n        overlaid.classList.add(\"thumbInPause\");\r\n      });\r\n    } else {\r\n      this.player.on(\"pause\", () => {\r\n        if (this.player?.elements?.container) {\r\n          this.player?.elements?.container.classList.add(\"plyr--stopped\");\r\n        }\r\n      });\r\n    }\r\n  }\r\n\r\n  /**\r\n   * destroy player\r\n   */\r\n  destroy() {\r\n    this.player?.destroy();\r\n  }\r\n\r\n  /**\r\n   *\r\n   * @param {String} value\r\n   * @returns {Int}\r\n   */\r\n  chapterTimeToSeconds(value = \"\") {\r\n    const time = value.toString().match(/(\\d+):(\\d+)/);\r\n    if (time == null) {\r\n      return parseInt(value);\r\n    }\r\n    return parseInt(time[1]) * 60 + parseInt(time[2]);\r\n  }\r\n\r\n  getTTT(f = 10, s = 10) {\r\n    return (f / 100) * s - (f / 100) * (100 - s);\r\n  }\r\n\r\n  onClick(element, callback) {\r\n    if (element) {\r\n      // element.onclick = () => callback();\r\n      element.addEventListener(\"click\", callback);\r\n    }\r\n  }\r\n\r\n  on(eventName, callback) {\r\n    this.player.on(eventName, callback);\r\n  }\r\n\r\n  /**\r\n   *  set nonce which will be used during ajax requests\r\n   * @param {string} nonce\r\n   */\r\n  setNonce(nonce) {\r\n    this.nonce = nonce;\r\n  }\r\n  /**\r\n   *  set videoId which will be used during view count\r\n   * @param {string} videoId\r\n   */\r\n  setVideoId(videoId) {\r\n    this.videoId = videoId;\r\n  }\r\n\r\n  videoHls() {\r\n    const initializeHls = () => {\r\n      if (!window.Hls?.isSupported()) {\r\n        console.warn(\"Hls does not support\");\r\n      } else {\r\n        // For more Hls.js options, see https://github.com/dailymotion/hls.js\r\n        const hls = new window.Hls();\r\n        hls.loadSource(this.media.src);\r\n\r\n        this.player.on(\"ready\", () => {\r\n          hls.attachMedia(this.player.media);\r\n        });\r\n\r\n        if (this.player.ready) {\r\n          hls.attachMedia(this.player.media);\r\n        }\r\n\r\n        hls.on(Hls.Events.MANIFEST_PARSED, () => {\r\n          if ([\"metadata\", \"none\"].includes(this.options.preload)) {\r\n            setTimeout(() => {\r\n              hls.stopLoad();\r\n            }, 1000);\r\n          }\r\n\r\n          this.player.on(\"play\", function () {\r\n            hls.startLoad();\r\n          });\r\n        });\r\n        window.player = this.player;\r\n\r\n        // hls.attachMedia(this.media);\r\n\r\n        this.player?.on(\"languagechange\", () => {\r\n          setTimeout(() => (hls.subtitleTrack = this.player.currentTrack), 50);\r\n        });\r\n      }\r\n    };\r\n    let hlsScript = document.getElementById(\"h5vp-hls-js\");\r\n    // con;\r\n    if (!hlsScript) {\r\n      hlsScript = document.createElement(\"script\");\r\n      hlsScript.setAttribute(\"id\", \"h5vp-hls-js\");\r\n      hlsScript.src = this.local?.hls;\r\n      document.getElementsByTagName(\"head\")[0]?.prepend(hlsScript);\r\n      hlsScript?.addEventListener(\"load\", () => initializeHls());\r\n    } else {\r\n      initializeHls();\r\n    }\r\n  }\r\n\r\n  videoDash() {\r\n    let dashScript = document.getElementById(\"h5vp-dash-js\");\r\n    if (!dashScript) {\r\n      dashScript = document.createElement(\"script\");\r\n      dashScript.setAttribute(\"id\", \"h5vp-dash-js\");\r\n      dashScript.src = this.local?.dash;\r\n      document.getElementsByTagName(\"head\")[0]?.prepend(dashScript);\r\n      dashScript.addEventListener(\"load\", () => {\r\n        if (dashjs) {\r\n          const dash = dashjs.MediaPlayer().create();\r\n          dash.initialize(this.media, this.media.src, true);\r\n        }\r\n      });\r\n    } else {\r\n      if (dashjs) {\r\n        const dash = dashjs.MediaPlayer().create();\r\n        dash.initialize(this.player.media, this.media.src, true);\r\n        this.player = new Plyr(this.player.media);\r\n      }\r\n    }\r\n  }\r\n\r\n  controlTouchAction() {\r\n    // enable touch only on mobile/tablet.\r\n    if (document.body.offsetWidth > 992) {\r\n      return false;\r\n    }\r\n\r\n    const wrapper = this.player.elements?.container;\r\n\r\n    if (!wrapper) {\r\n      return false;\r\n    }\r\n\r\n    const player = this.player;\r\n    const videoWrapper = wrapper.querySelector(\".plyr__video-wrapper\");\r\n    const span = document.createElement(\"span\");\r\n    span.classList.add(\"seekSecond\");\r\n    videoWrapper.appendChild(span);\r\n\r\n    // disable double click fullscreen | remove default event;\r\n    player.eventListeners.forEach((eventListener) => {\r\n      if (eventListener.type === \"dblclick\") {\r\n        wrapper.removeEventListener(eventListener.type, eventListener.callback, eventListener.options);\r\n      }\r\n    });\r\n\r\n    videoWrapper.parentNode.addEventListener(\"dblclick\", (e) => {\r\n      let rect = e.target.getBoundingClientRect();\r\n      let x = e.clientX - rect.left; //x position within the element.\r\n      if (this.player.fullscreen.active) {\r\n        if (videoWrapper.offsetWidth - 150 < x && videoWrapper.offsetWidth / 2 < x) {\r\n          this.player.forward(this.options.seekTime);\r\n          span.innerText = this.options.seekTime + \" sec\";\r\n        } else if (videoWrapper.offsetWidth / 2 > x && x < 150) {\r\n          this.player.rewind(this.options.seekTime);\r\n          span.innerText = \"-\" + this.options.seekTime + \" sec\";\r\n        }\r\n        setTimeout(() => {\r\n          span.innerText = \"\";\r\n        }, 1000);\r\n      }\r\n\r\n      if (x > 150 && x < videoWrapper.offsetWidth - 150) {\r\n        this.player.fullscreen.toggle();\r\n      }\r\n    });\r\n\r\n    //touch\r\n    wrapper.addEventListener(\r\n      \"touchstart\",\r\n      (e) => {\r\n        if (!this.player.fullscreen.active) return;\r\n        this.touchClientX = e.touches[0].clientX;\r\n        this.touchClientY = e.touches[0].clientY;\r\n      },\r\n      false\r\n    );\r\n\r\n    wrapper.addEventListener(\r\n      \"touchend\",\r\n      (e) => {\r\n        if (!this.player.fullscreen.active) return;\r\n        let deltaX, deltaY;\r\n        deltaX = e.changedTouches[0].clientX - this.touchClientX;\r\n        deltaY = e.changedTouches[0].clientY - this.touchClientX;\r\n\r\n        if (deltaX > 5) {\r\n          player.forward(parseInt(deltaX) / 10);\r\n          span.innerText = parseInt(deltaX / 10) + \" sec\";\r\n        } else if (deltaX < -5) {\r\n          player.rewind(Math.abs(deltaX) / 10);\r\n          span.innerText = parseInt(deltaX / 10) + \" sec\";\r\n        }\r\n\r\n        setTimeout(() => {\r\n          span.innerText = \"\";\r\n        }, 1000);\r\n      },\r\n      false\r\n    );\r\n  }\r\n\r\n  /**\r\n   *\r\n   * @param {*} player\r\n   */\r\n  pauseOther() {\r\n    if (location.pathname.includes(\"wp-admin\")) return false;\r\n    if (window.hpublic?.pauseOther) {\r\n      this.player.on(\"play\", () => {\r\n        const id = this.player.elements.fullscreen?.dataset?.uniqueId;\r\n        const players = document.querySelectorAll(`video:not([data-unique-id=\"${id}\"] video, a video)`);\r\n\r\n        players.forEach((player) => player.pause());\r\n      });\r\n    }\r\n  }\r\n\r\n  domAttributesToObjectList(elements) {\r\n    const resultArray = [];\r\n\r\n    elements.forEach((element) => {\r\n      const attributes = element.attributes;\r\n      const result = {};\r\n\r\n      for (let i = 0; i < attributes.length; i++) {\r\n        const attribute = attributes[i];\r\n        result[attribute.name] = attribute.value;\r\n      }\r\n\r\n      resultArray.push(result);\r\n    });\r\n\r\n    return resultArray;\r\n  }\r\n\r\n  getStoredSettings() {\r\n    return JSON.parse(window.localStorage.getItem(\"plyr\"));\r\n  }\r\n}\r\n\r\nexport const extractFileNamesWithoutExtension = (filePath) => {\r\n  const parts = filePath.split(\"/\");\r\n  const fileNameWithExtension = parts[parts.length - 1];\r\n  const fileNameWithoutExtension = fileNameWithExtension.replace(/\\.[^/.]+$/, \"\");\r\n  return fileNameWithoutExtension;\r\n};\r\n\r\nexport default MyPlayer;\r\n","import \"./style.scss\";\r\n\r\nconst Overlay = ({ enabled, items }) => {\r\n  if (!enabled) {\r\n    return <></>;\r\n  }\r\n  return (\r\n    <>\r\n      {items.map((item, index) => {\r\n        return (\r\n          <>\r\n            <style>\r\n              {`\r\n              .overlay_item_${index} p{\r\n                padding: 5px 12px;\r\n              }\r\n              .overlay_item_${index} p,\r\n              .overlay_item_${index} img,\r\n              .overlay_item_${index} a {\r\n              color: ${item.color};\r\n              font-size: ${item.fontSize};\r\n              background-color: ${item.backgroundColor};\r\n              border-radius: 3px px;\r\n              opacity: ${item.opacity}\r\n            }\r\n            .overlay_item_${index} a:hover,\r\n            .overlay_item_${index} p:hover {\r\n              color: ${item.hoverColor};\r\n            }\r\n            `.replace(/\\s+/g, \" \")}\r\n            </style>\r\n            <div key={index} className={`h5vp_overlay ${item.position} overlay_item_${index}`}>\r\n              {item.type === \"text\" ? (\r\n                <p>\r\n                  {item.link ? (\r\n                    <a href={item.link} rel=\"noreferrer\" target=\"_blank\">\r\n                      {item.text}\r\n                    </a>\r\n                  ) : (\r\n                    <>{item.text}</>\r\n                  )}\r\n                </p>\r\n              ) : item.link ? (\r\n                <a className=\"background-transparent\" href={item.link} rel=\"noreferrer\" target=\"_blank\">\r\n                  <img src={item.logo} />\r\n                </a>\r\n              ) : (\r\n                <img src={item.logo} />\r\n              )}\r\n            </div>\r\n          </>\r\n        );\r\n      })}\r\n    </>\r\n  );\r\n};\r\n\r\nexport default Overlay;\r\n","import { useEffect } from \"react\";\r\nimport { __ } from \"@wordpress/i18n\";\r\nimport \"./style.scss\";\r\n\r\nconst PopupOpener = ({ setOpen, popup, poster }) => {\r\n  const { align, enabled, btnStyle, hasBtn, selector, type, btnText } = popup;\r\n  const { padding, ...popupBtnStyle } = btnStyle || {};\r\n\r\n  useEffect(() => {\r\n    if (type === \"button\" && hasBtn && selector && enabled) {\r\n      document.querySelector([\".\", \"#\", \"[\"].includes(selector) ? `${selector}` : `.${selector}`)?.addEventListener(\"click\", () => {\r\n        setOpen(true);\r\n      });\r\n    }\r\n  }, []);\r\n\r\n  return (\r\n    <>\r\n      {enabled && (\r\n        <div className={type === \"button\" ? `flex justify-${align}` : \"\"}>\r\n          {!hasBtn || type === \"poster\" ? (\r\n            <>\r\n              {type === \"button\" ? (\r\n                <button className=\"popup_opener\" onClick={() => setOpen(true)} style={{ ...popupBtnStyle, padding: Object.values(padding).join(\" \") }}>\r\n                  {btnText}\r\n                </button>\r\n              ) : (\r\n                <>\r\n                  {poster ? (\r\n                    <div className=\"popup_opener\">\r\n                      <svg aria-hidden=\"true\" focusable=\"false\" className=\"popup_play\" onClick={() => setOpen(true)}>\r\n                        <use xlinkHref=\"#plyr-play\"></use>\r\n                      </svg>\r\n                      <img src={poster} width=\"100%\" />\r\n                    </div>\r\n                  ) : (\r\n                    <h3>Poster missing</h3>\r\n                  )}\r\n                </>\r\n              )}\r\n            </>\r\n          ) : (\r\n            <></>\r\n          )}\r\n\r\n          <span onClick={() => setOpen(false)} className=\"close\">\r\n            &times;\r\n          </span>\r\n        </div>\r\n      )}\r\n    </>\r\n  );\r\n};\r\n\r\nexport default PopupOpener;\r\n","const __WEBPACK_NAMESPACE_OBJECT__ = wp.i18n;","import React from \"react\";\r\n\r\nconst Video = ({ captions, poster, source, qualities, isPremium, className = \"\", reference, ...props }) => {\r\n  // console.log({ source });\r\n  return (\r\n    <>\r\n      <video crossOrigin className={className} id=\"player\" data-poster={poster || \"\"} ref={reference} src={source} {...props} style={{ width: \"100%\", maxWidth: \"100%\" }}>\r\n        {/* Captions / Subtitles */}\r\n        {isPremium && (\r\n          <>\r\n            {Array.isArray(captions) &&\r\n              captions.map((caption, index) => {\r\n                if (!caption.caption_file) {\r\n                  return;\r\n                }\r\n                const info = caption.label.split(\"/\");\r\n                return <track key={index} kind=\"captions\" srcLang={info[1] || \" \"} label={info[0] || \"no label\"} src={caption.caption_file} />;\r\n              })}\r\n\r\n            {/* Qualities */}\r\n            {![\"m3u8\", \"mpd\"].includes(source?.split(\".\").pop()) && (\r\n              <>\r\n                <source src={source} size={720} type={`video/${source?.split(\".\").pop()}`} />\r\n                {Array.isArray(qualities) &&\r\n                  qualities.map((item, index) => {\r\n                    // return <source key={index} src={item.video_file} size={item.size} type=\"video/mp4\" />;\r\n                  })}\r\n              </>\r\n            )}\r\n          </>\r\n        )}\r\n      </video>\r\n      {props[\"data-poster\"] && <div className=\"preload_poster\" style={{ background: `url(${props[\"data-poster\"]})` }}></div>}\r\n    </>\r\n  );\r\n};\r\n\r\nexport default Video;\r\n","/* eslint-disable react/no-unknown-property */\r\n\r\nconst Youtube = ({ source = \"https://www.youtube.com/watch?v=MLpWrANjFbI\", className = \"\", ...props }) => {\r\n  // console.log(source, props);\r\n\r\n  //new added\r\n  // if (!source) {\r\n  //   return <></>;\r\n  // }\r\n  return (\r\n    <div className={`plyr__video-embed ${className}`} id=\"player\" {...props}>\r\n      <iframe\r\n        src={`${source}?origin=${window.location.origin}&iv_load_policy=3&amp;modestbranding=1&amp;playsinline=1&amp;showinfo=0&amp;rel=0&amp;enablejsapi=1`}\r\n        // src={`${source}&feature=youtu.be`}\r\n        allowfullscreen\r\n        allowtransparency\r\n        allow=\"autoplay\"\r\n      ></iframe>\r\n      {props[\"data-poster\"] && <div className=\"preload_poster\" style={{ background: `url(${props[\"data-poster\"]})` }}></div>}\r\n    </div>\r\n  );\r\n};\r\n\r\nexport default Youtube;\r\n","function isVimeoLink(source) {\r\n  if (!source) return false;\r\n  // Regular expression pattern to match Vimeo video URLs\r\n  const vimeoPattern = /^(https?:\\/\\/)?(www\\.)?(player\\.)?vimeo\\.com\\/(video\\/)?(\\d+)(\\/[^\\s]*)?$/;\r\n  const id = source?.match(vimeoPattern)?.[5];\r\n  // console.log({ id });\r\n\r\n  if (id) {\r\n    return `https://player.vimeo.com/video/${id}`;\r\n    // https://vimeo.com/920314562\r\n  }\r\n\r\n  if (!isNaN(source)) {\r\n    return `https://player.vimeo.com/video/${source}`;\r\n  }\r\n  return vimeoPattern.test(source);\r\n}\r\n\r\nexport default isVimeoLink;\r\n","import { useEffect, useRef } from \"react\";\r\nimport \"./style.scss\";\r\n\r\nconst EndScreen = ({ endScreen, player }) => {\r\n  const { enabled, text, btnText, btnLink } = endScreen;\r\n\r\n  const endScreenRef = useRef(null);\r\n\r\n  useEffect(() => {\r\n    player?.player?.on(\"ended\", () => {\r\n      console.log(\"ended\");\r\n      if (enabled) {\r\n        player.player.stop();\r\n        endScreenRef.current.style.display = \"block\";\r\n        console.log(\"workign\");\r\n      }\r\n    });\r\n  }, [player]);\r\n\r\n  const handleClose = () => {\r\n    endScreenRef.current.style.display = \"none\";\r\n  };\r\n\r\n  return (\r\n    <>\r\n      {enabled && (\r\n        <>\r\n          <div ref={endScreenRef} className=\"h5vp_end_screen\">\r\n            <span className=\"close\" onClick={handleClose}>\r\n              &times;\r\n            </span>\r\n            <div className=\"content\">\r\n              <p>{text}</p>\r\n              {btnText && (\r\n                <a target=\"_blank\" rel=\"noreferrer\" href={btnLink}>\r\n                  {btnText}\r\n                </a>\r\n              )}\r\n            </div>\r\n          </div>\r\n        </>\r\n      )}\r\n    </>\r\n  );\r\n};\r\n\r\nexport default EndScreen;\r\n","function camelToKebabCase(inputString) {\r\n  return inputString.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\r\n}\r\n\r\nexport default camelToKebabCase;\r\n","import { useEffect, useState } from \"react\";\r\nimport camelToKebabCase from \"../utils/camelToKebabCase\";\r\n\r\nconst Style = ({ styles = {}, uniqueId }) => {\r\n  // console.log({ uniqueId });\r\n  const [CSS, setCSS] = useState(null);\r\n  useEffect(() => {\r\n    let css = \"\";\r\n    if (typeof styles === \"object\") {\r\n      Object.keys(styles).map((key) => {\r\n        if (typeof styles[key] === \"object\") {\r\n          let itemCSS = \"\";\r\n          Object.keys(styles[key]).map((key2) => {\r\n            itemCSS += `${camelToKebabCase(key2)}: ${styles[key][key2]};`;\r\n          });\r\n          css += `#${uniqueId} ${[\".\", \"#\"].includes(key[0]) ? \"\" : \".\"}${key}{${itemCSS}} `;\r\n        }\r\n      });\r\n    }\r\n    setCSS(css);\r\n  }, [styles, uniqueId]);\r\n\r\n  return <style dangerouslySetInnerHTML={{ __html: CSS }}></style>;\r\n};\r\n\r\nexport default Style;\r\n","import React from \"react\";\r\n\r\nconst Vimeo = ({ source = \"https://player.vimeo.com/video/76979871\", className = \"\", ...props }) => {\r\n  // console.log({ source });\r\n\r\n  //new added\r\n  // if (!source) {\r\n  //   return <></>;\r\n  // }\r\n  return (\r\n    <div className={`plyr__video-embed ${className}`} id=\"player\" {...props}>\r\n      <iframe\r\n        src={`${source}?loop=false&amp;byline=false&amp;portrait=false&amp;title=false&amp;speed=true&amp;transparent=0&amp;gesture=media`}\r\n        allowfullscreen\r\n        // eslint-disable-next-line react/no-unknown-property\r\n        allowtransparency\r\n        allow=\"autoplay\"\r\n      ></iframe>\r\n      {props[\"data-poster\"] && <div className=\"preload_poster\" style={{ background: `url(${props[\"data-poster\"]})` }}></div>}\r\n    </div>\r\n  );\r\n};\r\n\r\nexport default Vimeo;\r\n","function generateUniqueID(length) {\r\n  const charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"; // You can customize the characters here\r\n  let randomString = \"\";\r\n\r\n  for (let i = 0; i < length; i++) {\r\n    const randomIndex = Math.floor(Math.random() * charset.length);\r\n    randomString += charset.charAt(randomIndex);\r\n  }\r\n\r\n  return randomString;\r\n}\r\n\r\nexport default generateUniqueID;\r\n","import \"./simple-loader.scss\";\r\n\r\nconst SimpleLoader = ({ height = \"10px\", width = \"10px\", color = \"#3498db\", className = \"\", style = {} }) => {\r\n  return <div className={`simple-loader ${className}`} style={{ height, width, borderTopColor: color, ...style }}></div>;\r\n};\r\n\r\nexport default SimpleLoader;\r\n","import React, { useState, useEffect } from \"react\";\r\nimport { useWPAjax } from \"../../../wp-utils/v1\";\r\nimport SimpleLoader from \"../../../wp-utils/v1/components/Loader/SimpleLoader\";\r\n\r\nconst PasswordForm = ({ passwordProtected, setSrc, nonce, src, source, setQualities }) => {\r\n  const { enabled, heading, button, key, errorMessage } = passwordProtected;\r\n  const { data, refetch: checkPassword, isLoading: passwordChecking } = useWPAjax(\"h5vp_ajax_handler\", { nonce, method: \"check_password\", model: \"Video\", key }, true);\r\n  const [passwordError, setPasswordError] = useState(null);\r\n  const [password, setPassword] = useState(null);\r\n\r\n  const { text = \"Access\" } = button || {};\r\n\r\n  useEffect(() => {\r\n    setPasswordError(null);\r\n    if (!passwordChecking) {\r\n      if (data) {\r\n        setSrc(data.source);\r\n        setQualities(data.quality);\r\n      } else {\r\n        if (data !== null) {\r\n          setPasswordError(errorMessage || \"Password didn't matched\");\r\n        }\r\n      }\r\n    }\r\n  }, [passwordChecking]);\r\n\r\n  const onSubmit = (e) => {\r\n    e.preventDefault();\r\n    checkPassword({ key, password });\r\n  };\r\n\r\n  console.log(heading);\r\n\r\n  return (\r\n    <>\r\n      {enabled && !src && (\r\n        <>\r\n          <div className=\"password_form_overlay\"></div>\r\n          <div className=\"password_form\">\r\n            <form onSubmit={onSubmit}>\r\n              {heading && <h3 className=\"password_form_heading\">{heading}</h3>}\r\n              <input type=\"password\" className=\"password_form_input\" placeholder=\"Password\" onChange={(e) => setPassword(e.target.value)} />\r\n              <button className=\"password_form_button\" disabled={passwordChecking}>\r\n                {passwordChecking && <SimpleLoader style={{ borderWidth: \"2px\" }} />} {text}\r\n              </button>\r\n              {passwordError && <p className=\"password_form_error\">{passwordError}</p>}\r\n            </form>\r\n          </div>\r\n        </>\r\n      )}\r\n    </>\r\n  );\r\n};\r\n\r\nexport default PasswordForm;\r\n","import { useEffect, useState, useRef } from \"react\";\r\n\r\nimport \"./style.scss\";\r\nimport \"./../../public/css/h5vp.css\";\r\nimport MyPlayer, { extractFileNamesWithoutExtension } from \"../public/MyPlayer\";\r\nimport Overlay from \"./Overlay/Overlay\";\r\nimport PopupOpener from \"./PopupOpener/PopupOpener\";\r\nimport Video from \"./Video\";\r\nimport { isYoutubeURL, useWPAjax } from \"../../../wp-utils/v1\";\r\nimport SimpleLoader from \"../../../wp-utils/v1/components/Loader/SimpleLoader\";\r\nimport Youtube from \"./Youtube\";\r\nimport isVimeoLink from \"../utils/isVimeoLink\";\r\nimport EndScreen from \"./EndScreen/EndScreen\";\r\nimport Style from \"./Style\";\r\nimport Vimeo from \"./Vimeo\";\r\nimport generateUniqueID from \"../../../wp-utils/v1/generateUniqueId\";\r\nimport PasswordForm from \"./PasswordForm\";\r\n\r\n/**\r\n *\r\n * @param {attributes} props\r\n * @param {nonce} props\r\n * @returns\r\n */\r\n\r\nconst VideoPlayer = ({ attributes, nonce = window.h5vpBlock?.nonce }) => {\r\n  const { additionalCSS, additionalID, source, poster, provider, qualities: quality, captions, options, features, uniqueId, styles } = attributes;\r\n  window.attributes = attributes;\r\n  const { popup, overlay, endScreen, passwordProtected = {}, hideYoutubeUI } = features;\r\n  const [src, setSrc] = useState(passwordProtected.enabled ? \"\" : source);\r\n  const [player, setPlayer] = useState(null);\r\n  const [open, setOpen] = useState(false);\r\n  const [videoSource, setVideoSource] = useState(provider === \"library\" ? \"self-hosted\" : provider);\r\n  const { autoplay, muted, loop } = options;\r\n  const { data: isPremium, isLoading } = useWPAjax(\"pipe_handler\", { nonce });\r\n  const { data: videoId, refetch } = useWPAjax(\"h5vp_ajax_handler\", { nonce, method: \"create\", model: \"Video\" }, true);\r\n  const [qualities, setQualities] = useState(quality);\r\n\r\n  const playerRef = useRef(null);\r\n\r\n  useEffect(() => {\r\n    if (open) {\r\n      player?.player.play();\r\n    } else {\r\n      player?.player.pause();\r\n    }\r\n  }, [open]);\r\n\r\n  useEffect(() => {\r\n    playerRef.media = playerRef.current?.querySelector(\"#player\");\r\n  }, [playerRef]);\r\n\r\n  //initialize player\r\n  useEffect(() => {\r\n    const interval = setInterval(() => {\r\n      const media = playerRef.current?.querySelector(\"#player\");\r\n      if (media) {\r\n        const player = new MyPlayer(media, options, { ...features, qualities, captions });\r\n        setPlayer(player);\r\n        clearInterval(interval);\r\n\r\n        window.player = player;\r\n        player?.on(\"ready\", function () {\r\n          const interval = setInterval(() => {\r\n            if (player.player.elements.poster) {\r\n              clearInterval(interval);\r\n            }\r\n            player.player.elements.poster.style.backgroundImage = `url(${poster})`;\r\n          }, 500);\r\n        });\r\n      }\r\n    }, 100);\r\n\r\n    return () => {\r\n      player?.destroy();\r\n    };\r\n  }, [options, features, qualities, captions]); // removed playerRef.current\r\n\r\n  useEffect(() => {\r\n    if (player && !player?.nonce) {\r\n      player.setNonce(nonce);\r\n    }\r\n    if (player && !player?.videoId) {\r\n      player.setVideoId(videoId);\r\n    }\r\n  }, [nonce, videoId]);\r\n\r\n  useEffect(() => {\r\n    if (player) {\r\n      player.setIsPremium(isPremium);\r\n    }\r\n    if (!isLoading && !isPremium && videoSource !== \"self-hosted\") {\r\n      player?.destroy();\r\n    }\r\n  }, [isPremium, isLoading, videoSource]);\r\n\r\n  useEffect(() => {\r\n    // console.log(\"source\", attributes, videoSource);\r\n    if (!videoSource) {\r\n      if (isYoutubeURL(source)) {\r\n        setVideoSource(\"youtube\");\r\n      } else if (isVimeoLink(source)) {\r\n        setVideoSource(\"vimeo\");\r\n      } else {\r\n        setVideoSource(\"self-hosted\");\r\n      }\r\n    }\r\n  }, [source]);\r\n\r\n  useEffect(() => {\r\n    if (source && videoSource) {\r\n      refetch({ src: source, type: videoSource, title: extractFileNamesWithoutExtension(source) });\r\n    }\r\n  }, [source, videoSource]);\r\n\r\n  useEffect(() => {\r\n    if (player?.player) {\r\n      player.player.poster = poster;\r\n      // player.player.source = src;\r\n    }\r\n  }, [src, poster]);\r\n\r\n  useEffect(() => {\r\n    if (player?.player) {\r\n      player.setSource();\r\n      window.player = player;\r\n      player.dispatchEvent(\"update-source\", { source: src, qualities });\r\n    }\r\n  }, [src]);\r\n\r\n  useEffect(() => {\r\n    if (window.sources) {\r\n      window.sources.push(source);\r\n    } else {\r\n      window.sources = [source];\r\n    }\r\n  }, [src, source]);\r\n\r\n  useEffect(() => {\r\n    setSrc(passwordProtected.enabled ? \"\" : source);\r\n  }, [source]);\r\n\r\n  if (!source) {\r\n    return <h3>Video source missing</h3>;\r\n  }\r\n\r\n  return (\r\n    <div ref={playerRef} id={uniqueId} className={`h5vp_player_temp  ${popup.enabled ? \"h5vp_popup_enabled\" : \"\"} ${open ? \"h5vp_popup_open\" : \"\"}`}>\r\n      <Style styles={styles} uniqueId={uniqueId} />\r\n\r\n      <style>{additionalCSS}</style>\r\n\r\n      {isPremium && <PopupOpener setOpen={setOpen} popup={popup} poster={poster} />}\r\n\r\n      {/* {password protected form } */}\r\n      <PasswordForm passwordProtected={passwordProtected} nonce={nonce} src={src} setSrc={setSrc} source={source} setQualities={setQualities} />\r\n      <div className={`plyr_wrapper ${hideYoutubeUI ? \"hideUI\" : \"\"}`} id={additionalID} data-unique-id={generateUniqueID(5)}>\r\n        <>\r\n          {videoSource === \"vimeo\" && <Vimeo source={isVimeoLink(src)} />}\r\n          {videoSource === \"youtube\" && <Youtube source={isYoutubeURL(src)} />}\r\n        </>\r\n        {/* )} */}\r\n        {videoSource === \"self-hosted\" && (\r\n          <Video\r\n            qualities={src ? qualities : []}\r\n            captions={captions}\r\n            source={passwordProtected.enabled ? src : source}\r\n            poster={poster}\r\n            autoPlay={autoplay}\r\n            muted={muted}\r\n            loop={loop?.active}\r\n            // src={source}\r\n            preload={options.preload}\r\n            isPremium={isPremium}\r\n            playsInline={options.playsinline}\r\n          />\r\n        )}\r\n        {isPremium && (\r\n          <>\r\n            <EndScreen endScreen={endScreen} player={player} />\r\n            <Overlay {...overlay} player={player?.player} />\r\n          </>\r\n        )}\r\n        {/* <Toaster */}\r\n      </div>\r\n    </div>\r\n  );\r\n};\r\n\r\nexport default VideoPlayer;\r\n","import React from \"react\";\r\nimport { createRoot } from \"react-dom\";\r\n\r\nimport VideoPlayer from \"../components/VideoPlayer\";\r\nimport { jsonParse } from \"./../../../wp-utils/v1\";\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function () {\r\n  renderVideo();\r\n});\r\n\r\nexport const FrontEnd = (props) => {\r\n  // console.log(props);\r\n  return <VideoPlayer {...props} />;\r\n};\r\n\r\nwindow.addEventListener(\"elementor/frontend/init\", function () {\r\n  elementorFrontend.hooks.addAction(\"frontend/element_ready/H5VPPlayer.default\", function (scope, $) {\r\n    renderVideo();\r\n  });\r\n});\r\n\r\nexport const renderVideo = () => {\r\n  const players = document.querySelectorAll(\".html5_video_players\");\r\n\r\n  players?.forEach((item) => {\r\n    const attributes = jsonParse(item.dataset.attributes);\r\n    item.removeAttribute(\"data-attributes\"); // remove\r\n    item.removeAttribute(\"data-data\"); // remove\r\n\r\n    if (!attributes) {\r\n      return false;\r\n    }\r\n    const nonce = item.dataset.nonce;\r\n    if (typeof attributes === \"object\" && item) {\r\n      const root = createRoot(item);\r\n      root.render(<FrontEnd attributes={attributes} nonce={nonce} />);\r\n    }\r\n  });\r\n};\r\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","React","ReactDOM","action","params","arguments","length","undefined","set","isLoading","setIsLoading","useState","isError","setIsError","error","setError","data","setData","wp","ajax","console","sendRequest","payload","post","done","res","fail","request","async","useEffect","saveData","refetch","html","temp","document","createElement","innerHTML","content","firstChild","json","parsedJson","JSON","parse","warn","message","input","test","NOTHING","Symbol","for","DRAFTABLE","DRAFT_STATE","die","args","Error","getPrototypeOf","isDraft","value","isDraftable","isPlainObject","Array","isArray","constructor","isMap","isSet","objectCtorString","toString","proto","Ctor","Function","each","iter","getArchtype","entries","forEach","entry","index","thing","state","type_","has","propOrOldValue","t","add","target","Map","Set","latest","copy_","base_","shallowCopy","base","strict","slice","create","assign","descriptors","getOwnPropertyDescriptors","keys","Reflect","ownKeys","i","desc","writable","configurable","freeze","deep","isFrozen","clear","delete","dontMutateFrozenCollections","_key","currentScope","plugins","getPlugin","pluginKey","plugin","getCurrentScope","usePatchesInScope","scope","patchListener","patches_","inversePatches_","patchListener_","revokeScope","leaveScope","drafts_","revokeDraft","parent_","enterScope","immer2","immer_","canAutoFreeze_","unfinalizedDrafts_","draft","revoke_","revoked_","processResult","result","baseDraft","modified_","finalize","maybeFreeze","generateReplacementPatches_","rootScope","path","childValue","finalizeProperty","scope_","finalized_","resultEach","isSet2","generatePatches_","parentState","targetObject","rootPath","targetIsSet","assigned_","concat","autoFreeze_","objectTraps","source","getDescriptorFromProto","draft_","readPropFromProto","peek","prepareCopy","createProxy","current2","currentState","x","y","is","markChanged","Number","isNaN","deleteProperty","getOwnPropertyDescriptor","owner","setPrototypeOf","arrayTraps","useStrictShallowCopy_","fn","apply","this","parent","proxyMap_","proxySet_","isManual_","traps","revoke","proxy","Proxy","revocable","createProxyProxy","push","currentImpl","copy","immer","config","produce","recipe","defaultBase","self","base2","hasError","p","ip","produceWithPatches","patches","inversePatches","autoFreeze","setAutoFreeze","useStrictShallowCopy","setUseStrictShallowCopy","createDraft","current","finishDraft","applyPatches","patch","op","applyPatchesImpl","applyPatches_","bind","u","callbacks","addEventListener","e","dispatchEvent","n","Event","type","s","extractFileNamesWithoutExtension","filePath","parts","split","replace","EventEmitter","media","options","features","isPremium","super","markers","enabled","speed","map","item","parseFloat","fullscreen","container","iosNative","local","window","h5vpBlock","urls","download","closest","offsetWidth","controls","filter","control","includes","muted","volume","storage","player","Plyr","i18n","h5vpI18n","src","pop","videoHls","videoDash","passwordProtected","init","on","disablePause","play","elements","buttons","mute","_ref","setSource","qualities","captions","setIsPremium","sources","video_file","size","parseInt","tracks","caption_file","info","label","kind","srclang","title","poster","track","appendChild","reInit","location","pathname","pause","currentTime","makeElementSticky","sticky","createChapter","watermark","thumbInPause","autoplayWhenVisible","pauseOther","createView","disabled","plyr","startTime","setTimeout","autoplay","controlTouchAction","interval","videoId","pending","maxViewed","localStorage","getItem","created_at","Date","setItem","stringify","viewCreated","condition","playing","nonce","model","method","video_id","duration","log","playWhenVisible","scrollPlayed","offsetParent","offsetTop","scrollY","element","originalTop","getBoundingClientRect","top","closeBtn","htmlToElement","closeBtnExists","querySelector","classList","position","remove","wrapper","chapters","points","point","time","chapterTimeToSeconds","exists","chapterWrapper","chapterListWrapper","markerControl","chapterList","name","chapterItem","onclick","contains","event","onClick","volumeElem","menu","before","after","text","color","plyrWrapper","response","user","origin","tag","watermarkInterval","setInterval","watermarkElement","removeChild","Math","round","random","span","setAttribute","innerText","style","clearInterval","img","overlaid","destroy","match","getTTT","f","callback","eventName","setNonce","setVideoId","initializeHls","Hls","isSupported","hls","loadSource","attachMedia","ready","Events","MANIFEST_PARSED","preload","stopLoad","startLoad","subtitleTrack","currentTrack","hlsScript","getElementById","getElementsByTagName","prepend","dashScript","dashjs","MediaPlayer","initialize","dash","body","videoWrapper","eventListeners","eventListener","removeEventListener","parentNode","rect","clientX","left","active","forward","seekTime","rewind","toggle","touchClientX","touches","touchClientY","clientY","deltaX","deltaY","changedTouches","abs","hpublic","id","dataset","uniqueId","querySelectorAll","domAttributesToObjectList","resultArray","attributes","attribute","getStoredSettings","items","Fragment","fontSize","backgroundColor","opacity","hoverColor","className","link","href","rel","logo","setOpen","popup","align","btnStyle","hasBtn","selector","btnText","padding","popupBtnStyle","values","join","focusable","xlinkHref","width","reference","props","_extends","crossOrigin","ref","maxWidth","caption","srcLang","background","allowfullscreen","allowtransparency","allow","vimeoPattern","endScreen","btnLink","endScreenRef","useRef","stop","display","handleClose","inputString","toLowerCase","styles","CSS","setCSS","css","itemCSS","key2","camelToKebabCase","dangerouslySetInnerHTML","__html","charset","randomString","randomIndex","floor","charAt","height","borderTopColor","setSrc","setQualities","heading","button","errorMessage","checkPassword","passwordChecking","useWPAjax","passwordError","setPasswordError","password","setPassword","quality","onSubmit","preventDefault","placeholder","onChange","SimpleLoader","borderWidth","additionalCSS","additionalID","provider","overlay","hideYoutubeUI","setPlayer","open","videoSource","setVideoSource","loop","playerRef","MyPlayer","backgroundImage","isYoutubeURL","isVimeoLink","Style","PopupOpener","PasswordForm","generateUniqueID","Vimeo","Youtube","Video","autoPlay","playsInline","playsinline","EndScreen","Overlay","renderVideo","FrontEnd","VideoPlayer","elementorFrontend","hooks","addAction","$","players","jsonParse","removeAttribute","createRoot","render"],"sourceRoot":""}